View Single Post
  #2  
Old 12-31-2012, 10:08 PM
c0ncrete's Avatar
c0ncrete
Dragon
 
Join Date: Dec 2009
Posts: 719
Default

you could also put this in your EQEmu server directory and run it for free

runserver.vbs
Code:
set Shell = CreateObject("WScript.Shell")

' list of executables
procList = array("EQEmuLoginServer", "World", "EQLaunch", "UCS")

sub RunServer
    for each process in procList
        if not Running(process) then
            runStr = process & ".exe"
            if StrComp("EQLaunch", process, 1)=0 then
                runStr = runStr & " zone"
            end if
            'WScript.Echo "running " & runStr
            Shell.Run runStr, 0, false
        end if
    next
end sub

' is process running?
function Running(procName)
    found = false
    'WScript.Echo "checking " & procName
    for each proc in GetObject("Winmgmts:").ExecQuery("SELECT * FROM Win32_Process WHERE name='" & procName & ".exe'")
        if StrComp(proc.name, procName, 1) then
            found = true
            exit for
        end if
    next
    Running = found
end function

do until 0
    RunServer
    ' 30 second delay
    Wscript.Sleep 30000
loop
remove EQEmuLoginServer from the procList if you're not running your own login server and change value of sleep to change how long it takes between checks (in milliseconds).

you'll need to end the process named wscript.exe to stop the script as it won't have a command prompt.

i'd probably add some sort of logging method for restarts, but i got bored with it.
Reply With Quote