mIRC Home    About    Download    Register    News    Help

Print Thread
Joined: Dec 2015
Posts: 8
Nutrimatic drinks dispenser
OP Offline
Nutrimatic drinks dispenser
Joined: Dec 2015
Posts: 8
Cleaning up my scripts a bot for a channel bot and wanting to see if I can condense this. Essentially it just triggers on expletives. Not sure what all is permitted here so I censored it. Instead of having the following:

Code:
on *:text:*CURSEWORD*:#:{ 
    describe $chan washes $nick $+ 's mouth out with soap. 
}
on *:text:*CURSEWORD*:#:{ 
   describe $chan washes $nick $+ 's mouth out with soap. 
}
on *:text:*CURSEWORD*:#:{ 
  describe $chan washes $nick $+ 's mouth out with soap. 
}


Is there a way to condense this so that it can recognize all the triggers?

Code:
on *:text:*CURSEWORD,CURSEWORD,CURSEWORD*:#:{ 
  describe $chan washes $nick $+ 's mouth out with soap. 
}



thanks in advance!!!

Joined: Oct 2014
Posts: 54
O
Babel fish
Offline
Babel fish
O
Joined: Oct 2014
Posts: 54
Maroon did something like this on another thread.. Not sure if it will help you but it is very close.

Maroon thread on text match

Joined: Feb 2003
Posts: 2,812
Hoopy frood
Offline
Hoopy frood
Joined: Feb 2003
Posts: 2,812
There are multiple ways to handle lists.

Look at:

/help Token Identifiers
/help Hash Tables
/help While Loops
/help If Then Else


Well. At least I won lunch.
Good philosophy, see good in bad, I like!

Link Copied to Clipboard