You should use the [ code ] and [ /code ] , and I added one } at the end for you
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:
(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:
\.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
Any ideas/suggestions would be much, much appreciated!