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.

tclhttp error

Old posts that have not been replied to for several years.
Locked
k
kanibus
Halfop
Posts: 44
Joined: Tue May 03, 2005 7:22 am

tclhttp error

Post by kanibus »

hey im getting an error using tclhttp
can't read "state(-urlencoding)": no such variable.
using the latest version of tclhttp with the following code:

Code: Select all

set cztrig .czlid
bind PUB -|- $cztrig steam_query

proc steam_query { nick host hand chan text } {

        if { [string match "" "$text"] } {
            putserv "NOTICE $nick :usage: .czlid <steamid>      example: .czlid 0:1:2345"
	    } else {
            search_id $chan $text
        }
}
proc search_id { chan string } {
    set url "czleague.org/index.php?div=&action=steamidsearch&submit=1"
    set czid [::http::formatQuery steamid $string]
    set tok [::http::geturl $url -query $czid]
    set page [::http::data $tok]
        if {[::http::ncode $tok] != 200} {
                set text "An error occured while connecting to the CZL database."
                putserv "NOTICE $chan :$text"
                ::http::cleanup $tok ; return
        }
    
    set fs [open search.results w]
    puts $fs "$page"
    close $fs
}
any help is much appreciated
Last edited by kanibus on Wed Sep 07, 2005 6:15 pm, edited 6 times in total.
User avatar
demond
Revered One
Posts: 3073
Joined: Sat Jun 12, 2004 9:58 am
Location: San Francisco, CA
Contact:

Post by demond »

hey read the top sticky post
k
kanibus
Halfop
Posts: 44
Joined: Tue May 03, 2005 7:22 am

Post by kanibus »

edited
User avatar
demond
Revered One
Posts: 3073
Joined: Sat Jun 12, 2004 9:58 am
Location: San Francisco, CA
Contact:

Post by demond »

post .set errorInfo results

also, you use undefined/uninitialized variable $tok
k
kanibus
Halfop
Posts: 44
Joined: Tue May 03, 2005 7:22 am

Post by kanibus »

sorry here is the errorInfo
Currently: can't read "state(-urlencoding)": no such variable
Currently: while executing
Currently: "encoding convertto $state(-urlencoding) $string"
Currently: (procedure "mapReply" line 13)
Currently: invoked from within
Currently: "mapReply $i"
Currently: (procedure "::http::formatQuery" line 5)
Currently: invoked from within
Currently: "::http::formatQuery steamid $string"
Currently: (procedure "search_id" line 4)
Currently: invoked from within
Currently: "search_id $chan $text"
Currently: (procedure "steam_query" line 6)
Currently: invoked from within
Currently: "steam_query $_pub1 $_pub2 $_pub3 $_pub4 $_pub5"
and thanks for the quick reply :D
k
kanibus
Halfop
Posts: 44
Joined: Tue May 03, 2005 7:22 am

Post by kanibus »

does anyone maybe have an example script i can look at using tclhttp ??
User avatar
demond
Revered One
Posts: 3073
Joined: Sat Jun 12, 2004 9:58 am
Location: San Francisco, CA
Contact:

Post by demond »

Locked