Sign in to follow this  
Followers 0
thrlride

Need help with a loop please

3 posts in this topic

#1 ·  Posted (edited)

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

Share this post


Link to post
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]

Share this post


Link to post
Share on other sites

Thanks! I'll try that and report back if it works for me.

Share this post


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
Sign in to follow this  
Followers 0