Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 07/15/2016 in all areas

  1. yeah, you can put an _ArrayDisplay($aUniqueUser) line there as well to debug if there are issues or edge cases unaccounted for.
    1 point
  2. Welcome to AutoIt and the forum! Please have a look at the Excel UDF that comes with AutoIt, function _Excel_RangeRead.
    1 point
  3. Mbee, The only way we can really help is if you post your entire script so that we can examine it in detail - as proved above, mere snippets are not going to be enough. By all means PM me the code if you do not want to make it public - as long as it is legal by forum standards I will happily take a look to see if I can see anything in it which might explain what you are seeing. M23
    1 point
  4. P.S. Small note: where you write "properly" (also earlier in this thread) you meant "probably". I'm not a grammar Nazi or anything, but confusing those two can lead to actual confusion
    1 point
  5. See, this is why reproducers are so important 9 out of 10 times (if not more) even the process of trying to come up with a reproducer from scratch, or stripping your code down until the problem disappears and then looking at the last thing you stripped, shows the actual problem. Well, glad I could help
    1 point
  6. So here the timer actually works Maybe this is better to play around with? #include <Timers.au3> HotKeySet("x", "exiter") Global $gui = GUICreate("hello", 300, 300, 100, 100) ;~ GUISetState(@SW_SHOW, $gui) doThing() Exit Func doThing() Local $globaltimer = _Timer_SetTimer($gui, 6000, "doTimerFunction") ConsoleWrite("Timer id: " & $globaltimer & @CRLF) $beepTimer = TimerInit() While (1) If TimerDiff($beepTimer) > 3000 And TimerDiff($beepTimer) < 4000 Then Beep(1500, 100) EndIf WEnd Sleep(10000) EndFunc ;==>doThing Func doTimerFunction($hWnd, $iMsg, $iIDtimer, $iTime) Beep(1000, 300) EndFunc ;==>doBeep Func exiter() Exit EndFunc ;==>exiter
    1 point
  7. True, and I didn't want/need it to, I just wanted it to exist. Now that you mention it, the result of that _Timer_SetTimer returns 0 so the timer call fails and my test is faulty. That means that in your new case, the timer probably isn't created either and now your hotkey now remains working. So the problem still looks to be with that combination, or some contingency combined with that combination. Finding out which one of those two is the case is a matter of elimination Either start from scratch with that combination and see if you can reproduce, or snip away every other contingency until you arrive at the last contingency that determines whether this problem occurs or not, and you can write a reproducer (and/or find your error ).
    1 point
  8. #include <Array.au3> local $aFinal[0] Local $avArray[9][2] = [ _ ["user1", "76560BB696114467"], _ ["user2", "76560BB696114467"], _ ["user3", "76560BB696114467"], _ ["user4", "76560BB696114467"], _ ["user5", "76560BB696114467"], _ ["user6", "765454545454545"], _ ["user7", "7666565656565656"], _ ["user8", "76560BB6uyuyu567"], _ ["user1", "76560BB696114467"]] $aUniquePW = _ArrayUnique($avArray , 1) For $i = 1 to ubound($aUniquePW) - 1 $aMatch = _ArrayFindAll($avArray , $aUniquePW[$i] , 0 , 0 , 0 , 0 , 1) for $k = 0 to ubound($aMatch) - 1 $aMatch[$k] = $avArray[$aMatch[$k]][0] next $aUniqueUser = _ArrayUnique($aMatch) $aUniqueUser[0] = $aUniquePW[$i] _ArrayAdd($aUniqueUser , "") _ArrayConcatenate($aFinal , $aUniqueUser) Next _ArrayDisplay($aFinal)
    1 point
  9. I'm not saying whether or not your code is messy, and even messy code should still work if it is actually correct (just harder to work with ). If you want to know how far your code gets during execution, there are a few shortcuts you could take to get some information, such as enabling the TrayIconDebug option or using Tools -> Trace: add trace lines in Scite. You can always add your own ConsoleWrite commands to show more debug information, such as results, errors and extended error information returned from function calls. (Much more useful than MsgBox'es IMHO as they don't require interaction, don't overlap any gui etc..) I personally cannot see anything intrinsically wrong with this code (maybe someone else can?), but without clear information on when what happens exactly, it's blindfolded troubleshooting, at least to me. But that's what reproducers are for. The thing with reproducers is that if you feel like you would have a hard time making one, it's probably a sign that you have to rethink your solution to begin with, otherwise it's just trial-and-error to find a working band-aid...
    1 point
  10. Can't reproduce, your code is not testable for anyone else, the rest of your code and/or the application that you're trying to work with and/or pretty much anything else may throw sand in the machine. I tried to write a small reproducer that uses both types of timers at the same time as well and a hotkey, works fine for me: #include <Timers.au3> HotKeySet("x", "exiter") doThing() Exit Func doThing() $globaltimer = _Timer_SetTimer(-1, 10000, "doBeep") $beepTimer = TimerInit() While (1) If TimerDiff($beepTimer) > 6000 and TimerDiff($beepTimer) < 8000 Then Beep(2000, 300) EndIf WEnd EndFunc ;==>doThing Func doBeep() Beep(1000, 300) Sleep(100) EndFunc ;==>doBeep Func exiter() Exit EndFunc ;==>exiter Can you try and reproduce your issue with a standalone reproducer script?
    1 point
  11. 1 point
  12. In your directory with autoit scripts, use the following commandline (modify path and anything else you want to change of course): for /f %f in ('dir /b *.au3') do f:\dev\AutoIt3\Aut2Exe\Aut2exe.exe /in %f Something like that? (Double the % signs if you run that from a batch file.)
    1 point
  13. 1 point
  14. water

    Access Excel sheet

    I do not know of a book about AutoIt but i think the best way to learn is the help file the wiki the forum
    1 point
  15. ; Variables $color2 = 0x5E480F $centerColor = PixelSearch(190, 182, 1813, 984, 0x11c1A1) If IsArray($centerColor) = True Then MouseMove($centerColor[0], $centerColor[1]) Sleep(250) $centerColor2 = PixelSearch($centerColor[0], $centerColor[1] + 50, $centerColor[0], $centerColor[1] + 50, $color2) MouseMove($centercolor2[0], $centercolor2[1]) EndIf
    1 point
  16. $color2 is the color you're looking for, it's not the return value from the PixelSearch, you don't save the return value from the second pixelsearch so the mousemove isn't going to work.
    1 point
  17. water

    Excel Example Scripts

    Attached you will find a few examples based on the Excel UDF. Enjoy! Worksheet Change Event This example handles the Excel Worksheet change event when a cell has been changed and sets the color of the cell to red. Example Excel Events.zip History: Set color of every second row This example sets the background color for every second row in the used range to yellow. Example Color Rows.zip History:
    1 point
×
×
  • Create New...