Official Fulqrum Publishing forum

Official Fulqrum Publishing forum (http://forum.fulqrumpublishing.com/index.php)
-   CoD Multiplayer (http://forum.fulqrumpublishing.com/forumdisplay.php?f=192)
-   -   Dedicated server automation (http://forum.fulqrumpublishing.com/showthread.php?t=28004)

gec 11-22-2011 08:20 AM

Dedicated server automation
 
Hi all,

i wanted to make some kind of tool to reset my server if something fails.

i'm no programmer but have some basic knowledge about it. for this purpose i've used AutiIt scripting language.

It is not allowed to discus game automation on their forums so i'll share my accomplishments and troubles with u.

the script is waiting in the tray and checks if Launcher program is running. if not it runs it and sends commands to load and start map cycle.

it also checks for error windows, closes them and restarts the server.

it works fine most of the times just did not cache all the errors windows that can aper that needs to be closed.

here is the script:

Code:

AutoItSetOption ("TrayIconDebug", 1);0-off
While 1 = 1
        While WinExists ("Launcher") > 0 ; if window exists ...
                While WinExists("Steam Connection") > 0 ; check if this windows exists and close
                        WinActivate("Steam Connection")
                        Send("{ENTER}")
                        Sleep (500)
                WEnd
                While WinExists("Steam Connection Error") > 0 ; check if this windows exists and close
                        WinActivate("Steam Connection Error")
                        Send("{ENTER}")
                        Sleep (500)
                WEnd
                While WinExists("Error") > 0 ; check if this windows exists and close
                        WinActivate("Error")
                        Send("{ENTER}")
                        Sleep (500)
                WEnd
                While WinExists("Steam - Self Updater") > 0 ; check if this windows exists and close
                        WinActivate("Steam - Self Updater")
                        Send("{ENTER}")
                        Sleep (500)
                WEnd
                While WinExists("Steam - Shutdown") > 0 ; check if this windows exists and close
                        WinActivate("Steam - Shutdown")
                        Send("{ENTER}")
                        Sleep (500)
                WEnd
                Sleep (60000) ; check again in a minute
        WEnd
; if window does not exist
        ShellExecute("Launcher.lnk")
        WinActivate("Launcher")
        Sleep(10000)
        WinActivate("Launcher")
        Send("{ENTER}")
        Send("f start.cmd")
        Send("{ENTER}")
WEnd

i'm not going to explain how AutoIt works. please google it, RTFM :-P , and try to understand it. it is quite simple.

would like to get some good ideas how to make it better. specially from programmers.

Ataros 11-22-2011 12:05 PM

Thank you very much for sharing. Have a look at BigRepa's server automation script mentioned in my sig.

gec 11-22-2011 04:38 PM

thx Ataros.

i'll study your script some more but for now it looks SiFi for my skills :-P

Did not even know that there is If Not statement and enumerations are way over my head.

i'll have to dig in the AutoIt help file some more and learn something from your script.


All times are GMT. The time now is 02:53 AM.

Powered by vBulletin® Version 3.8.4
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright © 2007 Fulqrum Publishing. All rights reserved.