Register for your free account! | Forgot your password?

Go Back   elitepvpers > General Gaming > General Gaming Discussion
You last visited: Today at 03:28

  • Please register to post and access all features, it's quick, easy and FREE!

 

[AutoIt] Bezier Mouse Movement

Reply
 
Old   #1
 
elite*gold: 0
Join Date: Jan 2008
Posts: 113
Received Thanks: 56
[AutoIt] Bezier Mouse Movement

It was originally written for GuildWars in mind, and their anti-macro detection.

Code:
Dim $PtX[4]
Dim $PtY[4]
Dim $MaxPt = 3

Func Factorial($n)
   $value = 1
    For $i = 2 To $n
        $value = $value * $i
    Next
   
    Return $value
EndFunc


Func Y($t)
   $value = 0

    For $i = 0 To $MaxPt
        $value = $value + $PtY[$i] * Blend($i, $MaxPt, $t)
    Next
   
    Return $value
EndFunc


Func X($t)
   $value = 0

    For $i = 0 To $MaxPt
        $value = $value + $PtX[$i] * Blend($i, $MaxPt, $t)
    Next
   Return $value
EndFunc

Func MouseClickEx($btn, $x, $y, $num)
   
   MouseBezier($x, $y)
   MouseClick($btn, $x, $y, $num)

EndFunc

Func MouseBezier($ex, $ey)
   $pos = MouseGetPos()
   If IsArray($pos) Then
      If $pos[0] < $ex Then
         $PtX[0] = $pos[0]
         $PtX[1] = $pos[0] * Random(2, 3)
         $PtX[2] = $PtX[1]
         $PtX[3] = $ex
      Else
         $PtX[0] = $pos[0]
         $PtX[1] = $pos[0] / Random(2, 3)
         $PtX[2] = $PtX[1]
         $PtX[3] = $ex
      EndIf
      
      If $pos[1] < $ey Then
         $PtY[0] = $pos[1]
         $PtY[1] = $pos[1]
         $PtY[2] = $pos[1] * Random(2, 3)
         $PtY[3] = $ey;
      Else
         $PtY[0] = $pos[1]
         $PtY[1] = $pos[1]
         $PtY[2] = $pos[1] / Random(2, 3)
         $PtY[3] = $ey;
      EndIf
      
      MouseCurve(0, 1)
   EndIf
EndFunc

Func MouseCurve($start_t, $stop_t)
   $dt = 0.01
    $t = $start_t + $dt
    While $t < $stop_t
        MouseMove(X($t), Y($t),1)
        $t = $t + $dt
    Wend
   ;MouseMove(X($start_t), Y($stop_t),1)
EndFunc

Func Blend($i, $n, $t)
    Return Factorial($n) / Factorial($i) / Factorial($n - $i) * $t ^ $i * (1 - $t) ^ ($n - $i)
EndFunc

;MouseBezier(640, 512)



Penakle is offline  
Reply



« Previous Thread | Next Thread »

Similar Threads
Massive fps drop due to mouse movement
Hi, I'm going away for 5 days so as a last hope I decided to post this here. Recently I've been having fps drop on silkroad, and basically every game...
1 Replies - SRO Ask the Experts
Autoit/AutoHotkey hooking the mouse
I am running EU/US Aion 1.5 so no game guard. I am still having trouble sending mouse clicks to Aion the mouseclick("right") function works fine...
3 Replies - Aion Main - Discussions / Questions
Wallhack movement bugs out when moving with mouse?
i made a wallhakc that workd, but when i try to move via the mouse, my char starts moving really fast across the map in different directions, anyone...
8 Replies - Dekaron Private Server
Autoit Ctrl+left mouse udf
So i made a udf (user-defined-function) in Autoitv3 for sending "Ctrl_down + LeftMouse_Down" event to the conquer window (or really any other...
1 Replies - CO2 Bots & Macros
how to send contorl+mouse click in autoit
Hi, I am wondering how to send contorl+left mouse click in autoit. What I do now: AutoItSetOption &#40; &#34;SendKeyDownDelay&#34;, 10&#41; Send&#40;&#34;^&#34;&#41; ...
0 Replies - AutoIt



All times are GMT +1. The time now is 03:28.


Powered by vBulletin®
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
SEO by vBSEO ©2011, Crawlability, Inc.

Support | Contact Us | FAQ | Advertising | Privacy Policy | Abuse
Copyright ©2017 elitepvpers All Rights Reserved.