Bathory Posted March 11, 2008 Share Posted March 11, 2008 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 More sharing options...
Xenobiologist Posted March 11, 2008 Share Posted March 11, 2008 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 More sharing options...
Bathory Posted March 11, 2008 Author Share Posted March 11, 2008 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 Link to comment Share on other sites More sharing options...
Xenobiologist Posted March 11, 2008 Share Posted March 11, 2008 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 More sharing options...
Bathory Posted March 11, 2008 Author Share Posted March 11, 2008 yes! it works. Thank you. Link to comment Share on other sites More sharing options...
Bathory Posted March 11, 2008 Author Share Posted March 11, 2008 yes! it works. Thank you. Link to comment Share on other sites More sharing options...
Xenobiologist Posted March 11, 2008 Share Posted March 11, 2008 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 More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now