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 

imdb-1.1.0.tcl help please
Goto page Previous  1, 2, 3, 4, 5 ... 19, 20, 21  Next
 
Post new topic   Reply to topic    egghelp.org community Forum Index -> Script Support & Releases
View previous topic :: View next topic  
Author Message
OV2
Voice


Joined: 21 Jan 2006
Posts: 35

PostPosted: Sat Jan 21, 2006 4:00 pm    Post subject: Reply with quote

anotheregglover wrote:

Can anyone suggest how to get the script to output a single line 'nothing found' type error rather than all the regular multiline info categories with N/A.
[snip]

Thanks.


That was a problem with imdb's search page, i fixed it today so simply redownload.

@Luniz2k1:
I don't see anything wrong in the debug you posted - is your help-queue working?


Last edited by OV2 on Sat Jan 21, 2006 6:37 pm; edited 1 time in total
Back to top
View user's profile Send private message Visit poster's website
Luniz2k1
Voice


Joined: 17 Sep 2003
Posts: 19

PostPosted: Sat Jan 21, 2006 4:58 pm    Post subject: Reply with quote

OV2 wrote:

@Luniz2k1:
I don't see anything wrong in the debug you posted - is your help-queue working?


It used to. If !imdb is done alone:

Code:
[15:55] IMDB_DEBUG permission_result == 1
[15:55] IMDB_DEBUG instance == 0
[15:55] IMDB_DEBUG toput_result == PRIVMSG #test
[15:55] IMDB_DEBUG no arg passed, show help


But nothing in the channel.

The bot is opped in the chan, so there is no reason it cant speak in it.

I have tv.com.tcl set up on this bot and it works just fine, no problems responding in the channel.
Back to top
View user's profile Send private message
Luniz2k1
Voice


Joined: 17 Sep 2003
Posts: 19

PostPosted: Sat Jan 21, 2006 5:31 pm    Post subject: Reply with quote

Well, finally got it working. There was 1 channel it was set to join, but did not have the password set to join the channel. It was in all of the other channels that it was set to join. But !imdb would not work until it was in all channels that it was set to join.
Back to top
View user's profile Send private message
OV2
Voice


Joined: 21 Jan 2006
Posts: 35

PostPosted: Sat Jan 21, 2006 6:36 pm    Post subject: Reply with quote

Nice to know - if I get bored I'll try to figure out why this happens Smile
Back to top
View user's profile Send private message Visit poster's website
rosc2112
Revered One


Joined: 19 Feb 2006
Posts: 1454
Location: Northeast Pennsylvania

PostPosted: Thu May 11, 2006 5:31 am    Post subject: Bugs and requests :) Reply with quote

Hi OV2

When you're bored, there's a peculiar bit of behavior when the script is used on multiple channels and set to show the output in channel, where it will spew up duplicate data out of order. For example, if I'm on #chan1, and do !imdb poltergeist, and then on #chan2, !imdb daria, it will say on #chan2, Language: english, and then start showing the data for Title: 'Daria' and such.

So, it does like:

#chan1:
<rosc> .imdb is it college yet
<mybot> Is It College Yet? (2002) (TV) - http://www.imdb.com/title/tt0285627/
<mybot> Genre : Animation / Comedy
<mybot> Director: Karen Disher
<mybot> Runtime : 90 mins.
<mybot> Country : USA / South Korea
<mybot> Language: English
<mybot> Plot : Daria, Jane, and the rest of the Lawndale High seniors face graduation and college in this series finale TV-movie from MTV's 'Daria.'


#chan2:
<rosc> .imdb daria
<mybot> Genre : Animation / Comedy
<mybot> Country : USA / South Korea
<mybot> Language: English
<mybot> 'Daria' (1997) - http://www.imdb.com/title/tt0118298/
<mybot> Tagline : Talks Slow, Thinks Fast
<mybot> Director: Ray Kosarin
<mybot> Runtime : 22 mins.
<mybot> Plot : A smart & cynical girl goes through teenage life as an proud outsider in a world of mainly idiotic teens and condescending adults.

That's the bug I've found.

And the requests:

Could you have the script parse for multiple directors? Sometimes there is more than one. I tried to emulate how the 'Genre' tags are grabbed but not having much luck at getting it working.

Also, would like to ask if you would implement a function to get the cast.
I know that the cast list can be pretty long, perhaps allow a user-specified number of matches returned?

And maybe return the writers credits? Smile

BTW, I just added the awards to the script, so I'll post a diff file. I know this is not optimized, would appreciate any help to make this more efficient:

Code:

--- /home/geetob/work/imdb210106.tcl    Sat Jan 21 20:51:56 2006
+++ ./imdb210106.tcl    Thu May 11 05:08:15 2006
@@ -49,2 +49,3 @@
 # RUNTIME        = %time     |
+# AWARDS         = %awards   |
 # BUDGET         = %budget   |
@@ -330,3 +338,3 @@
     set runtime "N/A" ; set budget "N/A" ; set screens "N/A" ; set country "N/A"
-    set language "N/A" ; set soundmix "N/A" ; set top250 "top/bottom:N/A"
+       set language "N/A" ; set soundmix "N/A" ; set top250 "N/A"; set awards "N/A"
     set rating_bar ""
@@ -421,2 +426,15 @@
     if {$IMDB_DEBUG == 1} { putlog "IMDB_DEBUG runtime == $runtime" }
+       ## get awards
+       if [regexp {<b class=\"ch\">Awards:</b>.*?<a} $html awards] {
+               regsub -all {[\n]+} $awards {} awards
+               regsub -all {<a} $awards {} awards
+               regsub -all {&amp;} $awards {, } awards
+               set pos [string last > $awards] ; incr pos
+               set awards [string range $awards $pos end]
+               set pos [string last : $awards]
+               if {$pos != -1} {incr pos ; set awards [string range $awards $pos end]}
+               set awards [string trimleft $awards]
+       }
+       if {$IMDB_DEBUG == 1} { putlog "IMDB_DEBUG awards == $awards" }
+
     ## get country
@@ -491,2 +505,3 @@
     set output [replacevar $output "%time" $runtime]
+       set output [replacevar $output "%awards" $awards]
     set output [replacevar $output "%country" $country]



Thanks much for fixing this script Smile
Back to top
View user's profile Send private message
OV2
Voice


Joined: 21 Jan 2006
Posts: 35

PostPosted: Thu May 11, 2006 12:10 pm    Post subject: Reply with quote

Hi rosc,

If I understand you correctly, the output appears in the right channel, but lines that are the same for multiple searches appear out of order?
I don't have that much time today, but I'll look into it tomorrow.

Thanks for bringing it to my attention - I only use the script on one channel so it didn't happen to me yet Smile
Back to top
View user's profile Send private message Visit poster's website
rosc2112
Revered One


Joined: 19 Feb 2006
Posts: 1454
Location: Northeast Pennsylvania

PostPosted: Thu May 11, 2006 7:55 pm    Post subject: Reply with quote

That is correct. Just for reference, this is what I have for the 'set announce(IMDBIRC) var:
Code:

set announce(IMDBIRC) "%bold%title%bold - %url\n \
%boldTagline :%bold %tagline \n \
%boldGenre   :%bold %genre \n \
%boldAwards  :%bold %awards \n \
%boldRating  :%bold %rating (%votes votes) \n \
%boldDirector:%bold %name \n \
%boldRuntime :%bold %time mins.\n \
%boldCountry :%bold %country\n \
%boldLanguage:%bold %language\n \
%boldBudget  :%bold %budget\n \
%boldPlot    :%bold %plot \
"


Ohh I just remembered I changed the order a bit last night, but you get the idea Smile

I also added
Code:

if {[regexp N/A $line]} {
                        #putcmdlog "line $line"
                        continue
                } else {
                        puthelp "$toput :$line"

So that is why "N/A" lines did not appear in the sample output.

I ust tested it with the default announce(IMDBIRC) line to check that it wasn't my particular string causing the problem. It still behaved the same with the default.
Back to top
View user's profile Send private message
OV2
Voice


Joined: 21 Jan 2006
Posts: 35

PostPosted: Fri May 12, 2006 5:44 am    Post subject: Reply with quote

Hi rosc2112,

I'm still at work so I did not yet check the script, but something just popped into my head: do you allow identical entries in your queues?
(the "set double-help 1" line in the eggdrop config file)
If not, that might be causing the mix-up.

I'll still take a look at the script when I'm home.
Back to top
View user's profile Send private message Visit poster's website
OV2
Voice


Joined: 21 Jan 2006
Posts: 35

PostPosted: Sat May 13, 2006 4:14 am    Post subject: Reply with quote

OK I've updated the directors search to include multiple directors and included your awards option (I hope you don't mind). I don't understand why you check the awards string for a colon - I've yet to find one in the awards on imdb...

The option to remove the N/A lines is nice, but it only works if every info-part is on it's own line. Otherwise the whole line gets removed if only one is unavailable - so anyone who wants this will have to build their own method Wink .

I'm working on the cast list, I'll let you know when it works Smile

The problem with multiple channels does not happen to me - I've tried it in two channels and the requests are processed one after the other...
Do you have tcl threads enabled/disabled? Does your bot complete the output on one channel and then start the next channel output or do the lines come out at the same time?
Back to top
View user's profile Send private message Visit poster's website
rosc2112
Revered One


Joined: 19 Feb 2006
Posts: 1454
Location: Northeast Pennsylvania

PostPosted: Sun May 14, 2006 9:52 am    Post subject: Reply with quote

I basically copied the other functions to get the awards strings, and not knowing fully what I'm doing would explain the lack of optimization and why the "string last :" line is in there Wink

I've been trying to figure out a way to drop the N/A lines before they're put into the final 'puthelp $toput :$line' cmd, haven't figured out an elegant way to do that yet, but then I took a few days off. Will figure out something and post it =)

I do have tcl threads enabled in the compile. From various tests, the output appears on both channels at the same time. I did have set double-help 0, just tried it with it set at 1, rehashed, retested, same result with msgs appearing out of order.

And now that I think of it, I tested the weather script just to see if that did it as well, and damn it does... So I guess this isn't a script thing, its an eggdrop thing in general... Weird...

Is this because of having threaded tcl enabled? Or is this a eggdrop, or tcl bug?
Back to top
View user's profile Send private message
darkwing
Voice


Joined: 14 May 2006
Posts: 1

PostPosted: Sun May 14, 2006 10:10 am    Post subject: Reply with quote

there is a bug when bot is displaying a line with a http link in it. it just cuts the line where the link begins. try with the movie domino.

edit: overfiends script is what i use Smile

Code:
Tagline: I Am a Bounty Hunter - Synopsis: A recounting of
Back to top
View user's profile Send private message
OV2
Voice


Joined: 21 Jan 2006
Posts: 35

PostPosted: Sun May 14, 2006 10:32 am    Post subject: Reply with quote

I just checked - I have threads enabled in the eggdrop compile, but my tcl lib is compiled without thread support, so that could be why I do not encounter this behaviour.
Did you restart eggdrop after enabling duplicate queue entries?
If it still happens after that it's probably an eggdrop issue with multiple script instances adding lines into the same queue.
If you don't want to disable threads I can try to include some sort of syncronization into the script - but it'll probably take some time Smile
Back to top
View user's profile Send private message Visit poster's website
OV2
Voice


Joined: 21 Jan 2006
Posts: 35

PostPosted: Sun May 14, 2006 4:45 pm    Post subject: Reply with quote

I've made a beta version with all the changed stuff - I'll update the normal version if it works fine for a couple of days.
Beta version

Darkwing the bug you reported has been fixed - thanks.
The cast list has also been included, with an option to limit the output.

Thanks for your feedback.
Back to top
View user's profile Send private message Visit poster's website
rosc2112
Revered One


Joined: 19 Feb 2006
Posts: 1454
Location: Northeast Pennsylvania

PostPosted: Sun May 14, 2006 9:12 pm    Post subject: Reply with quote

OV2 wrote:
I just checked - I have threads enabled in the eggdrop compile, but my tcl lib is compiled without thread support, so that could be why I do not encounter this behaviour.

Hmm, I don't remember what compile options I used for tcl, I'm assuming whatever the defaults were, since I usually make a .doconf.sh file to run configure with any extra options, and save those files for later. Just checked with 'nm' and see thread symbols, so I think thats a "yes" Wink

Quote:

Did you restart eggdrop after enabling duplicate queue entries?
If it still happens after that it's probably an eggdrop issue with multiple script instances adding lines into the same queue.


Just tried it with a restart, and yeah it still does the same.. Guess I should make an enquiry on eggheads's site to see if there's a fix for this, since its not just this one script.

Thanks much for working on the script Smile
Back to top
View user's profile Send private message
rosc2112
Revered One


Joined: 19 Feb 2006
Posts: 1454
Location: Northeast Pennsylvania

PostPosted: Sun May 14, 2006 9:46 pm    Post subject: Reply with quote

Ohh, just another note, the script isn't tcl-special-char safe, I just did a quick test and it chokes on @ chars.. Surprising it didn't choke on { and [ Wink
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, 4, 5 ... 19, 20, 21  Next
Page 4 of 21

 
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