多数のサーバーを起動および停止できる GUI メニューを作成しようとしています。さらに、チェックボックスや「プレイヤー名」などのコマンドを手動で追加することで、さまざまなパラメーターを使用してコマンドをサーバーに送信できる必要があります。必要なのは、情報メニューを機能させる方法を見つけることです (ボタンを待っていると思います)。そして、開いた 3 つのコマンド プロンプトにコマンドを送信する方法を見つけます。まだサーバーを2つとバンジーサーバーを1つ追加する予定ですが、3つで機能する場合は6つで機能します。
Func Hub_func()
Run(@ComSpec & " /C Java -Xmx1024M -jar spigot-1.6.2-R0.1.jar", "E:\Spill\Alle spill\Minecraft\Bungee Servers\Hub")
Run(@ComSpec & " /C Java -Xmx1024M -jar spigot-1.6.2-R0.1.jar", "E:\Spill\Alle spill\Minecraft\Bungee Servers\Survival")
Run(@ComSpec & " /C Java -Xmx1024M -jar spigot-1.6.2-R0.1.jar", "E:\Spill\Alle spill\Minecraft\Bungee Servers\Plotworld")
EndFunc ;==>Hub_func
#include <ButtonConstants.au3>
#include <GUIConstantsEx.au3>
#include <GuiToolbar.au3>
#include <StaticConstants.au3>
#include <ToolbarConstants.au3>
#include <WindowsConstants.au3>
Opt("GUIResizeMode", $GUI_DOCKLEFT)
#region ### START Koda GUI section ### Form=c:\users\kristian\desktop\test.kxf
$Test = GUICreate("KnarCraft Client", 945, 1003, 957, 0)
GUISetFont(10, 400, 0, "MT Extra")
$Button1 = GUICtrlCreateButton("Exit", 848, 950, 75, 30)
GUICtrlSetFont(-1, 18, 400, 0, "MS Sans Serif")
GUICtrlSetResizing(-1, $GUI_DOCKAUTO + $GUI_DOCKRIGHT + $GUI_DOCKBOTTOM + $GUI_DOCKWIDTH + $GUI_DOCKHEIGHT)
GUICtrlSetTip(-1, "Exits the program")
$Button2 = GUICtrlCreateButton("Start Server", 24, 950, 139, 33)
GUICtrlSetFont(-1, 18, 400, 0, "MS Sans Serif")
GUICtrlSetResizing(-1, $GUI_DOCKLEFT + $GUI_DOCKBOTTOM + $GUI_DOCKWIDTH + $GUI_DOCKHEIGHT)
GUICtrlSetTip(-1, "Starts the KnarCraft server")
$ToolBar1 = _GUICtrlToolbar_Create($Test, 0)
$Checkbox1 = GUICtrlCreateCheckbox("Hide Console", 32, 928, 113, 17)
GUICtrlSetFont(-1, 12, 400, 0, "MS Sans Serif")
$Checkbox2 = GUICtrlCreateCheckbox("Old Version", 32, 904, 105, 17)
GUICtrlSetFont(-1, 12, 400, 0, "MS Sans Serif")
$Pic1 = GUICtrlCreatePic("D:\Bilder\Gameplay\b7223189a2371e69fabe26c661fae55d.jpeg", 0, 0, 937, 881)
$filemenu = GUICtrlCreateMenu("File")
$fileitem = GUICtrlCreateMenuItem("Open...", $filemenu)
$recentfilesmenu = GUICtrlCreateMenu("Recent Files", $filemenu)
$separator1 = GUICtrlCreateMenuItem("", $filemenu)
$exititem = GUICtrlCreateMenuItem("Exit", $filemenu)
$helpmenu = GUICtrlCreateMenu("?")
$aboutitem = GUICtrlCreateMenuItem("About", $helpmenu)
$tipsitem = GUICtrlCreateMenuItem("Tips", $helpmenu)
GUISetState(@SW_SHOW)
#endregion ### END Koda GUI section ###
While 1
$nMsg = GUIGetMsg()
Switch $nMsg
Case $GUI_EVENT_CLOSE
Exit
Case $Button1
MsgBox(64, "KnarCraft", "KnarCraft client will now close")
Exit
Case $Button2
Hub_func()
EndSwitch
WEnd
While 1
$msg = GUIGetMsg()
Select
Case $msg = $fileitem
$file = FileOpenDialog("Choose file...", @TempDir, "All (*.*)")
If @error <> 1 Then GUICtrlCreateMenuItem($file, $recentfilesmenu)
Case $msg = $aboutitem
MsgBox(0, "About", "GUI Menu Test")
Case $msg = $tipsitem
MsgBox(0, "Tips", "You can do lots with this client.")
EndSelect
WEnd