This is the new home of the egghelp.org community forum.
All data has been migrated (including user logins/passwords) to a new phpBB version.


For more information, see this announcement post. Click the X in the top right-corner of this box to dismiss this message.

weather3.2.7.tcl (again)

Old posts that have not been replied to for several years.
Locked
t
tainted
Master
Posts: 239
Joined: Sun May 12, 2002 8:00 pm
Location: chicago
Contact:

weather3.2.7.tcl (again)

Post by tainted »

Well.. It worked for a few weeks, but now out of nowhere, I get an error when using murf's weather tcl. When I do .wz, .wz <zip> or .wz <city> I get this:

[15:10] Tcl error [pub_wz]: can't use non-numeric string as operand of "*"

Also saw it say '..string as operand of "-"'..

Anyone?


PS: The script is at http://www.taintedreality.org/weather3.2.7.tcl
Last edited by tainted on Wed Jul 03, 2002 4:19 pm, edited 1 time in total.
t
tainted
Master
Posts: 239
Joined: Sun May 12, 2002 8:00 pm
Location: chicago
Contact:

Post by tainted »

Arg! Well, right after I wrote this, a user did .wz and got a partial answer.

<xxxxx[a]> .wz
<bot> Marshall, Minnesota -- 2:55 PM CDT on July 03, 2002
<bot> Humidity: 51%
<bot> Conditions : Clear with wind at 0

:cry:
t
tainted
Master
Posts: 239
Joined: Sun May 12, 2002 8:00 pm
Location: chicago
Contact:

Post by tainted »

Ok, maybe someone could help me out here. This tcl code is supposed to pull the temp out of the following html code.

Code: Select all

        if {$temp == "" && [string first Temperature $wzout] != -1} {
            for {set j 0} {$j <= 10} {incr j} {
               set wzout [gets $wzsock]
               if {[string first <b> $wzout] != -1} {
                 set stindx [string first b> $wzout]
                 set etindx [string first \& $wzout]
                 break
               }
            }
            set ltindx [expr { $stindx + 2}]
            set rtindx [expr { $etindx - 1}]
            set temp [string range $wzout $ltindx $rtindx]
            set temp [string trimright $temp { [<\/b>] } ]
            continue
        }

Code: Select all

<tr BGCOLOR=#FFFFFF><td>Temperature</td>
     <td>



    <b>75</b>° F

    /


        <b>24</b>° C




 </td>
     </tr>
The error the bot is giving is:
[bot(dcc)] [21:39] Tcl error [pub_wz]: can't use non-numeric string as operand of "*"

A bit more info.. wzout is the html found from http://www.wunderground.com/cgi-bin/fin ... [i]zipcode[/i][/b] and after its string'ed to the first "Updated" string found there. (Which appears to get it set up in the right area still)
t
tainted
Master
Posts: 239
Joined: Sun May 12, 2002 8:00 pm
Location: chicago
Contact:

Post by tainted »

Heh.. After a bit more debugging, I found that it is the expr command that is failing, (catch was returning non-zero's) and therefore it is not reading that bit of html in correctly.. :evil:
t
tainted
Master
Posts: 239
Joined: Sun May 12, 2002 8:00 pm
Location: chicago
Contact:

Post by tainted »

Muhahaha! Expect a unofficial update because murf's hasnt gotten around yet (if he made one yet) in the next day, I found what was making that error and have just about finished adjusting it.
t
tainted
Master
Posts: 239
Joined: Sun May 12, 2002 8:00 pm
Location: chicago
Contact:

Post by tainted »

Done. http://www.taintedreality.org/weather3.2.8-eggs.tcl is the edited copy. It turned out to be just a few hard coded numbers that were making html code be included with numeric values. :roll:
User avatar
Yourname
Master
Posts: 358
Joined: Mon Sep 24, 2001 8:00 pm
Location: Toronto

Post by Yourname »

good boy.
Dormant egghead.
t
tainted
Master
Posts: 239
Joined: Sun May 12, 2002 8:00 pm
Location: chicago
Contact:

Post by tainted »

Arf?
S
Stoner

Post by Stoner »

Using your edit...
The output is still buggered if you use a default,
ie; .wz
It's leaving the temp off.
Might just be me, having an irc crack attack! :-?
t
tainted
Master
Posts: 239
Joined: Sun May 12, 2002 8:00 pm
Location: chicago
Contact:

Post by tainted »

I noticed this a few times as well, but after the user reset their default it was fine. *boggle* Let me know if doing a .wz -d <zip> then .wz does not work right, and I'll look at it again.
S
Stoner

Post by Stoner »

That works mate, cheers... 8)
I
Invision

weather3.2.7.tcl

Post by Invision »

when i tried this TCL i get the fallowing message

Tcl error [pub_wz]: can't read "wzsock": no such variable
couldn't open socket: permission denied

anyone know how to correct this???

:lol:
Locked