Lemonadez Posted July 9, 2005 Posted July 9, 2005 Im having hard time how to do it -.- how do u do a autoscript... Hold right mouse button for 3 seconds and then release it...then do it over and over and over again.(just call it unlimited) home key=activate and end key= deactivate.. thanks
LxP Posted July 9, 2005 Posted July 9, 2005 Lemonadez said: Hold right mouse button for 3 seconds and then release it...then do it over and over and over again.(just call it unlimited) home key=activate and end key= deactivate..The MouseClick() and MouseClickDownDelay functions/options are what you are looking for to achieve your desired mouse behaviour. You can find them in the help file index.Once you have that working, all you need to do is place it in a loop. The HotKeySet() function will allow you to program the End key to terminate the script.
GaryFrost Posted July 9, 2005 Posted July 9, 2005 HotKeySet("{HOME}", "_StartMouse") HotKeySet("{END}", "_StopMouse") HotKeySet("{ESC}", "_Exit") Opt("MouseClickDownDelay",3000) $Click = 0 While 1 if $Click Then $start = TimerInit() MouseClick("left",1,1) ConsoleWrite("Clicked: " & TimerDiff($start) & @LF) EndIf WEnd Func _StartMouse() $Click = 1 EndFunc Func _StopMouse() $Click = 0 EndFunc Func _Exit() Exit EndFunc SciTE for AutoItDirections for Submitting Standard UDFs Don't argue with an idiot; people watching may not be able to tell the difference.
LxP Posted July 9, 2005 Posted July 9, 2005 You may wish to introduce some sort of delay for when the clicking is deactivated, so that CPU usage doesn't fly through the roof: ; ... While 1 if $Click Then $start = TimerInit() MouseClick("left",1,1) ConsoleWrite("Clicked: " & TimerDiff($start) & @LF) else sleep(250) EndIf WEnd ; ...
GaryFrost Posted July 9, 2005 Posted July 9, 2005 or use MouseClickDelay SciTE for AutoItDirections for Submitting Standard UDFs Don't argue with an idiot; people watching may not be able to tell the difference.
Lemonadez Posted July 9, 2005 Author Posted July 9, 2005 (edited) gafrost said: HotKeySet("{HOME}", "_StartMouse") HotKeySet("{END}", "_StopMouse") HotKeySet("{ESC}", "_Exit") Opt("MouseClickDownDelay",3000) $Click = 0 While 1 if $Click Then $start = TimerInit() MouseClick("left",1,1) ConsoleWrite("Clicked: " & TimerDiff($start) & @LF) EndIf WEnd Func _StartMouse() $Click = 1 EndFunc Func _StopMouse() $Click = 0 EndFunc Func _Exit() Exit EndFunc<{POST_SNAPBACK}>hmm that wierd...i try this script...and my mouse went over on the top left corner..EDIT: I GOT IT FIXEDHotKeySet("{HOME}", "_StartMouse")HotKeySet("{END}", "_StopMouse")HotKeySet("{ESC}", "_Exit")Opt("MouseClickDownDelay",3000)$Click = 0While 1 if $Click Then $start = TimerInit() MouseClick("right") ConsoleWrite("Clicked: " & TimerDiff($start) & @LF) EndIfWEndFunc _StartMouse() $Click = 1EndFuncFunc _StopMouse() $Click = 0EndFuncFunc _Exit() ExitEndFunc Edited July 9, 2005 by Lemonadez
GaryFrost Posted July 9, 2005 Posted July 9, 2005 You didn't specify where to click, so i just picked an x y coord. SciTE for AutoItDirections for Submitting Standard UDFs Don't argue with an idiot; people watching may not be able to tell the difference.
LxP Posted July 9, 2005 Posted July 9, 2005 gafrost said: or use MouseClickDelayMouseClickDelay is good for a delay inbetween clicks but when $Click = 0, the While..WEnd loop is effectively empty and can be troublesome without a Sleep() (just like me!).
GaryFrost Posted July 9, 2005 Posted July 9, 2005 yep your correct about the Sleep. SciTE for AutoItDirections for Submitting Standard UDFs Don't argue with an idiot; people watching may not be able to tell the difference.
LxP Posted July 9, 2005 Posted July 9, 2005 Lemonadez said: hmm that wierd...i try this script...and my mouse went over on the top left corner..If you'd like the mouse to be clicked where it currently sits then you can change the MouseClick() call to:mouseClick("right", mouseGetPos(0), mouseGetPos(1))
Lemonadez Posted July 9, 2005 Author Posted July 9, 2005 (edited) EDITED: THANKS NOW I GOT IT RIGHT Quote HotKeySet("{HOME}", "_StartMouse")HotKeySet("{END}", "_StopMouse")HotKeySet("{ESC}", "_Exit")$Click = 0While 1 if $Click Then $start = TimerInit() MouseClick("right") MouseUp("right") Sleep(1020) MouseDown("right") Sleep(3070) ConsoleWrite("Clicked: " & TimerDiff($start) & @LF) EndIfWEndFunc _StartMouse() $Click = 1EndFuncFunc _StopMouse() $Click = 0EndFuncFunc _Exit() ExitEndFunccan i ask something? is it possible to put a music into autoit? i mean if the music was .swf format and it was uploaded into a site...then make autoit have a button play stop? is that possible.. Edited July 9, 2005 by Lemonadez
MSLx Fanboy Posted July 9, 2005 Posted July 9, 2005 (edited) Someone just made a Flash Object script in the Scripts and Scraps forum...that may be what you're looking forEdit: Link Edited July 9, 2005 by MSLx Fanboy Writing AutoIt scripts since _DateAdd("d", -2, _NowCalcDate())
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