I got the socket to read using this code:
alias xile {
if ($sock(xile)) sockclose xile
sockopen xile xilero.net 80
}
on *:sockopen:xile:{
sockwrite -n $sockname GET /home.php HTTP/1.1
sockwrite -n $sockname Host: xilero.net $+ $crlf $+ $crlf
}
ON *:sockread:xile:{
if ($sockerr) {
echo -s SockError $sockname $sockerr
return
}
var %t
sockread %t
echo -s > %t
if (*XiLeRO Login:*Online* iswm %t) {
echo 3 -s XileRO Login: Online
}
elseif (*XiLeRO Login:*Offline* iswm %t) {
echo 4 -s XileRO Login: Offline
}
elseif (*XiLeRO Char:*Online* iswm %t) {
echo 3 -s XileRO Char: Online
}
elseif (*XiLeRO Char:*Offline* iswm %t) {
echo 4 -s XileRO Char: Offline
}
elseif (*XiLeRO Map:*Online* iswm %t) {
echo 3 -s XileRO Map: Online
}
elseif (*XiLeRO Map:*Offline* iswm %t) {
echo 4 -s XileRO Map: Offline
}
}
It catches two of the online/offline lines, but for some reason, the socket is getting strange data in the middle of one line which is disrupting the third catch.
When I open the webpage in a browser and view the source, I get this bit of code:
<table><tr><td><span style="color: black" >XiLeRO Login:</span></td><td><span style="color: green ; font-weight: 700" ><b>Online</b></span>
</td></tr><tr><td><span style="color: black" >XiLeRO Char:</span></td><td><span style="color: green ; font-weight: 700" ><b>Online</b></span>
</td></tr><tr><td><span style="color: black" >XiLeRO Map:</span></td><td><span style="color: green ; font-weight: 700" ><b>Online</b></span>
But when I view the exact same page with the mIRC socket, I get this code:
<table><tr><td><span style="color: black" >XiLeRO Login:</span></td><td><span style="color: green ; font-weight: 700" ><b>Online</b></span>
</td></tr><tr><td><span style="color: black" >XiLeRO Char:</span></td><td><s
54
pan style="color: green ; font-weight: 700" ><b>Online</b></span>
</td></tr><tr><td>
5e3
<span style="color: black" >XiLeRO Map:</span></td><td><span style="color: green ; font-weight: 700" ><b>Online</b></span>
I have absolutely no idea where the "54" and "5e3" and extra carriage returns are coming from. If anyone knows, please share with the rest of the class. ;P
-genius_at_work