egghelp.org community Forum Index
[ egghelp.org home | forum home ]
egghelp.org community
Discussion of eggdrop bots, shell accounts and tcl scripts.
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

bind for msg instead of pub

 
Post new topic   Reply to topic    egghelp.org community Forum Index -> Scripting Help
View previous topic :: View next topic  
Author Message
cache
Master


Joined: 10 Jan 2006
Posts: 306
Location: Mass

PostPosted: Sun Mar 11, 2007 8:21 pm    Post subject: bind for msg instead of pub Reply with quote

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
View user's profile Send private message
Sir_Fz
Revered One


Joined: 27 Apr 2003
Posts: 3793
Location: Lebanon

PostPosted: Sun Mar 11, 2007 9:03 pm    Post subject: Reply with quote

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
View user's profile Send private message Visit poster's website
cache
Master


Joined: 10 Jan 2006
Posts: 306
Location: Mass

PostPosted: Sun Mar 11, 2007 9:07 pm    Post subject: Reply with quote

Ohh duh at me, I forgot.. works now thanks Smile
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    egghelp.org community Forum Index -> Scripting Help All times are GMT - 4 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Forum hosting provided by Reverse.net

Powered by phpBB © 2001, 2005 phpBB Group
subGreen style by ktauber