benergy Posted March 18, 2023 Posted March 18, 2023 I'd like to loop the following script that I found on this forum. Would anyone be kind enough to check my code for errors? I just need the mouse to move continuously, and I'd like to be able to press F10 to start and stop the movement. Currently, when I press F10, nothing happens. Thanks! expandcollapse popup#cs ---------------------------------------------------------------------------- AutoIt Version: 3.3.16.1 Author: myName Script Function: Template AutoIt script. #ce ---------------------------------------------------------------------------- ; Script Start - Add your code below here HotKeySet("{F10}", "start") HotKeySet("{ESC}", "exit") ; Smoother Mouse Move ; by the DtTvB ; Ease in function func __calci1($i, $sm) return $i ^ $sm; endFunc ; Ease out function func __calci2($i, $sm) return 1 - ((1 - $i) ^ $sm); endFunc ; Ease in out function func __calci($i, $sm) if ($i < 0.5) then return __calci1($i * 2, $sm) / 2; else return (__calci2(($i - 0.5) * 2, $sm) / 2) + 0.5; endIf endFunc ; Ease backward function func __calof($i, $sm) if ($i < 0.5) then return __calci($i * 2, $sm); else return __calci((1 - $i) * 2, $sm); endIf endfunc ; MAIN FUNCTION Func start() While mouseMove2($x2, $y2) $x1 = Random(0, @DeskTopWidth); $y1 = Random(0, @DeskTopHeight); $xv = random(-100, 100); $yv = random(-100, 100); $sm = random(1.5, 2.5); $m = random(50, 160); for $i = 0 to $m $ci = __calci($i / $m, $sm); $co = __calof($i / $m, $sm); $cx = $x1 + (($x2 - $x1) * $ci) + ($xv * $co); $cy = $y1 + (($y2 - $y1) * $ci) + ($yv * $co); mouseMove ($cx, $cy, 1); next WEnd EndFunc ; Test Script ;start (512, 386); Func stop() Exit 0 EndFunc
Nine Posted March 18, 2023 Posted March 18, 2023 And for what game is this for ? What is the purpose of this mouse movement ? “They did not know it was impossible, so they did it” ― Mark Twain Reveal hidden contents Block all input without UAC Save/Retrieve Images to/from Text Monitor Management (VCP commands) Tool to search in text (au3) files Date Range Picker Virtual Desktop Manager Sudoku Game 2020 Overlapped Named Pipe IPC HotString 2.0 - Hot keys with string x64 Bitwise Operations Multi-keyboards HotKeySet Recursive Array Display Fast and simple WCD IPC Multiple Folders Selector Printer Manager GIF Animation (cached) Debug Messages Monitor UDF Screen Scraping Round Corner GUI UDF Multi-Threading Made Easy Interface Object based on Tag
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