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 

DragnLord's weather script
Goto page Previous  1, 2, 3 ... 22, 23, 24
 
Post new topic   Reply to topic    egghelp.org community Forum Index -> Script Support & Releases
View previous topic :: View next topic  
Author Message
bluzman
Voice


Joined: 22 Jan 2011
Posts: 4

PostPosted: Thu Feb 03, 2011 8:46 am    Post subject: Reply with quote

@stock : Thank you very much. That works perfectly!
Back to top
View user's profile Send private message
streamish
Voice


Joined: 03 Dec 2010
Posts: 21

PostPosted: Thu Feb 24, 2011 5:43 pm    Post subject: fwhat help Reply with quote

When I comment out the following code, the script works fine, but it does not print a forecast.

Code:
                regexp {<div class=\"b\">(.*?)</div>(.*?)</td>} $cast match fwhen($f) fwhat($f)
#               regsub -all {<([^<])*>} $fwhat($f) {} fwhat($f)
#               regsub -all {[[:cntrl:]]} $fwhat($f) {} fwhat($f)
#               regsub { &raquo; ZIP Code Detail} $fwhat($f) {} fwhat($f)
#               set fcast($f) "\002$fwhen($f):\002 $fwhat($f)"


However, if I uncomment the lines I get the following errors:

[14:37:27] Tcl error [pub_wz_forecast]: can't read "fwhat(2)": no such element in array

There are no errors in the tcl, and I have no idea what this may be. Can someone please help me out with this.
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: Fri Feb 25, 2011 3:05 am    Post subject: Re: fwhat help Reply with quote

syllable3 wrote:
There are no errors in the tcl, and I have no idea what this may be. Can someone please help me out with this.
Against my better judgement, (mainly because this script is written horrendously and makes my eyes sore) I'll offer you some help.

Code:
                regexp {<div class=\"b\">(.*?)</div>.*?<div>(.*?)</div>} $cast match fwhen($f) fwhat($f)
                regsub -all {<([^<])*>} $fwhat($f) {} fwhat($f)
                regsub -all {[[:cntrl:]]} $fwhat($f) {} fwhat($f)
                regsub { &raquo; ZIP Code Detail} $fwhat($f) {} fwhat($f)
                set fcast($f) "\002$fwhen($f):\002 $fwhat($f)"
Your section of code you've shown needs to resemble what I've done above.

Also... Saw this irony on IRC (EFNet/#eggtcl) and seems to relate directly to this exact post....
Quote:
<stream> http://paste.tclhelp.net/?id=8o6
<@MsMadria> http://xrl.us/bijvvz -> #TCL (16381 bytes)
<simple> stream, without knowing the contents of $forecast, it means little...
<stream> i'd kinda assume it wouldnt matter
<stream> since the error itself is fwhat
<stream> and the only instances of fwhat/fwhen is in that section
<+@thommey> you kinda assume wrong
<stream> yea?
<simple> which is populated via $cast, which is from $forecast
<+@thommey> regexp sets fwhat(2) if and only if it matches on $cast which is in turn based on $forecast
<+@thommey> and obviously, this code depends on it matching
<stream> i see
<simple> you probably also want to "set f 1" each iteration of $cast too
<+@thommey> it's the usual "web scraping fail"
<simple> but i might be wrong about that
<+@thommey> as soon as a website changes its layout, all scripts stop working
<+@thommey> and it's not trivial to fix them
<stream> lemme see if i can find it
<+@thommey> it's almost as complicated as writing them in the first place
<stream> regexp {<div class=\"tm10 bm15\">(.*?)</tbody>} $html match forecast
<stream> would that be it?
<+@thommey> how would I know
<+@thommey> I don't have the website source in front of me, knowing what you want to extract
<stream> ok nigger
quits: stream (stream@wargam.es) (Quit: leaving)
<+@thommey> what the hell
<+@thommey> and once again, I was way too friendly
<Razorback> sounds like gimmie what I want and I'll be nice or else attitude... :/
<+@thommey> but I never said I wouldn't give him what he wants
<+@thommey> I just told him that I need to see the website source
<+@thommey> at least I was trying to.. ;)
<+@thommey> that seems to be a severe insult in his country
<+@thommey> to ask for more information


If you are "stream" from the above quote. You need to watch your f-ing mouth. Ask for help, and don't think anybody will know it's you here. Kinda obvious it is.... lame Rolling Eyes
_________________
speechles' eggdrop tcl archive
Back to top
View user's profile Send private message
Trixar_za
Op


Joined: 18 Nov 2009
Posts: 143
Location: South Africa

PostPosted: Fri Feb 25, 2011 8:09 am    Post subject: Reply with quote

That's normally the point where I stop helping them at all... Anyway, using the classic interface of wunderground with prior mentioned fix tends to fix it. It's just a simple case of changing www to classic - simpler than that you just can't get.
_________________
http://www.trixarian.net/Projects
Back to top
View user's profile Send private message Visit poster's website
sharpie1664
Voice


Joined: 05 Aug 2007
Posts: 28

PostPosted: Mon Oct 17, 2011 6:10 pm    Post subject: Tcl error [pub_wz]: can't read "citychk": no such Reply with quote

When using Weather v4.2.6 by DragnLord i get this error when doing the .wz command


Tcl error [pub_wz]: can't read "citychk": no such variable
Back to top
View user's profile Send private message
aa
Voice


Joined: 08 Jan 2010
Posts: 3

PostPosted: Wed Oct 26, 2011 10:19 am    Post subject: Re: Tcl error [pub_wz]: can't read "citychk": no s Reply with quote

sharpie1664 wrote:
When using Weather v4.2.6 by DragnLord i get this error when doing the .wz command


Tcl error [pub_wz]: can't read "citychk": no such variable


I too am now getting that message when using a Canadian city. For example if I use .wz vancover ca I used to get the report but now only get the error message.

Any ideas?
Back to top
View user's profile Send private message
aa
Voice


Joined: 08 Jan 2010
Posts: 3

PostPosted: Tue Nov 08, 2011 11:35 am    Post subject: Reply with quote

Judging by the lack of responses one would assume that this script is dead in the water.

Is there another script that offers the same functionality as this one. I liked the 5 day forecast so was hoping for something that works similar.
Back to top
View user's profile Send private message
spithash
Master


Joined: 12 Jul 2007
Posts: 248
Location: Libera

PostPosted: Tue Nov 08, 2011 4:00 pm    Post subject: Reply with quote

yes there is, incith-weather is what I use. there's also forecast included.
_________________
Libera ##rtlsdr & ##re - Nick: spithash
Click here for troll.tcl
Back to top
View user's profile Send private message Visit poster's website Yahoo Messenger MSN Messenger
Suntop
Voice


Joined: 19 Dec 2008
Posts: 6

PostPosted: Sat May 12, 2012 8:38 am    Post subject: Reply with quote

I get this error when I try to use it:
Code:
<^Hawk^> [14:21] Tcl error [pub_wz]: can't read "citychk": no such variable


Anyone know how to fix this?

I tried to add a:
Code:
set citychk "0"

at the beginning, but then i get this instead:
Code:
«14:32:27» <@Suntop> .wz
«14:32:32» -^Hawk^- Sorry, oslo is not listed, check http://classic.wunderground.com/global/NO.html for a city thats close.


And I know Oslo is listed, cause it used to work..
Any ideas is very welcome Smile

Yeah, and I made all the changes everyone suggested here..still get this error..
_________________
--==> Wizard Suntop <==--
Back to top
View user's profile Send private message
Suntop
Voice


Joined: 19 Dec 2008
Posts: 6

PostPosted: Sat May 12, 2012 8:41 am    Post subject: Reply with quote

Yeah, and btw, I tried incith-weather too, but it has errors as well...
_________________
--==> Wizard Suntop <==--
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: Sat May 12, 2012 1:41 pm    Post subject: Reply with quote

Suntop wrote:
Yeah, and btw, I tried incith-weather too, but it has errors as well...


Quote:
<speechles> !wz oslo
<sp33chy> Multiple Results Found: Oslo, Minnesota; Oslo, Norway

<speechles> !wz oslo norway
<sp33chy> speechles's weather request; Oslo, Norway (60.1°N/10.8°E); Updated: 7:34 PM CEST (May 12, 2012); Conditions: Clear; Temperature: 50.4°F (10.2°C); High/Low: 55/42°F (12.8/5.6°C); Humidity: 43%; Dew Point: 29°F (-1.7°C); Pressure: 30.15 in/1021 hPa; Wind: North at 4.0 MPH (6.4 KPH)

<speechles> !fc oslo norway
<sp33chy> speechles's forecast request; Oslo, Norway Forecast (High/Low); Updated: 7:34 PM CEST (May 12, 2012); Saturday: 30% Chance of Rain, 55/42°F (12.8/5.6°C); Sunday: Scattered Clouds, 53/39°F (11.7/3.9°C); Monday: Scattered Clouds, 55/39°F (12.8/3.9°C); Tuesday: 30% Chance of Rain, 53/37°F (11.7/2.8°C); Wednesday: Scattered Clouds, 51/41°F (10.6/5°C)

<speechles> !sky oslo norway
<sp33chy> speechles's sky request; Oslo, Norway Astronomy; Sunrise: 4:44 AM CEST; Sunset: 9:43 PM CEST; Moon: Waning Gibbous (52%); Moonrise: 2:18 AM CEST; Moonset: 11:39 AM CEST; Visible Light: 19h 02m; Daylight Length: 16h 58m; Tomorrow: 4m 49s longer

<speechles> !time oslo norway
<sp33chy> speechles's time request; Oslo, Norway (60.1°N/10.8°E); Local Time: 7:39 PM CEST (May 12, 2012)


I'm unsure where to find the "errors" you talk about, because...the current version of Incith-weather is not found in the TCL Archive. It is found by clicking here. This is the version shown in use above.
_________________
speechles' eggdrop tcl archive
Back to top
View user's profile Send private message
Vasago
Voice


Joined: 23 Jan 2011
Posts: 3

PostPosted: Sat May 12, 2012 3:26 pm    Post subject: Reply with quote

speechles wrote:
..

Where would one go to keep updated on this incith-weather script?
Back to top
View user's profile Send private message
shadrach
Halfop


Joined: 14 Dec 2007
Posts: 74

PostPosted: Sat May 12, 2012 6:50 pm    Post subject: Reply with quote

Suntop wrote:
..

Insert a comma between location and country eg .wz oslo, no. Sudden requirement. Don't know why.
Back to top
View user's profile Send private message MSN Messenger
goalie204
Halfop


Joined: 28 Apr 2011
Posts: 44

PostPosted: Thu May 17, 2012 6:09 am    Post subject: Reply with quote

script still works fine for me, but super slow to reply from bot, not sure why all of a sudden?
Back to top
View user's profile Send private message
gig
Voice


Joined: 31 Jul 2012
Posts: 3
Location: Texas

PostPosted: Sun Aug 05, 2012 9:45 am    Post subject: Reply with quote

Tcl error [pub_wz]: can't read "localdate": no such variable


Not sure what this means if someone can help that'd be great.
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 ... 22, 23, 24
Page 24 of 24

 
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