Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #region ;**** Directives created by AutoIt3Wrapper_GUI ****
- #AutoIt3Wrapper_Icon=..\..\Downloads\Cool.ico
- #AutoIt3Wrapper_Outfile_x64=Programs.exe
- #AutoIt3Wrapper_Compression=4
- #AutoIt3Wrapper_UseX64=y
- #endregion ;**** Directives created by AutoIt3Wrapper_GUI ****
- #include <ButtonConstants.au3>
- #include <GUIConstantsEx.au3>
- #include <GuiToolbar.au3>
- #include <StaticConstants.au3>
- #include <WindowsConstants.au3>
- #include <Misc.au3>
- #include <ComboConstants.au3>
- #include <GuiToolbar.au3>
- #include <ToolbarConstants.au3>
- #include <EditConstants.au3>
- #include <GuiComboBoxEx.au3>
- Main()
- Func Main()
- $Form1 = GUICreate("Programs", 615, 30)
- $OneNote = GUICtrlCreateButton("OneNote", 8, 2, 73, 25)
- $Word = GUICtrlCreateButton("Word", 88, 2, 73, 25)
- $MinecraftServer = GUICtrlCreateButton("Minecraft Server", 168, 2, 86, 25)
- $Custom = GUICtrlCreateButton("E-Mail Reader", 264, 2, 75, 25)
- $Button5 = GUICtrlCreateButton("Button5", 528, 2, 73, 25)
- $Button6 = GUICtrlCreateButton("Button6", 440, 2, 75, 25)
- $Button7 = GUICtrlCreateButton("Button7", 352, 2, 73, 25)
- GUISetState(@SW_SHOW)
- While 1
- $nMsg = GUIGetMsg()
- Switch $nMsg
- Case $GUI_EVENT_CLOSE
- Exit
- Case $OneNote
- Run("C:\Program Files\Microsoft Office\Office15\ONENOTE.exe", "", @SW_MAXIMIZE)
- Case $Word
- Run("C:\Program Files\Microsoft Office\Office15\WINWORD.exe", "", @SW_MAXIMIZE)
- Case $MinecraftServer
- GUISetState(@SW_DISABLE, $Form1)
- GUISetState(@SW_HIDE, $Form1)
- MineCraftServer()
- GUISetState(@SW_ENABLE, $Form1)
- GUISetState(@SW_SHOW, $Form1)
- WinActivate("Programs")
- Case $Custom
- GUISetState(@SW_DISABLE, $Form1)
- GUISetState(@SW_HIDE, $Form1)
- Gui1()
- GUISetState(@SW_ENABLE, $Form1)
- GUISetState(@SW_SHOW, $Form1)
- WinActivate("Programs")
- EndSwitch
- WEnd
- EndFunc ;==>Main
- Func Gui1()
- Local $Form1 = GUICreate("E-Mail Reader", 330, 60, 192, 124)
- Local $Input1 = GUICtrlCreateInput("", 10, 24, 97, 21)
- Local $Label1 = GUICtrlCreateLabel("Program Name", 20, 5, 74, 17)
- Local $Input2 = GUICtrlCreateInput("", 112, 24, 121, 21)
- Local $Label2 = GUICtrlCreateLabel("E-Mails to read", 128, 5, 74, 17)
- Local $Button1 = GUICtrlCreateButton("Start", 240, 21, 75, 25)
- GUISetState(@SW_SHOW)
- WinActivate("E-Mail Reader")
- While 1
- Local $nMsg = GUIGetMsg()
- Switch $nMsg
- Case $GUI_EVENT_CLOSE
- GUIDelete($Form1)
- ExitLoop
- Case $Button1
- $time = GUICtrlRead($Input2)
- Local $hDLL = DllOpen("user32.dll")
- Do
- $hwnd = WinGetHandle($Input1)
- WinActivate($hwnd)
- $time -= 1
- ControlSend(GUICtrlRead($Input1), "", $hwnd, '{UP}')
- Sleep(750)
- Until $time = 1 Or _IsPressed("1B", $hDLL)
- EndSwitch
- WEnd
- EndFunc ;==>Gui1
- Func MineCraftServer()
- $Test = GUICreate("KnarCraft MineCraft Server Client -Made by Kristian Knarvik/EpicKnarvik97", 945, 150, 0, 0)
- $Button1 = GUICtrlCreateButton("Start Server", 24, 85, 75, 25)
- $Button2 = GUICtrlCreateButton("Stop Server", 840, 85, 75, 25)
- $Button3 = GUICtrlCreateButton("Kick", 112, 85, 75, 25)
- $Checkbox1 = GUICtrlCreateCheckbox("Hide Console", 24, 60, 97, 17)
- $Command_Arguments = GUICtrlCreateInput("", 392, 85, 320, 21)
- $Button4 = GUICtrlCreateButton("Ban", 208, 85, 75, 25)
- $Button5 = GUICtrlCreateButton("OP", 304, 85, 75, 25)
- $CConsole = GUICtrlCreateButton("Create Console Output", 715, 50)
- $Button6 = GUICtrlCreateButton("Custom Command", 728, 85, 91, 25)
- $Button7 = GUICtrlCreateButton("Save Server", 840, 60, 75, 25)
- $Label1 = GUICtrlCreateLabel("Choose Server Memory", 24, 10, 166, 20)
- GUICtrlSetFont(-1, 10, 800, 0, "MS Sans Serif")
- $Combo1 = GUICtrlCreateCombo("-Xmx512M", 24, 35, 161, 25, $CBS_DROPDOWNLIST)
- GUICtrlSetData(-1, "-Xmx1024M|-Xmx2048M|-Xmx3072M|-Xmx4096M|-Xmx5120M|-Xmx6144M|-Xmx7168M|-Xmx8192M|-Xmx9216M|-Xmx10240M")
- $filemenu = GUICtrlCreateMenu("File")
- $fileitem = GUICtrlCreateMenuItem("Open...", $filemenu)
- $separator1 = GUICtrlCreateMenuItem("", $filemenu)
- $helpmenu = GUICtrlCreateMenu("Help")
- $aboutitem = GUICtrlCreateMenuItem("About", $helpmenu)
- GUISetState(@SW_SHOW)
- WinActivate("KnarCraft MineCraft Server Client -Made by Kristian Knarvik/EpicKnarvik97")
- $Read1 = IniRead("C:\Program Files (x86)\KnarCraft\Config.ini", "Checkbox", "Check1", "1")
- $Read3 = IniRead("C:\Program Files (x86)\KnarCraft\Config.ini", "Combo", "Comb1", StringSplit("-Xmx1024M|-Xmx2048M|-Xmx3072M|-Xmx4096M", "|"))
- Global $file = IniRead("C:\Program Files (x86)\KnarCraft\Config.ini", "Server File", "File", "")
- Global $loc = IniRead("C:\Program Files (x86)\KnarCraft\Config.ini", "Server File", "Loc", "")
- GUICtrlSetData($Combo1, IniRead("C:\Program Files (x86)\KnarCraft\Config.ini", "Combo", "Comb1", "-Xmx1024M|-Xmx2048M|-Xmx3072M|-Xmx4096M"))
- If $Read1 = Int(1) = 1 Then
- GUICtrlSetState($Checkbox1, $GUI_CHECKED)
- Else
- GUICtrlSetState($Checkbox1, $GUI_UNCHECKED)
- EndIf
- $C = 0
- $Console = 0
- $file = ""
- $edit = 0
- While 1
- $chosen = GUICtrlRead($Combo1)
- $args = GUICtrlRead($Command_Arguments)
- $nMsg = GUIGetMsg()
- If GUICtrlRead($Checkbox1) = 1 Then
- $Hide = @SW_HIDE
- Else
- $Hide = @SW_SHOW
- EndIf
- If $C = 1 Then
- Local $file2 = FileOpen($loc & "server.log", 0)
- Local $chars = FileRead($file2, 05)
- If @error = -1 Then ExitLoop
- GUICtrlSetData($edit, $chars)
- EndIf
- Switch $nMsg
- Case $CConsole
- $Console = GUICreate("Console", 600, 600)
- GUISetState(@SW_SHOW)
- $C = 1
- $edit = GUICtrlCreateEdit("Edit Control with Text", 10, 10, 590, 580)
- Case $Button1
- If $file = "" Then
- MsgBox(16, "Failure", "No Server chosen")
- Else
- SoundPlay("C:\Program Files (x86)\KnarCraft\Blop-Mark_DiAngelo-79054334.mp3", 0)
- $start = Run('java -jar "' & $chosen & '" "' & $file & '"', $loc, $Hide)
- Sleep(100)
- EndIf
- WinSetTitle("C:\Windows\system32\java.exe", "", "Minecraft Server")
- WinSetTitle("C:\Windows\SYSTEM32\java.exe", "", "Minecraft Server")
- Case $Button3
- Opt("WinTitleMatchMode", 3)
- $hwnd = WinGetHandle("Minecraft Server")
- If @error Then
- MsgBox(16, "Failure", "The server isn't running")
- Else
- SoundPlay("C:\Program Files (x86)\KnarCraft\Blop-Mark_DiAngelo-79054334.mp3", 0)
- WinActivate($hwnd)
- ControlSend("Minecraft Server", "", $hwnd, 'kick ')
- ControlSend("Minecraft Server", "", $hwnd, $args)
- ControlSend("Minecraft Server", "", $hwnd, '{ENTER}')
- EndIf
- Case $Button4
- Opt("WinTitleMatchMode", 3)
- $hwnd = WinGetHandle("Minecraft Server")
- If @error Then
- MsgBox(16, "Failure", "The server isn't running")
- Else
- SoundPlay("C:\Program Files (x86)\KnarCraft\Blop-Mark_DiAngelo-79054334.mp3", 0)
- WinActivate($hwnd)
- ControlSend("Minecraft Server", "", $hwnd, 'ban ')
- ControlSend("Minecraft Server", "", $hwnd, $args)
- ControlSend("Minecraft Server", "", $hwnd, '{ENTER}')
- EndIf
- Case $Button5
- Opt("WinTitleMatchMode", 3)
- $hwnd = WinGetHandle("Minecraft Server")
- If @error Then
- MsgBox(16, "Failure", "The server isn't running")
- Else
- SoundPlay("C:\Program Files (x86)\KnarCraft\Blop-Mark_DiAngelo-79054334.mp3", 0)
- WinActivate($hwnd)
- ControlSend("Minecraft Server", "", $hwnd, 'op ')
- ControlSend("Minecraft Server", "", $hwnd, $args)
- ControlSend("Minecraft Server", "", $hwnd, '{ENTER}')
- EndIf
- Case $Button7
- Opt("WinTitleMatchMode", 3)
- $hwnd = WinGetHandle("Minecraft Server")
- If @error Then
- MsgBox(16, "Failure", "The server isn't running")
- Else
- SoundPlay("C:\Program Files (x86)\KnarCraft\Blop-Mark_DiAngelo-79054334.mp3", 0)
- WinActivate($hwnd)
- ControlSend("Minecraft Server", "", $hwnd, 'save-all {ENTER}')
- EndIf
- Case $Button6
- Opt("WinTitleMatchMode", 3)
- $hwnd = WinGetHandle("Minecraft Server")
- If @error Then
- MsgBox(16, "Failure", "The server isn't running")
- Else
- SoundPlay("C:\Program Files (x86)\KnarCraft\Blop-Mark_DiAngelo-79054334.mp3", 0)
- WinActivate($hwnd)
- ControlSend("Minecraft Server", "", $hwnd, $args)
- ControlSend("Minecraft Server", "", $hwnd, '{ENTER}')
- EndIf
- Case $Button2
- Opt("WinTitleMatchMode", 3)
- $hwnd = WinGetHandle("Minecraft Server")
- If @error Then
- MsgBox(16, "Failure", "The server isn't running")
- Else
- SoundPlay("C:\Program Files (x86)\KnarCraft\Blop-Mark_DiAngelo-79054334.mp3", 0)
- ConsoleWrite("Window handle is " & $hwnd & @CRLF)
- WinActivate($hwnd)
- Send("stop {ENTER}")
- EndIf
- Case $fileitem
- $loc = FileSelectFolder("Choose file location...", "\")
- $file = FileOpenDialog("Choose file...", $loc, "Jar Files (*.jar*)")
- IniWrite("C:\Program Files (x86)\KnarCraft\Config.ini", "Server File", "File", $file)
- IniWrite("C:\Program Files (x86)\KnarCraft\Config.ini", "Server File", "Loc", $loc)
- Case $aboutitem
- MsgBox(0, "Server Client", "This is a client that lets you easily control the server. Just click File then open and go to your server jarfile. It will be saved with your other settings under C:\Program Files (x86)\KnarCraft\Config.ini Then choose how much server memory you want to dedicate from the dropbox. If you want, you can also check the Hide Console checkbox to prevent the console window from popping up. Then just start the server with the start server button and you are good to go. The kick/ban/op buttons do what they say against the name in the text box. The save server button runs save-all and the stop server button runs stop. The custom command button allows every button you can use from the console. Just type in every command you want in the white box and hit the button. Remember. Since it's a console command, don't use / before the command.")
- Case $GUI_EVENT_CLOSE
- $exit = MsgBox(1, "KnarCraft", "Do you want to close the client?")
- IniWrite("C:\Program Files (x86)\KnarCraft\Config.ini", "Checkbox", "Check1", GUICtrlRead($Checkbox1))
- IniWrite("C:\Program Files (x86)\KnarCraft\Config.ini", "Combo", "Comb1", $chosen)
- If $exit = 1 Then
- GUIDelete($Test)
- If $C = 1 Then GUIDelete($Console)
- ExitLoop
- EndIf
- EndSwitch
- WEnd ;==>MineCraftServer
- EndFunc ;==>MineCraftServer
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement