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.

Match start of nick

Old posts that have not been replied to for several years.
Locked
G
Gozar
Voice
Posts: 2
Joined: Thu Jun 30, 2005 1:20 pm

Match start of nick

Post by Gozar »

Hello. I'm trying to make a script that sends a messege to a user if the start of the nick contains ex. [ABC] when they join the channel

Code: Select all

bind join - "\[ABC\]*" greet

proc greet { nick chan} {
  puthelp "PRIVMSG $chan :Hello $nick. Nice To see you"
  return 0
}
User avatar
Sir_Fz
Revered One
Posts: 3794
Joined: Sun Apr 27, 2003 3:10 pm
Location: Lebanon
Contact:

Post by Sir_Fz »

From tcl-commands.doc:
JOIN (stackable)
bind join <flags> <mask> <proc>
procname <nick> <user@host> <handle> <channel>

Description: triggered by someone joining the channel. The mask in
the bind is matched against "#channel nick!user@host" and can
contain wildcards
so try

Code: Select all

bind join - "* \[ABC\]*!*@*" greet 

proc greet {nick uhost hand chan} { 
  puthelp "PRIVMSG $chan :Hello $nick. Nice To see you" 
  return 0 
}
G
Gozar
Voice
Posts: 2
Joined: Thu Jun 30, 2005 1:20 pm

Post by Gozar »

Thangs. It works flawless.
Locked