| View previous topic :: View next topic |
| Author |
Message |
ZoneISP Voice
Joined: 29 May 2005 Posts: 11 Location: Kuwait
|
Posted: Fri Aug 19, 2005 12:50 pm Post subject: need some tcl :) |
|
|
hi again i want command that owner type !setnick harry` the bot chabged it to harry` anyone can help with me this plz |
|
| Back to top |
|
 |
greenbear Owner
Joined: 24 Sep 2001 Posts: 733 Location: Norway
|
Posted: Fri Aug 19, 2005 1:38 pm Post subject: |
|
|
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 |
|
 |
Ian-Highlander Op
Joined: 24 Sep 2001 Posts: 165 Location: Ely, Cambridgeshire
|
Posted: Fri Aug 19, 2005 1:50 pm Post subject: |
|
|
| 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  _________________ "Insanity Takes Its Toll, Please Have Exact Change" |
|
| Back to top |
|
 |
demond Revered One

Joined: 12 Jun 2004 Posts: 3073 Location: San Francisco, CA
|
Posted: Fri Aug 19, 2005 3:28 pm Post subject: |
|
|
| eggdrop should have [bind pub] unavailable to owners, controlling the bot that way is incredibly lame |
|
| Back to top |
|
 |
sKy Op

Joined: 14 Apr 2005 Posts: 194 Location: Germany
|
Posted: Fri Aug 19, 2005 8:02 pm Post subject: |
|
|
| 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 |
|
 |
metroid Owner
Joined: 16 Jun 2004 Posts: 771
|
Posted: Thu Aug 25, 2005 2:53 am Post subject: |
|
|
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 |
|
 |
spock Master
Joined: 12 Dec 2002 Posts: 319
|
Posted: Thu Aug 25, 2005 9:58 am Post subject: |
|
|
metroid, try your script with nicknames such as {abc} or {abc}d
it probably wont do what you want  _________________ photon? |
|
| Back to top |
|
 |
|