|
SetWorkingDir % A_ScriptDir |
|
|
|
csvfile = testvars.csv |
|
TestVar2 = ServerVariable1|| ServerVaraible2| ServerVariable3| |
|
|
|
; Gui, 1: +AlwaysOnTop |
|
Gui, 1: Font, S9 |
|
Gui, 1: Add, Text, CDefault, Select Var1 |
|
Gui, 1: Add, DDL, vDDL1 |
|
|
|
Gui, 1: Add, Text, CDefault, Select Server Variable |
|
Gui, 1: Add, DDL, vDDL2, %TestVar2% |
|
|
|
Gui, 1: Add, Button, wp Default gButtonLaunch, Launch |
|
|
|
Gui, 1: Add, Button, wp Default, Stop |
|
Gui, 1: Add, Checkbox, Checked vRcon, Use Debug Console |
|
|
|
Gui, 1: Add, Text, CDefault, YOUR LAN IP: %A_IPAddress1% |
|
|
|
Gui, 1: Add, Button, ys wp gLoadCSV, populate ddl1 |
|
|
|
Gui, 1: Show, h200 w325, Video Game Server Launcher |
|
|
|
return |
|
|
|
ButtonLaunch: |
|
Gui, 1: Submit, NoHide |
|
msgbox done |
|
MsgBox, Path/VideoGame.exe %DDL1%%DDL2% |
|
|
|
Sleep, 100 |
|
|
|
if Rcon = 1 |
|
|
|
MsgBox, Debugconsole.exe |
|
Return |
|
|
|
ButtonStop: |
|
Gui, Submit, NoHide |
|
Runwait, taskkill /im VideoGame.exe /f |
|
Runwait, taskkill /im Debugconsole.exe /f |
|
return |
|
|
|
LoadCSV: |
|
GUIControl, 1:, DDL1, % CSVtoDDL(csvfile) |
|
return |
|
|
|
GuiClose: |
|
ExitApp |
|
|
|
CreateCSV(csvfile) |
|
{ |
|
If !FileExist(csvfile) |
|
{ |
|
Loop 5 |
|
FileAppend, % "level" a_index "`,", % csvfile |
|
} |
|
} |
|
|
|
CSVtoDDL(csvfile) |
|
{ |
|
If !FileExist(csvfile) |
|
CreateCSV(csvfile) |
|
|
|
FileRead, csv, % csvfile |
|
Loop, Parse, csv, CSV |
|
ddl.=A_LoopField (A_Index=1?"||":"|") |
|
|
|
Return SubStr(ddl,1,-1) |
|
} |