zzxxzzxx Posted June 6, 2005 Share Posted June 6, 2005 http://www.autoitscript.com/forum/index.php?showtopic=5760very new here. so hope anyone can show me some skills to these few functions. 1. pressing F9 will toggle LEFT CLICK hold DOWN2. pressing F10 will toggle RIGHT CLICK hold DOWN3. pressing F11 will toggle pressing SPACEBAR in loop with 1 sec delay?4. pressing F12 will stop the above 35. pressing F8 will exit programmaybe some GUI to show these functions too if possible.its actually for a game Mu Online, but i would like to know how to do these stuffs based on the IsPressed function above (link).i want to start learning by looking at how its done for the above. hope someone can help. it's easier to learn from something that interests you. Link to comment Share on other sites More sharing options...
w0uter Posted June 6, 2005 Share Posted June 6, 2005 i think it is easyer to just use HotKeySet. but thats me. My UDF's:;mem stuff_Mem;ftp stuff_FTP ( OLD );inet stuff_INetGetSource ( OLD )_INetGetImage _INetBrowse ( Collection )_EncodeUrl_NetStat_Google;random stuff_iPixelSearch_DiceRoll Link to comment Share on other sites More sharing options...
MSLx Fanboy Posted June 6, 2005 Share Posted June 6, 2005 HotKeySet most likely, and just set a variable to 1 or 0 based upon whether the button is currently down or not.. i.e. If pressing F9 through my function Then Stop pressing F9 set $F9isdown to 0 Else Start pressing F9 set $F9isdown to 1 EndIf Writing AutoIt scripts since _DateAdd("d", -2, _NowCalcDate()) Link to comment Share on other sites More sharing options...
Valuater Posted June 6, 2005 Share Posted June 6, 2005 Just what you asked for....... expandcollapse popup#include <GUIConstants.au3> $Window=GUICreate("My GUI") Global $Left="", $Right="", $Space="" $Send=GUICtrlCreatelabel("1. pressing F9 will toggle LEFT CLICK hold DOWN " & @CRLF & _ "2. pressing F10 will toggle RIGHT CLICK hold DOWN"& @CRLF & _ "3. pressing F11 will toggle pressing SPACEBAR in loop with 1 sec delay" & @CRLF & _ "4. pressing F2 will stop the above 3 (note F12 would not work for me)" & @CRLF & _ "5. pressing F8 will exit program", 30, 30, 350, 350) ;Windows prohibits ESC, ENTER, TAB, SPACEBAR, PRINT SCREEN, SHIFT, or BACKSPACE from being used in hotkeys. ; soooo... i put it in the while 1 loop HotKeySet("{F8}", "_Exit") HotKeySet("{F9}", "_Left") HotKeySet("{F10}", "_right") HotKeySet("{F11}", "_Space") HotKeySet("{F2}", "_Clear") GuiSetState() While 1 $msg = GUIGetMsg() If $msg = $GUI_EVENT_CLOSE then MsgBox(0, "Close GUI", "This will close the GUI " & @CRLF & " to Exit the program press *F8* ") GUISetState(@SW_HIDE, $Window) EndIf If $Space <> "" then Send("{SPACE}") Sleep(990) EndIf Sleep(10) WEnd ;---------- functions ------------------- Func _Exit() ToolTip('Exiting the program',0,0) Sleep(1000) ToolTip("") Exit 0 EndFunc Func _Left() If $left = "" then MouseDown("left") $Left="Down" ToolTip('Mouse is Left Clicked Hold',0,0) Sleep(1000) ToolTip("") Return EndIf If $left <> "" then MouseUp("left") $Left="" ToolTip('Mouse is Left Click Off',0,0) Sleep(1000) ToolTip("") Return EndIf EndFunc Func _Right() If $Right = "" then MouseDown("right") $Right="Down" ToolTip('Mouse is Right Clicked Hold',0,0) Sleep(1000) ToolTip("") Return EndIf If $Right <> "" then MouseUp("right") $Right="" ToolTip('Mouse is Right Click Off',0,0) Sleep(1000) ToolTip("") Return EndIf EndFunc Func _Space() If $Space = "" then $Space="Down" ToolTip('Space will be pressed every one second +/-',0,0) Sleep(1000) ToolTip("") Return EndIf If $Space <> "" then $Space="" ToolTip('Space will not be pressed',0,0) Sleep(1000) ToolTip("") Return EndIf EndFunc Func _Clear() ; F12 key does not work on my system ;MsgBox(0, "Close GUI", "Working................") MouseUp("right") $Right="" ToolTip('Mouse is Right Click Off',0,0) Sleep(1000) ToolTip("") MouseUp("left") $Left="" ToolTip('Mouse is Left Click Off',0,0) Sleep(1000) ToolTip("") $Space="" ToolTip('Space will not be pressed',0,0) Sleep(1000) ToolTip("") EndFunc F12 would not work on my system... changed to F2 and ;Windows prohibits ESC, ENTER, TAB, SPACEBAR, PRINT SCREEN, SHIFT, or BACKSPACE from being used in hotkeys. ; soooo... i put it in the while 1 loop Tweak how you want........ Enjoy! 8) Link to comment Share on other sites More sharing options...
zzxxzzxx Posted June 7, 2005 Author Share Posted June 7, 2005 oh, that is very kind of you. THANKS Link to comment Share on other sites More sharing options...
Valuater Posted June 7, 2005 Share Posted June 7, 2005 Your Welcome .... nice to hear "thanks" some people dont acknowledge any real help I always try to Enjoy! 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