Jump to content
Sign in to follow this  
jimmer

Looping Problem!

Recommended Posts

This works fine... except, I want the First action to be performed at least out of 50 times

While 1
$Loop = 1
;First action
Send("{ALT}")
Send("{UP 150}")
Send("{DOWN down}")
Sleep(1500)
Send("{DOWN up}")

;Second action
$RepeatWhile = 0 
While $RepeatWhile <= 1
$coord = PixelSearch(108,439,279,439,0xFFEEDD) 
if NOT @error then 
Send("{D}")
endif 
$RepeatWhile = $RepeatWhile + 1 
Sleep(1000) 

WEnd
WEnd

I tried this, but I come up with an error...

While 1
For $Loop = 1 To 2
If $Loop = 1 Then
Send("{ALT}")
Send("{UP 150}")
Send("{DOWN down}")
Sleep(1500)
Send("{DOWN up}")

$RepeatWhile = 0 
While $RepeatWhile <= 1
$coord = PixelSearch(108,439,279,439,0xFFEEDD) 
if NOT @error then 
Send("{D}")
endif 
$RepeatWhile = $RepeatWhile + 1 
Sleep(1000) 

WEnd
Next
WEnd
Edited by jimmer

Share this post


Link to post
Share on other sites

While 1
For $Loop = 1 To 2
If $Loop = 1 Then
Send("{ALT}")
Send("{UP 150}")
Send("{DOWN down}")
Sleep(1500)
Send("{DOWN up}")
endif
;  this endif should work

$RepeatWhile = 0
While $RepeatWhile <= 1
$coord = PixelSearch(108,439,279,439,0xFFEEDD)
if NOT @error then
Send("{D}")
endif
$RepeatWhile = $RepeatWhile + 1
Sleep(1000)

WEnd
Next
WEnd

this should run but do you want the first part to run every other time?

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  

  • Recently Browsing   0 members

    No registered users viewing this page.

×
×
  • Create New...