Add new command that allows users to define their own custom variables.
Variable creation
Syntax:
var -- show the list of all variables defined so far
var name value -- assign a value to the variable, new or existing.
var name -- either show the current value or unassign. Needs discussion.
help var -- some placeholder for help text & examples
Variable name can contain EN or RU characters, underscores and numbers. Let's restrict first character to be a letter, to avoid confusion with $1, $2, should we need them in the future.
Vars are kept in local storage, as usual.
Variable evaluation
Variables can be used in built-in commands, such as #hotkey. Probably the best way is to follow JMC approach and use $varname syntax. Example usage with hotkey command:
#hotkey f2 blackjack $victim
#var victim Zauber
...
#hotkey f3 take $food backpack|eat $food
#var food pie
Variables need to be accessible from the settings JS (cog), so that it's possible to manipulate those variables from more complex JS triggers.
Add new command that allows users to define their own custom variables.
Variable creation
Syntax:
var -- show the list of all variables defined so far
var name value -- assign a value to the variable, new or existing.
var name -- either show the current value or unassign. Needs discussion.
help var -- some placeholder for help text & examples
Variable name can contain EN or RU characters, underscores and numbers. Let's restrict first character to be a letter, to avoid confusion with $1, $2, should we need them in the future.
Vars are kept in local storage, as usual.
Variable evaluation
$varname
syntax. Example usage with hotkey command: