Jump to content

MouseDown() help


Recommended Posts

Hi, I am a newbie to autoit, and i hope that somewone can help me.

I try to make , a script for a game , where i have to press the mouse for a long time. :)

this is my code :

HotKeySet("{F9}", "start")
HotKeySet("{F10}", "stop")

Func start()
while(1)
MouseDown("right")
WEnd
EndFunc

Func stop()
while 1 = 1
  Sleep(1000)
wend
EndFunc

while(1)
sleep(1000)
WEnd

i need this script , to keep the mouse click pressed for 5 seconds, and repeat until the "stop" hotkey is pressed.

sorry for my bad eglish ;)

Link to comment
Share on other sites

Hi,

does a normal click work when you add the option

Opt("MouseClickDownDelay", 5000)

?

Mega

Scripts & functions Organize Includes Let Scite organize the include files

Yahtzee The game "Yahtzee" (Kniffel, DiceLion)

LoginWrapper Secure scripts by adding a query (authentication)

_RunOnlyOnThis UDF Make sure that a script can only be executed on ... (Windows / HD / ...)

Internet-Café Server/Client Application Open CD, Start Browser, Lock remote client, etc.

MultipleFuncsWithOneHotkey Start different funcs by hitting one hotkey different times

Link to comment
Share on other sites

Does this not work?

#include<WinAPI.au3>
Opt("MouseClickDownDelay", 5000) 
HotKeySet("{F9}", "start")
HotKeySet("{F10}", "stop")

Func start()
    While (1)
        MouseClick("left", _WinAPI_GetMousePosX(), _WinAPI_GetMousePosy())
    WEnd
EndFunc  ;==>start

Func stop()
    While 1 = 1
        Sleep(1000)
    WEnd
EndFunc  ;==>stop

While (1)
    Sleep(1000)
WEnd

Mega

Scripts & functions Organize Includes Let Scite organize the include files

Yahtzee The game "Yahtzee" (Kniffel, DiceLion)

LoginWrapper Secure scripts by adding a query (authentication)

_RunOnlyOnThis UDF Make sure that a script can only be executed on ... (Windows / HD / ...)

Internet-Café Server/Client Application Open CD, Start Browser, Lock remote client, etc.

MultipleFuncsWithOneHotkey Start different funcs by hitting one hotkey different times

Link to comment
Share on other sites

Nevermind. Good luck! :-)

Scripts & functions Organize Includes Let Scite organize the include files

Yahtzee The game "Yahtzee" (Kniffel, DiceLion)

LoginWrapper Secure scripts by adding a query (authentication)

_RunOnlyOnThis UDF Make sure that a script can only be executed on ... (Windows / HD / ...)

Internet-Café Server/Client Application Open CD, Start Browser, Lock remote client, etc.

MultipleFuncsWithOneHotkey Start different funcs by hitting one hotkey different times

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