Jump to content
Sign in to follow this  
Caster

New in AutoIt, need help to automatize a server!

Recommended Posts

Caster

Well, I am pretty sure this is possible. I have seen many solutions for this, but I couldn't understand how to configurate it.

I have a Minecraft CraftBukkit server, but I want to automatize it a bit. Something like this:

10:00: Wake up pc from hybernating, and start 2 servers (they have both this CMD "gui").

After starting: Type 'save-all' (without the quotes) in both CMD's every 15 minutes until 13:00

13:00: Type 'broadcast Restarting server!' in both CMD's

13:02: Type 'stop' in both CMD's

13:04: Press the ENTER button in both CMD's, wait 5 seconds and restart the pc.

After restart: Start both servers.

After starting: Type 'save-all' in both CMD's every 15 minutes until 16:00

16:00: Type 'broadcast Restarting server!' in both CMD's

16:02: Type 'stop' in both CMD's

13:04: Press the ENTER button in both CMD's, wait 5 seconds and restart the pc.

After restart: Start both servers.

After starting: Type 'save-all' in both CMD's every 15 minutes until 20:00

20:00 Type 'broadcast Restarting server!' in both CMD's

20:02 Type 'stop' in both CMD's

20:04: Press the ENTER button in both CMD's, wait 5 seconds and restart the pc.

After restart: start both servers.

After starting: Type 'save-all' every 15 minutes in both CMD's until 01:00

01:00 Type 'broadcast STOPPING SERVER!' in both CMD's

01:02 Type 'stop' in both CMD's

01:04 Press the ENTER button in both CMD's, wait 5 seconds and set the pc to hybernate, and repeat the sequence (the pc wakes up at 10:00 again).

What I would like, is a clear optin/config in the beginning of the file or something where I can set when the server should start and stop (e.g $start=10:00; $stop=01:00) and when it should restart (e.g $restart=13:00;16:00;20:00) if that is possible.

If anyone can make a script like that for me, then I would be very happy. I have never used AutoIt before, I was just recommended by a friend about it.

-CasterAnd

Share this post


Link to post
Share on other sites
Melba23

CasterAnd,

Welcome to the AutoIt forum. :)

The Forum Rules prohibit the automation of game servers - so this thread will now be locked. ;)

However, I am not a gamer and I have asked another Mod who is to confirm that your request does indeed fall foul of the rules - if it does not it will be reopened. ;)

If anyone can make a script like that for me

But even if it is reopened, I must warn you that we do not write scripts to order. Think of the old saying: "Give a man a fish, you feed him for a day; give a man a net and you feed him forever". We try to be net makers and repairers, not fishmongers, so we will expect you do some work yourself. :)

M23


Public_Domain.png.2d871819fcb9957cf44f4514551a2935.png Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind._______Open Open spoiler to see my UDFs:

Spoiler

ArrayMultiColSort ---- Sort arrays on multiple columns
ChooseFileFolder ---- Single and multiple selections from specified path treeview listing
Date_Time_Convert -- Easily convert date/time formats, including the language used
ExtMsgBox --------- A highly customisable replacement for MsgBox
GUIExtender -------- Extend and retract multiple sections within a GUI
GUIFrame ---------- Subdivide GUIs into many adjustable frames
GUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView items
GUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeView
Marquee ----------- Scrolling tickertape GUIs
NoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxes
Notify ------------- Small notifications on the edge of the display
Scrollbars ----------Automatically sized scrollbars with a single command
StringSize ---------- Automatically size controls to fit text
Toast -------------- Small GUIs which pop out of the notification area

 

Share this post


Link to post
Share on other sites
Valik

This is against the forum rules. As already mentioned you won't get any help if you just want somebody to write a script for you. However, what you want shouldn't be all that hard. You've already broken the main problem down into a discrete series of smaller problems so begin to solve them one at a time and before long you will have your script. Indeed the "send command" part is generic enough that once it is solved once it's just a matter of passing different input to send other commands.

Thread remains locked. Should you choose to learn the language and need help make sure you are very clear on our rules before you post again.

Share this post


Link to post
Share on other sites
Guest
This topic is now closed to further replies.
Sign in to follow this  

  • Similar Content

    • Aleksandar
      By Aleksandar
      So can anyone help me ? I need to restart program when condition is not met ...

    • Spartan117
      By Spartan117
      Hi everyone,
      I wonder if there is a cloud service that can offer a physical server so that AutoIT can turn as it is in a physical machine.
      Thank you
    • krasnoshtan
      By krasnoshtan
      Hello forum users!
      At some point I had a need to restart my script. Is it possible to do this with autoit or do I need to connect additional scripts like .cmd or .bat?
      For example: i have only script.au3 and it's running. Wich code shoud i use to exit from the script and start it again?
    • comtech80
      By comtech80
      Folks,
      I have an issue I've been trying to solve for a while, I'm trying to add static routes in DHCP via a 121 route rule in Windows 2012 R2 is a brutal manual process and wanted to automate this via AutoIT.
       
      When I use the "ControlGetText" everything displays properly in the MSG box but when I try and use "ControlSetText" or "ControlSend" the values won't display in the input box but the action comes back as successful?
      Anyone able to help me with this? I'm thinking this might be an active window issue but i'm not sure.
      Here is a part of my code.
       
      $hWnd = WinWait("[TITLE:Add a Static Route]","", 10)
      WinActivate($hWnd)
      $Status = ControlSend($hWnd, "", "[CLASS:Edit; INSTANCE:4]", "192"); Does not add 192 to the text box.
      Local $sTextEdit1 = ControlGetText($hWnd, "", "[CLASS:Edit; INSTANCE:1]")
      ConsoleWrite ( "ControlSend Status: " &  $Status & @CRLF); Returns a Value of 1
      ConsoleWrite ( "ControlGetText Value Edit1: " &  $sTextEdit1 & @CRLF);
       
      Please see attachment for more info.

    • ur
      By ur
      I have a button control as below screen.

      This one I am able to suppress using below code in all the OS.
      But on server 2008, sometimes the button highlighted in the image is not getting clicked and some times it is working.
      I have cross checked the IDs when it is not working, but it is working only.
       
      $win1 = "erwin Mart Configuration" $MartConfigWindow = _WinWaitActivate1($win1,"Database Details") ControlSetText($MartConfigWindow, "", "WindowsForms10.EDIT.app.0.378734a6", $dbserver) ControlSetText($MartConfigWindow, "", "WindowsForms10.EDIT.app.0.378734a4", $dbname) ControlSetText($MartConfigWindow, "", "WindowsForms10.EDIT.app.0.378734a9", $dbuser) ControlSetText($MartConfigWindow, "", "WindowsForms10.EDIT.app.0.378734a8", $dbpassword) ;Button clicl logic $iControlClickStatus = ControlClick($MartConfigWindow, "", "[CLASS:WindowsForms10.BUTTON.app.0.378734a; INSTANCE:2]") ;If above button click fails, trying with mouse click on the control if ControlFocus($MartConfigWindow, "", "WindowsForms10.BUTTON.app.0.378734a2")=1 then ;sometimes above button fails in win server 2008,so this loop Send("{ENTER") EndIf  
      Any suggestion on how to resolve this.?
×