Jump to content

Help with click dragger


Recommended Posts

Ok first off what this script does.

Runs in background.

When you press insert it stores current mouse coord and resumes idling

when you press Delete it stores current mose coord as the stoping point and resumes idle.

when you press home it left-click drags from your set start point and set end point.

when you press end it stops.

It seems to work like i want in windows, but the game i made this for (Gunbound) doesn't seem to respond. I even tried renaming the exe to "Joytokey" which used to allow send commands. Not sure where to go from here.

; ----------------------------------------------------------------------------
;
; AutoIt Version: 3.0
; Language:    English
; Platform:    XP
; Author:       xxxxxxxxxx
;
; Script Function:
;   Save your wrist!
;
; ----------------------------------------------------------------------------


; ----------------------------------------------------------------------------
; Set up our defaults
; ----------------------------------------------------------------------------

;AutoItSetOption("MustDeclareVars", 1)
;AutoItSetOption("MouseCoordMode", 0)
;AutoItSetOption("PixelCoordMode", 0)
;AutoItSetOption("RunErrorsFatal", 0)
;AutoItSetOption("TrayIconDebug", 1)
;AutoItSetOption("WinTitleMatchMode", 4)


; ----------------------------------------------------------------------------
; Script Start
; ----------------------------------------------------------------------------









;Go!--------********--------********
hotkeyset("{Home}","clickdrag")
hotkeyset("{Insert}","setstartcoords")
hotkeyset("{Delete}","setdragcoords")
hotkeyset("{End}","stop")
$stop = 0
$startpoint = 0
$dragpoint = 0


;while $stop = 0
;sleep(500)
;$sleeptime = random(500,1000)
;WEnd

while 1
    sleep(500)
    $sleeptime = random(500,1000)
WEnd

func setstartcoords()
    $startpoint = mousegetpos()
    tooltip("Got Start Coords")
EndFunc

func setdragcoords()
    $dragpoint = mousegetpos()
    tooltip("Got end coords")
EndFunc

func clickdrag()
Do 
    $stop = 0
    mouseclickdrag("Left",$startpoint[0],$startpoint[1],$dragpoint[0],$dragpoint[1],3)
    sleep($sleeptime)
until $stop = 1
EndFunc
    


func stop()
    $stop = 1
    tooltip("Stopped")
EndFunc

any help would be great

"A man who has never gone to school may steal from a freight car; but if he has a university education, he may steal the whole railroad." - Theodore Roosevelt
Link to comment
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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...