Sign in to follow this  
Followers 0
Bathory

MouseDown() help

7 posts in this topic

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 ;)

Share this post


Link to post
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

Share this post


Link to post
Share on other sites

when i add that options, it clicks very quick. but i need to keep the click pressed for 5 seconds, release the click and loop

Share this post


Link to post
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

Share this post


Link to post
Share on other sites

yes! it works. Thank you.

Share this post


Link to post
Share on other sites

yes! it works. Thank you.

Share this post


Link to post
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

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  
Followers 0