Jump to content

Automating a text-based game(Help)


Recommended Posts

Hi, Recently i have been playing a Tribalwars, that is a Norwegian version of Travian.

Now i want to have a script that login to tribalwars.no and upgrade the houses.

I just want a script that allows me to login and choose what url it shall go to after that.

Like: at 16:00 the browser would go to "http://no1.tribalwars.no/game.php?village=18616&screen=main&action=build&id=barracks&h=3ae7" then wait some seconds and wait for the next task.

Login Code:

#include <IE.au3>

$username = "mylogin"
$password = "mypassword"



$oIE = _IECreate ("www.tribalwars.no", 0, 0, 1)

; get pointers to the login form and username, password ,signin fields and worldname
$o_form = _IEFormGetObjByName ($oIE, "f1")
$o_login = _IEFormElementGetObjByName ($o_form, "user")
$o_password = _IEFormElementGetObjByName ($o_form, "password")
$o_signin = _IEFormElementGetObjByName ($o_form, "submit")

;Then it need to select what world i want to login to, what would be value "no1" or text "Verden 1"


; Set field values and submit the form
_IEFormElementSetValue ($o_login, $username)
_IEFormElementSetValue ($o_password, $password)
_IEAction ($o_signin, "submit")

Can any one help me?

Edited by Chris86
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...