-
Notifications
You must be signed in to change notification settings - Fork 4
Counter
counters is a core command found within Kdkbot. Counters are often paired with custom Commands to allow increasing values in a command without modifying the command to manually increment the number in the message.
counter <new <name> [value] | <delete|remove> <name> | <+|add> <name> [value] | <-|sub> <name> [value] | <*|mult> <name> <value> | </|divide> <name> <value> | <=|get> <name>>
Since the above can be a bit annoying to decipher, the syntax for each sub-command is as follows:
- counter new <name> [value]
- counter delete <name>
- counter remove <name>
- counter + <name> [value]
- counter add <name> [value]
- counter - <name> [value]
- counter sub <name> [value]
- counter * <name> <value>
- counter mult <name> <value>
- counter / <name> <value>
- counter divide <name> <value>
- counter = <name>
- counter get <name>
counter new will add a new counter to keep track of. It expects a name of the counter and will start at 0 if no value is provided.
counter delete and counter remove will remove a given counter by name
counter + and counter add will increment a given counter by name by 1 unless a value is provided.
counter - and counter sub will decrement a given counter by name by 1 unless a value is provided.
counter * and counter mult will multiply a given counter by name by value.
counter / and counter divide will divide a given counter by name by value.
counter = and counter get will respond with the value from the counter by name
Counters can be used within custom Commands by providing a percent-arg with the correct counter name. For example, a counter with name countex would be inserted in a custom commands message by using %CNTR:countex%