Good Afternoon Chaps.

Twitch Question:

I have been playing around with 'inc %egg.times' in the code, to keep track of a variable, but what I would like it to do, is create a further variable, that checks what channel the command is being used in, and use said channel in the variable to keep track of where the command is being used, and also parse that back into the output of the command.

Code
on *:TEXT:!eggnew *:#: { 
  var %channel = $chan
  inc %egg.times
  inc %egg.times.%channel
  .msg # /me ! Throws an 🥚 at $$2 - I have thrown a total of %egg.times Eggs, and %egg.times.%channel times in this channel.
}


The alias %channel works, and $chan also displays #eggfriedcheese, so I'm wondering if the # in the channel from IRC is causing me issues.

Does anyone have any ideas, or a better way of doing this? I need to integrate this into a number of commands running in the bot, and might be opening the bot to other channels, so would rather not have to enter manual lines of code for every single channel the bot is in.

Thanks
Egg


SOLVED:

For those that are interested: Below Code:

Code
on *:TEXT:!egg *:#: { 
  inc %egg.times
  inc %egg.times. [ $+ [ $chan ] ] 
  .msg # /me ! Throws an 🥚 at $$2 - I have thrown a total of %egg.times Eggs, and %egg.times. [ $+ [ $chan ] ] times in this channel.
}

Last edited by EggFriedCheese; 25/05/22 03:23 PM. Reason: SOLVED

Twitch Live-Streamer:
Synth Riders
Beat Saber
www.twitch.tv/eggfriedcheese