i cant solve this problem .. i get this error when i try to load that new' Znuff's version into my bot.it says invalid command i cant found whatha ... that cmd is...it wrotes on line 1.. but nuthins wrong on line 1..need help...
[21:35:11] Tcl error in file 'yum.conf':
[21:35:11] invalid command name ""
while executing
""
(file "scripts/imdb.tcl" line 1)
invoked from within
"source scripts/imdb.tcl"
(file "yum.conf" line 264)
[21:35:11] * CONFIG FILE NOT LOADED (NOT FOUND, OR ERROR)
That is most likely due to your editor adding the UTF-8 "Byte Order Mark" sequence at the beginning of the file. Use a different editor, or check if your current editor has an option to turn BOM off.
hi nml375
thank you very much for your reply and yep you're r8..my bad..i was edit it with windows notepad yesterday. this time i use notepad++ and i just load it with no problem.. thnx a lot
set goldstars [expr round($rating)]
set greystars [expr 10 - $goldstars]
Find that part, those 2 lines...
and change it to ... this ... these several lines below. Expr is supposed to be used as a last resort (like regexp/regsub), and in this case it's forgotten to use braces around it's equation which contains variable contents. This is a problem, because not only does this slow the whole thing down. It can be exploited because using no braces within an expr will cause double substitution. There are other ways to "round" without using expr. I'll give a simple example below so it's quite easy to understand how it is rounding. Try the code below:
# is there a rating?
if {[info exists $rating] && [string length $rating]} {
# attain gold stars as integer that starts rating.
set goldstars [lindex [split $rating "."] 0]
# if decimal remnant of rating is equal to or greater than 0.5 add 1 to goldstars
if {[join [lrange [split $rating "."] 1 end]] >= 0.5} { incr goldstars }
# grey stars is out of 10, so subtract gold stars to find amount of grey stars
# notice the expr below contains braces to make the expression "safe" and "faster"
set greystars [expr {10 - $goldstars}]
# if there is no rating, gold and grey stars are 0
} else { set goldstars 0 ; set greystars 0 }
I am also experiencing this same exact problem, the code snippet that was posted fixes the script but for some reason the script does not show the rating, and I think it may be a problem with the routine to actually fetch the rating from IMDB, as the rating code does display properly except it has nothing to parse to generate the rating bar is what I assume the problem is. Not meaning to bump this topic but I am surprised more people are not having this problem with the new version of the script. Thank you!
I kinda changed the basic/default "set announce" theme, so don't be surprised if it doesn't look like how you previously had it. Change it back if you don't like it.
EDIT:
The rating was really not working. I thought it was but it would only show the votes. so, they changed the website a little bit.. here's the fix:
# is there a rating?
if {[info exists $rating] && [string length $rating]} {
# attain gold stars as integer that starts rating.
set goldstars [lindex [split $rating "."] 0]
# if decimal remnant of rating is equal to or greater than 0.5 add 1 to goldstars
if {[join [lrange [split $rating "."] 1 end]] >= 0.5} { incr goldstars }
# grey stars is out of 10, so subtract gold stars to find amount of grey stars
# notice the expr below contains braces to make the expression "safe" and "faster"
set greystars [expr {10 - $goldstars}]
# if there is no rating, gold and grey stars are 0
} else { set goldstars 0 ; set greystars 0 }
set goldstars [expr round($rating)]
set greystars [expr 10 - $goldstars]
and the rating bar displays properly now.. but as you had said speechles, expr is to be used as a last resort.. dunno if you want to dive further into it but at least this fixes it momentarily.
deathtoll wrote:yay, its fetching the ratings correctly now, but the rating bar is broke
yeah, I wasn't using the rating bar personally, but since it breaks for you guys, I removed that entry from the script as well, the link is updated and still the same.
Hey anybody cares to fix the flood-control? It seems like it's malfunctioning...
For example if I set it to 2 requests every 30 seconds and flood it, the script stops working for everyone and just displays the channel message saying that it got flooded blah blah blah...
Libera ##rtlsdr & ##re - Nick: spithash
Click here for troll.tcl
if { $queue_enabled == 1 } {
#flooded?
if { $instance >= $queue_size } {
if {$IMDB_DEBUG == 1} { putlog "IMDB_DEBUG flood detected" }
if { $warn_msg == 0 } {
set warn_msg 1
putquick "$toput :Flood-Control: Request for \"$arg\" from user \"$nick\" will not be answered. Maximum of $queue_size requests every $queue_time seconds."
# putquick "$toput :Flood-Control: Maximum of $queue_size requests every $queue_time seconds."
utimer 120 wmsg
}
return
}
incr instance
if { $IMDB_DEBUG == 1 } { putlog "IMDB_DEBUG new instance == $instance" }
}
foreach line [split [imdb_decode $output] "\n"] {
while {$line != ""} {
puthelp "$toput :[string range $line 0 399]"
set line [string range $line 400 end]
}
}