I just made this code, this code moves the mouse more smoothly.
It smoothly starts, and smoothly ends. This function also do some random curves, but it is still smooth!
The ease in function.
Slowly increases the value, used in animations.
$i = number between 0 and 1 representing the animation position.
$sm = smoothness, if set to 1, it will be a linear animation.

; Ease in function func __calci1($i, $sm) return $i ^ $sm; endFuncoÝ÷ Ù´áyæ¬z)èº×îËb¢ÛRȧØ^y«v§uæ¬z¶+y«^j÷«Êɨ¢ØZ)¶*'h!¶Úþ-uÚh¶îrGr¿jVîÏç׿?éeéàýæ¬z)èºØ"ø¦«¢+Øì Í¥¸½ÕÐչѥ½¸)Õ¹}} ±¤ ÀÌØí¤°ÀÌØíÍ´¤(%¥ ÀÌØí¤±ÐìÀ¸Ô¤Ñ¡¸($%ÉÑÕɸ}} ±¤Ä ÀÌØí¤¨È°ÀÌØíÍ´¤¼Èì(%±Í($%ÉÑÕɸ¡}} ±¤È ÀÌØí¤´À¸Ô¤¨È°ÀÌØíÍ´¤¼È¤¬À¸Ôì(%¹%)¹Õ¹oÝ÷ Ù´áyæ¬y¶«uû§rبöâmÊ%¢º+yÛ)j{-ÊWoÝ÷ Ù´ázf¢û§rبöÓ+ºw-ÚrÛ¦¢÷¬¶¦¢ëN«yªÞ· )j¶¦z׫²Ø^µªàzÜi¢ÈÚÛazÖ«ër¦"¶*'jëh×6; MAIN FUNCTION func mouseMove2($x2, $y2) $x1 = mouseGetPos(0); $y1 = mouseGetPos(1); $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, 0); next endFuncoÝ÷ Ùµ,x- ë®*mý¶®¶sc²FW7B67&@¦Ö÷W6TÖ÷fS"S"Â3boÝ÷ Ø Ý~)Ú¡z·¢²Ø^~éer^¡øjëh×6; 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 mouseMove2($x2, $y2) $x1 = mouseGetPos(0); $y1 = mouseGetPos(1); $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, 0); next endFunc ; Test Script mouseMove2 (512, 386);
Tell me what you think about it!
Edited by the DtTvB, 09 October 2006 - 01:09 PM.






