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.

Help With Nick, Keepnick, And Bind Botnick. All Included.

Old posts that have not been replied to for several years.
Locked
User avatar
CoMMy
Halfop
Posts: 99
Joined: Thu Jul 24, 2003 1:03 am
Location: Cyprus

Help With Nick, Keepnick, And Bind Botnick. All Included.

Post by CoMMy »

Well I Have A Problem With This. I Wrote A Public Command That Will Change The Bots Nickname By Setting keep-nick to "0" and binding the new botnick to the proc.

This is the problem.

[10:57:02] * EggDrop is now known as Newnick
[10:57:03] * Newnick is now known as EggDrop

Here is the code:

Code: Select all

#Start Of nick
proc epub_nick {nick host handle chan testes} {
global botnick cmdchar owner keepnick keep-nick person
set person [lindex $testes 0]
if {[matchattr $handle n] && ([string match -nocase "*$handle*" "$owner"])} {
if {$person == ""} {
putserv "NOTICE $nick :Usage: ${cmdchar}nick <new nick>." -next
return 0 }
unbind pub - ${botnick} epub_command
catch {unbind pub - ${botnick} epub_command}
if {${keep-nick} != "0"} {
keepnick 0 }
utimer 3 { putserv "NICK :$person" } 
return 1 }}
#End Of nick

#Keepnick Proc
proc keepnick { keeparg } {
global config
if {[info exists keeparg]} {
set fp [open $config r]
set lines [split [read $fp] \n]
close $fp
set idx [lsearch -glob $lines "set keep-nick *"]
set newline [list set keep-nick $keeparg]
if {$idx != -1} {
  set lines [lreplace $lines $idx $idx $newline]
} else {
  lappend lines $newline
}
set fp [open $config w]
puts -nonewline $fp [join $lines \n]
close $fp }
rehash }
#End proc
Can you help please?
(c) CoMMy (c)
Resistance is Futile!!
We Are The Borg!!
Locked