Hello guys!
I want to create a simple script which will show me how much resources or soldiers I have on my game acount.
Game's name is Travian.
I have already tried to do it for several hours but it seems impossible for me. (I know how GET or POST works but I can't figure out how to do it. I watched many tuts but it didn't help me too).
This is what I have:
Login page: [Only registered and activated users can see links. Click Here To Register...]
name: ssamko
password: autoit123
I want only script which will get data like amount of wood, gold or something like that+ finally I will learn how to do it (I play with autoit for about a year...but HTTP requests are my death )
I would be very thankful for help !
I want to create a simple script which will show me how much resources or soldiers I have on my game acount.
Game's name is Travian.
I have already tried to do it for several hours but it seems impossible for me. (I know how GET or POST works but I can't figure out how to do it. I watched many tuts but it didn't help me too).
This is what I have:
Code:
#include <WinHttp.au3>
#include <Array.au3>
#include <String.au3>
Global $user="ssamko"
Global $pass="autoit123"
Local $url= BinaryToString(InetRead( "http://ts5.travian.sk/?lang=sk" ))
$token=_StringBetween($url,'name="login" value="','"')
$token=$token[0]
$login_url="http://ts5.travian.sk/login.php"
$login= ObjCreate("WinHttp.WinHttpRequest.5.1")
$login_packet="name=ssamko&password=autoit123&s1=Login&w=1920%3A1080&login="&$token&"&lowRes=0"
$login.open("POST", $login_url)
$login.SetRequestHeader("Content-Type", "application/x-www-form-urlencoded")
$login.send($login_packet)
$login.WaitForResponse()
$cookies = $login.getresponseheader("Set-Cookie")
ConsoleWrite($cookies&@CRLF&@CRLF)
name: ssamko
password: autoit123
I want only script which will get data like amount of wood, gold or something like that+ finally I will learn how to do it (I play with autoit for about a year...but HTTP requests are my death )
I would be very thankful for help !