eliteapu Posted March 4, 2007 Share Posted March 4, 2007 (edited) Heres my beginning script. NO CREDITS ADDED YET, but i did take the beginning bit from another post. What I am looking for is it to have a client be able to specifiy a hotkey to be used, then when they hold that hotkey, it will hit numpad1 and when they release, it will release numpad1 Also, later on i want to be able to have the hotkey to be set on a mouse1/2 or 3 #include <Misc.au3> $var = InputBox("","Hotkey : ", 1) HotKeySet($var, "UP") HotKeySet("{Esc}", "Quit") Func UP() If _IsPressed($var) Then Do Send("{numpad1 down}") Until Not _IsPressed($var) then Send ("{numpad1 up}") Else sleep(10) Endif EndFunc Func Quit() Exit EndFunc Edited March 4, 2007 by eliteapu Link to comment Share on other sites More sharing options...
Moderators SmOke_N Posted March 4, 2007 Moderators Share Posted March 4, 2007 Heres my beginning script. NO CREDITS ADDED YET, but i did take the beginning bit from another post. What I am looking for is it to have a client be able to specifiy a hotkey to be used, then when they hold that hotkey, it will hit numpad1 and when they release, it will release numpad1 Also, later on i want to be able to have the hotkey to be set on a mouse1/2 or 3 #include <Misc.au3> $var = InputBox("","Hotkey : ", 1) HotKeySet($var, "UP") HotKeySet("{Esc}", "Quit") Func UP() If _IsPressed($var) Then Do Send("{numpad1 down}") Until Not _IsPressed($var) then Send ("{numpad1 up}") Else sleep(10) Endif EndFunc Func Quit() Exit EndFuncIs there an issue here you need help with ? Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer. Link to comment Share on other sites More sharing options...
nfwu Posted March 4, 2007 Share Posted March 4, 2007 (edited) Try this: #include <Misc.au3> $var = InputBox("","Hotkey : ", 1) HotKeySet("{Esc}", "Quit") While 1 If _IsPressed($var) Then Do Send("{numpad1 down}") Until Not _IsPressed($var) then Send ("{numpad1 up}") Else sleep(100) Endif WEnd Func Quit() Exit EndFunc Edit: btw, you'll need to lookup _IsPressed in the help file and use the appropriate ID code for the key. #) Edited March 4, 2007 by nfwu TwitterOut of date stuff:Scripts: Sudoku Solver | Webserver | 3D library (Pure AutoIt) | Wood's GadgetsUDFs: _WoodUniqueID() | _DialogEditIni() | _Console*() | _GetIPConfigData() | _URLEncode/Decode() Link to comment Share on other sites More sharing options...
eliteapu Posted March 4, 2007 Author Share Posted March 4, 2007 That compiles fine, but it wont work. I run it and it does not seem to be pressing numpad1 Link to comment Share on other sites More sharing options...
nfwu Posted March 4, 2007 Share Posted March 4, 2007 (edited) Try it now.Edit: btw, you'll need to lookup _IsPressed in the help file and use the appropriate ID code for the key.Edit2: And next time state what the problem is first.#) Edited March 4, 2007 by nfwu TwitterOut of date stuff:Scripts: Sudoku Solver | Webserver | 3D library (Pure AutoIt) | Wood's GadgetsUDFs: _WoodUniqueID() | _DialogEditIni() | _Console*() | _GetIPConfigData() | _URLEncode/Decode() Link to comment Share on other sites More sharing options...
eliteapu Posted March 4, 2007 Author Share Posted March 4, 2007 (edited) Same result... EDIT: yeah sorry for not posting correctly. And thank you for your quick responses. Edited March 4, 2007 by eliteapu Link to comment Share on other sites More sharing options...
nfwu Posted March 4, 2007 Share Posted March 4, 2007 you'll need to lookup _IsPressed in the help file and use the appropriate ID code for the key.Have you done that?#) TwitterOut of date stuff:Scripts: Sudoku Solver | Webserver | 3D library (Pure AutoIt) | Wood's GadgetsUDFs: _WoodUniqueID() | _DialogEditIni() | _Console*() | _GetIPConfigData() | _URLEncode/Decode() Link to comment Share on other sites More sharing options...
Moderators SmOke_N Posted March 4, 2007 Moderators Share Posted March 4, 2007 Two ways to intepret what you are doing I guess. expandcollapse popupGlobal $sVarPressed $var = InputBox("", "Hotkey : ", 1) HotKeySet($var, "UP") HotKeySet("{Esc}", "Quit") While 1 Sleep(100000) WEnd Func UP() $sVarPressed = Not $sVarPressed If $sVarPressed Then Send("{numpad1 down}") Else Send("{numpad1 up}") EndIf Return EndFunc ;==>UP Func Quit() Exit EndFunc ;==>QuitoÝ÷ Ø Ý¶¨¶«jëh×6Global $sVarPressed $var = InputBox("", "Hotkey : ", 1) HotKeySet($var, "UP") HotKeySet("{Esc}", "Quit") While 1 Sleep(100000) WEnd Func UP() $sVarPressed = Not $sVarPressed Do Send("{numpad1}") Until Not $sVarPressed Return EndFunc ;==>UP Func Quit() Exit EndFunc ;==>Quit Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer. Link to comment Share on other sites More sharing options...
eliteapu Posted March 4, 2007 Author Share Posted March 4, 2007 Thank you very much. the 2nd one is more what I am looking for, although it needs a bit of tweaking..thanks again.. Another question would be..is it possible to make it so in the input box it will recolonize mouse clicks to they can be hotkeys Link to comment Share on other sites More sharing options...
Moderators SmOke_N Posted March 4, 2007 Moderators Share Posted March 4, 2007 Thank you very much. the 2nd one is more what I am looking for, although it needs a bit of tweaking..thanks again..Another question would be..is it possible to make it so in the input box it will recolonize mouse clicks to they can be hotkeysNo... Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer. Link to comment Share on other sites More sharing options...
eliteapu Posted March 4, 2007 Author Share Posted March 4, 2007 Okay, well thanks alot man 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