Jump to content

Stopping Loop And Identifying A Varaiable


Recommended Posts

Guest summit492

How do I manually stop loop, and probly use If Then in this script. But I haven't figured out how to identify text from a website. Window Spy won't or I can't figure it out.

Hopfully I'm explaining this correctly, been working on this for more than a week.

HotKeySet("^3","game")
While 1
    Sleep(50)
Wend

:setup
Func game()
run("C:\Program Files\Internet Explorer\IEXPLORE.EXE http://game.com")
Sleep(5000)
MouseClick ( "left" , 160, 550 , 1 , 10 )
Sleep(5000)

;search
While 2
MouseClick ( "left" , 50, 475 , 1 , 10 )
Sleep(5000)
MouseClick ( "left" , 50, 475 , 1 , 10 )
Sleep(5000)
MouseClick ( "left" , 50, 475 , 1 , 10 )
Sleep(5000)
WEnd

;If  Then

MouseClick("left", 80, 335, 1, 5)
EndFunc
Link to post
Share on other sites

just an example of a user function:

ex:

while 1
x=getinfo()
if $x="bob" then exitloop
sleep(10)
wend

func getinfo()
if winactive("HiddenSoft") then $x="bob"
return $x
endfunc

sorry that could have been confusing.

I use dosomething() most of the time. :D

AutoIt3, the MACGYVER Pocket Knife for computers.

Link to post
Share on other sites

on a side thought, most of your script is in a function, so to exit that, use return, not exitloop

Since when you click on the stuff in Hasbro's website, the title of the webpage changes, you could use that to triger your next move.

Also this would be very computer specific, as the desktop size, the size of the browser's font, and the window size can throw off mouse coords, as well as them changing the page itself, but good luck. It is always a learning experience....

you can also use the hotkey to step through things, such as:

hotkeyset("^3","nextone")
$x=0
while $x=0
sleep(10)
wend

run("C:\Program Files\Internet Explorer\IEXPLORE.EXE http://game.com")
Sleep(5000)

while winexists("Hasbro")
MouseClick ( "left" , 160, 550 , 1 , 10 )
sleep(500)
wend

Sleep(5000)

;search
While 2
MouseClick ( "left" , 50, 475 , 1 , 10 )
Sleep(5000)
MouseClick ( "left" , 50, 475 , 1 , 10 )
Sleep(5000)
MouseClick ( "left" , 50, 475 , 1 , 10 )
Sleep(5000)
if winexists("my game") or $x>1 then exitloop;  you can hit ^3 again to bypass
WEnd

;If  Then

MouseClick("left", 80, 335, 1, 5)

func nextone()
$x=$x+1
endfunc

Not tested, but might give you a diferent view.

AutoIt3, the MACGYVER Pocket Knife for computers.

Link to post
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
  • Recently Browsing   0 members

    No registered users viewing this page.

×
×
  • Create New...