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 ... 21, 22, 23, 24  Next
 
Post new topic   Reply to topic    egghelp.org community Forum Index -> Script Support & Releases
View previous topic :: View next topic  
Author Message
DragnLord
Owner


Joined: 24 Jan 2004
Posts: 711
Location: C'ville, Virginia, USA

PostPosted: Sun Sep 27, 2009 11:29 pm    Post subject: Reply with quote

Kein wrote:
Also, help-string still says "[23:27:09] -Bot- Check your syntax, use .wz -help", but well, you see, I have changed the prefix and cmd... Just make it variable in help-text Razz
Yes, that is an error, it should be "$weather help" for you.

Help is activated by using "help" as the location, I'll change the message for the next version.
Back to top
View user's profile Send private message
DragnLord
Owner


Joined: 24 Jan 2004
Posts: 711
Location: C'ville, Virginia, USA

PostPosted: Sun Sep 27, 2009 11:47 pm    Post subject: Specifying country code Reply with quote

The country code is required for all locations outside of the United States of America.
Back to top
View user's profile Send private message
DragnLord
Owner


Joined: 24 Jan 2004
Posts: 711
Location: C'ville, Virginia, USA

PostPosted: Mon Sep 28, 2009 12:14 am    Post subject: Reply with quote

Kein wrote:

[country] -> I always thought that the args in [] brackets is optional.

Quote:

[23:18:01] <Kein> $weather boston
[23:22:34] <Bot> [22:22] Tcl error [pub_wz]: can't read "outtitle": no such variable


Looks like I was wrong all my life.

Specifying the state with a city is not in [] brackets and is required as stated.
Country code for locations within the United States of America used to be optional, and now is not used.
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 Sep 28, 2009 5:33 pm    Post subject: Reply with quote

Actually, I think what he meant is the reason you require the state is because without it you are presented with a list of possible matches rather than a definite match.
CtrlAltDel wrote:
Quote:

[23:18:01] <Kein> $weather boston
[23:22:34] <Bot> [22:22] Tcl error [pub_wz]: can't read "outtitle": no such variable


Looks like I was wrong all my life.

Can you just make it... optional? Let it return the first result, c'mon. It will not break anything or destroy the eternity.


He would rather it just take the top suggested result and roll with that than give a tcl error mentioning some non-existant variable, "outtitle". Or, at the very least, present the potential list of matches and ask for refinement. I don't think guy was asking for the moon, or your first born child. That makes damn good sense. You should embrace the ideas coming from people using your script, rather than impose your disdain upon them. And yeah, lighten up. It's only irc, type /clear. Breathe. ;D

Edit:
Code:
find this:   
regexp {<title>(.*?)</title>} $html match outtitle
if {[string first Search $outtitle] !=-1} {puthelp "NOTICE $nick :Check your syntax, use .wz -help";close $wzsock;return 0}
if {[string first Error $outtitle] !=-1} {puthelp "NOTICE $nick :Location not found, please check spelling.";close $wzsock;return 0}

change it to this:
if {![regexp {<title>(.*?)</title>} $html match outtitle]} {
  puthelp "NOTICE $nick :You need to supply more information for that location.."
  close $wzsock;return 0
}
if {[string first Search $outtitle] !=-1} {puthelp "NOTICE $nick :Check your syntax, use .wz -help";close $wzsock;return 0}
if {[string first Error $outtitle] !=-1} {puthelp "NOTICE $nick :Location not found, please check spelling.";close $wzsock;return 0}

That will at least give a proper error message to the user, rather than cause a tcl error.
_________________
speechles' eggdrop tcl archive
Back to top
View user's profile Send private message
DragnLord
Owner


Joined: 24 Jan 2004
Posts: 711
Location: C'ville, Virginia, USA

PostPosted: Mon Sep 28, 2009 11:29 pm    Post subject: Reply with quote

Earlier versions of the script did return lists of locations, however that was removed due to user requests and complaints. I may include an option for that feature in a future version after 4.2.6, which has already been uploaded to the archives.
Back to top
View user's profile Send private message
spithash
Master


Joined: 12 Jul 2007
Posts: 248
Location: Libera

PostPosted: Thu Sep 16, 2010 10:44 am    Post subject: Reply with quote

DragnLord,

If you add some flood protection, like, how many trigger requests per how many seconds.. would be AWESOME! Very Happy

When a user floods a trigger, the bot will post the requests without stopping and even worse, when the script is set to:
Code:
set wz_outmeth putserv

or even worse to:
Code:
set wz_outmeth putquick

then the bot excess flood quits. Confused

Even more annoying when you even have that set to "puthelp" and someone trigger floods in the channel and the bot HAS to post EVERYTHING Crying or Very sad Takes time!!!
_________________
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
CtrlAltDel
Halfop


Joined: 02 Jun 2004
Posts: 49

PostPosted: Sat Jan 22, 2011 10:20 am    Post subject: No Report Reply with quote

All of a sudden this morning I'm getting "No Report" for temperature no matter what location I try.
You just knew it had been too long since they screwed it up.

Still the best weather script available. Thanks
Back to top
View user's profile Send private message
planetb
Voice


Joined: 21 Jan 2011
Posts: 6

PostPosted: Sat Jan 22, 2011 12:17 pm    Post subject: Re: No Report Reply with quote

CtrlAltDel wrote:
All of a sudden this morning I'm getting "No Report" for temperature no matter what location I try.
You just knew it had been too long since they screwed it up.

Still the best weather script available. Thanks



I'm also seeing the same issue :

New York, New York -- 11:17 AM EST Updated: 11:16 AM EST on January 22, 2011
Conditions: Temp: No report
Humidity: 32% Dew Point: 3°F / -16°C
Pressure: 30.01in / 1016.1hPa (Steady) Wind: 3.0mph / 4.8km/h / 1.3m/s Variable
Back to top
View user's profile Send private message
planetb
Voice


Joined: 21 Jan 2011
Posts: 6

PostPosted: Sun Jan 23, 2011 5:16 pm    Post subject: Re: No Report Reply with quote

Not sure if DragnLord is still around. So I learned a little about tcl and started looking into the issue a little. made a couple changes and now the script is working again. Looks like they changed the website format a little.

Changes I made :
Code:

Line 782 : changed "&#176" to "&deg"

         if {[regexp {Temperature} $conditions]} {regexp {Temperature (.*?)&deg;F / (.*?)&deg;C} $conditions match temp mtemp} else {regexp {[[:blank:]](.{1,5}?)&deg;F} $conditions match temp; regexp {F /[[:blank:]]*?(.*?)&deg;C (.*?) [[:alpha:]]*?:} $conditions match mtemp cond}

Code:

Line 792 and 793 : Changed "&#176" to "&deg" also.

         if {[regexp {Windchill} $conditions]} {regexp {Windchill: (.*?)&deg;F / (.*?)&deg;C [[:alpha:]]*:} $conditions match ichill mchill}
         if {[regexp {Heat Index} $conditions]} {regexp {Heat Index: (.*?)&deg;F / (.*?)&deg;C [[:alpha:]]*:} $conditions match ihindex mhindex}

Found this by putting "putlog $conditions" right above line 782 and then looking in the log file "eggdrop.log" after I had someone run a .wz . Dew point was also already set as &deg

Log file entry :
Quote:

[16:14] Updated: 4:07 PM EST on January 23, 2011 26.1&deg;F / -3.3&deg;C Clear Windchill: 17&deg;F / -8&deg;C Humidity: 19% Dew Point: -13&deg;F / -25&deg;C Wind: 9.0mph / 14.5km/h / 4.0m/s from the NW Wind Gust: 13.0mph / 20.9km/h / 9.3m/s Pressure: 30.14in / 1020.5hPa (Rising) Visibility: 10.0miles / 16.1kilometers UV: 1 out of 16 Pollen: .10 out of 12Pollen Forecast new! Clouds: Clear - (Above Ground Level) Elevation: 52ft / 15m

Quote:

New York, New York -- 4:07 PM EST Updated: 4:07 PM EST on January 23, 2011
Conditions: 26.1°F / -3.3°C | Clear
Humidity: 19% Windchill: 17°F / -8°C Dew Point: -13°F / -25°C
Pressure: 30.14in / 1020.5hPa (Rising) Wind: 9.0mph / 14.5km/h / 4.0m/s from the NW
Back to top
View user's profile Send private message
Vasago
Voice


Joined: 23 Jan 2011
Posts: 3

PostPosted: Sun Jan 23, 2011 6:19 pm    Post subject: Reply with quote

Thank you Planetb for the fix you came up with. My husband usally fixes things but he couldn't figure this one out.
Back to top
View user's profile Send private message
CtrlAltDel
Halfop


Joined: 02 Jun 2004
Posts: 49

PostPosted: Sun Jan 23, 2011 11:14 pm    Post subject: Reply with quote

planetb: Many thanks
Back to top
View user's profile Send private message
bluzman
Voice


Joined: 22 Jan 2011
Posts: 4

PostPosted: Mon Jan 24, 2011 6:21 am    Post subject: Reply with quote

Thanks planetb, your fix worked perfectly.

Cheers!
Back to top
View user's profile Send private message
webmastir
Voice


Joined: 28 Jan 2011
Posts: 6

PostPosted: Fri Jan 28, 2011 12:30 am    Post subject: Reply with quote

can anyone upload a working tcl somewhere w/ planetb's fixes integrated?

thx Smile
Back to top
View user's profile Send private message
caesar
Mint Rubber


Joined: 14 Oct 2001
Posts: 3741
Location: Mint Factory

PostPosted: Fri Jan 28, 2011 2:40 am    Post subject: Reply with quote

Can't you edit the tcl file in a text editor and replace all instances of "&#176" with "&deg"? Basically this is what he did.
_________________
Once the game is over, the king and the pawn go back in the same box.
Back to top
View user's profile Send private message
webmastir
Voice


Joined: 28 Jan 2011
Posts: 6

PostPosted: Fri Jan 28, 2011 8:38 am    Post subject: Reply with quote

caesar wrote:
Can't you edit the tcl file in a text editor and replace all instances of "&#176" with "&deg"? Basically this is what he did.


lol. well ya, i suppose i could Embarassed . i swore when i looked at his post last night it was quite a bit more tweaking. seems easy enough. will try it out. thx

edit: worked...thx
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 ... 21, 22, 23, 24  Next
Page 22 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