Solution AlmarM Posted April 19, 2015 Solution Share Posted April 19, 2015 I must say I'm rather confused as well, but I gave it a try. Here's what I came up with: expandcollapse popupHotKeySet("{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 Minesweeper A minesweeper game created in autoit, source available. _Mouse_UDF An UDF for registering functions to mouse events, made in pure autoit. 2D Hitbox Editor A 2D hitbox editor for quick creation of 2D sphere and rectangle hitboxes. Link to comment Share on other sites More sharing options...
SadBunny Posted April 20, 2015 Share Posted April 20, 2015 (edited) It's just >this topic all over again. There too some perfectly serviceable examples were posted, and all you come up with is "it's not what I mean, let me repeat the same question in different words but just as ambiguously and vague". There it was moving the mouse in a circle. Just for fun, honest. Even if you are hoping for someone to just code exactly what you want, you would do good in fact saying what exactly you want. You're like one of these Facebook people posting publicly "I'll find a way to survive after the tears have gone" and then doesn't want to speak to anyone offering consolation. It's really irritating. Come on man, either admit it's for a game bot and accept your loss, or be more specific. Edited April 20, 2015 by SadBunny Roses are FF0000, violets are 0000FF... All my base are belong to you. Link to comment Share on other sites More sharing options...
Bert Posted April 20, 2015 Share Posted April 20, 2015 Agreed. This is getting old. Spit it out already. This has been going on for 9 days now. The Vollatran project My blog: http://www.vollysinterestingshit.com/ Link to comment Share on other sites More sharing options...
AlmarM Posted April 20, 2015 Share Posted April 20, 2015 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. Minesweeper A minesweeper game created in autoit, source available. _Mouse_UDF An UDF for registering functions to mouse events, made in pure autoit. 2D Hitbox Editor A 2D hitbox editor for quick creation of 2D sphere and rectangle hitboxes. Link to comment Share on other sites More sharing options...
Auio42TheWin Posted April 20, 2015 Author Share Posted April 20, 2015 Mind is blown right now. One person. one. Link to comment Share on other sites More sharing options...
JohnOne Posted April 21, 2015 Share Posted April 21, 2015 AutoIt Absolute Beginners Require a serial Pause Script Video Tutorials by Morthawt ipify Monkey's are, like, natures humans. Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted April 21, 2015 Moderators Share Posted April 21, 2015 Auio42TheWin,If you made your question a little clearer from the outset you might have had an easier ride - as it is you are lucky that at least one person guessed your intent and that the Moderators here are patient and do not prejudge.M23 Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind Open spoiler to see my UDFs: Spoiler ArrayMultiColSort ---- Sort arrays on multiple columnsChooseFileFolder ---- Single and multiple selections from specified path treeview listingDate_Time_Convert -- Easily convert date/time formats, including the language usedExtMsgBox --------- A highly customisable replacement for MsgBoxGUIExtender -------- Extend and retract multiple sections within a GUIGUIFrame ---------- Subdivide GUIs into many adjustable framesGUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView itemsGUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeViewMarquee ----------- Scrolling tickertape GUIsNoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxesNotify ------------- Small notifications on the edge of the displayScrollbars ----------Automatically sized scrollbars with a single commandStringSize ---------- Automatically size controls to fit textToast -------------- Small GUIs which pop out of the notification area Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now