The following code doesn't work. Anyone know why? I can't for the life of me figure out what I'm doing wrong.
Alias RpgGet {
sockopen IdleRPGCheck www.idlerpg.eu 80
/window -e @RPGTest1
}
on 1:sockopen:IdleRPGCheck: {
sockwrite -nt IdleRPGCheck GET /players.php
if $error != $null {
echo Error! $error
sockclose *
}
}
on *:sockread:IdleRPGCheck: {
sockread %RPG.temp
if ($sockbr == 0) { goto End }
if (%RPG.temp == $null) %RPG.temp = -
if ($sockbr > 930) %RPG.Temp = $left(%RPG.temp, 930)
echo @RPGTest1 %RPG.Temp
}
www.idlerpg.eu exists and works fine with my browser.
www.idlerpg.eu/players.php exists and works fine with my browser. For whatever reason, when I try and read the website using Mirc's sockets I get this.
<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
<html><head>
<title>404 Not Found</title>
</head><body>
<h1>Not Found</h1>
<p>The requested URL /players.php was not found on this server.</p>
<hr>
<address>Apache Server at server.reusitii.com Port 80</address>
</body></html>
Any help? Please??
Edit: Can't type.
Edit 2: Got it working. I'm just a newbie.
Alias RpgGet {
sockopen IdleRPGCheck idlerpg.eu 80
window -e @RPGTest1
}
;-----------------------Read Player List
on 1:sockopen:IdleRPGCheck: {
;/echo -a Opened Socket
sockwrite -n IdleRPGCheck GET /players.php HTTP/1.1
sockwrite -n $sockname Host: www.idlerpg.eu $+ $crlf $+ $crlf
if $error != $null {
/echo Error! $sockerr
/sockclose *
}
}
on *:sockread:IdleRPGCheck: {
sockread %RPG.temp
if ($sockbr == 0) { goto End }
if (%RPG.temp == $null) %RPG.temp = -
if ($sockbr > 930) %RPG.temp = $left(%RPG.temp, 930)
echo @RPGTest1 %Rpg.Temp
}