From 60f7bbbbd502dd7ff7e432d26a8b1e35b96845db Mon Sep 17 00:00:00 2001 From: David Daily Date: Tue, 26 Jan 2021 11:07:46 -0600 Subject: [PATCH] slight improvements --- flag.ahk | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/flag.ahk b/flag.ahk index c4e77b8..be0d394 100644 --- a/flag.ahk +++ b/flag.ahk @@ -28,12 +28,10 @@ Switch A_Args[1] blink(A_Args[2], length) Case "p": patt(A_Args[2], length) - Default: - MsgBox,, Flag, % "Incorrect parameters passed to script: " A_Args[1] ", " A_Args[2] ", " length } -solid(input, length) +solid(input, length := 0) { Switch input { @@ -60,9 +58,10 @@ solid(input, length) ) } translate("https://api.luxafor.com/webhook/v1/actions/solid_color", json_str, length) + ExitApp } -blink(input, length) +blink(input, length := 0) { If (length = 0) { @@ -87,9 +86,10 @@ blink(input, length) } ) translate("https://api.luxafor.com/webhook/v1/actions/blink", json_str, length) + ExitApp } -patt(input, length) +patt(input, length := 0) { If (length = 0) { @@ -131,6 +131,7 @@ patt(input, length) } ) translate("https://api.luxafor.com/webhook/v1/actions/pattern", json_str, length) + ExitApp } translate(url, data, length) @@ -138,7 +139,7 @@ translate(url, data, length) If (length = 0) { req(url, data) - ExitApp + Goto, tEnd } Else { time_to_run := length * 1000 start_time := A_TickCount @@ -153,6 +154,7 @@ translate(url, data, length) Sleep, (length * 1000) off() } + tEnd: } off()