Very nice.Jonny12 wrote:Thanks willyw,
At least I know it's not just me. I tried emailing them. I'll let you know if I find anything out.
Thank you.
Still ?Jonny12 wrote:Well, the website seems to be back up, but I am still
Had you mentioned this one before?getting the 301 Moved Permanently message.
Yes. It's in the channel in my signature.Is your bot working in IRC, willyw?
Jonny12 wrote:Well, the website seems to be back up...
Code: Select all
#Bot's Nickname to Respond to: ex. MyBot - Usage: MyBot, what's 1+1?
set pandoraNick "MyBot"
#Your Pandora Bot ID. (Feel free to use the existing one if you want, but the bot will think its name is AlphaBot
set botid "a5cd504e4e342614"
#STOP EDITING HERE
package require http
if {[catch {package require tls 1.6}]} {
putcmdlog "https links requires tcltls : https://core.tcl.tk/tcltls/wiki/Download"
set enabletls 0
} else {
set enabletls 1
tls::init -ssl3 0 -ssl2 0 -tls1 1
http::register https 443 [list ::tls::socket -require 0 -request 1]
}
bind pubm - "% ${pandoraNick}*" talkto
proc talkto {n u h c t} {
set query [::http::formatQuery botid $::botid custid $n input [join [lrange [split $t] 1 end]]]
if {[catch {set token [::http::geturl https://pandorabots.com/pandora/talk-xml -query $query -timeout 16000]} error]} {
putlog "[string map [list \n " ,"] $error] ,[::http::status $token]"
::http::cleanup $token
}
if {[string match -nocase "timeout" [::http::status $token]]} {
putlog "[::http::code $token]"
::http::cleanup $token
}
if {![string equal -nocase [::http::status $token] "ok"]} {
putlog "[::http::code $token] ,[::http::status $token]"
::http::cleanup $token
}
if {[::http::ncode $token] == "200" && [string equal -nocase [::http::status $token] "ok"]} {
set pandata [::http::data $token]
::http::cleanup $token
}
if {![regexp {<that>(.*?)</that>} $pandata -> responce]} {
putlog "This regex sucks!!! Source codes changed or what?!?"
return
} else {
puthelp "privmsg $c :$responce"
}
return 0
}
heartbroken wrote: ...
You need to have tcltls for https links. https://core.tcl.tk/tcltls/wiki/Download , http://wiki.tcl.tk/2630
It seems the pandorabots.com website changed something/some code/somewhere and the TCL script can't fetch the reply.Jonny12 wrote:Thanks willyw,
At least I know it's not just me. I tried emailing them. I'll let you know if I find anything out.
Code: Select all
# what you wanna say ?
set saysmth "Do You Love me ?"
package require http
package require tls
tls::init -ssl3 0 -ssl2 0 -tls1 1
http::register https 443 [list ::tls::socket -require 0 -request 1]
set url "https://www.pandorabots.com/pandora/talk?botid=f5d922d97e345aa1&skin=custom_input"
set token [::http::geturl $url -query [http::formatQuery input $saysmth] -timeout 16000]
upvar #0 $token state
puts "state array got these: \n [parray state]"
set data [::http::data $token]
::http::cleanup $token
regexp {<em>[^:]*:([^<]*)</em>.+<b>([^:]*):<em>([^<]*)</em>} $data - me bot botalk
puts "without cookie: human says: $me || botname: $bot || bot response: $botalk"
Done.heartbroken wrote:Could you test this : http://paste.tclhelp.net/?id=6cfb
Replace it with your own settings.
and change http://www.pandorabots... links to https
That's why I thought it might be impossible to fix it.it was an obfuscated script
Could there be other packages that need to be loaded?and when i unobfuscate it ,i have to fix the lines again, because it was crash the bot. it took some time to fix the lines.
You can try now.
Code: Select all
dpkg -l *tls* |grep ii
ii tcl-tls 1.5.0.dfsg-10build1 the TLS OpenSSL extension to Tcl
Code: Select all
Tcl error [talkto]: can't read "token": no such variable
Code: Select all
#Bot's Nickname to Respond to: ex. MyBot - Usage: MyBot, what's 1+1?
set pandoraNick "AI"
#Your Pandora Bot ID. (Feel free to use the existing one if you want, but the bot will think its name is AlphaBot
set botid "f60ea9654e345adb"
#STOP EDITING HERE
package require http
if {[catch {package require tls 1.6}]} {
putcmdlog "https links requires tcltls : https://core.tcl.tk/tcltls/wiki/Download"
set enabletls 0
} else {
set enabletls 1
tls::init -ssl3 0 -ssl2 0 -tls1 1
http::register https 443 [list ::tls::socket -require 0 -request 1]
}
bind pubm - "% ${pandoraNick}*" talkto
proc talkto {n u h c t} {
set query [::http::formatQuery botid $::botid custid $n input [join [lrange [split $t] 1 end]]]
if {[catch {set token [::http::geturl https://pandorabots.com/pandora/talk-xml -query $query -timeout 16000]} error]} {
putlog "[string map [list \n " ,"] $error] ,[::http::status $token]"
::http::cleanup $token
}
if {[string match -nocase "timeout" [::http::status $token]]} {
putlog "[::http::code $token]"
::http::cleanup $token
}
if {![string equal -nocase [::http::status $token] "ok"]} {
putlog "[::http::code $token] ,[::http::status $token]"
::http::cleanup $token
}
if {[::http::ncode $token] == "200" && [string equal -nocase [::http::status $token] "ok"]} {
set pandata [::http::data $token]
::http::cleanup $token
}
if {![regexp {<that>(.*?)</that>} $pandata -> responce]} {
putlog "This regex sucks!!! Source codes changed or what?!?"
return
} else {
puthelp "privmsg $c :$responce"
}
return 0
}