This is the new home of the egghelp.org community forum.
All data has been migrated (including user logins/passwords) to a new phpBB version.


For more information, see this announcement post. Click the X in the top right-corner of this box to dismiss this message.

Message when certain ident/hostmasks join

Help for those learning Tcl or writing their own scripts.
Post Reply
R
Reserve
Voice
Posts: 6
Joined: Mon Apr 18, 2005 5:25 am
Location: Nottingham, UK

Message when certain ident/hostmasks join

Post by Reserve »

Im writing (trying to write) a script that will put a msg to a channel when certain users using a certain ident and/or hostmask joins. Ive searched the forums and found some usefull snippets of code and from that i've So far got

Code: Select all

bind join - * onjoin:msg

proc onjoin:msg {nick host hand chan} {
   if {$host == "~ident@host.mask"} {
     putquick "PRIVMSG $chan : Message for user 1" 
   } elseif {$host == "~ident@another.host.mask"} {
     putquick "PRIVMSG $chan : Message for user 2" 
   } elseif {$host == "*.*@another.host.mask"} {
     putquick "PRIVMSG $chan : Message for users from hostmask" 
   }
}
But that doesnt seem to work :(

I get no errors but the bot doesnt put the msg to the channel when the user joins :?

Can anyone see from the code what ive done wrong?

How would i add a pause/delay into the script so that the bot pauses for say 5 seconds before it posts the msg?

Any help greatly appreciated

Regards

Reserve
User avatar
Sir_Fz
Revered One
Posts: 3793
Joined: Sun Apr 27, 2003 3:10 pm
Location: Lebanon
Contact:

Post by Sir_Fz »

You can't use wildcards with ==, instead try

Code: Select all

if {[string match -nocase "*id@host.*" $host]} {
Post Reply