Leaderboard
Popular Content
Showing content with the highest reputation on 12/19/2017 in all areas
-
isArray
Earthshine and one other reacted to kaisies for a topic
The [$k] is there because you are looping through an array, and autoit needs to know what index of the array to evaluate. It doesn't "click all the arrays". You can't do that. You need to loop through each, determine if it is an array (pixelsearch found it), and then click it. That's the point of the For loop. Sounds like you need to learn about For loops next (which go hand in hand with arrays). I don't know what you mean by return that value of what was given after searched. 1 Refers to Element 1 of Array $cArr. In this case, the result of your First pixelsearch, or $cArr[1]. $cArr is the variable $cArr... which has 4 elements. So For 1 to (4-1), or 1 to 3. Nested arrays are difficult to understand, AND difficult to look at, TBH. It is a poor example of learning arrays / learning for loops. A basic array would suit learning that much better. In this context of a PixelSearch though, it is probably the most ideal use. Perhaps this may help #include <Array.au3> Local $a = PixelSearch(352,172,498, 251,0xED1C24,10) Local $a1 = PixelSearch(352,172,498, 251,0x880015,10) Local $a2 = PixelSearch(352,172,498, 251,0x231C24,10) Local $iTimesClicked Global $cArr[4] = [0, $a, $a1, $a2] For $k = 1 To UBound($cArr) - 1 MsgBox(0,'',"Looping through array indexes. Searching index: " & $k) If Not IsArray($cArr[$k]) Then ContinueLoop _ArrayDisplay($cArr[$k],"Displaying the nested array in index: " & $k) MouseClick("left",($cArr[$k])[0], ($cArr[$k])[1], 1, 10) Sleep(50) ;do something else here, Maybe increment a variable? $iTimesClicked += 1 Next Msgbox(0,'',"I found and Clicked " & $iTimesClicked & " Times!")2 points -
1 point
-
WinClose Not Closing Chrome
Earthshine reacted to Wannabe for a topic
I appreciate your assistance on this, Earthshine.1 point -
CodeCrypter - Encrypt your Script
Earthshine reacted to RTFC for a topic
Without a (minimum-sized!) reproducer script, there's no way anyone except you could possibly figure out what is wrong in your set-up.1 point -
for any reason the move work in #requireadmin ...1 point
-
WinClose Not Closing Chrome
Wannabe reacted to Earthshine for a topic
try the other link i referred to above. Junkew's UI Autmation stuff.1 point -
isArray
RoundChecker reacted to kaisies for a topic
$k = 1 Does not represent anything. It is initializing the variable $k with the value 1. In the context of looping through an array, it would start with index 1, or [1].1 point -
isArray
Earthshine reacted to kaisies for a topic
Close, but not quite. Global $cArr[4] = [0, $a, $a1, $a2] your Values, $a, $a1, and $a2 are in indexes 1, 2, and 3. Not 2, 3, 4 as you said. This is why the For loop needs to start at 1. UBound($cArr) returns 4. There are 4 elements. Subtract 1 to get 3. So now the For statement is: for $k = 1 to 3 A For loop doesn't return anything, it doesn't find anything. This For loop isn't evaluating your array. The 1 means it is literally starting at $cArr[1], which is the value of $a, NOT 0. A for loop in plain english is: Use this Variable ($k). Start it with this value (1), and then increment it (default is 1), until (to) this value (UBound($cArr)-1). It is essentially the same as a Do..Until Loop, but its incrementing the variable for you. $x = 1 Do ConsoleWrite($x & @CRLF) $x+=1 Until $x >= 4 For $x = 1 to 3 ConsoleWrite($x & @CRLF) Next1 point -
1 point
-
Helpful script small andquick
RoundChecker reacted to careca for a topic
Is the idea to build a tool to start saving information of the customers from now on? To have a simple tool that saves names and aditional info if needed and then you can retrieve a list of customers in the future? I did something like this in the past, a very small thing, only have to translate it, because it's in my language, i can then post here if you want to test.1 point -
ArraySearch with Exact match
Earthshine reacted to Julia_Muc for a topic
totally confused over here. i just mixed up the numbers. Normally i know that it's 0 &1 and not 1&2 as index of the Array. *facepalm* So Sorry for that, Problem (which apparently wasn't even one) solved1 point -
ArraySearch with Exact match
careca reacted to RoundChecker for a topic
Since you have 2 arrays in there you can just search them by their corresponding numbers, if you read the tutorial about arrays you should know that array starts with 0 to 1, if you want to display the exact array, which is the second one, if that's the question, then This is $testarray[0] P4.SitePage1.TarifLine3Minutes This is $testarray[1] P4.SitePage1.StandortTarifLine3 If you want it to find that just search for it like $i = _ArraySearch($testarray[1],'P4.SitePage1.StandortTarifLine3',0,0,0,3,1,1,False) I don't know why your method if doing that is this way but I use different method, if isArray($testarray[1]) then ;do something ;Do something EndIf Could also work if you are just looking for that exact array.1 point -
If i had to bet, i'd bet the regex had a problem, but i dont know regex so.. Scratch that, My test here resulted in 1. so Its correct. 1 is the P4.SitePage1.StandortTarifLine31 point
-
pxiel search or time
Earthshine reacted to Bert for a topic
Yes it is the worst way for a LOT of reasons. It is inherently UNSTABLE the slightest change to the GUI will break it. This includes window resizing, application update by the vendor and so forth anything that gets put in front of the window - oh look - script breaks. if the window isn't the active window - depending on how the script is written - broken. I can keep going. You should ALWAYS try first to hook directly into the control. I can only count on one hand the number of times where pixel searching was the only option in solving the problem when dealing with controls. I've been working with AutoIt since 2005 so I think I know what I'm talking about. Now if this is game automation - we ALL know that is a No, NO, NO WAY, NO! Just NO! in that being discussed in the forum. So, I will ask again: The name of the application please.1 point -
1 point
-
isArray
RoundChecker reacted to kaisies for a topic
If you put your loop/click inside a loop, with a return, that is the expected behavior. If you want it to click all elements of the array that exist as an array, there is no need for a function call. Local $a = PixelSearch(352,172,498, 251,0xED1C24,10) Local $a1 = PixelSearch(352,172,498, 251,0x880015,10) Local $a2 = PixelSearch(352,172,498, 251,0x231C24,10) Local $iTimesClicked Global $cArr[4] = [0, $a, $a1, $a2] For $k = 1 To UBound($cArr) - 1 If Not IsArray($cArr[$k]) Then ContinueLoop MouseClick("left",($cArr[$k])[0], ($cArr[$k])[1], 1, 10) Sleep(50) ;do something else here, Maybe increment a variable? $iTimesClicked += 1 Next Msgbox(0,'',"I found and Clicked " & $iTimesClicked & " Times!")1 point -
pxiel search or time
Earthshine reacted to Jos for a topic
Not sure I would agree there, but it is funny to see how many respond without the OP even responding to any of it. Also wondering whether you read the forum rules as the posted example is pretty much a game automation script without naming it. Your other posts are also it that direction. Jos1 point -
pxiel search or time
Earthshine reacted to Bert for a topic
What is the application you are working with? Also - why greater than 29 seconds? Pixel searching is the WORST way to automate. The slightest change in the GUI can break your script. It is extremely likely there is a script that already does what you are asking for.1 point -
isArray
RoundChecker reacted to Deye for a topic
Didn't expect that lol This should do : If $inum >= 1 Then Local $a = $cArr[$inum] MouseClick("left", $a[0], $a[1], 1, 10) EndIf1 point -
Syntax thoughts: If Then ElseIf
Earthshine reacted to Jos for a topic
It is pretty strait forward either use a single line If...Then statement or else you can use the multiline - If-ElseIf-Else option. Don't try to mix them. Jos1 point -
isArray
RoundChecker reacted to Deye for a topic
Start the array with just an 0 so its not included it in the search as a valid return Global $cArr[4] = [0, $a, $a1, $a2] Local $inum = _find() If $inum >= 1 Then MouseClick("left", $cArr[$inum][0], $cArr[$inum][1], 1, 10) Func _find() For $k = 1 To UBound($cArr) - 1 If Not IsArray($cArr[$k]) Then ContinueLoop Return $k Next Return 0 EndFunc ;==>_find1 point -
isArray
RoundChecker reacted to Deye for a topic
what about: $cK = False For $k = 0 To $iMax - 1 If Not IsArray($cArr[$k]) Then ContinueLoop $cK = True ExitLoop Next1 point -
Is it possible to let AU3 detect the APPCRASH error and and skip it?
Earthshine reacted to jchd for a topic
The solution is to fix the bogus DllCall so that your program doesn't crash.1 point -
GUID Brute Forcer
Earthshine reacted to Somerset for a topic
Necro-Poster, 7 almost 8 year old dead thread.1 point -
after created the automation scripts , having weird issues all the time.
Earthshine reacted to JLogan3o13 for a topic
Agree with Jos, @jmendonca automating Excel with mouseclicks is , there are far easier ways to do so in AutoIt. If you start with a clear and concise explanation of what application you're working in, and what you're trying to accomplish, and then work backward from there, you will probably receive a lot more help.1 point -
after created the automation scripts , having weird issues all the time.
Earthshine reacted to Jos for a topic
That is the magic you get when running scripts ....but seriously, what exactly did you expect when formulating the question as you did? Jos1 point -
after created the automation scripts , having weird issues all the time.
Earthshine reacted to JLogan3o13 for a topic
@jmendonca Asking folks to troubleshoot your scripts, with no more description than "a lot of weird behaviors" without actually posting your scripts, is generally not a great way to receive help. How about helping us help you and posting your code?1 point -
understanding usage of DirCopy and FileCopy
mrmacro reacted to 232showtime for a topic
Yes you need to include the full path for FileCopy. there are two different ways on including the full path. Example: $FPath = "C:\Users\user\Desktop" $File = "New Text Document.txt" If FileExists($FPath & "\" & $File) Then MsgBox(0, "", "File Found") Else MsgBox(0, "", "File not Found") EndIf If FileExists(@DesktopDir & "\" & $File) Then MsgBox(0, "", "File Found") Else MsgBox(0, "", "File not Found") EndIf1 point -
Forum Rules
edenwheeler reacted to Jon for a topic
We want the forum to be a pleasant place for everyone to discuss AutoIt scripting, and we also want to protect the reputation of AutoIt. So we ask you to respect these simple rules while you are here: Forum Posting 1. Do not ask for help with AutoIt scripts, post links to, or start discussion topics on the following subjects: Malware of any form - trojan, virus, keylogger, spam tool, "joke/spoof" script, etc. Bypassing of security measures - log-in and security dialogs, CAPTCHAs, anti-bot agents, software activation, etc. Automation of software/sites contrary to their EULA (see Reporting bullet below). Launching, automation or script interaction with games or game servers, regardless of the game. Running or injecting any code (in any form) intended to alter the original functionality of another process. Decompilation of AutoIt scripts or details of decompiler software. This list is non-exhaustive - the Moderating team reserve the right to close any thread that they feel is contrary to the ethos of the forum. 2. Do not post material that could be considered pornographic, violent or explicit - or express personal opinions that would not be acceptable in a civilized society. Do not post any copyrighted material unless the copyright is owned by you or by this site. 3. To protect this community, any files posted by you are subject to checks to ensure that they do not contain malware. This includes, but is not limited to, decompilation and reverse engineering. 4. Do not flame or insult other members - and just report the thread to a Moderator (see below) if you are so attacked. 5. Do not PM other users asking for support - that is why the forum exists, so post there instead. 6. Do not create multiple accounts - if you inadvertently created multiple accounts then contact a Moderator to close the unwanted ones. 7. Do not repost the same question if the previous thread has been locked - particularly if you merely reword the question to get around one of the prohibitions listed above. 8. Do not delete your posts, nor completely remove their content, if doing so will interrupt the flow of the thread. 9. Do not post in a thread while the Moderating team are actively trying to determine whether it is legal. The Moderation team will do their best to act in fair and reasonable manner. Sanctions will only be applied as a last resort and any action taken will be explained in the relevant thread. If moderation action is taken, you will need to acknowledge this through a dialog or you will be unable to post further in the forum. Please note that this dialog is not an agreement that the warning was justified - it is only there so that members are aware that moderation action has been taken and that they may have certain restrictions applied to their account. If you feel that you have been unfairly moderated then contact the Moderator concerned - using a PM or the "Report" button is preferable to opening a new thread (although new members may have to do this). But do be aware that the Moderation team has the final word - the rules are set out by the site owner and you are only welcome here if you respect his wishes. Signatures and Avatars There is no formal policy for the use of signatures but if a moderator thinks it is too big and/or distracting then you may be asked to tone it down. No-one likes wading through signatures that are a page high. Similarly for avatars, expect distracting flashing and animated gifs to be removed. Reporting If you feel a post needs Moderator attention, please use the "Report" button next to the post date at the top. You can then enter details of why you have reported the post - but there is no need to include the content of the post as that is done automatically. The Moderating team will be alerted to the post and will deal with it as soon as they can. If you suspect a EULA violation, do not expect the Moderating team to do all the work - please provide some evidence in the report such as a copy of (or link to) the EULA in question, as well as the section you believe has been violated. Finally, please do not enter into an argument with the original poster - that is why we have Moderators. Spam Please do not react to spam in any way other than reporting it. Multiple reports are combined by the forum software, so there is no need to announce that you have reported the spam - in fact doing so only increases the work for the Moderator who deals with it. Interacting with this website Anyone found abusing the website is subject to harsh punishment without warning. A non-exhaustive list of potential abuses include: Automated forum registration or login. Automated posting or sending messages on the forum. Automated manipulation of polls, user reputation or other forum features. Automated creation or comments on issue tracker tickets. Automated creation or editing of wiki pages. Other abuses which are either examples of excessive bandwidth usage or automation of the site. Use common sense. If you do not have common sense, don't do anything. Do not automate the forum, wiki or issue tracker in any way at all. Scripts which automatically update AutoIt such as AutoUpdateIt are acceptable as long as they are not abused and do not generate excessive bandwidth usage.1 point