Jump to content

hold mouse1 script


Recommended Posts

hey guys im trying to create a script that repeats the key X as long as i hold the MOUSE1 button and stops when i release it... but im having a lot of trouble to create it ... can u guys help me out ???

i've managed to make a similar script but it only works whit space bar , im trying to modify it to repeat X while holding MOUSE1 ...

#include <Misc.au3>

#include <GUIConstantsEx.au3>

$spacerepeat= 3

$spacerepeatdelay= 100

$hgui= GUICreate("send space app", 200, 60)

GUISetState();shows the gui window

do

$guimsg= GUIGetMsg()

if _IsPressed("20") Then

for $i=0 to $spacerepeat-1

$timer= TimerInit()

while TimerDiff($timer)<$spacerepeatdelay

wend

send("{space}")

next

endif

until $guimsg= $GUI_EVENT_CLOSE

what im doing wrong , or what should i do ??

thanks guys .

Edited by josh77
Link to comment
Share on other sites

im rather new to scripting and i still cant make it work , i changed something but ii still dont work =[

#include <Misc.au3>

#include <GUIConstantsEx.au3>

$xrepeat= 3

$xrepeatdelay= 10

$hgui= GUICreate("send x app", 200, 60)

GUISetState();shows the gui window

do

$guimsg= GUIGetMsg()

if _IsPressed("20") Then

for $i=0 to $xrepeat-1

$timer= TimerInit()

while TimerDiff($timer)<$xrepeatdelay

wend

send MouseClick( "Left" )

next

endif

until $guimsg= $GUI_EVENT_CLOSE

i made some changes and i feel like i made it worse ... still can make a proper macro that repeats X while i hold MOUSE1 , can someone help me out ??? btw thanks for answers i got so far =]

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...