Socket trouble - 22/11/14 01:47 PM
Hi, I'm trying to make a socket script around this page
http://www.mtggoldfish.com/player/Player_Name_Here
(For example http://www.mtggoldfish.com/player/smdster)
Eventually, what I'm trying to do is this: someone types "!lookup smdster" and the bot returns with "The last 3 Standard decks played by smdster are RG, RG, RG"
But before going that far I'm just trying to paste all the page's source code info into a window, but this shows up in the mIRC window
What am I doing wrong? :<
This is the script
http://www.mtggoldfish.com/player/Player_Name_Here
(For example http://www.mtggoldfish.com/player/smdster)
Eventually, what I'm trying to do is this: someone types "!lookup smdster" and the bot returns with "The last 3 Standard decks played by smdster are RG, RG, RG"
But before going that far I'm just trying to paste all the page's source code info into a window, but this shows up in the mIRC window
Code:
<p>The requested URL <code>/player/smdster</code> was not found on this server. <ins>That’s all we know.</ins>
What am I doing wrong? :<
This is the script
Code:
on *:text:!lookup*:#:{ set %player $2- set %channel # lookup } alias lookup { sockclose lookup sockopen lookup mtggoldfish.com 80 } on *:sockopen:lookup:{ if ($sockerr) { sockclose $sockname | halt } sockwrite -n $sockname GET /player/ $+ %player HTTP/1.1 sockwrite -n $sockname Host: www.mtggoldfish.com sockwrite -n $sockname $crlf } on *:sockread:lookup: { window -deC @ $+ $sockname -1 -1 700 700 var %read sockread -f %read aline -p @ $+ $sockname : $+ %read } on *:sockclose:lookup:{ unset %channel unset %player }