Jump to content
Sign in to follow this  
langthang084

help about mouseclickdrag

Recommended Posts

langthang084

I want to auto change camera in my games by drag right mouse.

while 1
    $p = MouseGetPos()
    MouseClickDrag("right",$p[0],$p[1],$p[0]+30,$p[1],100)
WEnd

But when it runs, the games screen dont change regularly. It change, stop and continue change screen.

So anybody could help me to make the games screen change regularly??

thanks!

Share this post


Link to post
Share on other sites
martin

I want to auto change camera in my games by drag right mouse.

while 1
     $p = MouseGetPos()
     MouseClickDrag("right",$p[0],$p[1],$p[0]+30,$p[1],100)
 WEnd

But when it runs, the games screen dont change regularly. It change, stop and continue change screen.

So anybody could help me to make the games screen change regularly??

thanks!

Maybe something like this would work.

HotKeySet("{ESC}","quit")
opt("MouseClickDragDelay",0)

$mostx = 700;set this to the farthest right position the mouse can be while dragging
$xincr = 0
$step = 2
$p = MouseGetPos()
while 1
  ;drag in small steps for constant speed
    MouseClickDrag("right",$p[0]+$xincr,$p[1],$p[0]+$xincr + $step,$p[1],40)
    $xincr += $step
    If $xincr + $p[0] > $mostx then $xincr = 0
    mousemove($p[0]+$xincr,$p[1],0)

WEnd


Func quit()

    Exit
EndFunc

    Exit
EndFunc

You can experiment with different values of the $step (2 in my example) and the speed which is 40 in my example.


Serial port communications UDF Includes functions for binary transmission and reception.printing UDF Useful for graphs, forms, labels, reports etc.Add User Call Tips to SciTE for functions in UDFs not included with AutoIt and for your own scripts.Functions with parameters in OnEvent mode and for Hot Keys One function replaces GuiSetOnEvent, GuiCtrlSetOnEvent and HotKeySet.UDF IsConnected2 for notification of status of connected state of many urls or IPs, without slowing the script.

Share this post


Link to post
Share on other sites
langthang084

Oh! Yeah! It run very well. Many thanks for U :D:D

Share this post


Link to post
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×