egghelp.org community Forum Index
[ egghelp.org home | forum home ]
egghelp.org community
Discussion of eggdrop bots, shell accounts and tcl scripts.
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

TVRage.com Schedule Script (Latest: 2.0)
Goto page Previous  1, 2, 3 ... 31, 32, 33, 34  Next
 
Post new topic   Reply to topic    egghelp.org community Forum Index -> Script Support & Releases
View previous topic :: View next topic  
Author Message
dmssf
Voice


Joined: 13 Aug 2006
Posts: 5

PostPosted: Mon Sep 05, 2011 9:04 pm    Post subject: anyone got a complete copy of this script thats working? Reply with quote

anyone got a complete copy of this script thats working?
Back to top
View user's profile Send private message
GaveUp
Op


Joined: 19 Jan 2006
Posts: 139

PostPosted: Tue Sep 06, 2011 12:03 pm    Post subject: Re: anyone got a complete copy of this script thats working? Reply with quote

dmssf wrote:
anyone got a complete copy of this script thats working?


Perhaps you should try reading the FIRST sentence of the FIRST post in this thread?
Back to top
View user's profile Send private message
McGuyver
Voice


Joined: 31 Aug 2011
Posts: 14

PostPosted: Thu Sep 08, 2011 1:46 am    Post subject: Reply with quote

Is there anyway to filter by showname instead of network?
Back to top
View user's profile Send private message
GaveUp
Op


Joined: 19 Jan 2006
Posts: 139

PostPosted: Thu Sep 08, 2011 8:09 am    Post subject: Reply with quote

McGuyver wrote:
Is there anyway to filter by showname instead of network?


No there isn't right now.
Back to top
View user's profile Send private message
dmssf
Voice


Joined: 13 Aug 2006
Posts: 5

PostPosted: Fri Sep 30, 2011 7:22 pm    Post subject: getting partyline error Reply with quote

<@user> !showinfo Majors & Minors
<@eggdrop> Title :: Majors & Minors <> URL :: http://www.tvrage.com/shows/id-29411 <> Premiered :: 2011 <> Latest Episode :: 01x01 - One World - Part 1 (Sep/23/2011) <> Next Episode :: 01x02 - One World - Part 2 (Sep/30/2011) <> Country :: USA <> Status :: New Series <> Airtime :: Friday at 08:00 pm

but everytime i do showinfo in channel on the partyline i get
{e%airtime: 08<>15 03Airtime ::15 04{%%airtime%%}15%e} :::: airtime :::: :::: :::: 08<>15 03Airtime ::15 04{%%airtime%%}

anyone else getting this or know how to fix?
Back to top
View user's profile Send private message
GaveUp
Op


Joined: 19 Jan 2006
Posts: 139

PostPosted: Fri Sep 30, 2011 8:18 pm    Post subject: Reply with quote

The party line spam was due to debug code that I forgot to remove. It has been removed from the latest version.
Back to top
View user's profile Send private message
Rizli
Voice


Joined: 10 Oct 2011
Posts: 5

PostPosted: Mon Oct 10, 2011 7:46 am    Post subject: Reply with quote

Hello,

so I am trying to run your script on a machine that is in the CET timezone..

Can someone please explain me how to configure your script properly to announce US tv shows on time?

The offset and fudgeMinutes settings get me somehow confused!!

Airtime 08:00 pm = 02:00 am at my place, so that'd be +7 hours


ps. it would be nice if the script could handle all the timezone stuff better, like !today and show the times in original and user timezone

08:00 pm (02:00 am CET) - CBS - How I Met Your Mother 07x05 <> The CW - Gossip Girl 05x03 <> FOX - Terra Nova 01x04 <> ABC Family - The Lying Game 01x09

Also because here it's already next day, when someone triggers !today at 2 am (which equals to 08:00 pm) it shows the next days shows and not the shows that will actually air duo to the timezone issues...
Back to top
View user's profile Send private message
Rizli
Voice


Joined: 10 Oct 2011
Posts: 5

PostPosted: Mon Oct 10, 2011 3:12 pm    Post subject: Reply with quote

Also sometime !showinfo doesn't work, here some debug:

Code:

[21:10] TVRage(DEBUG): Getting http://services.tvrage.com/tools/quickinfo.php?show=House
[21:10] TVRage(DEBUG): Entering show info handler.
can't read "request(::http::10,chan)": no such element in array
    while executing
"set show(chan) $request($token,chan)"
    (procedure "::tvrage::getShowInfoHandler" line 7)
    invoked from within
"::tvrage::getShowInfoHandler $token"
    ("eval" body line 1)
    invoked from within
"eval $state(-command) {$token}"
    ("eval" body line 19)
    invoked from within
"eval ::error $errorlist"
    (procedure "http::reset" line 11)
    invoked from within
"http::reset ::http::10 timeout"
    ("after" script)
Back to top
View user's profile Send private message
speechles
Revered One


Joined: 26 Aug 2006
Posts: 1398
Location: emerald triangle, california (coastal redwoods)

PostPosted: Mon Oct 10, 2011 4:11 pm    Post subject: Reply with quote

Rizli wrote:
Also sometime !showinfo doesn't work, here some debug:

Code:

[21:10] TVRage(DEBUG): Getting http://services.tvrage.com/tools/quickinfo.php?show=House
[21:10] TVRage(DEBUG): Entering show info handler.
can't read "request(::http::10,chan)": no such element in array
    while executing
"set show(chan) $request($token,chan)"
    (procedure "::tvrage::getShowInfoHandler" line 7)
    invoked from within
"::tvrage::getShowInfoHandler $token"
    ("eval" body line 1)
    invoked from within
"eval $state(-command) {$token}"
    ("eval" body line 19)
    invoked from within
"eval ::error $errorlist"
    (procedure "http::reset" line 11)
    invoked from within
"http::reset ::http::10 timeout"
    ("after" script)


It's a logic flaw. A slight bug in how it anticipates errors. To correct this is simple.

Code:
   debug DEBUG "Entering show info handler."

   set show(chan) $request($token,chan)
   set show(nick) $request($token,nick)
   set displayLine $request($token,displayLine)

   debug DEBUG "Checking for http errors."

   if { [http::status $token] == "timeout" } {
      set problem "Timeout retrieving show info."
      debug ERROR "$problem"
      set show(problem) $problem
      displayInfo [templateParser $tvrage(problemMessage) [array get show]]
      cleanupRequest $token
      [http::cleanup $token]
      return
   } elseif { [http::status $token] != "ok" } {
      set problem [http::error $token]
      [http::cleanup $token]
      debug ERROR "$problem"
      set show(problem) $problem
      displayInfo [templateParser $tvrage(problemMessage) [array get show]]
      cleanupRequest $token
      return
   }

   set data [http::data $token]
   http::cleanup $token


Change that code block above, to look like it does below...

Code:
   debug DEBUG "Entering show info handler."
   debug DEBUG "Checking for http errors."

   if {![string equal -nocase [::http::status $http] "ok"]} {
      set problem [::http::error $token]
      ::http::cleanup $token
      debug ERROR "$problem"
      set show(problem) $problem
      displayInfo [templateParser $tvrage(problemMessage) [array get show]]
      cleanupRequest $token
      return
   }
   set show(chan) $request($token,chan)
   set show(nick) $request($token,nick)
   set displayLine $request($token,displayLine)
   set data [::http::data $token]
   ::http::cleanup $token


This should solve your problem, and correctly report "timeout" when it's a timeout instead of generating tcl errors. How do I know it's a timeout that is causing the issue...
It's right there at the end of your errorInfo reponse: "http::reset ::http::10 timeout"
But.. its caught... and the script attempts to attain variables first, instead of checking for http errors. This was the problem, I've corrected that problem.

Code:
proc getShowInfo {displayLine nick chan text} {
   variable tvrage
   variable request
   upvar show show
   set url $tvrage(showinfourl)[http::formatQuery {show} [string trimleft $text]]
   debug DEBUG "Getting $url"
   if {[catch {set token [http::geturl $url -command [namespace current]::getShowInfoHandler -timeout [expr $tvrage(httpTimeout) * 1000]]} error]} {
      error $error
   } {
      set request($token,nick) $nick
      set request($token,chan) $chan
      set request($token,displayLine) $displayLine
   }
}


I would also change the procedure above, to more accurately handle these types of exceptions. I would make it exactly as you see it below...

Code:
proc getShowInfo {displayLine nick chan text} {
   variable tvrage
   variable request
   upvar show show
   set url $tvrage(showinfourl)[http::formatQuery {show} [string trimleft $text]]
   debug DEBUG "Getting $url"
   catch { http::geturl $url -command [namespace current]::getShowInfoHandler -timeout [expr $tvrage(httpTimeout) * 1000] } error
   if {[string match -nocase "::http::*" $error]} {
      set request($error,nick) $nick
      set request($error,chan) $chan
      set request($error,displayLine) $displayLine
   } { error $error }
}


This adds a pretty clear check that the variable has a proper http token before it sets its variables.
_________________
speechles' eggdrop tcl archive
Back to top
View user's profile Send private message
GaveUp
Op


Joined: 19 Jan 2006
Posts: 139

PostPosted: Mon Oct 10, 2011 4:45 pm    Post subject: Reply with quote

A couple of issues with it, though. One is, I assume, $http should be $token on the if. The other is that the displayInfo line will always fail in this scenario since show(chan) and show(nick) are set afterwards.

That was/is one of the problems I'm trying to find a proper solution for. Occasionally the handler is called before the request variables are set which causes the the error, but if I don't have those two variables (or one depending on the specific theme) I can't display to the user that there was a problem.

If you've got a solution I'm open to it. The way the code is now is based on another post on the forum (maybe by you?) that handled passing variables to the handler the same way, but there was no mention of this particular scenario or how to handler it and as I said before I haven't come up with one.
Back to top
View user's profile Send private message
Rizli
Voice


Joined: 10 Oct 2011
Posts: 5

PostPosted: Mon Oct 10, 2011 8:30 pm    Post subject: Reply with quote

Rizli wrote:
Hello,

so I am trying to run your script on a machine that is in the CET timezone..

Can someone please explain me how to configure your script properly to announce US tv shows on time?

The offset and fudgeMinutes settings get me somehow confused!!

Airtime 08:00 pm = 02:00 am at my place, so that'd be +7 hours


ps. it would be nice if the script could handle all the timezone stuff better, like !today and show the times in original and user timezone

08:00 pm (02:00 am CET) - CBS - How I Met Your Mother 07x05 <> The CW - Gossip Girl 05x03 <> FOX - Terra Nova 01x04 <> ABC Family - The Lying Game 01x09

Also because here it's already next day, when someone triggers !today at 2 am (which equals to 08:00 pm) it shows the next days shows and not the shows that will actually air duo to the timezone issues...


Okay and what about all the other questions/suggestions I've had? (quoted it)

I still can't figure out how to configure it to work properly with my timezone (CET). No matter what I set it just doesn't announce on time...
Back to top
View user's profile Send private message
GaveUp
Op


Joined: 19 Jan 2006
Posts: 139

PostPosted: Mon Oct 10, 2011 9:02 pm    Post subject: Reply with quote

Play with the offsetHours and fudgeMinutes settings. Using those it will announce correctly. You are capable of displaying the announcement how you described by adding a bit of tcl to the theme setting to get the current date offset by the minutesBefore setting.
Back to top
View user's profile Send private message
Rizli
Voice


Joined: 10 Oct 2011
Posts: 5

PostPosted: Wed Oct 12, 2011 9:14 pm    Post subject: Reply with quote

GaveUp wrote:
Play with the offsetHours and fudgeMinutes settings. Using those it will announce correctly. You are capable of displaying the announcement how you described by adding a bit of tcl to the theme setting to get the current date offset by the minutesBefore setting.


I had to edit the code, as offsetHours was only moving the announce to a earlier time (minus) while I needed it the other way around..
Back to top
View user's profile Send private message
GaveUp
Op


Joined: 19 Jan 2006
Posts: 139

PostPosted: Wed Oct 12, 2011 9:17 pm    Post subject: Reply with quote

Never heard of a negative number, huh?
Back to top
View user's profile Send private message
Rizli
Voice


Joined: 10 Oct 2011
Posts: 5

PostPosted: Thu Oct 13, 2011 7:52 pm    Post subject: Reply with quote

GaveUp wrote:
Never heard of a negative number, huh?


Just assumed it wouldn't work, oh well whatever.
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    egghelp.org community Forum Index -> Script Support & Releases All times are GMT - 4 Hours
Goto page Previous  1, 2, 3 ... 31, 32, 33, 34  Next
Page 32 of 34

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Forum hosting provided by Reverse.net

Powered by phpBB © 2001, 2005 phpBB Group
subGreen style by ktauber