| View previous topic :: View next topic |
| Author |
Message |
DragnLord Owner

Joined: 24 Jan 2004 Posts: 711 Location: C'ville, Virginia, USA
|
Posted: Sun Sep 27, 2009 11:29 pm Post subject: |
|
|
| 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  | 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 |
|
 |
DragnLord Owner

Joined: 24 Jan 2004 Posts: 711 Location: C'ville, Virginia, USA
|
Posted: Sun Sep 27, 2009 11:47 pm Post subject: Specifying country code |
|
|
| The country code is required for all locations outside of the United States of America. |
|
| Back to top |
|
 |
DragnLord Owner

Joined: 24 Jan 2004 Posts: 711 Location: C'ville, Virginia, USA
|
Posted: Mon Sep 28, 2009 12:14 am Post subject: |
|
|
| 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 |
|
 |
speechles Revered One

Joined: 26 Aug 2006 Posts: 1398 Location: emerald triangle, california (coastal redwoods)
|
Posted: Mon Sep 28, 2009 5:33 pm Post subject: |
|
|
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 |
|
 |
DragnLord Owner

Joined: 24 Jan 2004 Posts: 711 Location: C'ville, Virginia, USA
|
Posted: Mon Sep 28, 2009 11:29 pm Post subject: |
|
|
| 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 |
|
 |
spithash Master

Joined: 12 Jul 2007 Posts: 248 Location: Libera
|
Posted: Thu Sep 16, 2010 10:44 am Post subject: |
|
|
DragnLord,
If you add some flood protection, like, how many trigger requests per how many seconds.. would be AWESOME!
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.
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 Takes time!!! _________________ Libera ##rtlsdr & ##re - Nick: spithash
Click here for troll.tcl |
|
| Back to top |
|
 |
CtrlAltDel Halfop
Joined: 02 Jun 2004 Posts: 49
|
Posted: Sat Jan 22, 2011 10:20 am Post subject: No Report |
|
|
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 |
|
 |
planetb Voice
Joined: 21 Jan 2011 Posts: 6
|
Posted: Sat Jan 22, 2011 12:17 pm Post subject: Re: No Report |
|
|
| 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 |
|
 |
planetb Voice
Joined: 21 Jan 2011 Posts: 6
|
Posted: Sun Jan 23, 2011 5:16 pm Post subject: Re: No Report |
|
|
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 "°" to "°"
if {[regexp {Temperature} $conditions]} {regexp {Temperature (.*?)°F / (.*?)°C} $conditions match temp mtemp} else {regexp {[[:blank:]](.{1,5}?)°F} $conditions match temp; regexp {F /[[:blank:]]*?(.*?)°C (.*?) [[:alpha:]]*?:} $conditions match mtemp cond}
|
| Code: |
Line 792 and 793 : Changed "°" to "°" also.
if {[regexp {Windchill} $conditions]} {regexp {Windchill: (.*?)°F / (.*?)°C [[:alpha:]]*:} $conditions match ichill mchill}
if {[regexp {Heat Index} $conditions]} {regexp {Heat Index: (.*?)°F / (.*?)°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 °
Log file entry :
| Quote: |
[16:14] Updated: 4:07 PM EST on January 23, 2011 26.1°F / -3.3°C Clear Windchill: 17°F / -8°C Humidity: 19% Dew Point: -13°F / -25°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 |
|
 |
Vasago Voice
Joined: 23 Jan 2011 Posts: 3
|
Posted: Sun Jan 23, 2011 6:19 pm Post subject: |
|
|
| 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 |
|
 |
CtrlAltDel Halfop
Joined: 02 Jun 2004 Posts: 49
|
Posted: Sun Jan 23, 2011 11:14 pm Post subject: |
|
|
| planetb: Many thanks |
|
| Back to top |
|
 |
bluzman Voice
Joined: 22 Jan 2011 Posts: 4
|
Posted: Mon Jan 24, 2011 6:21 am Post subject: |
|
|
Thanks planetb, your fix worked perfectly.
Cheers! |
|
| Back to top |
|
 |
webmastir Voice
Joined: 28 Jan 2011 Posts: 6
|
Posted: Fri Jan 28, 2011 12:30 am Post subject: |
|
|
can anyone upload a working tcl somewhere w/ planetb's fixes integrated?
thx  |
|
| Back to top |
|
 |
caesar Mint Rubber

Joined: 14 Oct 2001 Posts: 3741 Location: Mint Factory
|
Posted: Fri Jan 28, 2011 2:40 am Post subject: |
|
|
Can't you edit the tcl file in a text editor and replace all instances of "°" with "°"? 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 |
|
 |
webmastir Voice
Joined: 28 Jan 2011 Posts: 6
|
Posted: Fri Jan 28, 2011 8:38 am Post subject: |
|
|
| caesar wrote: | | Can't you edit the tcl file in a text editor and replace all instances of "°" with "°"? Basically this is what he did. |
lol. well ya, i suppose i could . 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 |
|
 |
|