### Abacus

A chat/console based calculator for Minecraft with awareness of the concept of a "Minecraft stack of items". You can perform math operations on stacks to determine how many stacks of a material you need for your building projects.

## Syntax

```/abacus <formula>
```

Examples:

```/abacus 1+1 --> Result: 2
```

```/abacus 1+1*5 --> Result: 6
```
```/abacus 10*10/100 --> Result: 1
```
```/abacus 0.5*0.5 --> Result: 0.25
```
```/abacus 2*(3+2) --> Result: 10
```

## Supported Operations

Operators: + (addtion), - (subtraction), * (multiplication), / (division), \ (integer division), % (modulus/remainder), ^ (power operator).

### Random Operator

There is also a special operator that generates random numbers. Examples:

```/abacus 1d6
```

will produce a random number between 1 and 6.

```/abacus 10d6
```

will produce the sum of 10 random numbers between 1 and 6.

A future release may add a function to control the range.

## Minecraft "stack" Aware

Can perform calculations on quantities that are in the unit "stacks" (64 items) or "partial stacks" (16 items) and produce results describing the number of stacks. All the examples below are given for full stacks. Partial stack operations are identical, except that you use 'p' as the unit instead of 's'.

If you want the result expressed in terms of stacks, simply precede the formula with an 's':

```/abacus s 64 * 1
Result: 1 stacks and 0 individual items.
```
```/abacus s 32 * 2
Result: 1 stacks and 0 individual items.
```

If you want to include a quantity that is a number of stacks, append an 's' to the quantity:

```/abacus 1s + 0
Result: 64
```
```/abacus 1s + 1s
Result: 128
```

You can use both, of course, so the following, while silly, works:

```/abacus s300s
Result: 300 stacks and 0 individual items.
```

More importantly, you can do this sort of thing: You're making 300 'somethings', you've already worked out that each one takes 5 stacks of blocks plus 28 more...how many to make all 300?

```/abacus s (5s + 28) *  300
Result: 1631 stacks and 16 individual items.
```

You can mix partial and full stacks, although I'd be careful in doing so, you can potentially mislead yourself as to what is going on. One situation where this might come up is with snowballs. Snowballs are stackable in partial stacks of 16, but snow blocks are in stacks of 64. Supposing you had 30 stacks of snowballs, you could do something like this to find out how many stacks of snow blocks you could make.

```/abacus s30p / 4
Result: 7 stacks and 32 individual items.
```

## Supported Grouping symbols

(), <>, [], {}

That means this is a valid expression:

```[(1+1)*5+15]
```

## Comma Grouping

Can evaluate multiple expressions "in one go" that are separated by commas:

```/abacus 1+1,2+2,3+3
Result: 2,4,6
```

## Permission Nodes

abacus.* - grants all permissions (as there is only one right now, this is largely useless). Defaults to op. abacus.abacus - grants access to the abacus command. Defaults to true.

## Planned Features/Changes

I'm playing with an idea for computing the required materials for complex items. A potential syntax might be:

```/abacus 30 wooden stairs
Result: 30 wooden stairs requires 48 planks or 12 logs.
```

Stairs in particular is on my radar, since I frequently miscalculate the materials required for a stairway. :)

I haven't fully decided on an approach on how to do this generically yet. Suggestions welcome. :)

Posts Quoted:

• Project ID
47326
• Created
Nov 16, 2012
• Last Released File
Sep 9, 2015
16,396

• Sep 9, 2015