Socket Help - 28/12/08 06:29 AM
I'm trying to retrieve all the info from the first page after I log in to my game (Torn City) but can't get it to authenticate. Any help would be appreciated.
EDIT - I removed my log in info and replaced with generic lol
Code:
on *:text:!sockupdate:#:{ sockopen bag www.torncity.com 80 } on *:SOCKOPEN:bag:{ var %string = player=player&password=pass sockwrite -n $sockname POST /authenticate.php HTTP/1.1 sockwrite -n $sockname Host: www.torncity.com sockwrite -n $sockname Referer: www.torncity.com/index.php sockwrite -n $sockname Content-Length: $len(%string) sockwrite -n $sockname Content-Type: application/x-www-form-urlencoded sockwrite -n $sockname Cookie: SERVERID=ww11; PHPSESSID=ubltva7cjuove678ogf5ljcif2; sockwrite -n $sockname $crlf %string } on 1:sockread:bag:{ if ($sockerr > 0) return :nextread sockread %temp if ($sockbr == 0) return if (%temp == $null) %temp = - if (* iswm %temp) { echo -a - msg #ci $htmlfree(%temp) goto nextread } } alias -l htmlfree { var %x, %i = $regsub($1-,/(^[^<]*>|<[^>]*>|<[^>]*$)/g,$null,%x), %x = $remove(%x, ) return %x } alias urlencode { var %a = $regsubex($$1,/([^\w\s])/Sg,$+(%,$base($asc(\t),10,16,2))) return $replace(%a,$chr(32),$chr(43)) }
EDIT - I removed my log in info and replaced with generic lol