ElitePlayer Posted February 2, 2007 Posted February 2, 2007 I just wanted to start out with this script:Assign "Insert" Key as a trigger to start pressing a Key (Say "G") and hold it until I press "Pause" as a hotkey to pause the script and then resume with "Insert" Key. Finally, close the script with "End" key.Any help would be greatly appreciated. :">
BrettF Posted February 2, 2007 Posted February 2, 2007 (edited) HotkeySet is your friend And Send And Sleep... Edit: Added ands.... Edited February 2, 2007 by bert Vist my blog!UDFs: Opens The Default Mail Client | _LoginBox | Convert Reg to AU3 | BASS.au3 (BASS.dll) (Includes various BASS Libraries) | MultiLang.au3 (Multi-Language GUIs!)Example Scripts: Computer Info Telnet Server | "Secure" HTTP Server (Based on Manadar's Server)Software: AAMP- Advanced AutoIt Media Player | WorldCam | AYTU - Youtube Uploader Tutorials: Learning to Script with AutoIt V3Projects (Hardware + AutoIt): ArduinoUseful Links: AutoIt 1-2-3 | The AutoIt Downloads Section: | SciTE4AutoIt3 Full Version!
ElitePlayer Posted February 2, 2007 Author Posted February 2, 2007 HotkeySet is your friend Can you like show it to me with the script itself?I'm totally lost.
BrettF Posted February 2, 2007 Posted February 2, 2007 Global $Paused HotKeySet("{INSERT}", "Trigger") HotKeySet("{PAUSE}", "TogglePause") HotKeySet("{END}", "END") While 1 Sleep(100) WEnd Func Trigger () While 1 Send ("G") Sleep (100) Send ("G") Sleep (100) Send ("G") Sleep (100) Send ("G") Sleep (100) WEnd Exit EndFunc ;==>_Func Func TogglePause() $Paused = NOT $Paused While $Paused sleep(100) ToolTip('Script is "Paused"',0,0) WEnd ToolTip("") EndFunc Func END () Exit EndFunc That should get you started.... Vist my blog!UDFs: Opens The Default Mail Client | _LoginBox | Convert Reg to AU3 | BASS.au3 (BASS.dll) (Includes various BASS Libraries) | MultiLang.au3 (Multi-Language GUIs!)Example Scripts: Computer Info Telnet Server | "Secure" HTTP Server (Based on Manadar's Server)Software: AAMP- Advanced AutoIt Media Player | WorldCam | AYTU - Youtube Uploader Tutorials: Learning to Script with AutoIt V3Projects (Hardware + AutoIt): ArduinoUseful Links: AutoIt 1-2-3 | The AutoIt Downloads Section: | SciTE4AutoIt3 Full Version!
ElitePlayer Posted February 2, 2007 Author Posted February 2, 2007 Global $Paused HotKeySet("{INSERT}", "Trigger") HotKeySet("{PAUSE}", "TogglePause") HotKeySet("{END}", "END") While 1 Sleep(100) WEnd Func Trigger () While 1 Send ("G") Sleep (100) Send ("G") Sleep (100) Send ("G") Sleep (100) Send ("G") Sleep (100) WEnd Exit EndFunc ;==>_Func Func TogglePause() $Paused = NOT $Paused While $Paused sleep(100) ToolTip('Script is "Paused"',0,0) WEnd ToolTip("") EndFunc Func END () Exit EndFunc That should get you started.... That works perfectly if you speak but I'm trying to implement this in a game where you have to hold down that button("G"). This doesn't work in that case. I wonder wats wrong
BrettF Posted February 2, 2007 Posted February 2, 2007 What stoping the script in between the keypresses? What happens if you hold down "G"?? gggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggg... all mine dose is (spaces is sleep...) g g g g g g g g g g g g g g g g g g g g........ So what should you do? Vist my blog!UDFs: Opens The Default Mail Client | _LoginBox | Convert Reg to AU3 | BASS.au3 (BASS.dll) (Includes various BASS Libraries) | MultiLang.au3 (Multi-Language GUIs!)Example Scripts: Computer Info Telnet Server | "Secure" HTTP Server (Based on Manadar's Server)Software: AAMP- Advanced AutoIt Media Player | WorldCam | AYTU - Youtube Uploader Tutorials: Learning to Script with AutoIt V3Projects (Hardware + AutoIt): ArduinoUseful Links: AutoIt 1-2-3 | The AutoIt Downloads Section: | SciTE4AutoIt3 Full Version!
BALA Posted February 2, 2007 Posted February 2, 2007 (edited) From help file: To hold a key down (generally only useful for games) Send("{a down}");Holds the A key down Send("{a up}");Releases the A key EDIT: made a big mistake earlier, I fixed it now XD Edited February 2, 2007 by BALA [font="Comic Sans MS"]BA-LA[/font]http://ba-la.110mb.comJoin my community, CLICK HEREAlternative links to my site:http://www.ba-la.tkhttp://www.ba-la.co.nrContact me if you would like to help with some of my projects: joeythepirate@gmail.com
ElitePlayer Posted February 2, 2007 Author Posted February 2, 2007 (edited) Both of you thanks a lot. I made it to work like this: Global $Paused HotKeySet("{INSERT}", "Trigger") HotKeySet("{PAUSE}", "TogglePause") HotKeySet("{END}", "END") While 1 Sleep(100) WEnd Func Trigger () While 1 Send ("{g down}") Sleep (100) WEnd Exit EndFunc ;==>_Func Func TogglePause() $Paused = NOT $Paused Send ("{g up}") While $Paused sleep(100) ToolTip('Script is "Paused"',0,0) WEnd ToolTip("") EndFunc Func END () Send ("{g up}") Exit EndFunc Edited February 2, 2007 by ElitePlayer
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