Possible to modify an arguments variable


#1

So I was curious to the possibility of using vanilla nightbot to create a command that uses two variables that are pre-set by the owner. And a second/third command that acts similar to $count to and incrementally increases the value by 1.

Example:

Outputs Variable $(1) and $(2) to the user when !wulfe is used

!commands add !wulfe Strawberry has bitten Wulfe $(1) times and dropped her to her death $(2) times.

Owner or moderator uses !wulfebite to modify the first variable by an increment of 1

!commands add !wulfebite -a=!commands edit !wulfe Strawberry has bitten Wulfe ( $(1) + 1) times and dropped her to her death $(2) times.

Owner or moderator uses !wulfedrop to modify the second variable by an increment of 1

!commands add !wulfedrop -a=!commands edit !wulfe Strawberry has bitten Wulfe $(1) times and dropped her to her death ( $(2) + 1) times.


#2

You can use the $(eval) variable to write JavaScript to do this: https://docs.nightbot.tv/commands/variables/eval


#3

Would (eval $(1)++) or (eval $(1)+=1) work I apologise it’s been a while since I have used js


#4

To learn JavaScript visit Mozilla’s pretty decent documentation at https://developer.mozilla.org/en-US/docs/Web/JavaScript