jimmyxxx Posted July 12, 2007 Posted July 12, 2007 Hi all am new in this script things xD. But i have start making my own one. It is an auto" q " press, to use very fast potions in some games Now i have some noobie questions to make better my script: 1.How can i make a function to pause script with button F7 2.How to make a function to start it with F6 3.How can the script not to start when i oen it. Thanks for helps
DarkNecromancer Posted July 12, 2007 Posted July 12, 2007 You could have a variable keep track of a 'run' state which is default as 'off'. Then you conditionally execute your 'q' send if the run state has been changed to on. As for the key presses, you should look at CODEHotKeySet ( "key" [, "function"] ) as it appears to be what your looking for. Possible something like thisCODEHotKeySet ( "{f6}", "SwitchToRUN" ) HotKeySet ( "{f7}", "SwitchToPAUSE" ) Dim $State = False While(1) If($State = True)Then ;; UNCOMMENT to have it send the q ;Send( "q" ) EndIf Sleep(100) WEnd Func SwitchToRUN() $State = True EndFunc Func SwitchToPAUSE() $State = False EndFunc Darknecromancer
SadBunny Posted July 12, 2007 Posted July 12, 2007 You could have a variable keep track of a 'run' state which is default as 'off'. Then you conditionally execute your 'q' send if the run state has been changed to on. As for the key presses, you should look at CODEHotKeySet ( "key" [, "function"] ) as it appears to be what your looking for. Possible something like thisCODEHotKeySet ( "{f6}", "SwitchToRUN" ) HotKeySet ( "{f7}", "SwitchToPAUSE" ) Dim $State = False While(1) If($State = True)Then ;; UNCOMMENT to have it send the q ;Send( "q" ) EndIf Sleep(100) WEnd Func SwitchToRUN() $State = True EndFunc Func SwitchToPAUSE() $State = False EndFunc Darknecromancer Why not use one key to pause OR unpause it? It's what I used in GTA SA to auto-tap the left shift key Guessing this is like you need it too This code starts out doing nothing, but when you press F3 (change that to whatever you want) it toggles the on/off state. Opt("SendKeyDownDelay",50); <- be sure to experiment with this; many games don't register keypresses if they are only held down for the default length of 5 ms! HotKeySet("{F3}","toggle") $toggle = False While 1 If $toggle Then Send("{LSHIFT}") Sleep(250) WEnd Func Toggle() $toggle = Not $toggle EndFunc Roses are FF0000, violets are 0000FF... All my base are belong to you.
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