6 posts in this topic
My esteemed Autoits I need your help once again.
I'm trying to figure out how to create a loop that gets 1 value from an array and repeats until each value from the array has been used. I have never used arrays before and I know once I learn more things should get easier for me.
Here is what Im trying to do:
-Have an array of values that determine what application i log into. ex: app1, app2, app3, app4 etc.
-Have a loop that repeats a process sequentially using each value in the array to finish the process for each app1, app2, app 3 and so forth. I have 30 apps that I need to update on a regular basis and getting this sorted out is what I perceive to be the best way to do it.
Here is my feeble attempt that obviously fails:
local $array = ["10", "11", "12",etc etc]
;;Local $site = InputBox("ERx Site","What site do you want to login as?","","")
Local $userid = InputBox("ERx Login", "What is your username?", "", "")
Local $Passwd = InputBox("Security Check", "Enter your UAT password.", "", "*")
for $1 = 1 to 30(I need to do the same steps in 30 different apps)
Send (Sequential ARRAY VALUE HERE)
your help is greatly appreciated.
Thanks for your time
Hello i Have HP Bar in my game and it has 170px of width and then im gonna find start of this by mouse pos then i got $hpStart = 661 $hpStart = 230 , $hpEnd = 839
And there is from $hpStart = 661 the same color - 0xCB423B but depends of my points of hp for example on pixel $hpStart = 745 would be another color not 0xCB423B and then i will know my my character got 50% of health points.
I encountered problem here - for loop still looping to 839 and not founding this change in color for example on pixel $hpStart = 745
I would know actual $i counter and $hpEnd then only i can calculate current health percent value
Please help me how to achieve that! Thanks for any help
Func MouseCord() $MousePos = MouseGetPos() global $hpStart = $MousePos global $hpEnd = $hpStart $hpEnd = $hpEnd + 170 For $i = $hpStart To $hpEnd ; Looping from 661 to 839 $pixel = PixelGetColor($i,$hpStart) If $pixel <> 0xCB423B Then $hpNowPer = ( $hpEnd - $i ) / 170 $hpPoOdjeciu = 1 - $hpNowPer $hpNowPercent = Round($hpPoOdjeciu,2) ExitLoop ; - that not working EndIf Next EndFunc
is it possible to make a For Loop infinite,
ho do i make a for loop infinite??? using the script below
For $i = 0 To 10 Msgbox(64, "Succes", $i) Next
An IE link collection $oLinks is being looped by a $oLink with a for-in loop. An if statement is used such that when the $oLink.href matches a string reg. exp., it will do a set of statements. The set of statements is this:
$a = 1 do $matchpic = StringRegExp($oLink + $a.href, '(http://t2.imgchili.com/)(\d+)(\/)(\d+)(_)') $a += 1 until $matchpic = 1 But the error is that $a is not an object variable.
After a match has been found, this $oLink is _paused_ at the current position inside this collection (I believe). How do I loop at the current $oLink?
Here's a piece of code:
Global $Array = ["AA", "BB", "CC", "DD", "EE"] For $I = 2 To $Array ConsoleWrite('@@ Debug(' & @ScriptLineNumber & ') : $I = ' & $I & @crlf & '>Error code: ' & @error & @crlf) ;### Debug Console Next The results for this piece of code are very strange:
Is this a bug with the For code, in that it's acting somewhat like a For/Next loop, and somewhat like a For/In/Next loop? By the way, it doesn't matter what the first number in the loop is, I used 2 as an example, it will always output the same. It takes the number you started the loop at, and then the variable will hold the contents of the second through the last array elements.
On a 2D array, it still doesn't work as expected, but it works differently than how I'd expect it to.
Global $Array = [["AA", "1"], ["BB", 2], ["CC", 3], ["DD", 4],["EE", 5]] For $I = 10 To $Array ConsoleWrite('@@ Debug(' & @ScriptLineNumber & ') : $I = ' & $I & @crlf & '>Error code: ' & @error & @crlf) ;### Debug Console Next This outputs:
Which is 5 instances of $ being 10, which seems to be a quick way of looping through an array if you don't need to access the contents of the array.