Unc3nZureD 13 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 ) Share this post Link to post Share on other sites
AdmiralAlkex 125 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 Share this post Link to post Share on other sites
Unc3nZureD 13 Posted April 30, 2010 Thanks, works well! Share this post Link to post Share on other sites