after searching 4 days the forums and trying a few code-snippets, I am giving up and need some help on a tiny script.
1. I call a php-script:
http://mysite/irckey.php?nick=$nick&status=$userstatus
I got the nick but not the Status.
The Script:
Code: Select all
package require http
bind pub - !getkey get_key
set userstatus "0"
proc getnick {nick host handle chan} {
putquick "PRIVMSG nickserv :status $nick"
}
proc get_key {nick host handle chan text} {
global botnick getnick userstatus
if {([string match -nocase "STATUS*3" $text])} {
set userstatus "3"
}
if {([string match -nocase "STATUS*1" $text])} {
set userstatus "1"
}
if {([string match -nocase "STATUS*0" $text])} {
set userstatus "0"
}
set data [::http::geturl http://mysite/getkey.php?nick=$nick&status=$userstatus]
foreach line [split [::http::data $data] \n] {
putquick "NOTICE $nick :$line"
}
::http::cleanup $data
}
putlog "Key Announcer loaded"
I am absolute shure, that I have a mistake, because "set userstatus 'x'" seems to be empty. But I can't find it really...
can someone give me a hand with this please?