nightbot counter command

using this post i was able to set up a death counter

however the !counter command gives me this response “There have been 1,plus deaths” im very much a noob with all this and cant work out in the code where the text “plus” is coming from.

this was the code ive used my tokens in mine thats all ive altered. any help is apricated.

$(eval a=$(urlfetch https://twitch.center/customapi/quote/list?token=Public_Token&no_id=1);a!=There are no quotes added?There is ${a.split( )[0]}${a.split( )[1]} deaths:There is 0 deaths)

Hey @Laura_Smith!

The “plus” comes from the !add and !substract commands, however I don’t understand what is your request: you don’t say what you’re waiting for.
Also, I don’t have much time to update @potatoeaterlove’s code lately, so I’ll let him deal with it once you’ve replied with more details.
I’m not sure why the “plus” is in the code, I guess it must be important, so if you want to remove it, then the solution is to treat the lack of “plus” as if it was there, which is how I would have written the code in the first place.


On another note, I’m not sure why you’d want to be able to substract to a death counter, so here’s another topic that might fit what you’re looking for a little bit better:

1 Like

Sorry about that those are fairly old commands (and if I’m being honest quite a mess). These ones should do the trick and be much easier to add for future users.

!add

$(urlfetch $(eval B=`https://twitch.center/customapi/`;Q=`quote?token=PRIVATE_TOKEN&data=`;S=`&silent=1`;X=parseInt(decodeURIComponent(`$(querystring)`));N=`$(urlfetch https://twitch.center/customapi/quote/list?token=PUBLIC_TOKEN&no_id=1)`;!isNaN(X)?I=X:I=1;!isNaN(N)?`${B}edit${Q}1%20${parseInt(N)+I+S}`:`${B}add${Q+I+S}`))

!subtract

$(urlfetch $(eval B=`https://twitch.center/customapi/`;Q=`quote?token=PRIVATE_TOKEN&data=`;S=`&silent=1`;X=parseInt(decodeURIComponent(`$(querystring)`));N=`$(urlfetch https://twitch.center/customapi/quote/list?token=PUBLIC_TOKEN&no_id=1)`;!isNaN(X)?I=X:I=1;!isNaN(N)?`${B}edit${Q}1%20${parseInt(N)-I+S}`:`${B}add${Q}-${I+S}`))

!counter

\*Insert Start of Message Here\* $(urlfetch https://twitch.center/customapi/quote/list?token=PUBLIC_TOKEN&no_id=1) \*Insert End of Message Here\*
2 Likes

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.