Skip to content
Kalbintion edited this page Oct 27, 2014 · 7 revisions

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.

Syntax

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>

New

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.

Delete & Remove

counter delete and counter remove will remove a given counter by name

Add (+)

counter + and counter add will increment a given counter by name by 1 unless a value is provided.

Sub (-)

counter - and counter sub will decrement a given counter by name by 1 unless a value is provided.

Mult (*)

counter * and counter mult will multiply a given counter by name by value.

Divide (/)

counter / and counter divide will divide a given counter by name by value.

Get (=)

counter = and counter get will respond with the value from the counter by name

Custom Command Usage

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%

Clone this wiki locally