Advertisement
EpicKnarvik97

Program with programs

Oct 1st, 2013
120
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
AutoIt 10.14 KB | None | 0 0
  1. #region ;**** Directives created by AutoIt3Wrapper_GUI ****
  2. #AutoIt3Wrapper_Icon=..\..\Downloads\Cool.ico
  3. #AutoIt3Wrapper_Outfile_x64=Programs.exe
  4. #AutoIt3Wrapper_Compression=4
  5. #AutoIt3Wrapper_UseX64=y
  6. #endregion ;**** Directives created by AutoIt3Wrapper_GUI ****
  7. #include <ButtonConstants.au3>
  8. #include <GUIConstantsEx.au3>
  9. #include <GuiToolbar.au3>
  10. #include <StaticConstants.au3>
  11. #include <WindowsConstants.au3>
  12. #include <Misc.au3>
  13. #include <ComboConstants.au3>
  14. #include <GuiToolbar.au3>
  15. #include <ToolbarConstants.au3>
  16. #include <EditConstants.au3>
  17. #include <GuiComboBoxEx.au3>
  18.  
  19. Main()
  20.  
  21.  
  22. Func Main()
  23.     $Form1 = GUICreate("Programs", 615, 30)
  24.     $OneNote = GUICtrlCreateButton("OneNote", 8, 2, 73, 25)
  25.     $Word = GUICtrlCreateButton("Word", 88, 2, 73, 25)
  26.     $MinecraftServer = GUICtrlCreateButton("Minecraft Server", 168, 2, 86, 25)
  27.     $Custom = GUICtrlCreateButton("E-Mail Reader", 264, 2, 75, 25)
  28.     $Button5 = GUICtrlCreateButton("Button5", 528, 2, 73, 25)
  29.     $Button6 = GUICtrlCreateButton("Button6", 440, 2, 75, 25)
  30.     $Button7 = GUICtrlCreateButton("Button7", 352, 2, 73, 25)
  31.     GUISetState(@SW_SHOW)
  32.     While 1
  33.         $nMsg = GUIGetMsg()
  34.         Switch $nMsg
  35.             Case $GUI_EVENT_CLOSE
  36.                 Exit
  37.             Case $OneNote
  38.                 Run("C:\Program Files\Microsoft Office\Office15\ONENOTE.exe", "", @SW_MAXIMIZE)
  39.             Case $Word
  40.                 Run("C:\Program Files\Microsoft Office\Office15\WINWORD.exe", "", @SW_MAXIMIZE)
  41.             Case $MinecraftServer
  42.                 GUISetState(@SW_DISABLE, $Form1)
  43.                 GUISetState(@SW_HIDE, $Form1)
  44.                 MineCraftServer()
  45.                 GUISetState(@SW_ENABLE, $Form1)
  46.                 GUISetState(@SW_SHOW, $Form1)
  47.                 WinActivate("Programs")
  48.             Case $Custom
  49.                 GUISetState(@SW_DISABLE, $Form1)
  50.                 GUISetState(@SW_HIDE, $Form1)
  51.                 Gui1()
  52.                 GUISetState(@SW_ENABLE, $Form1)
  53.                 GUISetState(@SW_SHOW, $Form1)
  54.                 WinActivate("Programs")
  55.         EndSwitch
  56.     WEnd
  57. EndFunc   ;==>Main
  58.  
  59. Func Gui1()
  60.     Local $Form1 = GUICreate("E-Mail Reader", 330, 60, 192, 124)
  61.     Local $Input1 = GUICtrlCreateInput("", 10, 24, 97, 21)
  62.     Local $Label1 = GUICtrlCreateLabel("Program Name", 20, 5, 74, 17)
  63.     Local $Input2 = GUICtrlCreateInput("", 112, 24, 121, 21)
  64.     Local $Label2 = GUICtrlCreateLabel("E-Mails to read", 128, 5, 74, 17)
  65.     Local $Button1 = GUICtrlCreateButton("Start", 240, 21, 75, 25)
  66.     GUISetState(@SW_SHOW)
  67.     WinActivate("E-Mail Reader")
  68.     While 1
  69.         Local $nMsg = GUIGetMsg()
  70.         Switch $nMsg
  71.             Case $GUI_EVENT_CLOSE
  72.                 GUIDelete($Form1)
  73.                 ExitLoop
  74.             Case $Button1
  75.                 $time = GUICtrlRead($Input2)
  76.                 Local $hDLL = DllOpen("user32.dll")
  77.                 Do
  78.                     $hwnd = WinGetHandle($Input1)
  79.                     WinActivate($hwnd)
  80.                     $time -= 1
  81.                     ControlSend(GUICtrlRead($Input1), "", $hwnd, '{UP}')
  82.                     Sleep(750)
  83.                 Until $time = 1 Or _IsPressed("1B", $hDLL)
  84.         EndSwitch
  85.     WEnd
  86. EndFunc   ;==>Gui1
  87.  
  88. Func MineCraftServer()
  89.     $Test = GUICreate("KnarCraft MineCraft Server Client -Made by Kristian Knarvik/EpicKnarvik97", 945, 150, 0, 0)
  90.  
  91.     $Button1 = GUICtrlCreateButton("Start Server", 24, 85, 75, 25)
  92.     $Button2 = GUICtrlCreateButton("Stop Server", 840, 85, 75, 25)
  93.     $Button3 = GUICtrlCreateButton("Kick", 112, 85, 75, 25)
  94.     $Checkbox1 = GUICtrlCreateCheckbox("Hide Console", 24, 60, 97, 17)
  95.     $Command_Arguments = GUICtrlCreateInput("", 392, 85, 320, 21)
  96.     $Button4 = GUICtrlCreateButton("Ban", 208, 85, 75, 25)
  97.     $Button5 = GUICtrlCreateButton("OP", 304, 85, 75, 25)
  98.     $CConsole = GUICtrlCreateButton("Create Console Output", 715, 50)
  99.     $Button6 = GUICtrlCreateButton("Custom Command", 728, 85, 91, 25)
  100.     $Button7 = GUICtrlCreateButton("Save Server", 840, 60, 75, 25)
  101.     $Label1 = GUICtrlCreateLabel("Choose Server Memory", 24, 10, 166, 20)
  102.     GUICtrlSetFont(-1, 10, 800, 0, "MS Sans Serif")
  103.     $Combo1 = GUICtrlCreateCombo("-Xmx512M", 24, 35, 161, 25, $CBS_DROPDOWNLIST)
  104.     GUICtrlSetData(-1, "-Xmx1024M|-Xmx2048M|-Xmx3072M|-Xmx4096M|-Xmx5120M|-Xmx6144M|-Xmx7168M|-Xmx8192M|-Xmx9216M|-Xmx10240M")
  105.     $filemenu = GUICtrlCreateMenu("File")
  106.     $fileitem = GUICtrlCreateMenuItem("Open...", $filemenu)
  107.     $separator1 = GUICtrlCreateMenuItem("", $filemenu)
  108.     $helpmenu = GUICtrlCreateMenu("Help")
  109.     $aboutitem = GUICtrlCreateMenuItem("About", $helpmenu)
  110.     GUISetState(@SW_SHOW)
  111.  
  112.     WinActivate("KnarCraft MineCraft Server Client -Made by Kristian Knarvik/EpicKnarvik97")
  113.     $Read1 = IniRead("C:\Program Files (x86)\KnarCraft\Config.ini", "Checkbox", "Check1", "1")
  114.     $Read3 = IniRead("C:\Program Files (x86)\KnarCraft\Config.ini", "Combo", "Comb1", StringSplit("-Xmx1024M|-Xmx2048M|-Xmx3072M|-Xmx4096M", "|"))
  115.     Global $file = IniRead("C:\Program Files (x86)\KnarCraft\Config.ini", "Server File", "File", "")
  116.     Global $loc = IniRead("C:\Program Files (x86)\KnarCraft\Config.ini", "Server File", "Loc", "")
  117.     GUICtrlSetData($Combo1, IniRead("C:\Program Files (x86)\KnarCraft\Config.ini", "Combo", "Comb1", "-Xmx1024M|-Xmx2048M|-Xmx3072M|-Xmx4096M"))
  118.     If $Read1 = Int(1) = 1 Then
  119.         GUICtrlSetState($Checkbox1, $GUI_CHECKED)
  120.     Else
  121.         GUICtrlSetState($Checkbox1, $GUI_UNCHECKED)
  122.     EndIf
  123.     $C = 0
  124.     $Console = 0
  125.     $file = ""
  126.     $edit = 0
  127.  
  128.     While 1
  129.         $chosen = GUICtrlRead($Combo1)
  130.         $args = GUICtrlRead($Command_Arguments)
  131.         $nMsg = GUIGetMsg()
  132.         If GUICtrlRead($Checkbox1) = 1 Then
  133.             $Hide = @SW_HIDE
  134.         Else
  135.             $Hide = @SW_SHOW
  136.         EndIf
  137.         If $C = 1 Then
  138.             Local $file2 = FileOpen($loc & "server.log", 0)
  139.             Local $chars = FileRead($file2, 05)
  140.             If @error = -1 Then ExitLoop
  141.             GUICtrlSetData($edit, $chars)
  142.         EndIf
  143.  
  144.         Switch $nMsg
  145.             Case $CConsole
  146.                 $Console = GUICreate("Console", 600, 600)
  147.                 GUISetState(@SW_SHOW)
  148.                 $C = 1
  149.                 $edit = GUICtrlCreateEdit("Edit Control with Text", 10, 10, 590, 580)
  150.             Case $Button1
  151.                 If $file = "" Then
  152.                     MsgBox(16, "Failure", "No Server chosen")
  153.                 Else
  154.                     SoundPlay("C:\Program Files (x86)\KnarCraft\Blop-Mark_DiAngelo-79054334.mp3", 0)
  155.                     $start = Run('java -jar "' & $chosen & '" "' & $file & '"', $loc, $Hide)
  156.                     Sleep(100)
  157.                 EndIf
  158.                 WinSetTitle("C:\Windows\system32\java.exe", "", "Minecraft Server")
  159.                 WinSetTitle("C:\Windows\SYSTEM32\java.exe", "", "Minecraft Server")
  160.             Case $Button3
  161.                 Opt("WinTitleMatchMode", 3)
  162.                 $hwnd = WinGetHandle("Minecraft Server")
  163.                 If @error Then
  164.                     MsgBox(16, "Failure", "The server isn't running")
  165.                 Else
  166.                     SoundPlay("C:\Program Files (x86)\KnarCraft\Blop-Mark_DiAngelo-79054334.mp3", 0)
  167.                     WinActivate($hwnd)
  168.                     ControlSend("Minecraft Server", "", $hwnd, 'kick ')
  169.                     ControlSend("Minecraft Server", "", $hwnd, $args)
  170.                     ControlSend("Minecraft Server", "", $hwnd, '{ENTER}')
  171.                 EndIf
  172.             Case $Button4
  173.                 Opt("WinTitleMatchMode", 3)
  174.                 $hwnd = WinGetHandle("Minecraft Server")
  175.                 If @error Then
  176.                     MsgBox(16, "Failure", "The server isn't running")
  177.                 Else
  178.                     SoundPlay("C:\Program Files (x86)\KnarCraft\Blop-Mark_DiAngelo-79054334.mp3", 0)
  179.                     WinActivate($hwnd)
  180.                     ControlSend("Minecraft Server", "", $hwnd, 'ban ')
  181.                     ControlSend("Minecraft Server", "", $hwnd, $args)
  182.                     ControlSend("Minecraft Server", "", $hwnd, '{ENTER}')
  183.                 EndIf
  184.             Case $Button5
  185.                 Opt("WinTitleMatchMode", 3)
  186.                 $hwnd = WinGetHandle("Minecraft Server")
  187.                 If @error Then
  188.                     MsgBox(16, "Failure", "The server isn't running")
  189.                 Else
  190.                     SoundPlay("C:\Program Files (x86)\KnarCraft\Blop-Mark_DiAngelo-79054334.mp3", 0)
  191.                     WinActivate($hwnd)
  192.                     ControlSend("Minecraft Server", "", $hwnd, 'op ')
  193.                     ControlSend("Minecraft Server", "", $hwnd, $args)
  194.                     ControlSend("Minecraft Server", "", $hwnd, '{ENTER}')
  195.                 EndIf
  196.             Case $Button7
  197.                 Opt("WinTitleMatchMode", 3)
  198.                 $hwnd = WinGetHandle("Minecraft Server")
  199.                 If @error Then
  200.                     MsgBox(16, "Failure", "The server isn't running")
  201.                 Else
  202.                     SoundPlay("C:\Program Files (x86)\KnarCraft\Blop-Mark_DiAngelo-79054334.mp3", 0)
  203.                     WinActivate($hwnd)
  204.                     ControlSend("Minecraft Server", "", $hwnd, 'save-all {ENTER}')
  205.                 EndIf
  206.             Case $Button6
  207.                 Opt("WinTitleMatchMode", 3)
  208.                 $hwnd = WinGetHandle("Minecraft Server")
  209.                 If @error Then
  210.                     MsgBox(16, "Failure", "The server isn't running")
  211.                 Else
  212.                     SoundPlay("C:\Program Files (x86)\KnarCraft\Blop-Mark_DiAngelo-79054334.mp3", 0)
  213.                     WinActivate($hwnd)
  214.                     ControlSend("Minecraft Server", "", $hwnd, $args)
  215.                     ControlSend("Minecraft Server", "", $hwnd, '{ENTER}')
  216.                 EndIf
  217.             Case $Button2
  218.                 Opt("WinTitleMatchMode", 3)
  219.                 $hwnd = WinGetHandle("Minecraft Server")
  220.                 If @error Then
  221.                     MsgBox(16, "Failure", "The server isn't running")
  222.                 Else
  223.                     SoundPlay("C:\Program Files (x86)\KnarCraft\Blop-Mark_DiAngelo-79054334.mp3", 0)
  224.                     ConsoleWrite("Window handle is " & $hwnd & @CRLF)
  225.                     WinActivate($hwnd)
  226.                     Send("stop {ENTER}")
  227.                 EndIf
  228.             Case $fileitem
  229.                 $loc = FileSelectFolder("Choose file location...", "\")
  230.                 $file = FileOpenDialog("Choose file...", $loc, "Jar Files (*.jar*)")
  231.                 IniWrite("C:\Program Files (x86)\KnarCraft\Config.ini", "Server File", "File", $file)
  232.                 IniWrite("C:\Program Files (x86)\KnarCraft\Config.ini", "Server File", "Loc", $loc)
  233.             Case $aboutitem
  234.                 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.")
  235.             Case $GUI_EVENT_CLOSE
  236.                 $exit = MsgBox(1, "KnarCraft", "Do you want to close the client?")
  237.                 IniWrite("C:\Program Files (x86)\KnarCraft\Config.ini", "Checkbox", "Check1", GUICtrlRead($Checkbox1))
  238.                 IniWrite("C:\Program Files (x86)\KnarCraft\Config.ini", "Combo", "Comb1", $chosen)
  239.                 If $exit = 1 Then
  240.                     GUIDelete($Test)
  241.                     If $C = 1 Then GUIDelete($Console)
  242.                     ExitLoop
  243.                 EndIf
  244.         EndSwitch
  245.     WEnd ;==>MineCraftServer
  246. EndFunc   ;==>MineCraftServer
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement