jimmer Posted January 17, 2005 Posted January 17, 2005 (edited) 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 January 17, 2005 by jimmer
normeus Posted January 17, 2005 Posted January 17, 2005 the first if needs an endif: If $Loop = 1 Then do you want the first section to run once every fifty? http://www.autoitscript.com/autoit3/scite/...iTe4AutoIt3.exe
normeus Posted January 17, 2005 Posted January 17, 2005 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? http://www.autoitscript.com/autoit3/scite/...iTe4AutoIt3.exe
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now