Jump to content

AlmarM

Active Members
  • Posts

    1,675
  • Joined

  • Last visited

  • Days Won

    1

AlmarM last won the day on February 17 2012

AlmarM had the most liked content!

About AlmarM

  • Birthday 08/22/1992

Profile Information

  • Member Title
    Coding my way.
  • Location
    Netherlands, Utrecht

Recent Profile Visitors

1,002 profile views

AlmarM's Achievements

  1. Oh boy this is an old post. Anyway, you should probably move that HotKeySet outside of the while loop. I assume you've a _Exit function defined somewhere?
  2. I have not played with this yet, but it looks amazing. Will definitely try this sometime, good work!
  3. Aaah! There was a space missing. I have updated the zip file and should be working now.
  4. I have not touched the code for a long time, I think my UDF is not compatible with newer version of AutoIt anymore. As soon as I get home, I will take a look at it. EDIT: I have downloaded and started the example.au3 myself on the latest AutoIt version and I am having no issues. What AutoIt version are you using? Where are you getting the error?
  5. Seems the links are a bit outdated, haha. As soon as I get home, I will re-post the source codes EDIT: Added the source code!
  6. Creating something yourself is never a bad idea. You'll gain loads of experience and information from the process. As far as I know, I have no clue if anyone has already done this. Is 'chrome screen scaper' not good enough, or are you just curious?
  7. It seemed the OP wasn't really interested in how to move a mouse relatively, since he already know how to do so, but rather how to utilize his (or any) method into a basic path finding. As seen in my example. Knowing this gives his posts so much more sense.
  8. I must say I'm rather confused as well, but I gave it a try. Here's what I came up with: HotKeySet("{ESC}", "_Exit") Global Const $iStepSize = 32 Global $iX = 0, $iY = 0 Global $iTargetX, $iTargetY Global $hWnd = GUICreate("", 512, 512) Global $hTargetLabel = GUICtrlCreateLabel("", -$iStepSize, -$iStepSize, $iStepSize, $iStepSize) GUICtrlSetBkColor(-1, 0xFF0000) Global $hLabel = GUICtrlCreateLabel("", $iX, $iY, $iStepSize, $iStepSize) GUICtrlSetBkColor(-1, 0x0) _RandomizeTargetLocation() GUISetState() While 1 Switch GUIGetMsg() Case -3 Exit EndSwitch ; loop If ($iX < $iTargetX) Then $iX += $iStepSize If ($iX > $iTargetX) Then $iX -= $iStepSize If ($iY < $iTargetY) Then $iY += $iStepSize If ($iY > $iTargetY) Then $iY -= $iStepSize GUICtrlSetPos($hLabel, $iX, $iY) If ($iX == $iTargetX And $iY == $iTargetY) Then Sleep(1000) _RandomizeTargetLocation() EndIf Sleep(300) WEnd Func _RandomizeTargetLocation() $iTargetX = Int(Random(0, 512, 1) / $iStepSize) * $iStepSize $iTargetY = Int(Random(0, 512, 1) / $iStepSize) * $iStepSize GUICtrlSetPos($hTargetLabel, $iTargetX, $iTargetY) EndFunc Func _Exit() Exit EndFunc
  9. Yes, I get that. These are just samples to reproduce the issues I stumbled upon. I'm still experimenting with the way I'd like to go in the end. Thanks!
  10. Hi! Is AutoIt able to initialize a 2D array with predefined values as arrays? I can't seem to make it work without a workaround. In this example the 2D array takes the predefined values as regular values, while I want them to be 1D arrays. #include <Array.au3> Global $asBegin[3][1] = [["a1-1"],["a1-0"],["a0-1"]] _ArrayDisplay($asBegin) In this example the 2D array does take the predefined arrays as array, because I defined them in another function. #include <Array.au3> Global $asBegin[3][1] = [[__MA("a1-1")],[__MA("a1-0")],[__MA("a0-1")]] _ArrayDisplay($asBegin) _ArrayDisplay($asBegin[1][0]) Func __MA($sString) Local $asResult[1] = [$sString] Return $asResult EndFunc
×
×
  • Create New...