This is the new home of the egghelp.org community forum.
All data has been migrated (including user logins/passwords) to a new phpBB version.


For more information, see this announcement post. Click the X in the top right-corner of this box to dismiss this message.

need some tcl :)

Old posts that have not been replied to for several years.
Locked
Z
ZoneISP
Voice
Posts: 11
Joined: Sun May 29, 2005 4:50 pm
Location: Kuwait
Contact:

need some tcl :)

Post by ZoneISP »

hi again :D i want command that owner type !setnick harry` the bot chabged it to harry` anyone can help with me this plz
g
greenbear
Owner
Posts: 733
Joined: Mon Sep 24, 2001 8:00 pm
Location: Norway

Post by greenbear »

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: Select all

bind pub n !setnick foo
proc foo {n u h c a} {
 set nick [lindex [split $a] 0]
 set ::nick [join $nick]
}
I
Ian-Highlander
Op
Posts: 165
Joined: Mon Sep 24, 2001 8:00 pm
Location: Ely, Cambridgeshire

Post by Ian-Highlander »

Code: Select all

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 :D
"Insanity Takes Its Toll, Please Have Exact Change"
User avatar
demond
Revered One
Posts: 3073
Joined: Sat Jun 12, 2004 9:58 am
Location: San Francisco, CA
Contact:

Post by demond »

eggdrop should have [bind pub] unavailable to owners, controlling the bot that way is incredibly lame
User avatar
sKy
Op
Posts: 194
Joined: Thu Apr 14, 2005 5:58 pm
Location: Germany

Post by sKy »

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: Select all

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
m
metroid
Owner
Posts: 771
Joined: Wed Jun 16, 2004 2:46 am

Post by metroid »

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: Select all

bind pub n !setnick change:nick
proc change:nick {n u h c a} {
 set ::nick [join [lindex [split $a] 0]]
}
s
spock
Master
Posts: 319
Joined: Thu Dec 12, 2002 8:40 pm

Post by spock »

metroid, try your script with nicknames such as {abc} or {abc}d
it probably wont do what you want :wink:
photon?
Locked