Dhanbb Posted June 6, 2018 Share Posted June 6, 2018 Hi, im a new user and im starting to learn about AHK. I want to make a simple script with these processes: 1. When the "5" key is detected, modify a line from a ini i got that permits the user to open a process. Something like a variable with newline and old line? 2. After a time, lets say 5 minutes, the script should return for example "ESC", and wait for another "5" key, which is the native status of the script. 3. (optional) if another 5 is pressed, add another 5 minutes to the restarting amount of time. 4. (optional) show a gui with the current remaining time. I know its complex but i just need a little push. Thank you!! Link to comment Share on other sites More sharing options...
TheXman Posted June 6, 2018 Share Posted June 6, 2018 (edited) @Dhanbb If you want to learn AHK, why don't you post your request in an AHK forum? You do realize this is an AutoIt forum don't you? If you want to learn AutoIt, then I would start with getting familiar with the help file and the search function of the forum. Edited June 6, 2018 by TheXman CryptoNG UDF: Cryptography API: Next Gen jq UDF: Powerful and Flexible JSON Processor | jqPlayground: An Interactive JSON Processor Xml2Json UDF: Transform XML to JSON | HttpApi UDF: HTTP Server API | Roku Remote: Example Script About Me How To Ask Good Questions On Technical And Scientific Forums (Detailed) | How to Ask Good Technical Questions (Brief) "Any fool can know. The point is to understand." -Albert Einstein "If you think you're a big fish, it's probably because you only swim in small ponds." ~TheXman Link to comment Share on other sites More sharing options...
Subz Posted June 6, 2018 Share Posted June 6, 2018 You can use something like: HotKeySet("{ESC}", "_ExitScript") HotKeySet("6", "_EndTimer") HotKeySet("5", "_StartTimer") Global $hTimer, $fTimer = 0, $bTimer = False Global $sIniProcess = @ScriptDir & "\Process.ini" ;~ Ini File Path While 1 Sleep(100) WEnd Func _StartTimer() $bTimer = True $hTimer = TimerInit() ;~ Begin the timer and store the handle in a variable IniWrite($sIniProcess, "Process", "Notepad.exe", True) While 1 $fTimer = Round(TimerDiff($hTimer), 0) If $fTimer >= 10000 Or $bTimer = False Then $bTimer = False IniWrite($sIniProcess, "Process", "Notepad.exe", False) ExitLoop EndIf WEnd EndFunc Func _EndTimer() $bTimer = False EndFunc Func _ExitScript() Exit EndFunc 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