| 1 |
#Requires AutoHotkey v2.0+ |
| 2 |
; ask what WLED preset to run |
| 3 |
MyGui := Gui(, "Choose WLED Preset") |
| 4 |
MyGui.Add("Text",, "Preset:") |
| 5 |
MyGui.AddDropDownList("vColorChoice", ["Off","Purpley","Blue Pacifica","Magma Flow"]) |
| 6 |
MyGui.Add("Button", "default", "OK").OnEvent("Click", ProcessUserInput) |
| 7 |
MyGui.OnEvent("Close", ProcessUserInput) |
| 8 |
MyGui.Show() |
| 9 |
|
| 10 |
ProcessUserInput(*) |
| 11 |
{ |
| 12 |
Saved := MyGui.Submit() ; Save the contents of named controls into an object. |
| 13 |
; MsgBox("You entered '" Saved.ColorChoice " '.") |
| 14 |
switch Saved.ColorChoice |
| 15 |
{ |
| 16 |
case "Off": Run('curl "http://192.168.1.143/win&PL=1"') |
| 17 |
case "Purpley": Run('curl "http://192.168.1.143/win&PL=2"') |
| 18 |
case "Blue Pacifica": Run('curl "http://192.168.1.143/win&PL=3"') |
| 19 |
case "Magma Flow": Run('curl "http://192.168.1.143/win&PL=4"') |
| 20 |
} |
| 21 |
} |
| 22 |
Return |