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 msg, reg nick

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


Joined: 22 Oct 2005
Posts: 6

PostPosted: Fri Jan 06, 2006 6:43 am    Post subject: bind msg, reg nick Reply with quote

Hey

Yes i'm new so sorry for stupid question Wink
And yes, i'm reading http://tcl.activestate.com/man/tcl8.3/TclCmd/proc.htm but it doesn't help me with this problem.

I'm trying to register a nick over PM, posting this on channel has no use since it involves password..

This method works, !regteam some_nick some_pass <--- PUBLIC channel
Code:

bind pub n|- !regteam pub:reg_team

proc pub:reg_team { nickname hostname handle channel arguments } {
   set nick [lindex [split $arguments] 0]
   set password [lindex [split $arguments] 1]
   puthelp "PRIVMSG $nickname :Nickname: $nick Password: $password"
}



This method doesn't work, PM method!! What am i missing here?!?
Code:
bind msg n !regteam msg:reg_team

proc msg:reg_team { nickname hostname handle channel arguments } {
   set nick [lindex [split $arguments] 0]
   set password [lindex [split $arguments] 1]
   puthelp "PRIVMSG $nickname :Nickname: $nick Password: $password"
}


btw, the error i get using above MSG code is: wrong # args: should be "reg_team nickname hostname handle channel arguments"

Now if i change "arguments" to "args" the error is not there anymore but there is nothing in the args so the output is: Nickname: Password:
Back to top
View user's profile Send private message
TheRudy
Voice


Joined: 22 Oct 2005
Posts: 6

PostPosted: Fri Jan 06, 2006 7:10 am    Post subject: Reply with quote

Code:
bind msg -|- !regteam msg:reg_team

proc msg:reg_team { nickname args } {
   set team_name [lindex [split $args] 2]
   set password [lindex [split $args] 3]
   puthelp "PRIVMSG $nickname :Password: $password Team name: $team_name"
}


Wink
Managed to get it working BUT the output is: Password: somepassword} Team name: {someteamname

with a command: !regteam someteamname somepassword

where did those { in front and at the end } come from??
Back to top
View user's profile Send private message
Sir_Fz
Revered One


Joined: 27 Apr 2003
Posts: 3793
Location: Lebanon

PostPosted: Fri Jan 06, 2006 9:08 am    Post subject: Reply with quote

Don't split args or use
Code:
bind msg -|- !regteam msg:reg_team

proc msg:reg_team {nick uhost hand arg} {
   set team_name [lindex [split $arg] 0]
   set password [lindex [split $arg] 1]
   puthelp "PRIVMSG $nick :Password: $password Team name: $team_name"
}

_________________
Follow me on GitHub

- Opposing

Public Tcl scripts
Back to top
View user's profile Send private message Visit poster's website
TheRudy
Voice


Joined: 22 Oct 2005
Posts: 6

PostPosted: Fri Jan 06, 2006 10:33 am    Post subject: Reply with quote

Oh my Smile
I'll learn, thanks, it works now just as i wanted!
Back to top
View user's profile Send private message
Sir_Fz
Revered One


Joined: 27 Apr 2003
Posts: 3793
Location: Lebanon

PostPosted: Fri Jan 06, 2006 10:51 am    Post subject: Reply with quote

The problem was that you had extra arguments for the msg proc. Read Tcl-commands.doc to know about the binds.
_________________
Follow me on GitHub

- Opposing

Public Tcl scripts
Back to top
View user's profile Send private message Visit poster's website
TheRudy
Voice


Joined: 22 Oct 2005
Posts: 6

PostPosted: Sun Jan 08, 2006 5:36 am    Post subject: Reply with quote

omg, yes thanks for that, didn't know its there!
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