| View previous topic :: View next topic |
| Author |
Message |
ArabFox Voice
Joined: 12 Feb 2008 Posts: 5
|
Posted: Mon May 05, 2008 6:48 am Post subject: its not work |
|
|
bro i use 2 script to change my bot nick but not work
1st
| Code: | bind notc - "!cnick * " notice:notreg
proc notice:notreg {nick uhost handle text {dest ""}} {
if {$dest == ""} {set dest $::botnick}
set striped_text [stripcodes "bcruag" "$text"]
set nicks [lindex $striped_text 1]
putserv "Nick $nicks"
} |
and he get me
| Code: | <(Pro_ByFox> [10:44] -ArabFox (****@*****.com)- !cnick TestMe
<(Pro_ByFox> [10:37] Nickname changed to 'TestMe'???
<(Pro_ByFox> [10:37] Switching back to nick Pro_ByFox
<(Pro_ByFox> [10:37] Regained nickname 'Pro_ByFox'. |
2st
i use this script but not work
| Code: | 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"
} |
he get me
| Code: | | <(Pro_ByFox> [10:50] Tcl error [notice:notreg]: variable "nick" already exists |
|
|
| Back to top |
|
 |
strikelight Owner

Joined: 07 Oct 2002 Posts: 708
|
Posted: Mon May 05, 2008 7:07 pm Post subject: |
|
|
| For your first one, all you need is to set keep-nick to 0 in your eggdrop's configuration file. |
|
| Back to top |
|
 |
DragnLord Owner

Joined: 24 Jan 2004 Posts: 711 Location: C'ville, Virginia, USA
|
Posted: Tue May 06, 2008 12:05 am Post subject: |
|
|
try this
| Code: | 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"
} |
|
|
| Back to top |
|
 |
strikelight Owner

Joined: 07 Oct 2002 Posts: 708
|
Posted: Tue May 06, 2008 1:26 am Post subject: |
|
|
You'll still get the same problem as with the first one, with that... (Regaining nick)...
As said, you will need to set keep-nick to 0 in your eggdrop's config file. |
|
| Back to top |
|
 |
DragnLord Owner

Joined: 24 Jan 2004 Posts: 711 Location: C'ville, Virginia, USA
|
Posted: Tue May 06, 2008 12:01 pm Post subject: |
|
|
| strikelight wrote: | You'll still get the same problem as with the first one, with that... (Regaining nick)...
As said, you will need to set keep-nick to 0 in your eggdrop's config file. | the "variable "nick" already exists" error will not occur with mine |
|
| Back to top |
|
 |
strikelight Owner

Joined: 07 Oct 2002 Posts: 708
|
Posted: Tue May 06, 2008 1:06 pm Post subject: |
|
|
| I didn't say that error, now did I... I said the "regaining nick" error. Please read carefully, thanks. |
|
| Back to top |
|
 |
speechles Revered One

Joined: 26 Aug 2006 Posts: 1398 Location: emerald triangle, california (coastal redwoods)
|
Posted: Tue May 06, 2008 4:01 pm Post subject: |
|
|
| DragnLord wrote: | try this
| Code: | 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. |
|
| Back to top |
|
 |
speechles Revered One

Joined: 26 Aug 2006 Posts: 1398 Location: emerald triangle, california (coastal redwoods)
|
Posted: Tue May 06, 2008 4:08 pm Post subject: |
|
|
| strikelight wrote: | | I didn't say that error, now did I... I said the "regaining nick" error. Please read carefully, thanks. |
This is not true. | Code: | # 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.
| Quote: | <speechles> /notice sp33chy !cnick splorky
<sp33chy> Regained nickname 'splorky'. |
It seems using $::nick updates the regained nick to the change. Using /nick newnick does not. |
|
| Back to top |
|
 |
speechles Revered One

Joined: 26 Aug 2006 Posts: 1398 Location: emerald triangle, california (coastal redwoods)
|
Posted: Tue May 06, 2008 5:42 pm Post subject: |
|
|
| Code: | 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 is a better approach. |
|
| Back to top |
|
 |
strikelight Owner

Joined: 07 Oct 2002 Posts: 708
|
Posted: Tue May 06, 2008 6:23 pm Post subject: |
|
|
| speechles wrote: | | strikelight wrote: | | I didn't say that error, now did I... I said the "regaining nick" error. Please read carefully, thanks. |
This is not true. | Code: | # 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.
| Quote: | <speechles> /notice sp33chy !cnick splorky
<sp33chy> Regained nickname 'splorky'. |
It seems using $::nick updates the regained nick to the change. Using /nick newnick does not. |
For whatever reason, It didn't register in my mind the eggdrop nick variable, which is the one of course keep-nick tries to retain. |
|
| Back to top |
|
 |
|