bind notc - "!cnick * " notice:notreg
proc notice:notreg {nick uhost handle text {dest ""}} {
global nick
if {$dest == ""} {set dest $::botnick}
set striped_text [stripcodes "bcruag" "$text"]
set nicks [lindex $striped_text 1]
set nick "$nicks"
}
bind notc - "!cnick * " notice:notreg
proc notice:notreg {n u h text {dest ""}} {
global nick
if {$dest == ""} {set dest $::botnick}
set striped_text [stripcodes "bcruag" "$text"]
set nicks [lindex $striped_text 1]
set nick "$nicks"
}
bind notc - "!cnick * " notice:notreg
proc notice:notreg {n u h text {dest ""}} {
global nick
if {$dest == ""} {set dest $::botnick}
set striped_text [stripcodes "bcruag" "$text"]
set nicks [lindex $striped_text 1]
set nick "$nicks"
}
pretty sure, since your not splitting $text during stripping it or afterwards that your lindex (aka the entire script) will fail when nicknames contain curly braces.
# This setting makes the bot try to get his original nickname back if its
# primary nickname is already in use.
set keep-nick 1
This is my eggdrop.conf setting. Now what will happen if you have keep-nick set to 1 and use that script (albeit properly with split) it will allow you to use any nickname and change the regained nick to that nick as evidenced below.
bind notc - "!cnick * " notice:notreg
proc notice:notreg {n u h text {dest ""}} {
global nick
if {$dest == "" || [isbotnick $dest]} {
set nick "[lindex [split [stripcodes bcruag $text]] 1]"
}
}
# This setting makes the bot try to get his original nickname back if its
# primary nickname is already in use.
set keep-nick 1
This is my eggdrop.conf setting. Now what will happen if you have keep-nick set to 1 and use that script (albeit properly with split) it will allow you to use any nickname and change the regained nick to that nick as evidenced below.