Jump to content

MaximusCZ

Active Members
  • Posts

    73
  • Joined

  • Last visited

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

MaximusCZ's Achievements

Wayfarer

Wayfarer (2/7)

5

Reputation

  1. Oh my god, now that wouldn't occur to me in a long while, that must be it. Funny how at least one, search term or array element, must be Number, but not both. Ah, then I guess it's just not consistent with other functions that default to -1, but I am okay with that. Thank you both! Edit: Yes, specifying the $time to Number($time) started returning search results OK!
  2. Can someone explain why is the 96 not found? Says Error code 2, which is value outside of array min/max, but clearly is not. Column 0 is sorted, ideally I want to ignore all other columns, but the default values for optional parameters for _ArrayBinarySearch is 0. I think this should be "-1", because I dont want to search every column when specifying 0 in $iColumn. I want to ONLY search column 0, but I guess setting Column 0 just makes it search every column instead?
  3. Because it isnt 2D array, but an array of arrays. just $var[$i][$o] doesnt work here Works perfectly, thanks!
  4. I read a file into array of arrays Local $programFileArray _FileReadToArray($programFile, $programFileArray, "2", ',') Because its array of arrays, I read it like Dim $pointsToAdjust[0] For $i = 0 To UBound($programFileArray)-1 If UBound($programFileArray[$i]) < 5 Then ContinueLoop ;I dont care lines with less than 5 elements If (StringInStr(($programFileArray[$i])[0], $pointName & " : POINT")) == 0 Then ContinueLoop ;not the line we look for Else _ArrayAdd($pointsToAdjust, $i) ;Add the index of an element to the list to remember ExitLoop EndIf Next Now I wanna edit the array so I can call "_FileWriteFromArray" later with my modified data. I check the value I wanna edit: For $point in $pointsToAdjust $testprogramFileArray = $programFileArray ;So the changes here dont affect next iteration ConsoleWrite('@@ Debug(' & @ScriptLineNumber & ') : ($testprogramFileArray[$point])[7] = ' & ($testprogramFileArray[$point])[7] + 2 & @CRLF & '>Error code: ' & @error & @CRLF) ;### Debug Console <<-- This reads value and adds 2 to it correctly in console output ($testprogramFileArray[$point])[7] = ($testprogramFileArray[$point])[7] + 2 ;<<-- This fails Next It fails with "C:\__work\AutoitSkripts\__PointMouse_fastSim.au3"(1357,78) : error: Statement cannot be just an expression. ($testprogramFileArray[$point])[7] = ($testprogramFileArray[$point])[7] + 2 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^ C:\__work\AutoitSkripts\__PointMouse_fastSim.au3 - 1 error(s), 0 warning(s) Why exactly? The value inside I can read, why cant I assign it a new value? (The +2 is just illustrative) How would I go about updating that value so I can _FileWriteFromArray Later? Thanks for any help
  5. Sure thing! I am reading files containing movement/application programs for atomotive industrial paintshop robots. Each file consists of points and triggers. Points for actual robot movement, and triggers for events like opening/closing the main needle (GunOn/Off), changing application parameters (flow amount of color/air etc) and possibly much more. In this case the IFs are for panel repairs, making the robot paint only the areas that are marked by the factory to be repainted, hence the GunOn/Off events in IFs. The problem I am facing is that if those conditions are made the easy way, theres a high chance a robot will encounter two GunOns in a row (without GunOff in between), and for some stupid reason this raises an alarm. So every condition must be carefully crafted to only trigger precisely as needed, making sure that all condition states from before are considered. Its clunky, its unintuitive, but its reality. I am writing a macro capable of reading these programs, simulating "going trough" the program in sequence for all possible combinations of variables (usually less than 5 in a single module), and making sure such things cant happen. No need to worry, I am not writing a game bot, I am aware of the rules Thanks for taking care of AutoIt and its users so consistently over the years, its really helping. Also 69th comment, nice..
  6. Absolutely amazing, thanks! Had no idea about Execute and Assign function existing at all , now it make sense why you made them Bold in your original post
  7. Already have 1. and 2. finished. I am not sure I follow the rest? Currently I store the vars in an array (KV, MH..), do I just do a pass on the array adding "$" in front of every element? How am I supposed to simulate the boolean logic on the whole statement?
  8. I am not really looking for efficient way to do it, as I said I think bruteforcing is completely acceptable approach here. I just do a pass on the file for each combination of inputs. The issue I have is "how" to parse and store the data in codeblock, so that it can then simulate executing the IF properly.
  9. Hi. I have a file that contains boolean expressions: ... IF  ((KV = TRUE) AND (MH = FALSE)) OR (TV = TRUE) THEN     GUN(GUN1, GunOn, PT5, TR5)   END_IF  ... I would like to read the file, parse those imporant bits, and save those in some data structure that allows me to "simulate a run" trough that file with all combinations of variables. I have trouble comming up with an idea on how to save the data in a way I can than use later. How do I model my data structure so that I can then assign "random" values(true/false) to vars (KV, MH..), and see if, given those variable values, the IF condition is satisfied or not (so whether Gun line gets read given set of variables). Theres gonna be max 10 IFs per file, and the maximum amount of variables is about 10, so bruteforcing seems like the easiest way (I will just try all combinations one after another) for simulation. But how do I code up the "solver" of these regular expressions?
  10. It would be splendid if OP included some screenshots
  11. @junkew Yes, I tried MSAA (not even sure what that is). The other option resulted in target program crashing often. Not sure how to handle WM_GETOBJECT, I dont understand the parameters I should pass. @jugador It works as long as my mouse is actually on the button. Once its not on the button, the button only flickers as if hovered on for the duration of the click (not visible in your script, but visible with "Sleep(100)" added inbetween LBUTTONDOWN and LBUTTONUP. Your script should work elsewhere, its just my application thats special. @Zedna I am not sure I am using Winspector correctly? I open it up along with my target program, drag the crosshair over control of interest and it shows me the control in tree, Thats where my luck ends: When I select "Watch this window class", it asks me what to look for (I select all), and nothing happens. When I open "Messages", the window is always empty. When I open "Properties", it shows properties of window (and clicking refresh works, so dragging the window and pressing refresh updates its position in Properties) but Messages is still empty. I made sure its unpaused. Ran winspector as administrator.
  12. @junkew Sadly the buttonCount variable is empty after calling the DLL. I added $TB_BUTTONCOUNT value of 0x0418 to WindowsConstants.au3. Isnt the GETITEMRECT basically the same way all those spy tools getting their own data about controls? Also since the buttons were not really visible until now, I have a bad feeling those buttons might be custom coded instead of using stubs like "toolbar" windows would expect.. @ad777 Works to the same effect as my gif in very first post. The button is showing itself being hovered over for 100ms and then not for another 100ms. Moving my mouse over it makes it click as needed, but once the mouse leaves the button, it goes back to the hovering effect. @Danyfirex While giving you the installation package would probably be fine, the app needs a hardware bound licencekey and backup of data to load correctly, for which I could get into big trouble if shared. The closest I can get you to it would be remote desktop - is teamviewer ok?
  13. Fiddled a bit with Deviare Managed to catch an event when clicking on two buttons marked in red. Left and Right button in red are mutually exclusive - selecting one deselects the other. Left button button fires the event as shown and right button fires identical one but with "uCheck 0x8" Some of following buttons are just regular buttons like "reset camera"(the house one) and those are not catched. The buttons im interested are in subwindow thats not shown here, also acting as regular buttons (more than one can be selected at once) and are also not catched in this hook. From time to time my hooked application crashes. After restart, this CheckMenuItem still works (on those two buttons only) The HMENU - hMenu - value changed, but UINT - uIDCheckItem and UINT - uCheck values are the same also noteworthy that the event is fired even when using a hotkey (default in program, one of few) to switch between those two items BUT theres also a button that swaps orthographic/perspective camera (single button that changes on click, the "cube" on the right on screenshot), and clicking this button fires Two events, identical to the one shown in picture, first with 0x0 and second with 0x8 as their "uCheck" value. The resulting events from single click on "change perspective" button are identical to two clicks on "select cursor" and "select drag"... 😕
  14. Thanks for suggestion, altho from a quick scan it looks way above my ability. If anyone with knowhow and a idea of how to capture and replicate the event feels like trying, we could arrange some cooperation. This is the screen of process exe in Deviare In the meantime, if anyone has other ideas, please share.
  15. Oh yes. I was trying to find a way to interface with the window in a more controlled way. Over the years I tried saving bmps of buttons of interest, which breaks down once resolution/scaling changes. I tried going pixel-by-pixel to look for different color indicating window delimeter, and hardcoding a path to arrive at the button, but that broke in more ways I can remember. In the end, window/control relative coordinates with commands to set focus to certain controls (to make sure my target is actually visible), proved to be the most robust, but even that I have to manually adapt every once in a while. + I was hoping the macro do certain tasks in background, having to have a window on screen and highjacking mouse kinda sucks. Any ideas on how to control this without pointing real mouse cursor over it is highly appreciated
×
×
  • Create New...