for first excuse my bad english. I'm very new in the TCL programming and I got a few Problems with my Windrop-Script.
Before I write down my code, here what I want the Script/Bot to do.
The Bot is sitting in a channel and wait for Topic-changes. If the Topic was changed he should catch it, build an URL to submit it to a PHP-module an makes an Simple URL-call. I got everything to work, only the URL-Call will not work. I added 2 "putlog"'s to see if the topic was catched correctly and if the http::formatQuery builds the end of the URL in the rigt way. Following my actual Script-Code.
Code: Select all
bind topc - * catch_topic
package require http
proc catch_topic {nick uhost handle chan topic} {
global botnick url chantopic
if {$chan == "#d2nsa.bt"} then {
set chantopic [topic #d2nsa.bt]
set ::http(-useragent) {Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.0)}
set url [::http::formatQuery "type" "topic" "info" $chantopic]
set token [::http::geturl "http://www.allytool.d2nsa.de/submit.php" -query $url -timeout 5000]
putlog "$url"
::http::cleanup $token
putlog "New topic: d2nsa.bt $chantopic"
}
}
Code: Select all
http://www.allytool.d2nsa.de/submit.php?type=topic&info=$chantopic
And there is another Question for me. The Topic in the Original Channel is Colored. When the Bot catch this i get an Error. I don't remember the complete Message, but it was like " Invalid Url". in the Putlog I see the coplete colored Topic. How can I strip the Colors out of the topic?
I know, these are a lot of questions, but maybe someone can help me.
Greets
Dark_Lancer