-
1 Attachment(s)
Anti Crash v1.0
This Is Like The Other Restarters Except.. This One Checks For The 'Fatal Error' And It Dose Not Have A GUI ( Window ) It Logs All Data To A File Also Its Scripted In AutoIt So You Might Get A False Positive Ill Also Release The Source Code.
How It Works :
Checks Processes ( Servers )
Checks Errors
If There Is An Error Or A Process Not Found It Closes The Other Processes ( Servers ) And Reboots.
* Basic Short And Simple :8: :ott: *
Hot-Key(s) : Alt+Esc = Exit
Source Code :
Code:
#Include <Date.Au3>
#Include <Process.Au3>
#NoTrayIcon
Opt ('WinTitleMatchMode','2')
HotKeySet ('!{Esc}','_Exit')
_Log ('Anti Crash v1.0 Has Started.')
Global $Server['4']
$Server['1'] = ('1. Login Server.exe')
$Server['2'] = ('2. Char Server.exe')
$Server['3'] = ('3. World Server.exe')
While ('1')
Sleep ('150')
If _Process_Check () = ('0') Or _Error_Check () = ('1') Then _Reboot ()
WEnd
Func _Error_Check ()
Local $Error
If WinExists ('Fatal') Then
_Log ('Fatal Error Found On Process : ' & _ProcessGetName (WinGetProcess ('Fatal')) & '.')
Sleep ('500')
ProcessClose (_ProcessGetName (WinGetProcess ('Fatal')))
$Error = ('1')
EndIf
If $Error = '1' Then
Return ('1')
Else
Return ('0')
EndIf
EndFunc
Func _Process_Check ()
Local $Server_Check['4']
$Server_Check['1'] = ('-1')
$Server_Check['2'] = ('-1')
$Server_Check['3'] = ('-1')
For $Array = '1' To '3'
If ProcessExists ($Server[$Array]) Then
$Server_Check[$Array] = ('1')
Else
_Log ('Process Not Found : ' & $Server[$Array] & '.')
EndIf
Next
If $Server_Check['1'] = ('1') And $Server_Check['2'] = ('1') And $Server_Check['3'] = ('1') Then
Return ('1')
Else
Return ('0')
EndIf
EndFunc
Func _Close_All ()
For $Array = '1' To '3'
ProcessClose ($Server[$Array])
Sleep ('500')
Next
EndFunc
Func _Reboot ()
_Close_All ()
_Log ('Reboot Started.')
For $Array = '1' To '3'
ShellExecute ($Server[$Array])
Sleep ('500')
Next
EndFunc
Func _Log ($Data)
FileWriteLine (@ScriptDir & '\' & _Date_String () & ' - Anti Crash Log.txt','[' & _NowTime () & '] ' & $Data)
EndFunc
Func _Date_String ()
Local $Return, $String_1, $String_2, $Month_String = ('January|February|March|April|May|June|July|August|September|October|November|December')
$String_1 = StringSplit (_NowDate (), '/')
$String_2 = StringSplit ($Month_String, '|')
$Return = ($String_2[$String_1['1']] & ' ' & $String_1['2'] & ', ' & $String_1['3'])
Return $Return
EndFunc
Func _Exit ()
Exit
EndFunc
Func OnAutoItExit ()
_Log ('Anti Crash v1.0 Has Exited.')
EndFunc
* Make Sure Its In Your Server Files Folder *
All Functions Made By Me Also All Credits Goto Me
-
Re: Anti Crash v1.0
very nice!:thumbup: good work
-
Re: Anti Crash v1.0
hmm would this make the big ass log fiels like caali's rev 1 used to?
-
Re: Anti Crash v1.0
Nice release.
Question: Is this PHP?
-
Re: Anti Crash v1.0
No It Dose Not Make A Big Ass Log File It Simply Logs : When It Starts, When A Process Dose Not Exist Or When An Error Is Found And No Its In AutoIt O.o Not PHP
-
Re: Anti Crash v1.0
I thought this is anti caali crash XD
-
Re: Anti Crash v1.0
desn't work for me
Code:
$Return = ($String_2[$String_1['1']] & ' ' & $String_1['2'] & ', ' & $String_1['3'])
$Return = (^ ERROR
-
Re: Anti Crash v1.0
Make Sure
#Include <Date.Au3>
#Include <Process.Au3>
#NoTrayIcon
Opt ('WinTitleMatchMode','2')
Is At The Top If It Dose Not Work Then Idk x_X;
-
Re: Anti Crash v1.0
It will still crash, it will just restart. So the server will still go down and everyone will still get disconnected temporarily...
-
Re: Anti Crash v1.0
not to slam AutoIt but it seems to be an inferior language to that of lower machine languages (i.e. C, C++, VB). You might want to learn these for better and more stable security.
-
Re: Anti Crash v1.0
does it work on rev3? and its only one .au3 file? how does it run?
-
Re: Anti Crash v1.0
Do it check the CPU % too or only fatal errors ?
-
Re: Anti Crash v1.0
how i make it work jest need to be with server filles ?
-
Re: Anti Crash v1.0
you need to compile it with autoIt soft. And it read twice, process and error
-
Re: Anti Crash v1.0
its no work to me .. some ine know how to fix ?