Jump to content

Need help with firefox automation


 Share

Recommended Posts

(I use the firefox add-on that is on this page )

I want to use firefox to automatically login into Tribalwars, Go to my village, selct barracks and then click on create max units

But i cant find an way to click on it!

My script now looks like this: (I use the Dutch Tribalwars)

#include <FF.au3>
 dim $Socket = _FFstart("http://www.tribalwars.nl/","default" ,2)
 _FFOpenUrl ($socket,"http://nl5.tribalwars.nl/login.php?user=*****&password=***********************")
 _FFOpenUrl ($socket,"http://nl5.tribalwars.nl/game.php?village=2473&screen=overview&")
 _FFOpenUrl ($socket,"http://nl5.tribalwars.nl/game.php?village=2473&screen=barracks")
 _FFClickLink ($socket,"java script:insertUnit(gid('sword'),125); tut();" )
  Exit

Because it is impossibel that the last FFclicklink is always different i want to use a wildcard in the string.

So instead of the 125 there has to be a wildcard that it still selects it.

I am not English... But that matters nothing, I'm Dutch and i SPEAK English so it doesnt matter :P

Link to comment
Share on other sites

(I use the firefox add-on that is on this page )

Very interesting. It appears Mozlab-Current.xpi is an XUL plug in for Firefox that accepts TCP connections on a local port through which string commands can be passed. Neat idea, but I hate to think what the security implications are... ;)

I want to use firefox to automatically login...

#include <FF.au3>
 dim $Socket = _FFstart("http://www.tribalwars.nl/","default" ,2)
 _FFOpenUrl ($socket,"http://nl5.tribalwars.nl/login.php?user=*****&password=***********************")
 _FFOpenUrl ($socket,"http://nl5.tribalwars.nl/game.php?village=2473&screen=overview&")
 _FFOpenUrl ($socket,"http://nl5.tribalwars.nl/game.php?village=2473&screen=barracks")
 _FFClickLink ($socket,"java script:insertUnit(gid('sword'),125); tut();" )
  Exit

Because it is impossibel that the last FFclicklink is always different i want to use a wildcard in the string.

So instead of the 125 there has to be a wildcard that it still selects it.

The use of _FFClickLink() looks wrong. The default specification (since you didn't give one) is "href" to specify the link. What you have there is some Java script. Is that exact Java string really inside the href code of link you are clicking on?

The _FFClickLink() function inside FF.au3 calls the _FFSetGet() with a RegExp that is passed to an internal javascript call FF__SearchImageLink(). You should be able to play with just the _FFSetGet() and your link text until it returns a valid index, then use that text for your _FFClickLink() call.

...at leas, as far as I can tell...

:P

Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law
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...