bind nick -|- * nick:change
proc nick:change {nick uhost hand chan newnick} {
if {[isbotnick $nick]} {
foreach bind [binds $nick] {
set type [lindex $bind 0]
set flag [lindex $bind 1]
set mask [lindex $bind 2]
set proc [lindex $bind 4]
regsub -- $nick $mask $newnick newmask
unbind $type $flag $mask $proc
bind $type $flag $newmask $proc
}
}
}
bind evnt - init-server connect:irc
proc connect:irc {type} {
global botnick settings
set cmdpfix [lindex [split $settings(binds)] 0]
foreach bind [binds ${cmdpfix}*] {
set cmd [string trimleft [lindex $bind 2] $cmdpfix]
bind pubm [lindex $bind 1] "% $botnick~${cmd}*" [lindex $bind 4]
}
}
That script works afther restart but if the botnick changed i need a new restart for working with the new nick.So maybe sombody got a ideea to modify the script or got a bether script i am realy interesed. thanks
Check this thread to see how to bind for botnick change outside a channel, because when you connect on init-server the bot is on no channel at that moment, it eventually takes time to join all the channels added in its .chan file.
# botnick.tcl v1.0 (21 November 1999)
# copyright 1999 by slennox <slennox@egghelp.org>
# slennox's eggdrop page - http://www.egghelp.org/
#
# This script adds a little feature that lots of people ask for - a DCC
# command (for global +n users) that changes the bot's nickname.
#
# Usage: botnick <newnick>
#
# Additional Features
# * You can use question marks in the newnick and the bot will substitute
# random numbers, e.g. '.botnick harry??' would create a nick like
# 'harry53'.
# * You can use '.botnick -altnick' to make the bot switch to its alternate
# nickname.
# Don't edit below unless you know what you're doing.
proc bn_dccbotnick {hand idx arg} {
global altnick nick
putcmdlog "#$hand# botnick $arg"
set newnick [lindex [split $arg] 0]
if {$newnick == ""} {
putidx $idx "Usage: botnick <newnick>"
return 0
}
if {$newnick == "-altnick"} {
set newnick $altnick
}
while {[regsub -- \\? $newnick [rand 10] newnick]} {continue}
putidx $idx "Changing nick to '$newnick'..."
set nick $newnick
return 0
}
bind dcc n botnick bn_dccbotnick
putlog "Loaded botnick.tcl v1.0 by slennox"
return
It works perfectly, although the version I have is altered slightly, so there is a switch to return to original nick (.botnick -true), and to do so after a certain period of time if not returned. Hope this helps
This is for changing the bots nick in dcc (partyline). The script which I recommended detects if the bot changes its nick, then does what ever you want it to do.
·awyeah·
==================================
Facebook: jawad@idsia.ch (Jay Dee) PS: Guys, I don't accept script helps or requests personally anymore.
==================================