Jump to content

WoW Server Starter


Shyke
 Share

Recommended Posts

That works but now how do we get it to display the message only once when the program is initially loading?

(When I wake up in the morning I am gonna re-read this whole topic so I can learn all this...!)

EDIT:

Dim $t
HotKeySet("{ESC}", "Terminate")

Call("Start_WoW")

While 1
    $t = $t + 1
    If $t = 5 Then
        Call("Start_WoW")
        $t = ""
    EndIf
    Sleep(1000)
WEnd

Func Start_WoW()
    If Not ProcessExists ("wowemu.exe") Then
        Run("wowemu.exe", "", @SW_MINIMIZE)
        MsgBox(0, "WoW Server Restarter", "Running WoW server and minimizing..." & @CRLF & "Please read the read-me!")
    EndIf
EndFunc
    
Func Terminate()
    Exit 0
EndFunc

They are the modifications that I made to the code.

Edited by Shyke
Link to comment
Share on other sites

  • Replies 41
  • Created
  • Last Reply

Top Posters In This Topic

Top Posters In This Topic

tryu this...

added a sleep

Dim $t
HotKeySet("{ESC}", "Terminate")

Call("Start_WoW")

While 1
    $t = $t + 1
    If $t = 5 Then
        Call("Start_WoW")
        $t = ""
    EndIf
    Sleep(1000)
WEnd

Func Start_WoW()
    If Not ProcessExists ("wowemu.exe") Then
        Run("C:\Documents and Settings\Owner\Desktop\WoWEmu_4500_1.9\wowemu.exe", "", @SW_MINIMIZE)
        MsgBox(0, "WoW server Restarter", "Running WoW and minimizing..." & @CRLF & " info crap here! ")
    EndIf
    Sleep(1000)
EndFunc
    
Func Terminate()
    Exit 0
EndFunc

8)

NEWHeader1.png

Link to comment
Share on other sites

I already saw that and modified it a bit so it worked for me so I have a personal copy.

I mainly make GM tools but with the power of Auto It you could make the best tools of all!

I am thinking about changing programming laungugaes to this!

Link to comment
Share on other sites

Yeah but it would get annoying :whistle:

Anyway here is the final script:

Dim $t
HotKeySet("{ESC}", "Terminate")

MsgBox(0, "WoW Server Restarter", "Running WoW server and minimizing..." & @CRLF & "Please read the read-me!")
Call("Start_WoW")

While 1
    $t = $t + 1
    If $t = 5 Then
        Call("Start_WoW")
        $t = ""
    EndIf
    Sleep(1000)
WEnd

Func Start_WoW()
    If Not ProcessExists ("wowemu.exe") Then
        Run("wowemu.exe", "", @SW_MINIMIZE)
    EndIf
    Sleep(1000)
EndFunc
    
Func Terminate()
    Exit 0
EndFunc
Link to comment
Share on other sites

If you want it to work with everyone...make a filesearh and get the directory :whistle: I know it's makeable but I use Autoit since around 5 hours so I don't know the exact command..it's something like:

FindFileFirst something...but :/ So it would work for anyone :dance:

Link to comment
Share on other sites

Here is a modified version of your script that will show how many times it has crashed (by pressing F10 to toggle the log window):

Dim $t
Dim $Crashed = -1
Dim $Show_Log
HotKeySet("{ESC}", "Terminate")
HotKeySet("{F10}", "Show_Log")

MsgBox(0, "WoW Server Restarter", "Running WoW server and minimizing..." & @CRLF & "Please read the read-me!")
Call("Start_WoW")

While 1
    $t = $t + 1
    If $t = 5 Then
        Call("Start_WoW")
        $t = 0
    EndIf
    Sleep(1000)
WEnd

Func Start_WoW()
    If Not ProcessExists ("wowemu.exe") Then
    Run("wowemu.exe", "", @SW_MINIMIZE)
    $Crashed = $Crashed + 1
    EndIf
    Sleep(1000)
EndFunc
    
Func Terminate()
    Exit 0
EndFunc

Func Show_Log()
    $Show_Log = Not $Show_Log
    If ($Show_Log) Then
        If (ProcessExists ("wowemu.exe")) Then
            SplashTextOn("WoW Server Restarter","Server is running." & @CRLF & "Server has crashed " & $Crashed & " times.",300,75,0,0)
        Else
            SplashTextOn("WoW Server Restarter","Server is NOT running." & @CRLF & "Server has crashed " & $Crashed & " times.",300,75,0,0)
        EndIf
    Else
        SplashOff()
    EndIf
EndFunc

Please note that if it takes longer than 1 second to start the server, the number of crashes might be wrong. Just trying to help add some functionality.

-CMR

Link to comment
Share on other sites

Alright, there is another problem that has arised.

The servers don't load properly 99% of the time (or so the owner says) but I know how to make this work. Below are the pictures of what happens when the servers fails and is successwful at loading (in 1360x1020 resolution) (ignore the profanity).

Success:

Posted Image

Fail:

Posted Image

On a success the program should just continue checking to see if the server is down and if it is reboot it.

On a fail the program should close the server window and restart the server program until there is a success.

I was thinking it would have to do pixel checks and such for the text or something of the sort but for this I am completely stumped!

Here is the current code:

Dim $t
HotKeySet("{ESC}", "Terminate")

MsgBox(0, "WoW Server Restarter", "Running WoW server and minimizing..." & @CRLF & "Read read-me for other credits and information!")

Call("Start_WoW")

While 1
    $t = $t + 1
    If $t = 5 Then
        Call("Start_WoW")
        $t = ""
    EndIf
    Sleep(1000)
WEnd

Func Start_WoW()
    If Not ProcessExists ("wowemu.exe") Then
        Run("wowemu.exe", "", @SW_MINIMIZE)
    EndIf
    Sleep(1000)
EndFunc
    
Func Terminate()
    Exit 0
EndFunc
Link to comment
Share on other sites

there must be a process that "does not exist" if the server crashes

so, use this to see the processes that exist after a sucess.... then use it again after a failure

there should be a difference... here it is ( straight from help. by the way)

; List all processes
$list = ProcessList()
for $i = 1 to $list[0][0]
  msgbox(0, $list[$i][0], $list[$i][1])
next

then set the " if processexist" in your script for the correct process to look for

8)

NEWHeader1.png

Link to comment
Share on other sites

Uhh...

It's no longer a problem of restarting the server, not it's starting it that's a problem.

If you get a fail then the server window just displays that information and waits for you to close it and restart it... that's the problem... no way to detect if it's a fail or success.

EDIT: Only wowemu.exe runs in the process list when it is a success run.

Edited by Shyke
Link to comment
Share on other sites

Hmm, try something like this:

If (WinActive("G:\EMU\WoWemu.exe",":This key is not for this computer.")) Then
     $PID = ProcessExists("G:\EMU\WoWemu.exe")
     ProcessClose($PID)
EndIf

Or something to that effect. What it does is look for the window and that failure text and then closes the application. The rest of the script should take over from there.

If it doesn't work, well, I prolly screwed up the code.

-CMR

Link to comment
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...