RawrOmg Posted February 1, 2009 Share Posted February 1, 2009 #cs SERVER RESTART SCRIPT, ORIGIONALLY WRITTEN BY BOBDOLE103 MODIFIED TO MY LIKEING ^_^ #ce If TimerDiff($starttime) >= $checkerror1 Then If WinExists("srcds.exe - Application Error") Then WinActivate("srcds.exe - Application Error") ElseIf WinExists("Engine Error") Then WinActivate("Engine Error") EndIf Send("{ENTER}") Sleep(1500) run("server.bat") endif I want to loop that over and over again every 5 seconds, ive already got the thing down, I just don't know how to make it run constantly. Link to comment Share on other sites More sharing options...
AdmiralAlkex Posted February 1, 2009 Share Posted February 1, 2009 Hi! You can use AdlibEnable for that, it would look something like: #cs SERVER RESTART SCRIPT, ORIGIONALLY WRITTEN BY BOBDOLE103 MODIFIED TO MY LIKEING #ce AdlibEnable("_CheckServer", 5000) While 1 Sleep(123456789) WEnd Func _CheckServer() If WinExists("srcds.exe - Application Error") Then WinActivate("srcds.exe - Application Error") ElseIf WinExists("Engine Error") Then WinActivate("Engine Error") EndIf Send("{ENTER}") Sleep(1500) Run("server.bat") EndFunc ;==>_CheckServer .Some of my scripts: ShiftER, Codec-Control, Resolution switcher for HTC ShiftSome of my UDFs: SDL UDF, SetDefaultDllDirectories, Converting GDI+ Bitmap/Image to SDL Surface Link to comment Share on other sites More sharing options...
RawrOmg Posted February 1, 2009 Author Share Posted February 1, 2009 Thanks, the problem that im having now is that sometimes the server doesn't give an error when it goes down, and so the script doesn't work. Is there anyway I can check if a program (srcds.exe) is using the internet or connected to something, and in the case of it not being connected for it to restart it? Link to comment Share on other sites More sharing options...
BrettF Posted February 1, 2009 Share Posted February 1, 2009 Have you tried altering the sleep time in his example? What about ProcessExists? Vist my blog!UDFs: Opens The Default Mail Client | _LoginBox | Convert Reg to AU3 | BASS.au3 (BASS.dll) (Includes various BASS Libraries) | MultiLang.au3 (Multi-Language GUIs!)Example Scripts: Computer Info Telnet Server | "Secure" HTTP Server (Based on Manadar's Server)Software: AAMP- Advanced AutoIt Media Player | WorldCam | AYTU - Youtube Uploader Tutorials: Learning to Script with AutoIt V3Projects (Hardware + AutoIt): ArduinoUseful Links: AutoIt 1-2-3 | The AutoIt Downloads Section: | SciTE4AutoIt3 Full Version! Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now