Originally Posted By: sparta
You should use the [ code ] and [ /code ] , and I added one } at the end for you wink

Code:
on 1:TEXT:*:#some-channel:{
  tokenize 32 $strip($1-)
  if ($1 == cmd1) {
    write file1.txt $gettok($1-,7,32)
  }
  elseif ($1 == cmd2) {
    write file2.txt $gettok($1-,7,32)
  }
  elseif ($1 == cmd3) {
    write file3.txt etc..
  }
}
...

etc...




Guys, thank you both SO much for your replies and kind help!
I'm still struggling with it, to be frank though.

Let me illustrate what I'm trying to do here. I want an event to be triggered on the following phrase:
Code:
.year.word.word.word-

(year in the standard yyyy format, meaning 1999, 2000, 2001, etc.)

Then:
- IF year is 198X, write to file 1
- IF year is 199X, write to file 2
- IF year is 200x, write to file 3
- IF year is 201X, write to file 3
- Etc.

So basically what I CAN'T get to work is the if checking against a regex that would look something like this:
Code:
\.198\d\.word\.word\.word-
\.199\d\.word\.word\.word-
etc.

(I checked the regex here and it seems to be valid: http://regexpal.com/)


Does anyone have an idea how to make that workable?
I tried playing around with $regex(), but the script just doesn't work for some reason frown

Any ideas/suggestions would be much, much appreciated! smile

Last edited by Diam0nd; 25/05/13 10:34 AM.