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 

set nick doesn't work

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


Joined: 16 Nov 2003
Posts: 21

PostPosted: Thu Jan 12, 2006 7:09 am    Post subject: set nick doesn't work Reply with quote

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


Joined: 15 Dec 2002
Posts: 1361
Location: Germany

PostPosted: Thu Jan 12, 2006 8:13 am    Post subject: Reply with quote

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
View user's profile Send private message MSN Messenger
BigSjedow
Voice


Joined: 16 Nov 2003
Posts: 21

PostPosted: Thu Jan 12, 2006 8:22 am    Post subject: Reply with quote

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


Joined: 15 Dec 2002
Posts: 1361
Location: Germany

PostPosted: Thu Jan 12, 2006 8:36 am    Post subject: Reply with quote

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
View user's profile Send private message MSN Messenger
BigSjedow
Voice


Joined: 16 Nov 2003
Posts: 21

PostPosted: Thu Jan 12, 2006 8:40 am    Post subject: Reply with quote

lol.., that was idd the problem...

thx m8 for the help.
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