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.

!msg script

Help for those learning Tcl or writing their own scripts.
Post Reply
s
slowpoke23
Voice
Posts: 5
Joined: Sun Feb 10, 2013 5:17 am

!msg script

Post by slowpoke23 »

Hi

lets say i have this script

Code: Select all

bind pub n !msg s_msg2
proc s_msg2 {nick uhost hand chan arg} {
global botnick
putserv "PRIVMSG $chan : $arg"
}

How can I make it message the channel OR the nickname

!msg #chan test
!msg nick test

:S
d
dirty
Halfop
Posts: 40
Joined: Fri Feb 08, 2013 2:33 pm
Location: Romania
Contact:

Post by dirty »

this way:

Code: Select all

bind pub n !msg s_msg2 
proc s_msg2 {nick uhost hand chan text} { 
     
     set where [lindex [join $text] 0]
     set what [join [lrange [split $text] 1 end]]

     putserv "PRIVMSG $where : $what" 
}
come to the dark side.. I have cookies!
WwW.BotZone.TK
Post Reply