| View previous topic :: View next topic |
| Author |
Message |
heartbroken Op

Joined: 23 Jun 2011 Posts: 106 Location: somewhere out there
|
Posted: Tue Aug 30, 2011 5:38 pm Post subject: |
|
|
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... | Code: | [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) |
_________________ Life iS Just a dReaM oN tHE wAy to DeaTh |
|
| Back to top |
|
 |
nml375 Revered One
Joined: 04 Aug 2006 Posts: 2857
|
Posted: Tue Aug 30, 2011 5:58 pm Post subject: |
|
|
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. _________________ NML_375, idling at #eggdrop@IrcNET |
|
| Back to top |
|
 |
heartbroken Op

Joined: 23 Jun 2011 Posts: 106 Location: somewhere out there
|
Posted: Wed Aug 31, 2011 1:33 am Post subject: |
|
|
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  _________________ Life iS Just a dReaM oN tHE wAy to DeaTh |
|
| Back to top |
|
 |
Anahel Halfop

Joined: 03 Jul 2009 Posts: 48 Location: Dom!
|
Posted: Wed Sep 21, 2011 10:00 am Post subject: |
|
|
i'm using znuff's imdb script and i noticed that sometimes i'm getting this error:
| Code: |
15:55:34 <nekomimi> [15:55:34] Tcl error [imdb_proc]: missing operand at _@_
15:55:34 <nekomimi> in expression "round(-_@_)" |
while using !imdb Apollo 18
here's whole debug from imdb http://pastebin.com/R091n95m
could anyone help me? |
|
| Back to top |
|
 |
speechles Revered One

Joined: 26 Aug 2006 Posts: 1398 Location: emerald triangle, california (coastal redwoods)
|
Posted: Thu Sep 22, 2011 3:53 am Post subject: |
|
|
| Anahel wrote: | i'm using znuff's imdb script and i noticed that sometimes i'm getting this error:
| Code: |
15:55:34 <nekomimi> [15:55:34] Tcl error [imdb_proc]: missing operand at _@_
15:55:34 <nekomimi> in expression "round(-_@_)" |
while using !imdb Apollo 18
here's whole debug from imdb http://pastebin.com/R091n95m
could anyone help me? |
| Code: | 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:
| Code: | # 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 } |
Have a fun  _________________ speechles' eggdrop tcl archive |
|
| Back to top |
|
 |
Anahel Halfop

Joined: 03 Jul 2009 Posts: 48 Location: Dom!
|
Posted: Thu Sep 22, 2011 8:42 am Post subject: |
|
|
thanks speechles, now imdb is working tho there is no rating
| Code: | | &Nekomimi> Ocena: - (375,523 glosow) [] |
(ocena means rating, and glosow = votes)
debug:
| Code: | | <nekomimi> [14:38:39] IMDB_DEBUG rating == - | votes == 375,523 | rating bar == %color14[%color7%color7%color14]%color |
|
|
| Back to top |
|
 |
deathtoll Voice
Joined: 23 Sep 2011 Posts: 2
|
Posted: Fri Sep 23, 2011 9:53 pm Post subject: |
|
|
| 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! |
|
| Back to top |
|
 |
goalie204 Halfop
Joined: 28 Apr 2011 Posts: 44
|
Posted: Sat Sep 24, 2011 12:47 am Post subject: |
|
|
| ditto, rating not showing anymore |
|
| Back to top |
|
 |
l1ve Voice
Joined: 30 Oct 2007 Posts: 7
|
Posted: Wed Sep 28, 2011 6:50 pm Post subject: |
|
|
| NEED Update pls |
|
| Back to top |
|
 |
spithash Master

Joined: 12 Jul 2007 Posts: 248 Location: Libera
|
Posted: Thu Sep 29, 2011 2:04 pm Post subject: |
|
|
Here's my working version with speechles's info/help added:
http://bsdunix.info/eggdrop/scripts/imdb.tcl
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:
find this:
| Code: | | if [regexp {<span class="rating-rating"><span class="value">(.*?)</span>} $html rating] { |
and replace it with this:
| Code: | | if [regexp {<strong><span itemprop="ratingValue">(.*?)</span></strong>} $html rating] { |
and you should be done.
The link above is updated too. Enjoy  _________________ Libera ##rtlsdr & ##re - Nick: spithash
Click here for troll.tcl |
|
| Back to top |
|
 |
deathtoll Voice
Joined: 23 Sep 2011 Posts: 2
|
Posted: Thu Sep 29, 2011 11:01 pm Post subject: |
|
|
yay, its fetching the ratings correctly now, but the rating bar is broke debug info is below | Code: | | rating bar == %color14[%color7%color7%color14]%color |
UPDATE: i commented out the new code for generating the rating bar that speechles had contributed | Code: | # 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 }
|
and uncommented the code below
| Code: | 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. |
|
| Back to top |
|
 |
spithash Master

Joined: 12 Jul 2007 Posts: 248 Location: Libera
|
Posted: Fri Sep 30, 2011 2:45 am Post subject: |
|
|
| 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.
http://bsdunix.info/eggdrop/scripts/imdb.tcl
EDIT: Added some colors to the rating. _________________ Libera ##rtlsdr & ##re - Nick: spithash
Click here for troll.tcl |
|
| Back to top |
|
 |
spithash Master

Joined: 12 Jul 2007 Posts: 248 Location: Libera
|
Posted: Wed Mar 14, 2012 9:13 pm Post subject: |
|
|
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 |
|
| Back to top |
|
 |
username Op

Joined: 06 Oct 2005 Posts: 196 Location: Russian Federation, Podolsk
|
Posted: Thu Mar 15, 2012 2:50 am Post subject: |
|
|
Try this:
Changing the settings part.
Find
| Code: | #flood-control
set queue_enabled 1
#max requests
set queue_size 6
#per ? seconds
set queue_time 120
|
Replace with
| Code: | # Delay between command for each channel.
set delay 10 |
In imdb_proc proc replace global variables for old antiflood with new one.
Find
| Code: | | queue_size queue_time queue_enabled |
Replace with
After that we delete old antiflood code and add new code. You can modify text in notices for your own.
Find
| Code: | 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" }
} |
Replace with
| Code: | if {[info exists imdb(lasttime,$chan)] && [expr $imdb(lasttime,$chan) + $delay] > [clock seconds]} {
putserv "NOTICE $nick :You can use only 1 command in $delay seconds."
putserv "NOTICE $nick :Wait [expr $delay - [expr [clock seconds] - $imdb(lasttime,$chan)]] seconds and try again."
return 0
} |
And now we need to save time when command was used last time.
Find
| Code: | foreach line [split [imdb_decode $output] "\n"] {
while {$line != ""} {
puthelp "$toput :[string range $line 0 399]"
set line [string range $line 400 end]
}
}
|
Add after
| Code: | | set imdb(lasttime,$chan) [clock seconds] |
_________________ Архив TCL скриптов для ботов Eggdrop/Windrop:
http://egghelp.ru/ |
|
| Back to top |
|
 |
spithash Master

Joined: 12 Jul 2007 Posts: 248 Location: Libera
|
Posted: Thu Mar 15, 2012 4:28 am Post subject: |
|
|
Thanks man for the help, I don't think it's working though  _________________ Libera ##rtlsdr & ##re - Nick: spithash
Click here for troll.tcl |
|
| Back to top |
|
 |
|