Is it possible to get a script that could catch a specific word in a channel and execute a command after a period of time.
ex.
user1: hey, im a n00b
Scripts checks n00b, and hold that for 10 min then it execute a command in a specifik chan.
!kick sorry, n00bs aint alllowed in here
A proper and fixed version of the script posted by iamdeath, depends on tcl8.2 or newer (for the -nocase matching) and eggdrop1.6.17 or newer (for stripcodes):
@iamdeath:
Actually, your code would trigger on any channel, but do the kick in a predefined channel. In case someone used multiple triggers in a single message, this would stack kick-timers causing unneccesary penalty points (I admit, even the fixed code does not check for pre-existing timers on subsecuencial messages). "args" is a special variable name when used in proc-declarations, accepting an arbitrary number of arguments (each added to args as a separate list-item), and should really be avoided unless this behaviour is explicitly desired. It is also not such a good idea to use string commands such as "string tolower" on list structures, as these will also modify the delimiter characters (such as {}) in some cases. Finally, don't ever use list commands such as foreach on non-lists (strings).
One thing worth mentioning however, is that none of the current "solutions" handle the case of "badboy" changing nick after writing a bad word, hence avoiding being kicked, and also possibly getting someone else kicked.
@Tosser^^:
It is fully functional, but maybe not recommendable in the sence of keeping the code clean. Nice catch anyway
One thing tho, is'nt the case of $chan in yourword dependant on the case used by the user triggering the commands, rather than the case it was added to the bot?
nice work guys.
But. =)
i dont think i said it clear enogh thou. =)
The kick was just an exampel.
I want it to send a command Or just a sentence in a specifik chan. and i want it to monitor one specifik chan, and i forgot to tell that it need to catch the word and set it in the command i want to send.
ex. 1
<user> Hey, im a n00b
<bot> triggers on Hey
and then it sends !command the word n00b isnt allowed
ex 2
<user> Hey, im a wanker
<bot> triggers on Hey
and then it send !command the word wanker isnt allowed
so it should trigger on Hey and catch both wanker and n00b and set this into whatever command i want to send.
i hope this can be done. ugly or a nice way dosent matter.
Well, in that case you'd just have to alter the message sent with putserv from something like "KICK $chan $nick :blah" into "PRIVMSG $chan :!kick $nick blah". $nick and $chan of course would depend on the actual script, as different examples in this thread choose different names for those arguments.
But in essence, putserv sends whatever string you supply to the irc-server without further parsing.
ok, i cant a [censored] of this scripting thingy. =)
But the above script is almost what i want.
But i want it to trigger on "myword" and put the second word in my command.
hey looser
triggers on hey, takes looser and put it in my command.
hey dick
triggers on hey, takes dick and put it in my command.
so it should trigger on a specific word i set and takes whatever other word that comes second and put it in my command.
=)
and monitor one chan and send the command in another chan.