View difference between Paste ID: Az6vabnK and UavTvskD
SHOW: | | - or go back to the newest paste.
1
#region ;**** Directives created by AutoIt3Wrapper_GUI ****
2
#AutoIt3Wrapper_Icon=Resources\Diamond Icon.ico
3
#AutoIt3Wrapper_Outfile_x64=..\..\Desktop\Bungee Server Launcher.exe
4
#endregion ;**** Directives created by AutoIt3Wrapper_GUI ****
5
#region Include
6
#include <GUIConstants.au3>
7
#include <GUIConstantsEx.au3>
8
#include <GuiComboBoxEx.au3>
9
#include <Constants.au3>
10
#include <ProgressConstants.au3>
11
#include <GuiStatusBar.au3>
12-
Global $hwnd0, $hwnd1, $hwnd2, $hwnd3, $hwnd4, $hwnd5, $servers, $backupdir, $file0, $file1, $file2, $file3, $file4, $file5, $chosen2, $chosen3, $Combo3, $Read3
12+
#include <EditConstants.au3>
13-
$Gui = GUICreate("MineCraft Server Client -Made by EpicKnarvik97", 450, 170, 0, 0)
13+
14-
$Tab1 = GUICtrlCreateTab(8, 8, 435, 110)
14+
15-
15+
16-
$TabSheet1 = GUICtrlCreateTabItem("Basic Controls")
16+
#include <EditConstants.au3>
17-
$Label1 = GUICtrlCreateLabel("Server(s) are closed", 10, 125)
17+
#include <WinAPI.au3>
18-
$StartG = GUICtrlCreateButton("Start Server", 10, 35, 75, 25)
18+
#endregion Include
19-
$StopG = GUICtrlCreateButton("Stop Server", 10, 60, 75, 25)
19+
#region GUI
20-
$Command_Arguments = GUICtrlCreateInput("", 11, 86, 213, 25)
20+
Global $hwnd0, $hwnd1, $hwnd2, $hwnd3, $hwnd4, $hwnd5, $servers, $backupdir, $file0, $file1, $file2, $file3, $file4, $file5, $chosen2, $chosen3, $Combo3, $Read3, $1, $2, $3, $BungeeServer, $GUI, $hwnd00, $Edit1, $Edit2, $Edit3, $Hide = @SW_SHOW, $GUI2;Global variabled needed to be defined because they aren't before further down then they are needed.
21-
$KickG = GUICtrlCreateButton("Kick", 87, 35, 75, 25)
21+
$GUI = GUICreate("MineCraft Server Client -Made by EpicKnarvik97", 450, 170, 0, 0);The main GUI
22-
$SaveG = GUICtrlCreateButton("Save Server", 87, 60, 75, 25)
22+
$Tab1 = GUICtrlCreateTab(8, 8, 435, 110);The main tab
23-
$BanG = GUICtrlCreateButton("Ban", 164, 35, 75, 25)
23+
$TabSheet1 = GUICtrlCreateTabItem("Basic Controls");Tab 1:Basic controls
24-
$UnbanG = GUICtrlCreateButton("Unban", 164, 60, 75, 25)
24+
$Label1 = GUICtrlCreateLabel("Server(s) are closed", 10, 125);State of the servers (Based on the start and stop server buttons).
25-
$OPG = GUICtrlCreateButton("OP", 241, 35, 75, 25)
25+
$StartG = GUICtrlCreateButton("Start Server", 10, 35, 75, 25);The button that starts the server.
26-
$DEOPG = GUICtrlCreateButton("DEOP", 241, 60, 75, 25)
26+
$StopG = GUICtrlCreateButton("Stop Server", 10, 60, 75, 25);The button that stops the server.
27-
$CCG = GUICtrlCreateButton("Custom Command", 225, 86, 91, 25)
27+
$Command_Arguments = GUICtrlCreateInput("", 11, 86, 213, 25);Input to allow command arguments.
28-
$addw = GUICtrlCreateButton("Add to Whitelist", 318, 35, 115)
28+
$KickG = GUICtrlCreateButton("Kick", 87, 35, 75, 25);The button that kicks a player.
29-
$delw = GUICtrlCreateButton("Remove from Whitelist", 318, 60, 115)
29+
$SaveG = GUICtrlCreateButton("Save Server", 87, 60, 75, 25);The button that saves the server.
30-
$backup = GUICtrlCreateButton("Backup", 318, 86, 115)
30+
$BanG = GUICtrlCreateButton("Ban", 164, 35, 75, 25);The button that bans a player.
31-
$helpmenu = GUICtrlCreateMenu("Help")
31+
$UnbanG = GUICtrlCreateButton("Unban", 164, 60, 75, 25);The button that bans a player.
32-
$setupitem = GUICtrlCreateMenuItem("Setup", $helpmenu)
32+
$OPG = GUICtrlCreateButton("OP", 241, 35, 75, 25);The button that ops a player.
33-
$help = GUICtrlCreateMenuItem("Warning", $helpmenu)
33+
$DEOPG = GUICtrlCreateButton("DEOP", 241, 60, 75, 25);The button that deops a player.
34-
$info = GUICtrlCreateMenu("Info")
34+
$CCG = GUICtrlCreateButton("Custom Command", 225, 86, 91, 25);The button that runs a command of your choice.
35-
$aboutitem = GUICtrlCreateMenuItem("About", $info)
35+
$addw = GUICtrlCreateButton("Add to Whitelist", 318, 35, 115);The button that adds a player to the whitelist.
36-
$How = GUICtrlCreateMenuItem("How does it work?", $info)
36+
$delw = GUICtrlCreateButton("Remove from Whitelist", 318, 60, 115);The button that removes a player from the whitelist.
37-
37+
$backup = GUICtrlCreateButton("Backup", 318, 86, 115);The button that commences a backup of the server.
38-
$TabSheet2 = GUICtrlCreateTabItem("Server Config")
38+
$consoles = GUICtrlCreateButton("Console Output", 318, 120, 115);The button that toggles visibility of the server.
39-
$Combo1 = GUICtrlCreateCombo("Server Memory", 10, 35, 161, 25, $CBS_DROPDOWNLIST)
39+
$helpmenu = GUICtrlCreateMenu("Help");Creates a helpmenu
40-
$Checkbox1 = GUICtrlCreateCheckbox("Hide Console", 180, 120, 97, 25)
40+
$setupitem = GUICtrlCreateMenuItem("Setup", $helpmenu);Creates a setup item in the helpmenu
41-
$Bungee = GUICtrlCreateCheckbox("Bungee", 175, 35, 97, 25)
41+
$help = GUICtrlCreateMenuItem("Warning", $helpmenu);Creates a warning item in the helpmenu
42-
$server1 = GUICtrlCreateCheckbox("Enable Server 1", 175, 60, 97, 25)
42+
$info = GUICtrlCreateMenu("Info");Creates an infomenu
43-
$server2 = GUICtrlCreateCheckbox("Enable Server 2", 175, 85, 97, 25)
43+
$aboutitem = GUICtrlCreateMenuItem("About", $info);Creates an About item in the infomenu
44-
$server3 = GUICtrlCreateCheckbox("Enable Server 3", 300, 35, 97, 25)
44+
$How = GUICtrlCreateMenuItem("How does it work?", $info);Creates a "How does it work" item in the infomenu
45-
$server4 = GUICtrlCreateCheckbox("Enable Server 4", 300, 60, 97, 25)
45+
$TabSheet2 = GUICtrlCreateTabItem("Server Config");Tab 2: Server Config
46-
$server5 = GUICtrlCreateCheckbox("Enable Server 5", 300, 85, 97, 25)
46+
$Bungee = GUICtrlCreateCheckbox("Bungee", 175, 35, 97, 25);The checkboz that enables the Bungee server.
47-
$DelConf = GUICtrlCreateButton("Delete all configurations and exit", 10, 120, 160, 25)
47+
$server1 = GUICtrlCreateCheckbox("Enable Server 1", 175, 60, 97, 25);The checkbox that enabled Server1.
48-
GUICtrlSetData($Combo1, "-Xmx1024M|-Xmx2048M|-Xmx3072M|-Xmx4096M|-Xmx5120M|-Xmx6144M|-Xmx7168M|-Xmx8192M|-Xmx9216M|-Xmx10240M")
48+
$server2 = GUICtrlCreateCheckbox("Enable Server 2", 175, 85, 97, 25);The checkbox that enabled Server2.
49
$server3 = GUICtrlCreateCheckbox("Enable Server 3", 300, 35, 97, 25);The checkbox that enabled Server3.
50
$server4 = GUICtrlCreateCheckbox("Enable Server 4", 300, 60, 97, 25);The checkbox that enabled Server4.
51-
51+
$server5 = GUICtrlCreateCheckbox("Enable Server 5", 300, 85, 97, 25);The checkbox that enabled Server5.
52-
52+
$DelConf = GUICtrlCreateButton("Delete all configurations and exit", 10, 120, 160, 25);The button that deletes all of your configurations.
53-
53+
$Combo1 = GUICtrlCreateCombo("Server Memory", 10, 35, 161, 25, $CBS_DROPDOWNLIST);A combo defined as a dropbox to choose server memory.
54
GUICtrlSetData($Combo1, "-Xmx1024M|-Xmx2048M|-Xmx3072M|-Xmx4096M|-Xmx5120M|-Xmx6144M|-Xmx7168M|-Xmx8192M|-Xmx9216M|-Xmx10240M");This sets the data aka the different choices of the dropbox.
55
$Combo2 = GUICtrlCreateCombo("Server Type", 10, 60, 161, 25, $CBS_DROPDOWNLIST)
56
GUICtrlSetData($Combo2, "Vanilla|Snapshot|Spigot|CB Dev|CB Stable|CB Beta")
57-
57+
If RegRead("HKEY_CURRENT_USER\Software\KnarCraft\Bungee Controller", "Combo2") = "Vanilla" Then
58
	GUISwitch($GUI, $TabSheet2)
59-
If $Read3 = "Vanilla" Then
59+
60-
	GUISwitch($Gui, $TabSheet2)
60+
61
	GUISwitch($GUI, $TabSheet1)
62
EndIf
63-
	ReadStats()
63+
64
GUICtrlCreateLabel("Coming Soon", 60, 50, 200, 40)
65-
65+
66-
If $backupdir = "" Then $backupdir = FileSelectFolder("Choose Backups Location", "")
66+
67-
If GUICtrlRead($Bungee) = 1 And $file0 = "" Then $file0 = FileSelectFolder("Choose Bungee Server Location...", "")
67+
68-
If GUICtrlRead($server1) = 1 And $file1 = "" Then $file1 = FileSelectFolder("Choose Server 1 Location...", "")
68+
#endregion GUI
69-
If GUICtrlRead($server2) = 1 And $file2 = "" Then $file2 = FileSelectFolder("Choose Server 2 Location...", "")
69+
#region Loc prompt and readstats
70-
If GUICtrlRead($server3) = 1 And $file3 = "" Then $file3 = FileSelectFolder("Choose Server 3 Location...", "")
70+
71-
If GUICtrlRead($server4) = 1 And $file4 = "" Then $file4 = FileSelectFolder("Choose Server 4 Location...", "")
71+
If $backupdir = "" Then $backupdir = FileSelectFolder("Choose Backups Location", "");Prompts for a location if it isn't defined.
72-
If GUICtrlRead($server5) = 1 And $file5 = "" Then $file5 = FileSelectFolder("Choose Server 5 Location...", "")
72+
If GUICtrlRead($Bungee) = 1 And $file0 = "" Then $file0 = FileSelectFolder("Choose Bungee Server Location...", "");Prompts for a location if it isn't defined.
73-
73+
If GUICtrlRead($server1) = 1 And $file1 = "" Then $file1 = FileSelectFolder("Choose Server 1 Location...", "");Prompts for a location if it isn't defined.
74
If GUICtrlRead($server2) = 1 And $file2 = "" Then $file2 = FileSelectFolder("Choose Server 2 Location...", "");Prompts for a location if it isn't defined.
75
If GUICtrlRead($server3) = 1 And $file3 = "" Then $file3 = FileSelectFolder("Choose Server 3 Location...", "");Prompts for a location if it isn't defined.
76-
While 1
76+
If GUICtrlRead($server4) = 1 And $file4 = "" Then $file4 = FileSelectFolder("Choose Server 4 Location...", "");Prompts for a location if it isn't defined.
77-
	Global $chosen = GUICtrlRead($Combo1), $chosen2 = GUICtrlRead($Combo2), $chosen3 = GUICtrlRead($Combo3), $args = GUICtrlRead($Command_Arguments), $nMsg = GUIGetMsg()
77+
If GUICtrlRead($server5) = 1 And $file5 = "" Then $file5 = FileSelectFolder("Choose Server 5 Location...", "");Prompts for a location if it isn't defined.
78-
	If GUICtrlRead($Checkbox1) = 1 Then
78+
#endregion Loc prompt and readstats
79-
		$Hide = @SW_HIDE
79+
While 1;The script's loop.
80-
	Else
80+
	$chosen = GUICtrlRead($Combo1)
81-
		$Hide = @SW_SHOW
81+
	$chosen2 = GUICtrlRead($Combo2)
82
	$chosen3 = GUICtrlRead($Combo3)
83
	$args = GUICtrlRead($Command_Arguments)
84
	$nMsg = GUIGetMsg()
85
	Switch $nMsg
86
		Case $GUI_EVENT_CLOSE
87-
		Case $StartG
87+
88-
			If GUICtrlRead($Bungee) = $GUI_UNCHECKED And GUICtrlRead($server1) = $GUI_UNCHECKED Then
88+
89
		Case $Combo2;Makes a combo to choose vanilla version.
90
			If $chosen2 = "Vanilla" Then
91
				GUISwitch($GUI, $TabSheet2)
92
				$Combo3 = GUICtrlCreateCombo("Choose Version", 10, 85, 161, 25, $CBS_DROPDOWNLIST)
93-
		Case $KickG
93+
				GUICtrlSetData($Combo3, "Latest|1.6.4|1.6.2|1.5.2|1.4.7|1.4.5")
94
				$Read9 = RegRead("HKEY_CURRENT_USER\Software\KnarCraft\Bungee Controller", "Combo3")
95-
				$kick = ControlSend("Server1", "", $hwnd1, 'kick ' & $args & '{ENTER}') & ControlSend("Server2", "", $hwnd2, 'kick ' & $args & '{ENTER}') & ControlSend("Server3", "", $hwnd3, 'kick ' & $args & '{ENTER}') & ControlSend("Server4", "", $hwnd4, 'kick ' & $args & '{ENTER}') & ControlSend("Server5", "", $hwnd5, 'kick ' & $args & '{ENTER}')
95+
				If Not $Read9 = "" Then
96
					GUICtrlSetData($Combo3, $Read9)
97
				EndIf
98
				GUICtrlCreateTabItem("")
99-
		Case $BanG
99+
100
				RegWrite("HKEY_CURRENT_USER\Software\KnarCraft\Bungee Controller", "Combo3", "REG_SZ", GUICtrlRead($Combo3))
101-
				$ban = ControlSend("Server1", "", $hwnd1, 'ban ' & $args & '{ENTER}') & ControlSend("Server2", "", $hwnd2, 'ban ' & $args & '{ENTER}') & ControlSend("Server3", "", $hwnd3, 'ban ' & $args & '{ENTER}') & ControlSend("Server4", "", $hwnd4, 'ban ' & $args & '{ENTER}') & ControlSend("Server5", "", $hwnd5, 'ban ' & $args & '{ENTER}')
101+
				GUISwitch($GUI, $TabSheet2)
102
				GUICtrlDelete($Combo3)
103
			EndIf
104
		Case $consoles;Changes the state of the comsoles window.
105-
		Case $UnbanG
105+
106
				If BitAND(WinGetState($GUI2), 2) Then
107-
				$unban = ControlSend("Server1", "", $hwnd1, 'pardon ' & $args & '{ENTER}') & ControlSend("Server2", "", $hwnd2, 'pardon ' & $args & '{ENTER}') & ControlSend("Server3", "", $hwnd3, 'pardon ' & $args & '{ENTER}') & ControlSend("Server4", "", $hwnd4, 'pardon ' & $args & '{ENTER}') & ControlSend("Server5", "", $hwnd5, 'pardon ' & $args & '{ENTER}')
107+
					GUISetState(@SW_HIDE, $GUI2)
108
				Else
109
					GUISetState(@SW_SHOW, $GUI2)
110
				EndIf
111-
		Case $OPG
111+
112
				MsgBox(16, "Failure", "The server isn't running")
113-
				$op = ControlSend("Server1", "", $hwnd1, 'op ' & $args & '{ENTER}') & ControlSend("Server2", "", $hwnd2, 'op ' & $args & '{ENTER}') & ControlSend("Server3", "", $hwnd3, 'op ' & $args & '{ENTER}') & ControlSend("Server4", "", $hwnd4, 'op ' & $args & '{ENTER}') & ControlSend("Server5", "", $hwnd5, 'op ' & $args & '{ENTER}')
113+
114
		Case $StartG;Starts the servers as long as at least one is selected.
115
			If GUICtrlRead($Bungee) = $GUI_UNCHECKED And GUICtrlRead($server1) = $GUI_UNCHECKED And GUICtrlRead($server2) = $GUI_UNCHECKED And GUICtrlRead($server3) = $GUI_UNCHECKED And GUICtrlRead($server4) = $GUI_UNCHECKED And GUICtrlRead($server5) = $GUI_UNCHECKED Then
116
				MsgBox(-1, "ERROR", "No servers enabled")
117-
		Case $DEOPG
117+
118
				Start()
119-
				$deop = ControlSend("Server1", "", $hwnd1, 'deop ' & $args & '{ENTER}') & ControlSend("Server2", "", $hwnd2, 'deop ' & $args & '{ENTER}') & ControlSend("Server3", "", $hwnd3, 'deop ' & $args & '{ENTER}') & ControlSend("Server4", "", $hwnd4, 'deop ' & $args & '{ENTER}') & ControlSend("Server5", "", $hwnd5, 'deop ' & $args & '{ENTER}')
119+
120
		Case $KickG;Kicks a player
121
			If $servers = "RUNNING" Then
122
				ControlSend("Server1", "", $hwnd1, 'kick ' & $args & '{ENTER}')
123-
		Case $SaveG
123+
				ControlSend("Server2", "", $hwnd2, 'kick ' & $args & '{ENTER}')
124
				ControlSend("Server3", "", $hwnd3, 'kick ' & $args & '{ENTER}')
125-
				$save = ControlSend("Server1", "", $hwnd1, 'save-all' & '{ENTER}') & ControlSend("Server2", "", $hwnd2, 'save-all' & '{ENTER}') & ControlSend("Server3", "", $hwnd3, 'save-all' & '{ENTER}') & ControlSend("Server4", "", $hwnd4, 'save-all' & '{ENTER}') & ControlSend("Server5", "", $hwnd5, 'save-all' & '{ENTER}')
125+
				ControlSend("Server4", "", $hwnd4, 'kick ' & $args & '{ENTER}')
126
				ControlSend("Server5", "", $hwnd5, 'kick ' & $args & '{ENTER}')
127
			Else
128
				MsgBox(16, "Failure", "The server isn't running")
129-
		Case $CCG
129+
130
		Case $BanG;Bans a player
131-
				$cc = ControlSend("Server1", "", $hwnd1, $args & '{ENTER}') & ControlSend("Server2", "", $hwnd2, $args & '{ENTER}') & ControlSend("Server3", "", $hwnd3, $args & '{ENTER}') & ControlSend("Server4", "", $hwnd4, $args & '{ENTER}') & ControlSend("Server5", "", $hwnd5, $args & '{ENTER}')
131+
132
				ControlSend("Server1", "", $hwnd1, 'ban ' & $args & '{ENTER}')
133
				ControlSend("Server2", "", $hwnd2, 'ban ' & $args & '{ENTER}')
134
				ControlSend("Server3", "", $hwnd3, 'ban ' & $args & '{ENTER}')
135-
		Case $StopG
135+
				ControlSend("Server4", "", $hwnd4, 'ban ' & $args & '{ENTER}')
136
				ControlSend("Server5", "", $hwnd5, 'ban ' & $args & '{ENTER}')
137
			Else
138-
				$stop = ControlSend("Bungee", "", $hwnd0, 'end' & '{ENTER}') & ControlSend("Server1", "", $hwnd1, 'stop' & '{ENTER}') & ControlSend("Server2", "", $hwnd2, 'stop' & '{ENTER}') & ControlSend("Server3", "", $hwnd3, 'stop' & '{ENTER}') & ControlSend("Server4", "", $hwnd4, 'stop' & '{ENTER}') & ControlSend("Server5", "", $hwnd5, 'stop' & '{ENTER}')
138+
139
			EndIf
140
		Case $UnbanG;Unbans a player
141-
		Case $backup
141+
142
				ControlSend("Server1", "", $hwnd1, 'pardon ' & $args & '{ENTER}')
143-
		Case $addw
143+
				ControlSend("Server2", "", $hwnd2, 'pardon ' & $args & '{ENTER}')
144
				ControlSend("Server3", "", $hwnd3, 'pardon ' & $args & '{ENTER}')
145-
				$addtowhitelist = ControlSend("Server1", "", $hwnd1, 'whitelist add ' & '{ENTER}') & ControlSend("Server2", "", $hwnd2, 'whitelist add ' & '{ENTER}') & ControlSend("Server3", "", $hwnd3, 'whitelist add ' & '{ENTER}') & ControlSend("Server4", "", $hwnd4, 'whitelist add ' & '{ENTER}') & ControlSend("Server5", "", $hwnd5, 'whitelist add ' & '{ENTER}')
145+
				ControlSend("Server4", "", $hwnd4, 'pardon ' & $args & '{ENTER}')
146
				ControlSend("Server5", "", $hwnd5, 'pardon ' & $args & '{ENTER}')
147
			Else
148
				MsgBox(16, "Failure", "The server isn't running")
149-
		Case $delw
149+
150
		Case $OPG;Ops a player
151-
				$removefromwhitelist = ControlSend("Server1", "", $hwnd1, 'whitelist remove ' & '{ENTER}') & ControlSend("Server2", "", $hwnd2, 'whitelist remove ' & '{ENTER}') & ControlSend("Server3", "", $hwnd3, 'whitelist remove ' & '{ENTER}') & ControlSend("Server4", "", $hwnd4, 'whitelist remove ' & '{ENTER}') & ControlSend("Server5", "", $hwnd5, 'whitelist remove ' & '{ENTER}')
151+
152
				ControlSend("Server1", "", $hwnd1, 'op ' & $args & '{ENTER}')
153
				ControlSend("Server2", "", $hwnd2, 'op ' & $args & '{ENTER}')
154
				ControlSend("Server3", "", $hwnd3, 'op ' & $args & '{ENTER}')
155-
		Case $aboutitem
155+
				ControlSend("Server4", "", $hwnd4, 'op ' & $args & '{ENTER}')
156
				ControlSend("Server5", "", $hwnd5, 'op ' & $args & '{ENTER}')
157-
		Case $setupitem
157+
158
				MsgBox(16, "Failure", "The server isn't running")
159-
		Case $How
159+
160
		Case $DEOPG;Deops a player
161-
		Case $help
161+
162
				ControlSend("Server1", "", $hwnd1, 'deop ' & $args & '{ENTER}')
163-
		Case $DelConf
163+
				ControlSend("Server2", "", $hwnd2, 'deop ' & $args & '{ENTER}')
164
				ControlSend("Server3", "", $hwnd3, 'deop ' & $args & '{ENTER}')
165-
			RegDelete("HKEY_CURRENT_USER\Software\KnarCraft\Bungee Controller", "Checkbox")
165+
				ControlSend("Server4", "", $hwnd4, 'deop ' & $args & '{ENTER}')
166
				ControlSend("Server5", "", $hwnd5, 'deop ' & $args & '{ENTER}')
167
			Else
168
				MsgBox(16, "Failure", "The server isn't running")
169
			EndIf
170
		Case $SaveG;Saving the servers' blockstates.
171
			If $servers = "RUNNING" Then
172
				ControlSend("Consoles", "", $hwnd00, ControlSend("Server1", "", $hwnd1, 'save-all' & '{ENTER}'))
173
				ControlSend("Server2", "", $hwnd2, 'save-all' & '{ENTER}')
174
				ControlSend("Server3", "", $hwnd3, 'save-all' & '{ENTER}')
175
				ControlSend("Server4", "", $hwnd4, 'save-all' & '{ENTER}')
176
				ControlSend("Server5", "", $hwnd5, 'save-all' & '{ENTER}')
177
			Else
178
				MsgBox(16, "Failure", "The server isn't running")
179
			EndIf
180
		Case $CCG;Executes the arguments you've written. Has to be a command without the "/".
181
			If $servers = "RUNNING" Then
182
				ControlSend("Server1", "", $hwnd1, $args & '{ENTER}')
183
				ControlSend("Server2", "", $hwnd2, $args & '{ENTER}')
184
				ControlSend("Server3", "", $hwnd3, $args & '{ENTER}')
185
				ControlSend("Server4", "", $hwnd4, $args & '{ENTER}')
186-
Func WriteStats()
186+
				ControlSend("Server5", "", $hwnd5, $args & '{ENTER}')
187-
	RegWrite("HKEY_CURRENT_USER\Software\KnarCraft\Bungee Controller", "Bungee", "Reg_SZ", GUICtrlRead($Bungee))
187+
188-
	RegWrite("HKEY_CURRENT_USER\Software\KnarCraft\Bungee Controller", "Checkbox", "REG_SZ", GUICtrlRead($Checkbox1))
188+
189-
	RegWrite("HKEY_CURRENT_USER\Software\KnarCraft\Bungee Controller", "Server1", "REG_SZ", GUICtrlRead($server1))
189+
190-
	RegWrite("HKEY_CURRENT_USER\Software\KnarCraft\Bungee Controller", "Server2", "REG_SZ", GUICtrlRead($server2))
190+
		Case $StopG;Stops the servers.
191-
	RegWrite("HKEY_CURRENT_USER\Software\KnarCraft\Bungee Controller", "Server3", "REG_SZ", GUICtrlRead($server3))
191+
192-
	RegWrite("HKEY_CURRENT_USER\Software\KnarCraft\Bungee Controller", "Server4", "REG_SZ", GUICtrlRead($server4))
192+
193-
	RegWrite("HKEY_CURRENT_USER\Software\KnarCraft\Bungee Controller", "Server5", "REG_SZ", GUICtrlRead($server5))
193+
				ControlSend("Bungee", "", $hwnd0, 'end' & '{ENTER}')
194-
	RegWrite("HKEY_CURRENT_USER\Software\KnarCraft\Bungee Controller", "Combo", "REG_SZ", $chosen)
194+
				ControlSend("Server1", "", $hwnd1, 'stop' & '{ENTER}')
195-
	RegWrite("HKEY_CURRENT_USER\Software\KnarCraft\Bungee Controller", "Combo2", "REG_SZ", $chosen2)
195+
				ControlSend("Server2", "", $hwnd2, 'stop' & '{ENTER}')
196-
	RegWrite("HKEY_CURRENT_USER\Software\KnarCraft\Bungee Controller", "Combo3", "REG_SZ", $chosen3)
196+
				ControlSend("Server3", "", $hwnd3, 'stop' & '{ENTER}')
197-
	RegWrite("HKEY_CURRENT_USER\Software\KnarCraft\Bungee Controller", "Backup", "REG_SZ", $backupdir)
197+
				ControlSend("Server4", "", $hwnd4, 'stop' & '{ENTER}')
198-
	RegWrite("HKEY_CURRENT_USER\Software\KnarCraft\Bungee Controller", "Loc0", "REG_SZ", $file0)
198+
				ControlSend("Server5", "", $hwnd5, 'stop' & '{ENTER}')
199-
	RegWrite("HKEY_CURRENT_USER\Software\KnarCraft\Bungee Controller", "Loc1", "REG_SZ", $file1)
199+
200-
	RegWrite("HKEY_CURRENT_USER\Software\KnarCraft\Bungee Controller", "Loc2", "REG_SZ", $file2)
200+
201-
	RegWrite("HKEY_CURRENT_USER\Software\KnarCraft\Bungee Controller", "Loc3", "REG_SZ", $file3)
201+
		Case $backup;Backups all of the server folders with the current date and time.
202-
	RegWrite("HKEY_CURRENT_USER\Software\KnarCraft\Bungee Controller", "Loc4", "REG_SZ", $file4)
202+
203-
	RegWrite("HKEY_CURRENT_USER\Software\KnarCraft\Bungee Controller", "Loc5", "REG_SZ", $file5)
203+
		Case $addw;Adds a player to the whitekist.
204
			If $servers = "RUNNING" Then
205-
Func ReadStats()
205+
				ControlSend("Server1", "", $hwnd1, 'whitelist add ' & '{ENTER}')
206-
	$Read0 = RegRead("HKEY_CURRENT_USER\Software\KnarCraft\Bungee Controller", "Bungee")
206+
				ControlSend("Server2", "", $hwnd2, 'whitelist add ' & '{ENTER}')
207-
	$Read1 = RegRead("HKEY_CURRENT_USER\Software\KnarCraft\Bungee Controller", "Checkbox")
207+
				ControlSend("Server3", "", $hwnd3, 'whitelist add ' & '{ENTER}')
208-
	$Read2 = RegRead("HKEY_CURRENT_USER\Software\KnarCraft\Bungee Controller", "Combo")
208+
				ControlSend("Server4", "", $hwnd4, 'whitelist add ' & '{ENTER}')
209-
	$Read3 = RegRead("HKEY_CURRENT_USER\Software\KnarCraft\Bungee Controller", "Combo2")
209+
				ControlSend("Server5", "", $hwnd5, 'whitelist add ' & '{ENTER}')
210-
	$Read4 = RegRead("HKEY_CURRENT_USER\Software\KnarCraft\Bungee Controller", "Server1")
210+
211-
	$Read5 = RegRead("HKEY_CURRENT_USER\Software\KnarCraft\Bungee Controller", "Server2")
211+
212-
	$Read6 = RegRead("HKEY_CURRENT_USER\Software\KnarCraft\Bungee Controller", "Server3")
212+
213-
	$Read7 = RegRead("HKEY_CURRENT_USER\Software\KnarCraft\Bungee Controller", "Server4")
213+
		Case $delw;Removes a player from the whitelist.
214-
	$Read8 = RegRead("HKEY_CURRENT_USER\Software\KnarCraft\Bungee Controller", "Server5")
214+
215-
	$Read9 = RegRead("HKEY_CURRENT_USER\Software\KnarCraft\Bungee Controller", "Combo3")
215+
				ControlSend("Server1", "", $hwnd1, 'whitelist remove ' & '{ENTER}')
216-
	$backupdir = RegRead("HKEY_CURRENT_USER\Software\KnarCraft\Bungee Controller", "Backup")
216+
				ControlSend("Server2", "", $hwnd2, 'whitelist remove ' & '{ENTER}')
217-
	$file0 = RegRead("HKEY_CURRENT_USER\Software\KnarCraft\Bungee Controller", "Loc0")
217+
				ControlSend("Server3", "", $hwnd3, 'whitelist remove ' & '{ENTER}')
218-
	$file1 = RegRead("HKEY_CURRENT_USER\Software\KnarCraft\Bungee Controller", "Loc1")
218+
				ControlSend("Server4", "", $hwnd4, 'whitelist remove ' & '{ENTER}')
219-
	$file2 = RegRead("HKEY_CURRENT_USER\Software\KnarCraft\Bungee Controller", "Loc2")
219+
				ControlSend("Server5", "", $hwnd5, 'whitelist remove ' & '{ENTER}')
220-
	$file3 = RegRead("HKEY_CURRENT_USER\Software\KnarCraft\Bungee Controller", "Loc3")
220+
221-
	$file4 = RegRead("HKEY_CURRENT_USER\Software\KnarCraft\Bungee Controller", "Loc4")
221+
222-
	$file5 = RegRead("HKEY_CURRENT_USER\Software\KnarCraft\Bungee Controller", "Loc5")
222+
223-
	If Not $Read2 = "" Then GUICtrlSetData($Combo1, $Read2)
223+
		Case $aboutitem;Information about what this is.
224-
	If Not $Read3 = "" Then GUICtrlSetData($Combo2, $Read3)
224+
225-
	If Not $Read9 = "" Then GUICtrlSetData($Combo3, $Read9)
225+
		Case $setupitem;Information about the setup.
226-
	If $Read1 = 1 Then GUICtrlSetState($Checkbox1, $GUI_CHECKED)
226+
227-
	If $Read4 = 1 Then GUICtrlSetState($server1, $GUI_CHECKED)
227+
		Case $How;Information about how the program works.
228-
	If $Read5 = 1 Then GUICtrlSetState($server2, $GUI_CHECKED)
228+
229-
	If $Read6 = 1 Then GUICtrlSetState($server3, $GUI_CHECKED)
229+
		Case $help;Explains some "Rules".
230-
	If $Read7 = 1 Then GUICtrlSetState($server4, $GUI_CHECKED)
230+
231-
	If $Read8 = 1 Then GUICtrlSetState($server5, $GUI_CHECKED)
231+
		Case $DelConf;Delete all the saved configurations and setting it all to default. Afterwards closing the program to prevent any bugs.
232
			RegDelete("HKEY_CURRENT_USER\Software\KnarCraft\Bungee Controller", "Bungee")
233
			RegDelete("HKEY_CURRENT_USER\Software\KnarCraft\Bungee Controller", "Server1")
234-
Func Start()
234+
235
			RegDelete("HKEY_CURRENT_USER\Software\KnarCraft\Bungee Controller", "Server3")
236
			RegDelete("HKEY_CURRENT_USER\Software\KnarCraft\Bungee Controller", "Server4")
237
			RegDelete("HKEY_CURRENT_USER\Software\KnarCraft\Bungee Controller", "Server5")
238
			RegDelete("HKEY_CURRENT_USER\Software\KnarCraft\Bungee Controller", "Combo")
239
			RegDelete("HKEY_CURRENT_USER\Software\KnarCraft\Bungee Controller", "Combo2")
240
			RegDelete("HKEY_CURRENT_USER\Software\KnarCraft\Bungee Controller", "Loc0")
241
			RegDelete("HKEY_CURRENT_USER\Software\KnarCraft\Bungee Controller", "Loc1")
242
			RegDelete("HKEY_CURRENT_USER\Software\KnarCraft\Bungee Controller", "Loc2")
243
			RegDelete("HKEY_CURRENT_USER\Software\KnarCraft\Bungee Controller", "Loc3")
244
			RegDelete("HKEY_CURRENT_USER\Software\KnarCraft\Bungee Controller", "Loc4")
245
			RegDelete("HKEY_CURRENT_USER\Software\KnarCraft\Bungee Controller", "Loc5")
246
			RegDelete("HKEY_CURRENT_USER\Software\KnarCraft\Bungee Controller", "Version")
247
			RegDelete("HKEY_CURRENT_USER\Software\KnarCraft\Bungee Controller", "SnapshotVersion")
248
			RegDelete("HKEY_CURRENT_USER\Software\KnarCraft\Bungee Controller", "Backup")
249
			RegDelete("HKEY_CURRENT_USER\Software\KnarCraft\Bungee Controller", "Combo3")
250
			Exit
251
	EndSwitch
252
WEnd
253
Func Start();Checking what servers are started and then launching with the opttions selected.
254
	ServerType()
255
	$GUI2 = GUICreate("Consoles", 1020, 600, 1282, 300, BitOR($WS_MINIMIZEBOX, $WS_SYSMENU, $WS_CAPTION, $WS_CLIPCHILDREN, $WS_POPUP, $WS_POPUPWINDOW, $WS_GROUP, $WS_BORDER, $WS_CLIPSIBLINGS))
256
	$hwnd00 = WinGetHandle("Consoles")
257
	If GUICtrlRead($Bungee) = 1 Then
258
		$BungeeServer = Run("java -Xmx512M -jar " & '"' & $file0 & "\BungeeCord.jar" & '"', $file0, $Hide)
259
		If Not ProcessWait($BungeeServer) = 0 Then
260
			WinSetTitle("C:\Windows\system32\java.exe", "", "Bungee")
261
			WinSetTitle("C:\WINDOWS\SYSTEM32\java.exe", "", "Bungee")
262
			Global $hwnd0 = WinGetHandle("Bungee")
263
		EndIf
264
	EndIf
265
	If GUICtrlRead($server1) = 1 Then
266
		$1 = Run("java " & $chosen & " -jar " & '"' & $file1 & '"' & "\minecraft_server.jar", $file1, $Hide)
267
		If Not ProcessWait($1) = 0 Then
268
			WinSetTitle("C:\Windows\system32\java.exe", "", "Server1")
269
			WinSetTitle("C:\WINDOWS\SYSTEM32\java.exe", "", "Server1")
270
			Global $hwnd1 = WinGetHandle("Server1")
271
		EndIf
272
	EndIf
273
	If GUICtrlRead($server2) = 1 Then
274
		$2 = Run("java " & $chosen & " -jar " & '"' & $file2 & '"' & "\minecraft_server.jar", $file2, $Hide)
275
		If Not ProcessWait($2) = 0 Then
276
			WinSetTitle("C:\Windows\system32\java.exe", "", "Server2")
277
			WinSetTitle("C:\WINDOWS\SYSTEM32\java.exe", "", "Server2")
278
			Global $hwnd2 = WinGetHandle("Server2")
279
		EndIf
280
	EndIf
281
	If GUICtrlRead($server3) = 1 Then
282
		$3 = Run("java " & $chosen & " -jar " & '"' & $file3 & '"' & "\minecraft_server.jar", $file3, $Hide)
283
		If Not ProcessWait($3) = 0 Then
284
			WinSetTitle("C:\Windows\system32\java.exe", "", "Server3")
285-
	GUICtrlSetData($Label1, "Server(s) are running")
285+
286
			Global $hwnd3 = WinGetHandle("Server3")
287-
Func ServerType()
287+
288-
	GUISetState(@SW_HIDE, $Gui)
288+
289-
	$Pgui = GUICreate("Downloading jars", 280, 25)
289+
290-
	GUISetState(@SW_SHOW, $Pgui)
290+
291-
	$Progress = GUICtrlCreateProgress("", "", 280, 25, BitOR($PBS_SMOOTH, $WS_BORDER), $WS_EX_CLIENTEDGE)
291+
292-
	GUICtrlSetData($Progress, 0)
292+
293-
	If GUICtrlRead($Bungee) = 1 Then InetGet("http://ci.md-5.net/job/BungeeCord/lastSuccessfulBuild/artifact/bootstrap/target/BungeeCord.jar", $file0 & "\BungeeCord.jar")
293+
294-
	GUICtrlSetData($Progress, 16)
294+
295-
	If GUICtrlRead($server1) = 1 Then Download($file1)
295+
296-
	GUICtrlSetData($Progress, 30)
296+
297-
	If GUICtrlRead($server2) = 1 Then Download($file2)
297+
298-
	GUICtrlSetData($Progress, 50)
298+
299-
	If GUICtrlRead($server3) = 1 Then Download($file3)
299+
300-
	GUICtrlSetData($Progress, 66)
300+
301-
	If GUICtrlRead($server4) = 1 Then Download($file4)
301+
302-
	GUICtrlSetData($Progress, 82)
302+
303-
	If GUICtrlRead($server5) = 1 Then Download($file5)
303+
304-
	GUICtrlSetData($Progress, 100)
304+
305-
	GUIDelete($Pgui)
305+
	_WinAPI_SetWindowLong($hwnd0, $GWL_EXSTYLE, $WS_EX_MDICHILD)
306-
	GUISetState(@SW_SHOW, $Gui)
306+
	_WinAPI_SetParent($hwnd0, $GUI2)
307
	_WinAPI_SetWindowLong($hwnd1, $GWL_EXSTYLE, $WS_EX_MDICHILD)
308-
Func Download($loc)
308+
	_WinAPI_SetParent($hwnd1, $GUI2)
309
	_WinAPI_SetWindowLong($hwnd2, $GWL_EXSTYLE, $WS_EX_MDICHILD)
310
	_WinAPI_SetParent($hwnd2, $GUI2)
311
	_WinAPI_SetWindowLong($hwnd3, $GWL_EXSTYLE, $WS_EX_MDICHILD)
312
	_WinAPI_SetParent($hwnd3, $GUI2)
313
	_WinAPI_SetWindowLong($hwnd4, $GWL_EXSTYLE, $WS_EX_MDICHILD)
314-
	If $chosen2 = "Snapshot" Then
314+
	_WinAPI_SetParent($hwnd4, $GUI2)
315
	_WinAPI_SetWindowLong($hwnd5, $GWL_EXSTYLE, $WS_EX_MDICHILD)
316
	_WinAPI_SetParent($hwnd5, $GUI2)
317
	WinMove($hwnd0, "", 0, 0, 340, 300)
318
	WinMove($hwnd1, "", 340, 0, 340, 300)
319
	WinMove($hwnd2, "", 680, 0, 340, 300)
320
	WinMove($hwnd3, "", 0, 300, 340, 300)
321
	WinMove($hwnd4, "", 340, 300, 340, 300)
322
	WinMove($hwnd5, "", 680, 300, 340, 300)
323
	Global $servers = "Running"
324
	GUICtrlSetData($Label1, "Server(s) are running");Changing the state of the servers shown in the GUI as running.
325
EndFunc   ;==>Start
326
Func ServerType();Checking what servers are enabled and downloading to the selected folder.
327
	GUISetState(@SW_HIDE, $GUI);Hides the main GUI.
328-
Func Vanilla($loc)
328+
	$Pgui = GUICreate("Downloading jars", 280, 25);Making a new GUI named Downloading jars.
329
	GUISetState(@SW_SHOW, $Pgui);Setting the state of the new gui as shown.
330
	$Progress = GUICtrlCreateProgress("", "", 280, 25, BitOR($PBS_SMOOTH, $WS_BORDER), $WS_EX_CLIENTEDGE);Creates a progress bar that shows what jars have been downloaded.
331
	GUICtrlSetData($Progress, 0);Setting the progress of the progress bar to 0%
332
	If GUICtrlRead($Bungee) = 1 Then InetGet("http://ci.md-5.net/job/BungeeCord/lastSuccessfulBuild/artifact/bootstrap/target/BungeeCord.jar", $file0 & "\BungeeCord.jar");Downloads the newest bungee version.
333
	GUICtrlSetData($Progress, 16);Setting the progress of the progress bar to 16%
334
	If GUICtrlRead($server1) = 1 Then Download($file1);Downloads the jarfile selected to the location of server1.
335
	GUICtrlSetData($Progress, 30);Setting the progress of the progress bar to 30%
336
	If GUICtrlRead($server2) = 1 Then Download($file2);Downloads the jarfile selected to the location of server2.
337
	GUICtrlSetData($Progress, 50);Setting the progress of the progress bar to 50%
338
	If GUICtrlRead($server3) = 1 Then Download($file3);Downloads the jarfile selected to the location of server3.
339
	GUICtrlSetData($Progress, 66);Setting the progress of the progress bar to 66%
340
	If GUICtrlRead($server4) = 1 Then Download($file4);Downloads the jarfile selected to the location of server4.
341
	GUICtrlSetData($Progress, 82);Setting the progress of the progress bar to 82%
342
	If GUICtrlRead($server5) = 1 Then Download($file5);Downloads the jarfile selected to the location of server5.
343-
	If GUICtrlRead($Combo2) = "Vanilla" And GUICtrlRead($Combo3) = "1.6.4" Then InetGet('https://s3.amazonaws.com/Minecraft.Download/versions/' & "1.6.4" & "/minecraft_server." & "1.6.4" & ".jar", $loc & "\minecraft_server.jar", 1, 0)
343+
	GUICtrlSetData($Progress, 100);Setting the progress of the progress bar to 100%
344-
	If GUICtrlRead($Combo2) = "Vanilla" And GUICtrlRead($Combo3) = "1.6.2" Then InetGet('https://s3.amazonaws.com/Minecraft.Download/versions/' & "1.6.2" & "/minecraft_server." & "1.6.2" & ".jar", $loc & "\minecraft_server.jar", 1, 0)
344+
	GUIDelete($Pgui);Deletes the Downloading jars GUI.
345-
	If GUICtrlRead($Combo2) = "Vanilla" And GUICtrlRead($Combo3) = "1.5.2" Then InetGet('https://s3.amazonaws.com/Minecraft.Download/versions/' & "1.5.2" & "/minecraft_server." & "1.5.2" & ".jar", $loc & "\minecraft_server.jar", 1, 0)
345+
	GUISetState(@SW_SHOW, $GUI);Shows the main GUI.
346-
	If GUICtrlRead($Combo2) = "Vanilla" And GUICtrlRead($Combo3) = "1.4.7" Then InetGet('https://s3.amazonaws.com/Minecraft.Download/versions/' & "1.4.7" & "/minecraft_server." & "1.4.7" & ".jar", $loc & "\minecraft_server.jar", 1, 0)
346+
347-
	If GUICtrlRead($Combo2) = "Vanilla" And GUICtrlRead($Combo3) = "1.4.5" Then InetGet('https://s3.amazonaws.com/Minecraft.Download/versions/' & "1.4.5" & "/minecraft_server." & "1.4.5" & ".jar", $loc & "\minecraft_server.jar", 1, 0)
347+
Func Download($loc);Downloads whatever is chosen to the location defined while calling this function.
348
	If $chosen2 = "Spigot" Then InetGet("http://ci.md-5.net/job/Spigot-1.7/lastSuccessfulBuild/artifact/Spigot-Server/target/spigot.jar", $loc & "\minecraft_server.jar", 1, 0)
349-
Func Backup()
349+
350-
	GUISetState(@SW_HIDE, $Gui)
350+
351-
	$Pgui = GUICreate("Backup Progress", 280, 25)
351+
352-
	GUISetState(@SW_SHOW, $Pgui)
352+
353-
	$Progress = GUICtrlCreateProgress("", "", 280, 25, BitOR($PBS_SMOOTH, $WS_BORDER), $WS_EX_CLIENTEDGE)
353+
	If $chosen2 = "Snapshot" Then;This generates a download link to the newest minecraft snapshot.
354-
	GUICtrlSetData($Progress, 0)
354+
355-
	If GUICtrlRead($server1) = 1 Then DirCopy($file1, $backupdir & "\Server1\" & " " & @HOUR & ";" & @MIN & " " & @MDAY & "-" & @MON & "-" & @YEAR)
355+
356-
	GUICtrlSetData($Progress, 20)
356+
357-
	If GUICtrlRead($server2) = 1 Then DirCopy($file2, $backupdir & "\Server2\" & " " & @HOUR & ";" & @MIN & " " & @MDAY & "-" & @MON & "-" & @YEAR)
357+
358-
	GUICtrlSetData($Progress, 40)
358+
359-
	If GUICtrlRead($server3) = 1 Then DirCopy($file3, $backupdir & "\Server3\" & " " & @HOUR & ";" & @MIN & " " & @MDAY & "-" & @MON & "-" & @YEAR)
359+
360-
	GUICtrlSetData($Progress, 60)
360+
361-
	If GUICtrlRead($server4) = 1 Then DirCopy($file4, $backupdir & "\Server4\" & " " & @HOUR & ";" & @MIN & " " & @MDAY & "-" & @MON & "-" & @YEAR)
361+
362-
	GUICtrlSetData($Progress, 80)
362+
363-
	If GUICtrlRead($server5) = 1 Then DirCopy($file5, $backupdir & "\Server5\" & " " & @HOUR & ";" & @MIN & " " & @MDAY & "-" & @MON & "-" & @YEAR)
363+
364-
	GUICtrlSetData($Progress, 100)
364+
365-
	GUIDelete($Pgui)
365+
366-
	GUISetState(@SW_SHOW, $Gui)
366+
367
Func Vanilla($loc);The function for downloading the latest Vanilla build unless a certain version is chosen.
368
	If GUICtrlRead($Combo2) = "Vanilla" And GUICtrlRead($Combo3) = "Latest" Then
369
		$Read = RegRead("HKEY_CURRENT_USER\Software\KnarCraft\Bungee Controller", "Version")
370
		$Path1 = @TempDir & "\versions.json"
371
		InetGet("https://s3.amazonaws.com/Minecraft.Download/versions/versions.json", $Path1, 1, 0)
372
		$FF = FileOpen($Path1)
373
		$RF = FileReadLine($FF, 4)
374
		If $Read = $RF And FileExists($loc) Then
375
		Else
376
			$ver = StringReplace(StringReplace($RF, '    "release": "', ""), '"', "")
377
			If InetGet('https://s3.amazonaws.com/Minecraft.Download/versions/' & $ver & "/minecraft_server." & $ver & ".jar", $loc & "\minecraft_server.jar", 1, 0) = 1 Then RegWrite("HKEY_CURRENT_USER\Software\KnarCraft\Snapshot", "Version", "REG_SZ", $RF)
378
		EndIf
379
		FileDelete($Path1)
380
		Sleep(1)
381
	EndIf
382
	VanillaCustom($loc)
383
EndFunc   ;==>Vanilla
384
Func VanillaCustom($loc);The function for downloading a certain vanilla version.
385
	If GUICtrlRead($Combo2) = "Vanilla" And GUICtrlRead($Combo3) = "1.6.4" Then InetGet('https://s3.amazonaws.com/Minecraft.Download/versions/' & "1.6.4" & "/minecraft_server." & "1.6.4" & ".jar", $loc & "\minecraft_server.jar", 1, 0);If your chosen vanilla version is 1.6.4, it downloads it.
386
	If GUICtrlRead($Combo2) = "Vanilla" And GUICtrlRead($Combo3) = "1.6.2" Then InetGet('https://s3.amazonaws.com/Minecraft.Download/versions/' & "1.6.2" & "/minecraft_server." & "1.6.2" & ".jar", $loc & "\minecraft_server.jar", 1, 0);If your chosen vanilla version is 1.6.2, it downloads it.
387
	If GUICtrlRead($Combo2) = "Vanilla" And GUICtrlRead($Combo3) = "1.5.2" Then InetGet('https://s3.amazonaws.com/Minecraft.Download/versions/' & "1.5.2" & "/minecraft_server." & "1.5.2" & ".jar", $loc & "\minecraft_server.jar", 1, 0);If your chosen vanilla version is 1.5.2, it downloads it.
388
	If GUICtrlRead($Combo2) = "Vanilla" And GUICtrlRead($Combo3) = "1.4.7" Then InetGet('https://s3.amazonaws.com/Minecraft.Download/versions/' & "1.4.7" & "/minecraft_server." & "1.4.7" & ".jar", $loc & "\minecraft_server.jar", 1, 0);If your chosen vanilla version is 1.4.7, it downloads it.
389
	If GUICtrlRead($Combo2) = "Vanilla" And GUICtrlRead($Combo3) = "1.4.5" Then InetGet('https://s3.amazonaws.com/Minecraft.Download/versions/' & "1.4.5" & "/minecraft_server." & "1.4.5" & ".jar", $loc & "\minecraft_server.jar", 1, 0);If your chosen vanilla version is 1.4.5, it downloads it.
390
EndFunc   ;==>VanillaCustom
391
Func WriteStats();The function for saving settings.
392
	RegWrite("HKEY_CURRENT_USER\Software\KnarCraft\Bungee Controller", "Bungee", "Reg_SZ", GUICtrlRead($Bungee));Saves the value of the Bungee Control.
393
	RegWrite("HKEY_CURRENT_USER\Software\KnarCraft\Bungee Controller", "Server1", "REG_SZ", GUICtrlRead($server1));Saves the value of the server1 Control.
394
	RegWrite("HKEY_CURRENT_USER\Software\KnarCraft\Bungee Controller", "Server2", "REG_SZ", GUICtrlRead($server2));Saves the value of the server2 Control.
395
	RegWrite("HKEY_CURRENT_USER\Software\KnarCraft\Bungee Controller", "Server3", "REG_SZ", GUICtrlRead($server3));Saves the value of the server3 Control.
396
	RegWrite("HKEY_CURRENT_USER\Software\KnarCraft\Bungee Controller", "Server4", "REG_SZ", GUICtrlRead($server4));Saves the value of the server4 Control.
397
	RegWrite("HKEY_CURRENT_USER\Software\KnarCraft\Bungee Controller", "Server5", "REG_SZ", GUICtrlRead($server5));Saves the value of the server5 Control.
398
	RegWrite("HKEY_CURRENT_USER\Software\KnarCraft\Bungee Controller", "Combo", "REG_SZ", $chosen);Saves the value of the chosen Control.
399
	RegWrite("HKEY_CURRENT_USER\Software\KnarCraft\Bungee Controller", "Combo2", "REG_SZ", $chosen2);Saves the value of the chosen2 Control.
400
	RegWrite("HKEY_CURRENT_USER\Software\KnarCraft\Bungee Controller", "Combo3", "REG_SZ", $chosen3);Saves the value of the chosen3 Control.
401
	RegWrite("HKEY_CURRENT_USER\Software\KnarCraft\Bungee Controller", "Backup", "REG_SZ", $backupdir);Saves the value of the backupdir Control.
402
	RegWrite("HKEY_CURRENT_USER\Software\KnarCraft\Bungee Controller", "Loc0", "REG_SZ", $file0);Saves the value of the file0 Control.
403
	RegWrite("HKEY_CURRENT_USER\Software\KnarCraft\Bungee Controller", "Loc1", "REG_SZ", $file1);Saves the value of the file1 Control.
404
	RegWrite("HKEY_CURRENT_USER\Software\KnarCraft\Bungee Controller", "Loc2", "REG_SZ", $file2);Saves the value of the file2 Control.
405
	RegWrite("HKEY_CURRENT_USER\Software\KnarCraft\Bungee Controller", "Loc3", "REG_SZ", $file3);Saves the value of the file3 Control.
406
	RegWrite("HKEY_CURRENT_USER\Software\KnarCraft\Bungee Controller", "Loc4", "REG_SZ", $file4);Saves the value of the file4 Control.
407
	RegWrite("HKEY_CURRENT_USER\Software\KnarCraft\Bungee Controller", "Loc5", "REG_SZ", $file5);Saves the value of the file5 Control.
408
EndFunc   ;==>WriteStats
409
Func ReadStats();The function for reading saved settings.
410
	$Read0 = RegRead("HKEY_CURRENT_USER\Software\KnarCraft\Bungee Controller", "Bungee");Sets the value of Read0 to the saved value of Bungee
411
	$Read2 = RegRead("HKEY_CURRENT_USER\Software\KnarCraft\Bungee Controller", "Combo");Sets the value of Read2 to the saved value of chosen
412
	$Read3 = RegRead("HKEY_CURRENT_USER\Software\KnarCraft\Bungee Controller", "Combo2");Sets the value of Read3 to the saved value of chosen2
413
	$Read4 = RegRead("HKEY_CURRENT_USER\Software\KnarCraft\Bungee Controller", "Server1");Sets the value of Read4 to the saved value of server1
414
	$Read5 = RegRead("HKEY_CURRENT_USER\Software\KnarCraft\Bungee Controller", "Server2");Sets the value of Read5 to the saved value of server2
415
	$Read6 = RegRead("HKEY_CURRENT_USER\Software\KnarCraft\Bungee Controller", "Server3");Sets the value of Read6 to the saved value of server3
416
	$Read7 = RegRead("HKEY_CURRENT_USER\Software\KnarCraft\Bungee Controller", "Server4");Sets the value of Read7 to the saved value of server4
417
	$Read8 = RegRead("HKEY_CURRENT_USER\Software\KnarCraft\Bungee Controller", "Server5");Sets the value of Read8 to the saved value of server5
418
	$Read9 = RegRead("HKEY_CURRENT_USER\Software\KnarCraft\Bungee Controller", "Combo3");Sets the value of Read9 to the saved value of chosen3
419
	$backupdir = RegRead("HKEY_CURRENT_USER\Software\KnarCraft\Bungee Controller", "Backup");Sets the value of backupdir to the saved value of backupdir
420
	$file0 = RegRead("HKEY_CURRENT_USER\Software\KnarCraft\Bungee Controller", "Loc0");Sets the value of file0 to the saved value of file0
421
	$file1 = RegRead("HKEY_CURRENT_USER\Software\KnarCraft\Bungee Controller", "Loc1");Sets the value of file1 to the saved value of file1
422
	$file2 = RegRead("HKEY_CURRENT_USER\Software\KnarCraft\Bungee Controller", "Loc2");Sets the value of file2 to the saved value of file2
423
	$file3 = RegRead("HKEY_CURRENT_USER\Software\KnarCraft\Bungee Controller", "Loc3");Sets the value of file3 to the saved value of file3
424
	$file4 = RegRead("HKEY_CURRENT_USER\Software\KnarCraft\Bungee Controller", "Loc4");Sets the value of file4 to the saved value of file4
425
	$file5 = RegRead("HKEY_CURRENT_USER\Software\KnarCraft\Bungee Controller", "Loc5");Sets the value of file5 to the saved value of file5
426
	If Not $Read2 = "" Then GUICtrlSetData($Combo1, $Read2);Sets the value of Combo1 to the value of Read2 unless it's empty.
427
	If Not $Read3 = "" Then GUICtrlSetData($Combo2, $Read3);Sets the value of Combo2 to the value of Read3 unless it's empty.
428
	If Not $Read9 = "" Then GUICtrlSetData($Combo3, $Read9);Sets the value of Combo3 to the value of Read9 unless it's empty.
429
	If $Read4 = 1 Then GUICtrlSetState($server1, $GUI_CHECKED);If the value of Read4 is 1, sets the state of the server1 checkbox to checked.
430
	If $Read5 = 1 Then GUICtrlSetState($server2, $GUI_CHECKED);If the value of Read5 is 1, sets the state of the server2 checkbox to checked.
431
	If $Read6 = 1 Then GUICtrlSetState($server3, $GUI_CHECKED);If the value of Read6 is 1, sets the state of the server3 checkbox to checked.
432
	If $Read7 = 1 Then GUICtrlSetState($server4, $GUI_CHECKED);If the value of Read7 is 1, sets the state of the server4 checkbox to checked.
433
	If $Read8 = 1 Then GUICtrlSetState($server5, $GUI_CHECKED);If the value of Read8 is 1, sets the state of the server5 checkbox to checked.
434
	If $Read0 = 1 Then GUICtrlSetState($Bungee, $GUI_CHECKED)
435
EndFunc   ;==>ReadStats
436
Func Backup();The function for making a backup of the enabled servers.
437
	GUISetState(@SW_HIDE, $GUI);Hides the main GUI.
438
	$Pgui = GUICreate("Backup Progress", 280, 25);Making a new GUI named Backup Progress.
439
	GUISetState(@SW_SHOW, $Pgui);Setting the state of the new gui as shown.
440
	$Progress = GUICtrlCreateProgress("", "", 280, 25, BitOR($PBS_SMOOTH, $WS_BORDER), $WS_EX_CLIENTEDGE);Creates a progress bar that shows what servers have been backuped.
441
	GUICtrlSetData($Progress, 0);Setting the progress of the progress bar to 0%
442
	If GUICtrlRead($server1) = 1 Then DirCopy($file1, $backupdir & "\Server1\" & " " & @HOUR & ";" & @MIN & " " & @MDAY & "-" & @MON & "-" & @YEAR);Copying the directory of the Server1 folder to the backup folder.
443
	GUICtrlSetData($Progress, 20);Setting the progress of the progress bar to 20%
444
	If GUICtrlRead($server2) = 1 Then DirCopy($file2, $backupdir & "\Server2\" & " " & @HOUR & ";" & @MIN & " " & @MDAY & "-" & @MON & "-" & @YEAR);Copying the directory of the Server2 folder to the backup folder.
445
	GUICtrlSetData($Progress, 40);Setting the progress of the progress bar to 40%
446
	If GUICtrlRead($server3) = 1 Then DirCopy($file3, $backupdir & "\Server3\" & " " & @HOUR & ";" & @MIN & " " & @MDAY & "-" & @MON & "-" & @YEAR);Copying the directory of the Server3 folder to the backup folder.
447
	GUICtrlSetData($Progress, 60);Setting the progress of the progress bar to 60%
448
	If GUICtrlRead($server4) = 1 Then DirCopy($file4, $backupdir & "\Server4\" & " " & @HOUR & ";" & @MIN & " " & @MDAY & "-" & @MON & "-" & @YEAR);Copying the directory of the Server4 folder to the backup folder.
449
	GUICtrlSetData($Progress, 80);Setting the progress of the progress bar to 80%
450
	If GUICtrlRead($server5) = 1 Then DirCopy($file5, $backupdir & "\Server5\" & " " & @HOUR & ";" & @MIN & " " & @MDAY & "-" & @MON & "-" & @YEAR);Copying the directory of the Server5 folder to the backup folder.
451
	GUICtrlSetData($Progress, 100);Setting the progress of the progress bar to 100%
452
	GUIDelete($Pgui);Deletes the Backup Progress GUI.
453
	GUISetState(@SW_SHOW, $GUI);Shows the main GUI.
454
EndFunc   ;==>Backup