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.
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 ..
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
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...
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