Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #region ;**** Directives created by AutoIt3Wrapper_GUI ****
- #AutoIt3Wrapper_Icon=C:\Users\Kristian\Downloads\Minecraft Icon Version III.ico
- #AutoIt3Wrapper_Compression=4
- #endregion ;**** Directives created by AutoIt3Wrapper_GUI ****
- #include <ButtonConstants.au3>
- #include <ComboConstants.au3>
- #include <GUIConstantsEx.au3>
- #include <GuiToolbar.au3>
- #include <StaticConstants.au3>
- #include <ToolbarConstants.au3>
- #include <WindowsConstants.au3>
- #include <GUIConstants.au3>
- #include <Misc.au3>
- #include <EditConstants.au3>
- #include <WindowsConstants.au3>
- #include <GuiComboBoxEx.au3>
- #include <TreeViewConstants.au3>
- #include <GuiTreeView.au3>
- #region ### START Koda GUI section ### Form=c:\users\kristian\desktop\test.kxf
- $Test = GUICreate("KnarCraft Client", 945, 1003, 960, 0)
- $Form1 = GUICreate("Form1", 945, 1003, 960, 0)
- $Button1 = GUICtrlCreateButton("Start Server", 24, 952, 75, 25)
- $Button2 = GUICtrlCreateButton("Stop Server", 840, 952, 75, 25)
- $Button3 = GUICtrlCreateButton("Kick", 112, 952, 75, 25)
- $Checkbox1 = GUICtrlCreateCheckbox("Hide Console", 24, 928, 97, 17)
- $Checkbox2 = GUICtrlCreateCheckbox("Old Version", 24, 904, 97, 17)
- $Command_Arguments = GUICtrlCreateInput("", 392, 952, 320, 21)
- $Button4 = GUICtrlCreateButton("Ban", 208, 952, 75, 25)
- $Button5 = GUICtrlCreateButton("OP", 304, 952, 75, 25)
- $Button6 = GUICtrlCreateButton("Custom Command", 728, 952, 91, 25)
- $Button7 = GUICtrlCreateButton("Save Server", 840, 920, 75, 25)
- $Label1 = GUICtrlCreateLabel("Choose Server Memory", 24, 848, 166, 20)
- GUICtrlSetFont(-1, 10, 800, 0, "MS Sans Serif")
- $Combo1 = GUICtrlCreateCombo("-Xmx512M", 24, 872, 161, 25, $CBS_DROPDOWNLIST)
- GUICtrlSetData(-1, "-Xmx1024M|-Xmx2048M|-Xmx3072M|-Xmx4096M")
- $TreeView1 = GUICtrlCreateTreeView(24, 24, 345, 730, BitOR($TVS_HASBUTTONS, $TVS_HASLINES, $TVS_LINESATROOT), $WS_EX_CLIENTEDGE)
- $KnarCraft = GUICtrlCreateTreeViewItem("KnarCraft Server Information", $TreeView1)
- $OldKnarCraft = GUICtrlCreateTreeViewItem("Old KnarCraft", $TreeView1)
- $KnarWorld = GUICtrlCreateTreeViewItem("KnarWorldServer", $KnarCraft)
- GUICtrlCreateTreeViewItem("Commands", $KnarWorld)
- GUICtrlCreateTreeViewItem("Permissions", $KnarWorld)
- GUICtrlCreateTreeViewItem("Attractions", $KnarWorld)
- GUICtrlCreateTreeViewItem("KnarWorld", $OldKnarCraft)
- $filemenu = GUICtrlCreateMenu("File")
- $fileitem = GUICtrlCreateMenuItem("Open...", $filemenu)
- $recentfilesmenu = GUICtrlCreateMenu("Recent Files", $filemenu)
- $separator1 = GUICtrlCreateMenuItem("", $filemenu)
- $exititem = GUICtrlCreateMenuItem("Exit", $filemenu)
- $helpmenu = GUICtrlCreateMenu("Help")
- $aboutitem = GUICtrlCreateMenuItem("About", $helpmenu)
- $tipsitem = GUICtrlCreateMenuItem("Tips", $helpmenu)
- $knarworlditem = GUICtrlCreateMenuItem("KnarWorld", $helpmenu)
- GUISetState(@SW_SHOW)
- #endregion ### END Koda GUI section ###
- ReadStats()
- While 1
- $chosen = GUICtrlRead($Combo1)
- $args = GUICtrlRead($Command_Arguments)
- $nMsg = GUIGetMsg()
- If GUICtrlRead($Checkbox2) = 1 Then
- $STATE = "CHECK"
- Else
- $STATE = "UNCHECK"
- EndIf
- If GUICtrlRead($Checkbox1) = 1 Then
- $Hide = @SW_HIDE
- Else
- $Hide = @SW_SHOW
- EndIf
- Switch $nMsg
- Case $GUI_EVENT_CLOSE
- WriteStats()
- Exit
- Case $exititem
- MsgBox(64, "KnarCraft", "KnarCraft client will now close")
- WriteStats()
- Exit
- Case $Button1
- Hub_func()
- Case $Button3
- If $STATE = "CHECK" Then
- Opt("WinTitleMatchMode", 3)
- $hwnd = WinGetHandle("C:\Windows\system32\java.exe")
- WinActivate($hwnd)
- ControlSend("C:\Windows\system32\java.exe", "", $hwnd, 'kick ')
- ControlSend("C:\Windows\system32\java.exe", "", $hwnd, $args)
- ControlSend("C:\Windows\system32\java.exe", "", $hwnd, '{ENTER}')
- Else
- EndIf
- Case $Button4
- If $STATE = "CHECK" Then
- Opt("WinTitleMatchMode", 3)
- $hwnd = WinGetHandle("C:\Windows\system32\java.exe")
- WinActivate($hwnd)
- ControlSend("C:\Windows\system32\java.exe", "", $hwnd, 'ban ')
- ControlSend("C:\Windows\system32\java.exe", "", $hwnd, $args)
- ControlSend("C:\Windows\system32\java.exe", "", $hwnd, '{ENTER}')
- Else
- EndIf
- Case $Button5
- If $STATE = "CHECK" Then
- Opt("WinTitleMatchMode", 3)
- $hwnd = WinGetHandle("C:\Windows\system32\java.exe")
- WinActivate($hwnd)
- ControlSend("C:\Windows\system32\java.exe", "", $hwnd, 'op ')
- ControlSend("C:\Windows\system32\java.exe", "", $hwnd, $args)
- ControlSend("C:\Windows\system32\java.exe", "", $hwnd, '{ENTER}')
- EndIf
- Case $Button7
- If $STATE = "CHECK" Then
- Opt("WinTitleMatchMode", 3)
- $hwnd = WinGetHandle("C:\Windows\system32\java.exe")
- WinActivate($hwnd)
- ControlSend("C:\Windows\system32\java.exe", "", $hwnd, 'save-all {ENTER}')
- EndIf
- Case $Button6
- If $STATE = "CHECK" Then
- Opt("WinTitleMatchMode", 3)
- $hwnd = WinGetHandle("C:\Windows\system32\java.exe")
- WinActivate($hwnd)
- ControlSend("C:\Windows\system32\java.exe", "", $hwnd, $args)
- ControlSend("C:\Windows\system32\java.exe", "", $hwnd, '{ENTER}')
- Else
- EndIf
- Case $Button2
- If $STATE = "CHECK" Then
- Opt("WinTitleMatchMode", 3)
- $hwnd = WinGetHandle("C:\Windows\system32\java.exe")
- ConsoleWrite("Window handle is " & $hwnd & @CRLF)
- WinActivate($hwnd)
- Send("stop {ENTER}")
- Else
- Stop()
- EndIf
- Case $fileitem
- $file = FileOpenDialog("Choose file...", @TempDir, "All (*.*)")
- If @error <> 1 Then GUICtrlCreateMenuItem($file, $recentfilesmenu)
- Case $aboutitem
- MsgBox(0, "Server Client", "This is a client that lets you easily control the server")
- Case $tipsitem
- MsgBox(0, "Tips", "You can do lots with this client. Some basic tips: Check if you have the right configuration you want.")
- Case $knarworlditem
- MsgBox(0, "KnarWorld", "Knarworld is the original world from the original server. Here people have access to flymode, but can't interact with blocks except from in their hotel room.")
- Case $KnarCraft
- MsgBox(0, "KnarCraft", "KnarCraft is a collection of servers. Originally it was only a heavy server, but it was split when MineCraft 1.6.2 came out. Now it consists of one BungeeCord server and one Spigot server for each world from the old server.")
- Case $OldKnarCraft
- MsgBox(0, "Old KnarCraft", "Old KnarCraft is before the server got BungeeCord and was split in several pieces. Last version was when Minecraft was in 1.6.2. Some of the information here may not be relevant to the new system.")
- EndSwitch
- WEnd
- Func WriteStats()
- IniWrite("C:\Config.ini", "Checkbox", "Check1", GUICtrlRead($Checkbox1))
- IniWrite("C:\Config.ini", "Checkbox", "Check2", GUICtrlRead($Checkbox2))
- IniWrite("C:\Config.ini", "Combo", "Comb1", $chosen)
- EndFunc
- Func ReadStats()
- $Read1 = IniRead("C:\Config.ini", "Checkbox", "Check1", "1")
- $Read2 = IniRead("C:\Config.ini", "Checkbox", "Check2", "1")
- $Read3 = IniRead("C:\Config.ini", "Combo", "Comb1", StringSplit("-Xmx1024M|-Xmx2048M|-Xmx3072M|-Xmx4096M", "|"))
- GUICtrlSetData($Combo1, IniRead("C:\Config.ini", "Combo", "Comb1", "-Xmx1024M|-Xmx2048M|-Xmx3072M|-Xmx4096M"))
- If $Read1 = Int(1) = 1 Then
- GUICtrlSetState($Checkbox1, $GUI_CHECKED)
- Else
- GUICtrlSetState($Checkbox1, $GUI_UNCHECKED)
- EndIf
- If $Read2 = Int(1) = 1 Then
- GUICtrlSetState($Checkbox2, $GUI_CHECKED)
- Else
- GUICtrlSetState($Checkbox2, $GUI_UNCHECKED)
- EndIf
- EndFunc
- Func Hub_func()
- If $STATE = "CHECK" Then
- Run("java " & $chosen & ' -jar spigot-1.6.2-R0.1.jar', "E:\Spill\Alle spill\Minecraft\KnarCraft 2013", $Hide)
- Else
- Global $PID2 = Run("java " & $chosen & ' -jar "spigot-1.6.2-R0.1.jar"', "E:\Spill\Alle spill\Minecraft\Bungee Servers\Hub", $Hide)
- WinWaitActive("C:\Windows\system32\java.exe")
- WinSetTitle("C:\Windows\system32\java.exe","",$PID2)
- Global $PID3 =Run("java " & $chosen & ' -jar "spigot-1.6.2-R0.1.jar"', "E:\Spill\Alle spill\Minecraft\Bungee Servers\Survival", $Hide)
- WinWaitActive("C:\Windows\system32\java.exe")
- WinSetTitle("C:\Windows\system32\java.exe","",$PID3)
- Global $PID4 =Run("java " & $chosen & ' -jar "spigot-1.6.2-R0.1.jar"', "E:\Spill\Alle spill\Minecraft\Bungee Servers\KnarWorld", $Hide)
- WinWaitActive("C:\Windows\system32\java.exe")
- WinSetTitle("C:\Windows\system32\java.exe","",$PID4)
- Global $PID5 =Run("java " & $chosen & ' -jar "spigot-1.6.2-R0.1.jar"', "E:\Spill\Alle spill\Minecraft\Bungee Servers\Plotworld", $Hide)
- WinWaitActive("C:\Windows\system32\java.exe")
- WinSetTitle("C:\Windows\system32\java.exe","",$PID5)
- Global $PID1 =Run("java " & $chosen & ' -jar "BungeeCord.jar"', 'E:\Spill\Alle spill\Minecraft\bungee', $Hide)
- WinWaitActive("C:\Windows\system32\java.exe")
- WinSetTitle("C:\Windows\system32\java.exe","",$PID1)
- EndIf
- EndFunc
- Func Stop()
- WinActivate($PID1)
- Send("end {ENTER}")
- WinActivate($PID2)
- Send("stop{ENTER}")
- WinActivate($PID3)
- Send("stop{ENTER}")
- WinActivate($PID4)
- Send("stop{ENTER}")
- WinActivate($PID5)
- Send("stop{ENTER}")
- EndFunc ;==>Stop
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement