I've been wracking my brain on this for weeks, googling, poking around on this board, etc., and never thought to just POST MY OWN QUESTION HERE. Whoops x_______x

EDIT: Ah, shoot...the unicode character that isn't rendering correctly (showing up as Σ) is the sigma character. As the first script is working correctly, I do not believe that the presence of such a unicode character is what is messing up the script.

I am a moderator of a channel on twitch.tv called saltybet. People gamble fake money on AI vs AI fighting games. People can see everyone else's bets, and folks commonly spam the channel with other peoples' bets in the format of:
alphanumericUsernameHere -> $123 (Σ$123)

I am trying to write a script to give a user a temporary timeout if one posts a bet three or more times in sixty seconds. As of now, I have this script working:
Code:
on *:TEXT:* -> $* (Σ$*)*:#saltybet:{
  inc -u60 %betSpam. [ $+ [ $nick ] ] 1
  if (%betSpam. [ $+ [ $nick ] ] >= 3) {
    timer 1 1 /msg $chan .timeout $nick
  }
}


The increment call and variable are working as intended. However, sometimes users post things like this:
alphanumericUsernameHere -> $123 (Σ$123)alphanumericUsernameHere -> $123 (Σ$123)alphanumericUsernameHere -> $123 (Σ$123)alphanumericUsernameHere -> $123 (Σ$123)

In this instance, I would want to use a $regex call to increment the aforementioned %betspam.usernameGoesHere a number of times equal to the number of times the bet appears. Is this making sense?

Here is the modified script that I've been testing using $regex:
Code:
on *:TEXT:* -> $* (Σ$*)*:#test:{
  inc -u60 %testSpam. [ $+ [ $nick ] ] $regex($1-, [A-Za-z0-9]. -> \$[0-9]+ \(Σ\$[0-9]+\))
  msg #test %testSpam. [ $+ [ $nick ] ]
}


The problem that I'm running into is that no matter how many instances of the string appears, the variable only ever increments by one, and when it is messaged back to the channel, it appears as one higher than whatever it was previously. I believe the issue lies in the $1- parameter of the $regex call. I'm kind of hazy on what exactly $1- is, but I thought it was the whole line related to whatever event is currently happening (in this case, maybe the text that met the on:TEXT call?). I've done tests with $1- and it will pass the entire line (with multiple instances of my trigger string) in msg calls.

Can anyone help me figure this out?

P.S.: one other, far simpler question I had is about using an on:TEXT action that will trigger on /me commands as well (so, ideally, on:TEXT||ACTION, if such a thing exists, which it doesn't seem to). Is such a thing possible? Also, should I have made a separate post for this? Nothing in the rules mentioned raising multiple questions in one post, apologies if I should have!

Thanks folks.

Last edited by 00000100; 12/09/13 01:50 AM.