Unc3nZureD Posted April 29, 2010 Posted April 29, 2010 Hi. I tried to do a bunny hop script for a free source code game (so i think it's legally) Global $Paused HotKeySet("{SPACEDOWN}", "Start") HotKeySet("{SPACEUP}", "Stop") HotKeySet("{ESC}", "Terminate") While 1 Sleep(100) WEnd Func Start() While 1 Send("{SPACE}") Sleep(50) Send("{SPACE}") Sleep(50) WEnd EndFunc Func Stop() $Paused = NOT $Paused While $Paused sleep(100) ToolTip('Script is "Paused"',0,0) WEnd ToolTip("") EndFunc Func Terminate() Exit 0 EndFunc So the question: How can i solve it the spacebar hold and relase? (because {spaceup} and {spacedown} isn't good )
AdmiralAlkex Posted April 29, 2010 Posted April 29, 2010 I would do it more like this: #include <Misc.au3> Local $hDll = DllOpen("user32.dll"), $iPaused = False HotKeySet("!{ESC}", "_Terminate") HotKeySet("!{PAUSE}", "_Pause") While 1 Sleep(10) If $iPaused <> True And _IsPressed("20", $hDll) Then Send("{SPACE UP}") Send("{SPACE DOWN}") Sleep(10) EndIf WEnd Func _Pause() $iPaused = Not $iPaused EndFunc Func _Terminate() Exit 0 EndFunc ;==>Terminate .Some of my scripts: ShiftER, Codec-Control, Resolution switcher for HTC ShiftSome of my UDFs: SDL UDF, SetDefaultDllDirectories, Converting GDI+ Bitmap/Image to SDL Surface
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