| View previous topic :: View next topic |
| Author |
Message |
cache Master
Joined: 10 Jan 2006 Posts: 306 Location: Mass
|
Posted: Sun Mar 11, 2007 8:21 pm Post subject: bind for msg instead of pub |
|
|
I'm trying to get a command to work via PM instead of main room.. I tried changing pub to msg since thats how i see the samples in other scripts...
I have:
| Code: | #
set usedcmds69 [expr {[unixtime]-3}]
bind msg - !69 cmds69
proc cmds69 {nick uhost hand chan arg} {
global usedcmds69
if {[set t [expr {[unixtime]-$usedcmds69}]] < 3} {
putquick "NOTICE $nick :You have to wait [expr {3-$t}] sec(s) before you can use this command."
return 0
}
if {$arg == ""} {
putserv "NOTICE $nick :Usage: !69 <who>"
return 0
}
set usedcmds69 [unixtime]
set 69who [lrange $arg 0 end]
putquick "privmsg $nick :\001ACTION $69who blah blah\001"
}
# |
But when I try that I get this error:
| Code: | | [20:09] Tcl error [cmd69]: wrong # args: should be "cmd69 nick uhost hand chan arg" |
Thanks |
|
| Back to top |
|
 |
Sir_Fz Revered One

Joined: 27 Apr 2003 Posts: 3793 Location: Lebanon
|
Posted: Sun Mar 11, 2007 9:03 pm Post subject: |
|
|
Tcl-commands.doc:
| Quote: | MSG
bind msg <flags> <command> <proc>
procname <nick> <user@host> <handle> <text>
Description: used for /msg commands. The first word of the user's
msg is the command, and everything else becomes the text argument.
|
Notice how there's no <chan> argument passed to a msg-bind proc. _________________ Follow me on GitHub
- Opposing
Public Tcl scripts |
|
| Back to top |
|
 |
cache Master
Joined: 10 Jan 2006 Posts: 306 Location: Mass
|
Posted: Sun Mar 11, 2007 9:07 pm Post subject: |
|
|
Ohh duh at me, I forgot.. works now thanks  |
|
| Back to top |
|
 |
|