mIRC Home    About    Download    Register    News    Help

Print Thread
#241345 11/04/13 12:36 AM
F
Felanbird
Felanbird
F
Another little question;

I'm looking for a script that will trigger by a character limit so giant walls of text don't go unchecked, any ideas? laugh

Joined: Oct 2004
Posts: 8,061
R
Hoopy frood
Offline
Hoopy frood
R
Joined: Oct 2004
Posts: 8,061
Use an on text event with $len() to check the number of characters and then do whatever you want if it's over the number that you choose. As a note, $len() will could all control codes as well.

Code:
on *:text:*:#channel: {
  if ($len($1-) > 200) { msg $chan Don't talk so much. }
}

F
Felanbird
Felanbird
F
Tyvm Works like a charm laugh

Joined: Oct 2004
Posts: 8,061
R
Hoopy frood
Offline
Hoopy frood
R
Joined: Oct 2004
Posts: 8,061
Also, if you plan to do something that requires you to be an op (kicking, banning, etc.), then you will want to put an @ on the on text event...

Code:
on @*:text:*:#channel:{


That will make it only trigger if you're an op so you don't get an error anytime you try to kick/ban someone when you're not an op. You can also just use a check to see if you're an op...

Code:
if ($me isop $chan) { }


That is useful if you want to do something when you're an op and something else if you're not an op.

And just a correction on my first post... it should say that $len() will *count* control codes. Sorry for the typo.


Link Copied to Clipboard