| View previous topic :: View next topic |
| Author |
Message |
TheRudy Voice
Joined: 22 Oct 2005 Posts: 6
|
Posted: Fri Jan 06, 2006 6:43 am Post subject: bind msg, reg nick |
|
|
Hey
Yes i'm new so sorry for stupid question
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 |
|
 |
TheRudy Voice
Joined: 22 Oct 2005 Posts: 6
|
Posted: Fri Jan 06, 2006 7:10 am Post subject: |
|
|
| 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"
} |
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 |
|
 |
Sir_Fz Revered One

Joined: 27 Apr 2003 Posts: 3793 Location: Lebanon
|
Posted: Fri Jan 06, 2006 9:08 am Post subject: |
|
|
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 |
|
 |
TheRudy Voice
Joined: 22 Oct 2005 Posts: 6
|
Posted: Fri Jan 06, 2006 10:33 am Post subject: |
|
|
Oh my
I'll learn, thanks, it works now just as i wanted! |
|
| Back to top |
|
 |
Sir_Fz Revered One

Joined: 27 Apr 2003 Posts: 3793 Location: Lebanon
|
Posted: Fri Jan 06, 2006 10:51 am Post subject: |
|
|
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 |
|
 |
TheRudy Voice
Joined: 22 Oct 2005 Posts: 6
|
Posted: Sun Jan 08, 2006 5:36 am Post subject: |
|
|
| omg, yes thanks for that, didn't know its there! |
|
| Back to top |
|
 |
|