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.

Lilyweather problems

Old posts that have not been replied to for several years.
Locked
s
syk
Voice
Posts: 22
Joined: Tue Jan 04, 2005 8:18 pm

Lilyweather problems

Post by syk »

This script was working perfectly hours ago, now I get the error

Tcl error [pub_w]: no value given for parameter "h" to "join"

and I edited nothing, any ideas?
User avatar
demond
Revered One
Posts: 3073
Joined: Sat Jun 12, 2004 9:58 am
Location: San Francisco, CA
Contact:

Post by demond »

how big the probability for someone here having used that script is, you think? 0.1%? no, it's less than that

post the script, or at least the relevant parts, and complete error traceback, obtained by typing .set errorInfo on bot's partyline
User avatar
user
 
Posts: 1452
Joined: Tue Mar 18, 2003 9:58 pm
Location: Norway

Re: Lilyweather problems

Post by user »

syk wrote:Tcl error [pub_w]: no value given for parameter "h" to "join"
"join" is a native tcl command and that error message comes from a proc. Overwriting the internal commands with procs that do something entirely different is not a good idea.
Have you ever read "The Manual"?
s
syk
Voice
Posts: 22
Joined: Tue Jan 04, 2005 8:18 pm

Post by syk »

Code: Select all

proc pub_w {nick uhand handle chan input} {
  if {[lsearch -exact [channel info $chan] +weather] != -1} {
    global botnick agent
    if {[llength $input]==0} {
      putserv "PRIVMSG $chan :Lilys Simple Weather V2"
    } else {
      set query "http://www.wunderground.com/cgi-bin/findweather/getForecast?qu$
      for { set index 0 } { $index<[llength $input] } { incr index } {
        set query "$query[lindex $input $index]"
          if {$index<[llength $input]-1} then {
            set query "$query+"
          }
      }
    }

    putserv "PRIVMSG $chan : $query"
    set http [::http::config -useragent $agent]
    set http [::http::geturl $query]
    set html [::http::data $http]
    regsub -all "\n" $html "" html
    regexp {Observed at<b>(.*)</b>\(<a} $html - loc
    if {[info exists loc]==0} {
      putserv "PRIVMSG $chan : I dont know where $input is, exactly"
      return 0
    }
    regexp {Updated: <b>(.*?)</b>} $html - updated
    regexp {Updated: <b>(.*?)Visibility} $html - data
    regexp {<font size=-1><b>(.*?)</b></font>} $data - cond
    regexp {arial><b>  <nobr><b>(.*?)</b> °F</nobr>  /  <nobr><b>(.*?)</b> °C</nobr>} $data - tempf tempc
    if {[info exists tempf]==0} {
      regexp {Temperature:</td><td valign=top><b>  <nobr><b>(.*?)</b> °F</nobr>  /  <nobr><b>(.*?)</b> °C</nobr>} $data $
    }
    if {[info exists tempf]==0} {
      putserv "PRIVMSG $chan : Weather for $loc"
      putserv "PRIVMSG $chan : is not currently available"
      return 0
    }
    regexp {Wind:(.*?)<nobr><b>(.*?)</b> mph</nobr>  /  <nobr><b>(.*?)</b> km/h</nobr>} $data - trash windm windk
    regexp {</b> from the <b>(.*?)</b>} $data - windd
    regexp {Humidity:</td><td valign=top><b>(.*?)</b>} $data - hum
    putserv "PRIVMSG $chan : Weather for \00312\002$loc\002"
    regsub -all "\<.*?\>" $updated "" updated
    putserv "PRIVMSG $chan : Updated at \00312\002$updated\002\003"
    if {[info exists cond]==0} {
      putserv "PRIVMSG $chan : \00312\002$tempf\002\003 F, Humidity \00312\002$hum\002"
    } else {
      putserv "PRIVMSG $chan : \00312\002$cond\002\003, \00312\002$tempf\002\003 F, Humidity \00312\002$hum\002"
    }
    if {[info exists windd]==0} {
      putserv "PRIVMSG $chan : Wind is \00312\002Calm\002\003"
    } else {
      putserv "PRIVMSG $chan : Wind \00312\002$windm MPH\002\003 From the \00312\002$windd\002\003"
    }
  }
}

User avatar
user
&nbsp;
Posts: 1452
Joined: Tue Mar 18, 2003 9:58 pm
Location: Norway

Post by user »

Why did you post that? Did you read my previous post? Rename your join proc and restart your bot as you have deleted the native join command from the interpreter.
Have you ever read "The Manual"?
s
syk
Voice
Posts: 22
Joined: Tue Jan 04, 2005 8:18 pm

Post by syk »

Well, I guess it's just not this script thats giving that error, and I don't know what you mean by the join proc, like I said, I'm new to this
User avatar
user
&nbsp;
Posts: 1452
Joined: Tue Mar 18, 2003 9:58 pm
Location: Norway

Post by user »

syk wrote:Well, I guess it's just not this script thats giving that error, and I don't know what you mean by the join proc, like I said, I'm new to this
The script you pasted is calling other procs that probably try to use the built in 'join' command. You have a proc called 'join' that replaced the original command. To restore the original command you need to .restart your bot. (.rehash won't do)
Have you ever read "The Manual"?
s
syk
Voice
Posts: 22
Joined: Tue Jan 04, 2005 8:18 pm

Post by syk »

I've .restart'd it like 10+ times, and it's still the same
User avatar
user
&nbsp;
Posts: 1452
Joined: Tue Mar 18, 2003 9:58 pm
Location: Norway

Post by user »

syk wrote:I've .restart'd it like 10+ times, and it's still the same
Then you didn't remove/rename that proc of yours. When you restart, the original command is restored for a brief moment untill your script is loaded back in and replace the command once more :P
Have you ever read "The Manual"?
s
syk
Voice
Posts: 22
Joined: Tue Jan 04, 2005 8:18 pm

Post by syk »

lol, well I found out what it was, and thats fixed now, but I'm getting some retarded error from the weather script

Tcl error [pub_w]: no such channel record

Not expecting you to know, but if you do, or if anyone does, I'd appreciate the help
User avatar
demond
Revered One
Posts: 3073
Joined: Sat Jun 12, 2004 9:58 am
Location: San Francisco, CA
Contact:

Post by demond »

your proc is trying to manipulate a non-existing channel
s
syk
Voice
Posts: 22
Joined: Tue Jan 04, 2005 8:18 pm

Post by syk »

ideas on how to fix it?
User avatar
demond
Revered One
Posts: 3073
Joined: Sat Jun 12, 2004 9:58 am
Location: San Francisco, CA
Contact:

Post by demond »

generally speaking, your best bet always is to contact script's author directly, there might be a newer version which fixes the bugs you are experiencing

other than that, I'd guess proc [pub_w] was somehow triggered on a channel that has been removed from the bot (or never added; this may happen as a side effect of other scripts, I have no idea what you are running)
Locked