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 

need some tcl :)

 
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    egghelp.org community Forum Index -> Archive
View previous topic :: View next topic  
Author Message
ZoneISP
Voice


Joined: 29 May 2005
Posts: 11
Location: Kuwait

PostPosted: Fri Aug 19, 2005 12:50 pm    Post subject: need some tcl :) Reply with quote

hi again Very Happy i want command that owner type !setnick harry` the bot chabged it to harry` anyone can help with me this plz
Back to top
View user's profile Send private message Visit poster's website
greenbear
Owner


Joined: 24 Sep 2001
Posts: 733
Location: Norway

PostPosted: Fri Aug 19, 2005 1:38 pm    Post subject: Reply with quote

This will change the botnick until the next rehash/restart.
For a permanent nickchange you have to manually change it in the config file.
Code:
bind pub n !setnick foo
proc foo {n u h c a} {
 set nick [lindex [split $a] 0]
 set ::nick [join $nick]
}
Back to top
View user's profile Send private message Send e-mail
Ian-Highlander
Op


Joined: 24 Sep 2001
Posts: 165
Location: Ely, Cambridgeshire

PostPosted: Fri Aug 19, 2005 1:50 pm    Post subject: Reply with quote

Code:
bind pub n !setnick nick_change

proc nick_change {nick host handle channel rest} {
global keep-nick
set new_nick [lindex [split $rest] 0]
set keep-nick 0
putserv "NICK $new_nick"
return 0
}


Edit: greenbear beat me to it, his code is nicer, use that Very Happy
_________________
"Insanity Takes Its Toll, Please Have Exact Change"
Back to top
View user's profile Send private message Send e-mail
demond
Revered One


Joined: 12 Jun 2004
Posts: 3073
Location: San Francisco, CA

PostPosted: Fri Aug 19, 2005 3:28 pm    Post subject: Reply with quote

eggdrop should have [bind pub] unavailable to owners, controlling the bot that way is incredibly lame
Back to top
View user's profile Send private message Visit poster's website
sKy
Op


Joined: 14 Apr 2005
Posts: 194
Location: Germany

PostPosted: Fri Aug 19, 2005 8:02 pm    Post subject: Reply with quote

greenbear wrote:
This will change the botnick until the next rehash/restart.
For a permanent nickchange you have to manually change it in the config file.
Code:
bind pub n !setnick foo
proc foo {n u h c a} {
 set nick [lindex [split $a] 0]
 set ::nick [join $nick]
}


Well, small correction. lindex will return you a string and not a list. With that reason there is really no need to join this string. lrange and lindex are list commands. But other then lrange will lindex return a string.
set ::nick [join $nick] --> set ::nick $nick
Back to top
View user's profile Send private message
metroid
Owner


Joined: 16 Jun 2004
Posts: 771

PostPosted: Thu Aug 25, 2005 2:53 am    Post subject: Reply with quote

Actually wrong, Using join is a very good idea incase of braces.

If the command gets used and the nickname contains brackets split will add braces around it and join removes those braces.

But ofcourse you can just make the code not make useless variables

Code:
bind pub n !setnick change:nick
proc change:nick {n u h c a} {
 set ::nick [join [lindex [split $a] 0]]
}
Back to top
View user's profile Send private message
spock
Master


Joined: 12 Dec 2002
Posts: 319

PostPosted: Thu Aug 25, 2005 9:58 am    Post subject: Reply with quote

metroid, try your script with nicknames such as {abc} or {abc}d
it probably wont do what you want Wink
_________________
photon?
Back to top
View user's profile Send private message
Display posts from previous:   
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    egghelp.org community Forum Index -> Archive 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