
tester123
Active Members-
Posts
33 -
Joined
-
Last visited
tester123's Achievements

Seeker (1/7)
0
Reputation
-
Thank you both! At the moment, i can only use components built in to the released version. But thanks anyway!
-
This is a rather simple question, I would like to exclude certain files when I use _FileListToArray Local $fileList = _FileListToArray(@scriptdir, "*.au3") ;List of all AutoIT files to execute The above code fetches all au3 files, but I would like to exclude 2 specific files. It would be a hassle to use ArraySearch and ArrayDelete, so is there a way I could directly specify the exclusion in the filter criteria itself? Something like Local $fileList = _FileListToArray(@scriptdir, "*.au3|^"Utilities.au3";^"Helper.au3"") ;exclude Utilities.au3 and Helper.au3 Thank You!
-
How to put wildcard characters in a string?
tester123 replied to Kidney's topic in AutoIt General Help and Support
Func FindSeasonEpisode($FileName) $result = StringRegExp ($FileName, "S\d\dE\d\d",0); ConsoleWrite($result & @CRLF) EndFunc Try this for For S01E13 d accepts any digit. The helpfile has a detailed list of options you could use -
Time & Memory Usage of a Function
tester123 replied to tester123's topic in AutoIt General Help and Support
Thank you both for your replies! To elaborate a bit on what I'm trying to do - I have a calculator like function which has several inputs. I would like to determine the time taken from the time the user hits "Calculate" till the results show up on the screen and also compute the memory used. I dont have access to the actual function itself which does the computation, so it is just a black-box to me. Since entering all the different inputs could take time, stats of the entire process wouldn't serve the purpose. @kylomas, Yes, I should probably read up more on memory management from the other threads - i'll update this post if I find something suitable @JLogan, The reason for not using two scripts is I should trigger the second script when the first script hits the calculate button and stop it when the first scripts shows up the results - Do you still feel that it would give more accurate results in this scenario? Thank You!! -
1. WinWaitActive("Administrator: C:\Windows\System32\cmd.exe", "", 15) 2. Send('cd C:/' & "{ENTER}") 3. Sleep(300) 4. send('mvn clean install > ' & $logFile & "{ENTER}") 5. Sleep(100) 6.Do 7.Sleep (100) 8.Until 9.<<Add something unique to your process>> Could be ControlCommand + isVisible/isEnabled
-
Hi All, I'm trying to calculate the time and memory usage of a particular function in the process. Would like to see if there is a better way or if this is reliable enough. Other threads are specific to memory usage of the entire process, so i'm a lil confused. Local $mem = ProcessGetStats() Local $startTime = TimerInit(); ControlClick ( "<<className>>","","CALCULATE" ) ;Hit the CALCULATE button Sleep (250) Do Sleep(250) Until ControlCommand ("<<className>>", "", "CALCULATE", "isEnabled"); The button is disabled till all the results show up on the screen Local $endTime = TimerDiff($startTime);Time taken by the function Local $mem2 = ProcessGetStats() ConsoleWrite ($endTime) ConsoleWrite ($mem2[0] - $mem[0]);Diff between the stats retrieved before and after the function was called Thank You!
-
Hey thank you very much for taking the time to write down code! *Like* Unfortunately, it takes a whole lotta time even with step included and like you mentioned it wasnt being accurate I guess I'll just have to use the Pixel Search approach with the entire window. *sigh*
-
tester123 reacted to a post in a topic: Text Color
-
Thanks FF, but looping with a PixelGetColor also returns 0 - perhaps, i'm doing something terribly wrong with that function. But I'm curious as to why PixelSearch is not working in this case: I'm trying to debug - Here's what ControlGetPos returns $array[0] = X position $array[1] = Y position $array[2] = Width $array[3] = Height PixelSearch ( left, top, right, bottom, color [, shade-variation [, step [, hwnd]]] ) $txtPos = ControlGetPos ( "<title>", "", $object ) <<Value returned is X:357, Y:535, Width: 115, Height:22 >> $searchPix = PixelSearch ($txtPos[0] , $txtPos[1] , $txtPos[2] , $txtPos[3], $color, 10) incorrect? <<Not able to find color>> (AutoIT formatted code in the first post) I tried with Opt("PixelCoordMode", 0) 1 and 2 - No difference.. I substituted with some random values which would cover the entire screen $searchPix = PixelSearch (0 , 0 , 100 , 900, $color, 10) This works fine and apparently the color was found at the position 80, 747 which for some reason is way off from where $txtPos location is. MsgBox(0, "X and Y are:", $searchPix[0] & "," & $searchPix[1]) --> 80, 747 80,747 and 357,535,115,22 - > Am I missing something? Any suggestions?
-
Thanks FireFox, I forgot to mention earlier that PixelGetColor returns 0 and thats why I used the Pixel Search approach. I tried the method in the link and that returns 0 as well. Any suggestions as to why the above code breaks?
-
Hi All, I have some static text fields and I would like to check their color. I tried this approach, but there seems to be a loop-hole somewhere. Works for white but not for the color amber Any tips on how I could improve this? I was hoping to use PixelGetColor, but it didn't work for this use case. $object ="Static1" $color = 0xFFB400 ;Color retrieved using the spy tool $txtPos = ControlGetPos ( "<title>", "", $object ) if not @error = 1 then $searchPix = PixelSearch ($txtPos[0] , $txtPos[1] , $txtPos[2] , $txtPos[3], $color, 10) ;10 shades tolerance if @error = 1 Then ;Hex($color) & " not present in the object " & $object & " - " return false; Else return true; EndIf Else ;Unable to find object: " & $object endif Appreciate your time!
-
Graceful exit of Autoit scripts
tester123 replied to tester123's topic in AutoIt General Help and Support
Kylomas, Thats exactly one of the two options I was looking for! Thank You. -
Graceful exit of Autoit scripts
tester123 replied to tester123's topic in AutoIt General Help and Support
Hey FireFox, Thank you for your reply! Yeah, thats one possibility, but each script has 100s of code with numerous functions and to check each one could be time consuming. But well, if there is no other option then I was hoping for a more global option that can be set. (like WinWaitDelay). Btw, I was wondering why does the script freeze when it is unable to perform an operation - say if a button is not present and the script tries to click it. Can it throw an exception saying "hey no button found". Any ideas as to making a global change? -
Hi, I'm not sure if this comes under "exception handling" but results when I searched for exception handling were a whole lot different, so i thought I'll start a new thread. I have 50+ scripts and I would like to run them in sequence. Lets assume I use a shell script to run them. Assuming script 25 fails. (By fail, i mean a condition where some control has changed and the script cannot find a certain element and so the script just gets stuck), how do I get script 25 to gracefully exit and let script 26 run? Or as an alternative, can i have a global time out which tells AutoIt,wait for a maximum of 2 minutes before giving up? Any help is much appreciated!
-
Am i screwed with windows 8 ?
tester123 replied to tonycst's topic in AutoIt General Help and Support
I've used AutoIt script on Microsoft's Surface Pro tablet running on Windows 8 and on Panasonic's roughbook (touchbook) on Windows 8. Thankfully, both work fine for me