From 605177e8e77687305b190280e2591d30fb6917b0 Mon Sep 17 00:00:00 2001 From: Eric Werner Date: Fri, 18 Mar 2022 09:30:56 +0100 Subject: [PATCH] aTimer: adding new WIP module --- aTimer/a2module.json | 28 ++++++++++++++++++++++++++++ aTimer/aTimer.ahk | 32 ++++++++++++++++++++++++++++++++ 2 files changed, 60 insertions(+) create mode 100644 aTimer/a2module.json create mode 100644 aTimer/aTimer.ahk diff --git a/aTimer/a2module.json b/aTimer/a2module.json new file mode 100644 index 0000000..968adb3 --- /dev/null +++ b/aTimer/a2module.json @@ -0,0 +1,28 @@ +[ + { + "author": "eric", + "date": "2021 9 14", + "description": "\u2022 Set number of minutes,\n\u2022 Set something to \"Run\" (url or program)\n.. that's currently it! Well, this could be huuuge!", + "display_name": "", + "tags": [], + "typ": "nfo", + "url": "", + "version": "0.1" + }, + { + "disablable": true, + "enabled": true, + "functionCode": "aTimer_menu()", + "functionMode": 0, + "keyChange": true, + "label": "Set up a timer", + "multiple": true, + "name": "aTimer_Hotkey", + "scopeChange": true, + "typ": "hotkey" + }, + { + "file": "aTimer.ahk", + "typ": "include" + } +] \ No newline at end of file diff --git a/aTimer/aTimer.ahk b/aTimer/aTimer.ahk new file mode 100644 index 0000000..1b16e25 --- /dev/null +++ b/aTimer/aTimer.ahk @@ -0,0 +1,32 @@ +; aTimer - aTimer.ahk +; author: eric +; created: 2021 9 14 + +aTimer_menu(){ + InputBox, minutes, aTimer, Set a timer in ... Minutes?, , 240, 120 + minutes := Trim(minutes) + If !IsNumber(minutes) { + if !minutes + return + a2tip("How much is """ minutes """ Minutes?!? ...") + return + } + + InputBox, what_to_do, aTimer, What to do in %minutes% Minutes?, , 240, 120 + what_to_do := Trim(what_to_do) + if !what_to_do + return + + global _aTimer_what_to_do + _aTimer_what_to_do := what_to_do + SetTimer, aTimer_exec, % minutes * 60000 +} + +aTimer_exec() { + SetTimer, aTimer_exec, Off + global _aTimer_what_to_do + app := "C:\Program Files (x86)\Google\Chrome\Application\chrome.exe" + Run, %app% %_aTimer_what_to_do% +} + +; https://mynoise.net/NoiseMachines/windSeaRainNoiseGenerator.php