| View previous topic :: View next topic |
| Author |
Message |
CoMMy Halfop

Joined: 24 Jul 2003 Posts: 99 Location: Cyprus
|
Posted: Tue May 18, 2004 4:05 am Post subject: Help With Nick, Keepnick, And Bind Botnick. All Included. |
|
|
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: | #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!! |
|
| Back to top |
|
 |
|
|
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
|
|