Jump to content

Need help with a loop please


thrlride
 Share

Recommended Posts

I'm sure this has been covered in many posts on the forum but I'm terrible at searching and finding what I need.

What I'm trying to do is simply run my script a set amount of times.

My code is below.

Run("C:\Program Files (x86)\Mozilla Firefox\firefox.exe http://www.dragonmastersworld.com/building/attempt_buy?building_id=1001&quantity=15")
$hFF = WinGetHandle('[CLASS:MozillaUIWindowClass]')
WinWaitActive('[CLASS:MozillaUIWindowClass]')
sleep(2000)
ControlSend($hFF, '', '', '^{F4}')

Can someone please instruct me or edit my script to show me how to loop it 10 times?

Thank you so much for your help!

Edited by thrlride
Link to comment
Share on other sites

How about this

$times = 10
For $i = 1 to $times
    Run("C:\Program Files (x86)\Mozilla Firefox\firefox.exe http://www.dragonmastersworld.com/building/attempt_buy?building_id=1001&quantity=15")
    $hFF = WinGetHandle('[CLASS:MozillaUIWindowClass]')
    WinWaitActive('[CLASS:MozillaUIWindowClass]')
    sleep(2000)
    ControlSend($hFF, '', '', '^{F4}')
Next
[font="Palatino Linotype"][size="2"]*** The information contained in this post should be considered and certified WORKS ON MY MACHINE ***[/size][/font][font="Palatino Linotype"][size="2"] [/size][/font]
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...