#NoEnv ; Recommended for performance and compatibility with future AutoHotkey releases.
SendMode Input ; Recommended for new scripts due to its superior speed and reliability.
SetWorkingDir %A_ScriptDir% ; Ensures a consistent starting directory.
#SingleInstance, Force
In := 1
; * Gui >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
GUI, Font, Segue UI s12 wBold
Menu, SettingsMenu, Add, Assign &Input Ctrl+I, Menu_AssignInput ; See remarks below about Ctrl+O.
Menu, SettingsMenu, Add, E&xit, Exit
Menu, MenuBar, Add, &Settings, :SettingsMenu ; Attach the two sub-menus that were created above.
GUI, Menu, MenuBar
GUI, Add, Text, x20 y20 w440 +Center,
GUI, Add, Edit, x20 y20 w440 vTitle +Center, Title
GUI, Add, Text, x20 y60 w220 +Center,
GUI, Add, Edit, x20 y60 w205 +Center, Home Team
GUI, Add, Text, x240 y60 w220 +Center,
GUI, Add, Edit, x255 y60 w205 +Center, Away Team
GUI, Add, Button, x225 y59 h30 w30 gTitleUpdate, ^
GUI, Add, Text, x20 y95 w440 +Center, ::::::::::Scores::::::::::
GUI, Font, Segue UI s20 wBold
GUI, Add, Edit, x20 y120 w210 +Center +Number gHomeUpdate, 0
GUI, Add, Edit, x250 y120 w210 +Center +Number gAwayUpdate, 0
GUI, Add, Button, x90 y160 h30 w30 gDecHome, -
GUI, Add, Button, x120 y160 h30 w30 gIncHome, +
GUI, Add, Button, x330 y160 h30 w30 gDecAway, -
GUI, Add, Button, x360 y160 h30 w30 gIncAway, +
GUI, Show, x272 y166 h200 w480, vMix Transition Demo
; -* End Gui <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
; Gosub Menu_AssignInput
Gosub HomeUpdate
Gosub AwayUpdate
GuiControl, Focus, Edit1
Return
Menu_AssignInput: ; * Input
^I::
inputs :=
GUI, Input:Font, Segue UI s10 wBold
loop,100
inputs := inputs . "|" . A_Index
Inputs := "Active|Preview" . inputs
GUI,Input:-SysMenu
GUI, Input:Add, Text, x20 y23 w310 , vMix Input to be used as Scoreboard output:
GUI, Input:Add, Combobox, x20 y50 w100 h30 R10 vIn, %inputs%
Gui, Input:Add, Button, gSubmitInput w310 h50,OK
Gui, Input:Show, w350 h150, Scoreboard Input
Return ; -*
SubmitInput: ; *
Gui, Input:Submit, NoHide
If not In
Return
Gui, Input:Destroy
If (In == "Active")
In := -1
If (In == "Preview")
In := 0
;msgbox %In%
Return ; -*
TitleUpdate: ; *
GuiControlGet, EditTitle, , Edit1,
Url =
http://127.0.0.1:8088/api/?Function=SetText&Input=%In%&SelectedName=Title&Value=%EditTitle%
URL2Var(Url)
GuiControl, Hide, Edit1
GuiControl, , Static1,%EditTitle%
GuiControlGet, EditHome, , Edit2,
Url =
http://127.0.0.1:8088/api/?Function=SetText&Input=%In%&SelectedName=HomeTitle&Value=%EditHome%
URL2Var(Url)
GuiControl, Hide, Edit2
GuiControl, , Static2,%EditHome%
GuiControlGet, EditAway, , Edit3,
Url =
http://127.0.0.1:8088/api/?Function=SetText&Input=%In%&SelectedName=AwayTitle&Value=%EditAway%
URL2Var(Url)
GuiControl, Hide, Edit3
GuiControl, , Static3,%EditAway%
GuiControl, Hide, Button1
Return ; -*
HomeUpdate: ; *
GuiControl, Disable, Edit4
GuiControlGet, HomeScore, , Edit4,
Url =
http://127.0.0.1:8088/api/?Function=SetText&Input=%In%&SelectedName=HomeScore&Value=%HomeScore%
URL2Var(Url)
GuiControl, Enable, Edit4
GuiControl, Focus, Edit4
Return ; -*
AwayUpdate: ; *
GuiControl, Disable, Edit5
GuiControlGet, AwayScore, , Edit5,
Url =
http://127.0.0.1:8088/api/?Function=SetText&Input=%In%&SelectedName=AwayScore&Value=%AwayScore%
URL2Var(Url)
GuiControl, Enable, Edit5
GuiControl, Focus, Edit5
Return ; -*
DecHome: ; *
GuiControlGet, HomeScore, , Edit4,
HomeScore := HomeScore - 1
GuiControl, , Edit4,%HomeScore%
Return ; -*
IncHome: ; *
GuiControlGet, HomeScore, , Edit4,
HomeScore := HomeScore + 1
GuiControl, , Edit4,%HomeScore%
Return ; -*
DecAway:
GuiControlGet, AwayScore, , Edit5,
AwayScore := AwayScore - 1
GuiControl, , Edit5,%AwayScore%
Return
IncAway:
GuiControlGet, AwayScore, , Edit5,
AwayScore := AwayScore + 1
GuiControl, , Edit5,%AwayScore%
Return
Exit: ; *
ExitApp
Return ; -*
URL2Var(URL) { ; *
ComObjError(0)
WebRequest := ComObjCreate("WinHttp.WinHttpRequest.5.1")
WebRequest.Open("GET", URL)
WebRequest.Send()
Return WebRequest.ResponseText()
, ComObjError(0)
} ; -*