| View previous topic :: View next topic |
| Author |
Message |
BigSjedow Voice
Joined: 16 Nov 2003 Posts: 21
|
Posted: Thu Jan 12, 2006 7:09 am Post subject: set nick doesn't work |
|
|
Hey all,
got a problem here:
| Code: |
set change_to "Sjaak"
bind part -|- * keepnick:part
proc keepnick:part {nick uhost hand chan reason} { keepnick:check $nick $chan }
bind nick -|- * keepnick:nick
proc keepnick:nick {nick uhost hand chan newnick} { keepnick:check $nick $chan }
proc keepnick:check { nick chan } {
global change_to
if {[onchan $change_to $chan] == 0} {
set nick $change_to
putlog "Nick: $change_to"
}
}
|
i want the bot to take my nick when i leave the server.
so i wrote this code.
but the: set nick $change_to
doesn't work and the putlog does.
on the artyline i can type .tcl set nick Sjaak, and that works fine..
anyone an idea?
Thx
BigSjedow |
|
| Back to top |
|
 |
De Kus Revered One

Joined: 15 Dec 2002 Posts: 1361 Location: Germany
|
Posted: Thu Jan 12, 2006 8:13 am Post subject: |
|
|
well, I doubt that will work that way, because part and nick will trigger before the chanlist is updated so your check will always be false. you could do a workaround by using utimer 1, but that would slow down reaction speed. So best you directly compare $nick to $change_to.
btw you probably meant to add nick to global list and take a new name for the one in the arg list. _________________ De Kus
StarZ|De_Kus, De_Kus or DeKus on IRC
Copyright © 2005-2009 by De Kus - published under The MIT License
Love hurts, love strengthens... |
|
| Back to top |
|
 |
BigSjedow Voice
Joined: 16 Nov 2003 Posts: 21
|
Posted: Thu Jan 12, 2006 8:22 am Post subject: |
|
|
thx for the quick respone.
it does work, the putlog is executed so it should als execute the set nick
i added nick 2 the global list. but now i get an error on the party line:
Tcl error [keepnick:nick]: variable "nick" already exists |
|
| Back to top |
|
 |
De Kus Revered One

Joined: 15 Dec 2002 Posts: 1361 Location: Germany
|
Posted: Thu Jan 12, 2006 8:36 am Post subject: |
|
|
| De Kus wrote: | | ...and take a new name for the one in the arg list. |
Since I already knew you would make that mistake I explicitly told you... _________________ De Kus
StarZ|De_Kus, De_Kus or DeKus on IRC
Copyright © 2005-2009 by De Kus - published under The MIT License
Love hurts, love strengthens... |
|
| Back to top |
|
 |
BigSjedow Voice
Joined: 16 Nov 2003 Posts: 21
|
Posted: Thu Jan 12, 2006 8:40 am Post subject: |
|
|
lol.., that was idd the problem...
thx m8 for the help. |
|
| Back to top |
|
 |
|