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.

can't read "ban": no such variable

Old posts that have not been replied to for several years.
Locked
w
wishbringer

can't read "ban": no such variable

Post by wishbringer »

Hi All,

I was wondering if you guys could assist me, I am running eggdrop 1.6.15 and I have added the scripts facelift V3.6.1.

I recently removed all greet functionality from the script by commenting out lines containing the word greet. Now when I was attempting to use _any_ ban functionality I get the following error...

Tcl error [pub_+ban]: can't read "ban": no such variable

I can't see how any of the lines I have commented out could affect my ban operation, but perhaps I'm wrong. If you guys/gals could give me any pointers, I'd appreciate it.

Thanks!
User avatar
Sir_Fz
Revered One
Posts: 3794
Joined: Sun Apr 27, 2003 3:10 pm
Location: Lebanon
Contact:

Post by Sir_Fz »

show us the pub_+ban proc
O
Ofloo
Owner
Posts: 953
Joined: Tue May 13, 2003 1:37 am
Location: Belguim
Contact:

Post by Ofloo »

Code: Select all

set ban ..... 
this means there is no ban set so the variable isn't set if the ban is set out side the proc global it first or use $::ban same as global.. but only works for 1.6.x bots ..
XplaiN but think of me as stupid
w
wishbringer

Post by wishbringer »

I have pasted the proc you requested below, there are other procs that
use the ban functionality and those also return the same error, that
ban variable seems to be globally broken!

I hope this helps...

Thanks guys


## public cmd +ban -- start
proc pub_+ban {nick uhost hand channel rest} {
global botnick CC ban-time
if {[matchattr $hand Q] == 0} {
puthelp "NOTICE $nick :\002\[FL\]\002 This command requires you to authenticate yourself. Please /msg $botnick auth <password>"
return 0
}
if {[botisop $channel]==1} {
if {$rest == ""} {
puthelp "NOTICE $nick :\002\[FL\]\002 Usage: ${CC}+ban <hostmask> \[reason\]"
return 0
}
if {$rest!=""} {
set host [lindex $rest 0]
set reason [lrange $rest 1 end]
if {[string tolower $host] == [string tolower $botnick]} {
putserv "KICK $channel $nick :\002\[FL\]\002 You really shouldn't try that..."
return 0
}
if {$reason == ""} {
set reason "\002requested\002"
}
set options [lindex $reason 0]
if {[string index $options 0] == "-"} {
set options [string range $options 1 end]
}
switch -exact $options {
perm {
set reason [lrange $reason 1 end]
newban $host $nick "$reason" 0
if {$reason == ""} {set reason "No reason given"}
putlog "\002\[FL\]\002 <<$nick>> !$hand! +ban $reason"
return 0
}
min {
if {[val [lindex $reason 1]] == ""} {
puthelp "NOTICE $nick :\002\[FL\]\002 Error, invalid time period"
return 0
}
set time [lindex $reason 1]
set reason [lrange $reason 2 end]
newban $host $nick "$reason" $time
if {$reason == ""} {set reason "No reason given"}
putlog "\002\[FL\]\002 <<$nick>> !$hand! +ban $reason"
return 0
}
hours {
if {[val [lindex $reason 1]] == ""} {
puthelp "NOTICE $nick :\002\[FL\]\002 Error, invalid time period"
return 0
}
set time [expr [lindex $reason 1]*60]
set reason [lrange $reason 2 end]
newban $host $nick "$reason" $time
if {$reason == ""} {set reason "No reason given"}
putlog "\002\[FL\]\002 <<$nick>> !$hand! +ban $reason"
return 0
}
days {
if {[val [lindex $reason 1]] == ""} {
puthelp "NOTICE $nick :\002\[FL\]\002 Error, invalid time period"
return 0
}
set time [expr [expr [lindex $reason 1]*60]*24]
set reason [lrange $reason 2 end]
newban $host $nick "$reason" $time
if {$reason == ""} {set reason "No reason given"}
putlog "\002\[FL\]\002 <<$nick>> !$hand! +ban $reason"
return 0
}
weeks {
if {[val [lindex $reason 1]] == ""} {
puthelp "NOTICE $nick :\002\[FL\]\002 Error, invalid time period"
return 0
}
set time [expr [expr [expr [lindex $reason 1]*60]*24]*7]
set reason [lrange $reason 2 end]
newban $host $nick "$reason" $time
if {$reason == ""} {set reason "No reason given"}
putlog "\002\[FL\]\002 <<$nick>> !$hand! +ban $reason"
return 0
}
}
set reason [lrange $reason 1 end]
newban $host $nick "$reason" $ban-time
if {$reason == ""} {set reason "No reason given"}
putlog "\002\[FL\]\002 <<$nick>> !$hand! +ban $reason"
return 0
}
}
if {[botisop $channel]!=1} {
puthelp "NOTICE $nick :\002\[FL\]\002 I am not oped"
}
}
## public cmd +ban -- stop
w
wishbringer

Post by wishbringer »

Ofloo wrote:

Code: Select all

set ban ..... 
this means there is no ban set so the variable isn't set if the ban is set out side the proc global it first or use $::ban same as global.. but only works for 1.6.x bots ..
what and where do I set this variable and set to what?
I'm sorry, but I have tried as best I could and getting no where...

Regards.
:-?
User avatar
GodOfSuicide
Master
Posts: 463
Joined: Mon Jun 17, 2002 8:00 pm
Location: Austria

Post by GodOfSuicide »

change the "newban $host $nick "$reason" $ban-time" to

Code: Select all

newban $host $nick "$reason" ${ban-time}
this should do the trick
User avatar
Sir_Fz
Revered One
Posts: 3794
Joined: Sun Apr 27, 2003 3:10 pm
Location: Lebanon
Contact:

Post by Sir_Fz »

don't use "-" in your vars. So next time instead of ban-time use ban_time.
User avatar
GodOfSuicide
Master
Posts: 463
Joined: Mon Jun 17, 2002 8:00 pm
Location: Austria

Post by GodOfSuicide »

Sir_Fz wrote:don't use "-" in your vars. So next time instead of ban-time use ban_time.
or, as quoted, use {va-riable} to read it.
btw, the best (at least i think so) is an array for everything, like mybanscript(time) mybanscript(reason) etc...makes it easier to debug / edit and you dont have so many little vars flying round
User avatar
Sir_Fz
Revered One
Posts: 3794
Joined: Sun Apr 27, 2003 3:10 pm
Location: Lebanon
Contact:

Post by Sir_Fz »

I agree with you on that. If a scripts has lots of settings, I prefer using arrays in it.
User avatar
TALES
Halfop
Posts: 59
Joined: Sun Nov 09, 2003 8:45 am
Location: Netherlands
Contact:

Post by TALES »

when its a channel ban with numbers like example 255.255.255.255!*@* then eggdrop can't yet remove the ban.


look @ url from bug report
http://eggheads.org/pipermail/bugs/2003 ... 00601.html
User avatar
GodOfSuicide
Master
Posts: 463
Joined: Mon Jun 17, 2002 8:00 pm
Location: Austria

Post by GodOfSuicide »

yeah, but this host isnt valid anyway, no network will allow such nicks
User avatar
Sir_Fz
Revered One
Posts: 3794
Joined: Sun Apr 27, 2003 3:10 pm
Location: Lebanon
Contact:

Post by Sir_Fz »

on DALnet you can't start a nick with a number and for sure you cant use .'s in it.
Locked