jWalker Posted February 29, 2012 Share Posted February 29, 2012 Hey i have a minecraftserver for me and my friends. It's hosted on my PC and now i want to write a gui for it. So i can easily teleport to someone or set the gamemode etc. ;MCSERVER #include <ButtonConstants.au3> #include <EditConstants.au3> #include <GUIConstantsEx.au3> #include <WindowsConstants.au3> #include <Constants.au3> #region ### START Koda GUI section ### Form= $Form1 = GUICreate("Form1", 615, 438, 192, 124) $Edit1 = GUICtrlCreateEdit("", 8, 8, 449, 393, BitOR($ES_READONLY, $ES_WANTRETURN, $WS_VSCROLL)) GUICtrlSetData(-1, "Edit1") $Button1 = GUICtrlCreateButton("Button1", 384, 408, 75, 25) $Input1 = GUICtrlCreateInput("Input1", 8, 408, 369, 21) GUISetState(@SW_SHOW) #endregion ### END Koda GUI section ### $path = "C:\Users\Danny\AppData\Roaming\.minecraft\mcserver" $minecraftserver = Run(@ComSpec & " /C java -Xms512M -Xmx1024M -jar minecraft_server.jar nogui", $path, @SW_HIDE, $STDIN_CHILD + $STDOUT_CHILD ) While 1 $dataout = StdoutRead( $minecraftserver ) If $dataout <> "" Then $log = FileOpen($path & "\MClog.dat", 9) FileWrite($log, $dataout) FileClose($log) $log = FileOpen($path & "\MClog.dat") $logtext = FileRead($log) FileClose($log) GUICtrlSetData($Edit1, $logtext) EndIf $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE StdinWrite( $minecraftserver, "stop" ) Exit EndSwitch WEnd At First i just want to Add Text and Read text. Adding text to the program works, On the Gui Event Close section is a part of the code which stops the server. It works. A Server output at the start usually looks like this: 177 recipes 27 achievements 2012-02-29 08:21:31 [INFO] Starting minecraft server version 12w08a 2012-02-29 08:21:31 [INFO] Loading properties 2012-02-29 08:21:31 [INFO] Starting Minecraft server on *:25565 2012-02-29 08:21:31 [INFO] Preparing level "world2" 2012-02-29 08:21:31 [INFO] Default game type: 0 2012-02-29 08:21:31 [INFO] Preparing start region for level 0 2012-02-29 08:21:32 [INFO] Done (730407150ns)! For help, type "help" or "?" All i get from StdOutRead is just 177 recipes and 27 achievements. The rest of this Output is in the Autoit Console oO Any ideas what i am doing wrong here? Link to comment Share on other sites More sharing options...
jWalker Posted February 29, 2012 Author Share Posted February 29, 2012 Okay next Problem I used StdErrRead in addition and it works. But not like a charm. This part: 2012-02-29 08:21:31 [INFO] Starting minecraft server version 12w08a 2012-02-29 08:21:31 [INFO] Loading properties 2012-02-29 08:21:31 [INFO] Starting Minecraft server on *:25565 2012-02-29 08:21:31 [INFO] Preparing level "world2" 2012-02-29 08:21:31 [INFO] Default game type: 0 2012-02-29 08:21:31 [INFO] Preparing start region for level 0 2012-02-29 08:21:32 [INFO] Done (730407150ns)! For help, type "help" or "?" looks like this: 2012-02-29 08:21:31 [INFO] Starting minecraft server version 12w08a2012-02-29 08:21:31 [INFO] Loading properties2012-02-29 08:21:31 [INFO] Starting Minecraft server on *:255652012-02-29 08:21:31 [INFO] Preparing level "world2"2012-02-29 08:21:31 [INFO] Default game type: 02012-02-29 08:21:31 [INFO] Preparing start region for level 02012-02-29 08:21:32 [INFO] Done (730407150ns)! For help, type "help" or "?" I think that these Infos come too fast. Any way to avoid that? Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted February 29, 2012 Moderators Share Posted February 29, 2012 jWalker,I am locking this thread until I get advice from another Mod who is into gaming as to whether it infringes our Forum rules. Apologies for the inconvenience if it is subsequently deemed legal. M23 Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind Open spoiler to see my UDFs: Spoiler ArrayMultiColSort ---- Sort arrays on multiple columnsChooseFileFolder ---- Single and multiple selections from specified path treeview listingDate_Time_Convert -- Easily convert date/time formats, including the language usedExtMsgBox --------- A highly customisable replacement for MsgBoxGUIExtender -------- Extend and retract multiple sections within a GUIGUIFrame ---------- Subdivide GUIs into many adjustable framesGUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView itemsGUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeViewMarquee ----------- Scrolling tickertape GUIsNoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxesNotify ------------- Small notifications on the edge of the displayScrollbars ----------Automatically sized scrollbars with a single commandStringSize ---------- Automatically size controls to fit textToast -------------- Small GUIs which pop out of the notification area Link to comment Share on other sites More sharing options...
Valik Posted February 29, 2012 Share Posted February 29, 2012 Locking the thread is correct. Server or client is irrelevant. Do not discuss using Autoit to interact with games in any manner on this forum. Link to comment Share on other sites More sharing options...
Recommended Posts