|
Joined: Oct 2004
Posts: 5
Nutrimatic drinks dispenser
|
OP
Nutrimatic drinks dispenser
Joined: Oct 2004
Posts: 5 |
I'm an IRCOp on the IRC server the website/forum I work at, and in the java applet there are these annoying /me commands that flood the screen pointlessly. We've made it against the rules to use them, but we can't physically remove them from the applet so I was wondering if it would be possible to make a script regarding them.
The basic plot of the script would be to /notice the user with a warning about the use of the automatic actions(I.E. things like "Nick attacks nobody in particular!", "Nick is really very bored.", "Nick slaps everyone in the room.", "Nick smiles at everyone in the room :-)", "Nick Laughs-Out-Loud!!", "Nick is going to be away from the channel.", "Nick bounces around the channel.", "Nick looks at nobody in particular and laughs.") twice before kicking them from the channel for it.
Is it doable?
|
|
|
|
Joined: Feb 2004
Posts: 714
Hoopy frood
|
Hoopy frood
Joined: Feb 2004
Posts: 714 |
If I understood the matter correctly, then yes on @*:action:*:#: {
inc $+(%,action,$nick,$chan)
if ($eval($+(%,action,$nick,$chan),2) < 2) { .notice $nick Please do not use actions (the /me command) in here. Thank you. }
else { kick # $nick You were warned to not use actions. | unset $+(%,action,$nick,$chan) }
} This should warn them in the first couple of times. After that, it kicks them. If you would like to have a limit for the actions (Eg: 2 in 30 minutes) you can add -uN between the inc and the $+(%,action,$nick,$chan) part, replacing N for the time in seconds. I hope this can help Zyzzyx.
Last edited by Zyzzyx26; 02/10/04 10:55 PM.
"All we are saying is give peace a chance" -- John Lennon
|
|
|
|
Joined: Oct 2004
Posts: 5
Nutrimatic drinks dispenser
|
OP
Nutrimatic drinks dispenser
Joined: Oct 2004
Posts: 5 |
That's basically it, yeah. The only thing is that /me commands themselves are allowed for use. It's these ready-made commands the place's java applet has that are the problem.
* Asperity is really very bored. * Asperity smiles at everyone in the room :-) * Asperity slaps everyone in the room. * Asperity attacks nobody in particular! * Asperity looks at nobody in particular and laughs. * Asperity is going to be away from the channel. * Asperity bounces around the channel. * Asperity Laughs-Out-Loud!!
|
|
|
|
Joined: Feb 2004
Posts: 714
Hoopy frood
|
Hoopy frood
Joined: Feb 2004
Posts: 714 |
on @*:action:*:#: {
if ($istok(%actions,$strip($1-),61)) {
inc $+(%,action,$nick,$chan)
if ($eval($+(%,action,$nick,$chan),2) <= 2) { .notice $nick Please do not use actions (the /me command) in here. Thank you. }
else { kick # $nick You were warned to not use actions. | unset $+(%,action,$nick,$chan) }
}
} You can try this then. The varible %actions should contain the JApplet's sentences, separated by an equal sign (=). Eg: is really very bored.= smiles at everyone in the room :-)=slaps everyone in the room.=attacks nobody in particular!and so on... I hope this can help Zyzzy.
"All we are saying is give peace a chance" -- John Lennon
|
|
|
|
Joined: Oct 2004
Posts: 5
Nutrimatic drinks dispenser
|
OP
Nutrimatic drinks dispenser
Joined: Oct 2004
Posts: 5 |
That should work great. Thank you very much.
I take it the %Actions variable would be set up in the Variables window for the Scripts editor, rather than in the script itself. How would it be set up there? I was checking the Help file, but it didn't help too much. I'm rather script illiterate.
|
|
|
|
Joined: Feb 2004
Posts: 714
Hoopy frood
|
Hoopy frood
Joined: Feb 2004
Posts: 714 |
Yes, they should be set up as variables. To do that, use the /set command. /set %actions <value> - would do it. Replace the <value> for the sentences of the Java Applet separated by the equal sign (=), and without the <>. For more information about variables, you can type /help variables [color:black] or /help /set[/color]. Good luck, Zyzzyx
"All we are saying is give peace a chance" -- John Lennon
|
|
|
|
Joined: Oct 2004
Posts: 5
Nutrimatic drinks dispenser
|
OP
Nutrimatic drinks dispenser
Joined: Oct 2004
Posts: 5 |
I've got it set up, but when I test it out I get "/if: close bracket not found". I've got the whole thing copied, and the variables in place.
|
|
|
|
Joined: Feb 2004
Posts: 714
Hoopy frood
|
Hoopy frood
Joined: Feb 2004
Posts: 714 |
Hmm... wierd By looking at the code above, I can't find any bracket mismatches. There is a closing bracket at the very end of the 4th line, which is kinda hidden. Please try copying the code again and make sure you get that "hidden" bracket as well. Zyzzyx
"All we are saying is give peace a chance" -- John Lennon
|
|
|
|
Joined: Oct 2004
Posts: 5
Nutrimatic drinks dispenser
|
OP
Nutrimatic drinks dispenser
Joined: Oct 2004
Posts: 5 |
I think when I copied and set it up I did some improper spacing. It works fine now.
Thank you very much for your help.
|
|
|
|
Joined: Feb 2004
Posts: 714
Hoopy frood
|
Hoopy frood
Joined: Feb 2004
Posts: 714 |
Awesome! Yw
"All we are saying is give peace a chance" -- John Lennon
|
|
|
|
|