Jump to content

wuschelbeutel

Active Members
  • Posts

    20
  • Joined

  • Last visited

wuschelbeutel's Achievements

Seeker

Seeker (1/7)

0

Reputation

  1. The 2D-array contains numbers and I want to find the index of the one element that is the highest value of all elements in the matrix. E.g., A 2D matrix with rows [1,2,5], [4,2,6] [8, 2, 4] I want to have index (2,0) returned because its value is 8
  2. I am familiar with this function but I dont know how it can help me get the max.
  3. MsgBox(0, 'Max Index String value', _ArrayMaxIndex($Matr)) MsgBox(0, 'Max String value', _ArrayMax($Matr)) don't work.
  4. I have hw1.xlsx open and I want to do the following: B12 and B13 contain integers (inputs) upon the rest of the spreadsheet depends on. The spreadsheet then computes a total in cell B14. Pressing F9 repeatedly will display slightly different totals in B14 (for any particular B12-B13 pair) as there are random numbers involved in the computation. I want to test out different integer combinations in B12 and B13 and read, say, 10 refreshes of the page (get an average) and the find the maximum total average value of B14 for each batch/tuple combination. After trying about +/-12 values for what was in B12 and +/-12 values for what was in B13, I want the B12-B13 values that gave the highest B14 value. Is this hard to do and what kind of AutoIt functions are key (parsing and entering values into cells)? The 10 replications for each tuple combination aren't that important, I can also just settle for one value.
  5. Thanks for the links, Are the registry edits really needed for includes that are in the same folder as the script you're running? I'd rather just dump it in the installation directory's Include folder then (and make a backup).
  6. Yes, I'm running the file from the Desktop and unfortunately backslash didn't work either. I also realized that those scripts have "include once" directives in them, so I tried including only the FindBMP.au3 (since it's dependent on ScreenCapture). Unfortunately, that didn't work either. These are the Scripts I'm using: I verified for potential Typos and didn't find any. I will now try #include <filename> while putting the files in C:Program FilesAutoIt3Include Edit: Works!
  7. #include <Array.au3> #include <ButtonConstants.au3> #include <EditConstants.au3> #include <GUIConstantsEx.au3> #include <StaticConstants.au3> #include <WindowsConstants.au3> ;~ #Include "../ScreenCapture/FindBMP.au3" ;~ #Include "../ScreenCapture/ScreenCaptureFixed.au3" #Include "ScreenCapture/FindBMP.au3" #Include "ScreenCapture/ScreenCaptureFixed.au3" Global $aResult = _FindBMP("SCREEN","TOP_LEFT.bmp") MsgBox(0, $aResult[2], $aResult[3]] I have that stuff in an Au3 that I saved on the desktop. On the desktop i have FindBMP.au3 and ScreenCaptureFixed.au3 saved and an image file TOP_LEFT.bmp. I also have a folder on the desktop called ScreenCapture and in it are FindBMP.au3 and ScreenCaptureFixed.au3. I also tried #Include "FindBMP.au3"
  8. 1. Lets say you want to invoke an AutiIT function but none of the parameters are required. However, you want to use the third optional parameter. What do you pass into the first two parameters to say that you want to keep the default for them? 2. Why would you use the AutiIt function Call instead of invoking a function directly? 3. How do you blow up each element of an array by a certain constant, without having to resort to a loop and explicitly (and tediously) adding it to each element. E.g., I want to do this: Const $q = 45 Global $xbuttomLeft[4] = [$q+2, $q+567, $q+353, $q+1029]
  9. ;Global $x[12] = 12 ints ;Global $y[12] = 12 ints ;Global $colors[12] = 12 6 digit strings that contain hex values Global $Form1 = GUICreate("Incrementer", 800, 600) Global $Button1 = GUICtrlCreateButton("Auto-Increment", 174, 184, 90, 25) Global $Input1 = GUICtrlCreateInput(0, 128, 24, 57, 21) Global $Input2 = GUICtrlCreateInput(0, 232, 24, 57, 21) ... Global $Input12 = GUICtrlCreateInput(0, 876, 24, 57, 21) GUICtrlCreateUpdown($Input1) GUICtrlCreateUpdown($Input2) ... GUICtrlCreateUpdown($Input12) GUISetState() While 1 $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE Exit Case $Button1 Call("autoincrement") EndSwitch WEnd and after that func autoincrement() For $i = 0 to 12 If Hex(PixelGetColor($x[$i], $y[$i]),6) = $colors[$i] Then GUICtrlSetData($Input & $i, GUICtrlRead($Input & $i) +1) EndIf Next EndFunc $Input: possibly used before declaration. [at the fourth-last line] Any ideas on how I can reference my ID's this way without receiving this error?
  10. thx. i kept looking at the wrong line because i doubleclicked on the error line and it highlighted the second @
  11. This is where it errors out (there is a lot of other code in this .au3): Local $file = FileOpen("dataset.txt", 1) If $file = -1 Then MsgBox(0, "Error", "Unable to open file.") Exit EndIf For $j = 0 to 8 Step +1 FileWrite($file, $Ratio[@j]) FileWrite($file, "" & @CRLF) Next FileClose($file) ; the array has 9 elements that are defined integers This is where it works: Local $file = FileOpen("test.txt", 1) If $file = -1 Then MsgBox(0, "Error", "Unable to open file.") Exit EndIf For $var2 = 0 to 200 Step +1 FileWrite($file, Random(0,1)) FileWrite($file, "" & @CRLF) Next FileClose($file) Any ideas on what could be wrong?
  12. My goal is to create a transparent Overlay HUD in AutoIt over an application (kind of like a filter). The only thing this HUD will contain (for the near future) is the integer contents of an array of size 10, each at a particular coordinate I define (hardcoded coordinates because I run the application in fullscreen in the same resolution always). So, ten numbers are spread out all over the screen - that's it. When I interact with the application I do not want the HUD to impair functionality. Since the HUD will always be in the foreground (visually) I do not want to click on some place in the app and the computer thinks I clicked on the HUD. I would appreciate help in the right direction (e.g., existing similar stuff or a key insight or which functions to use etc.).
×
×
  • Create New...