Shyke Posted September 3, 2005 Author Posted September 3, 2005 (edited) 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 September 3, 2005 by Shyke
Valuater Posted September 3, 2005 Posted September 3, 2005 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)
Shyke Posted September 3, 2005 Author Posted September 3, 2005 It still pops up every time it starts!
Valuater Posted September 3, 2005 Posted September 3, 2005 You could just ad the sleep to yours or take the message box outside the loopbecause you are into this Wowmaybe you should see thishttp://www.autoitscript.com/forum/index.ph...opic=13898&hl=#8)
Shyke Posted September 3, 2005 Author Posted September 3, 2005 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!
Valuater Posted September 3, 2005 Posted September 3, 2005 Listen I put your message box "inside" the loop because you said it "shuts down every four hours" or something like that so i figured every 4 hours they might see your program starter 8)
Shyke Posted September 3, 2005 Author Posted September 3, 2005 Yeah but it would get annoying 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
Shyke Posted September 3, 2005 Author Posted September 3, 2005 This launguage gives me so many idea's for easy to make programs that everyone would love, lol!
Gaboury Posted September 3, 2005 Posted September 3, 2005 If you want it to work with everyone...make a filesearh and get the directory 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
CodeMaster Rapture Posted September 3, 2005 Posted September 3, 2005 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): expandcollapse popupDim $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
Shyke Posted September 3, 2005 Author Posted September 3, 2005 For the exe to start it takes about a second but for the server to load it takes almost twenty minutes. Thank-you all for your support!
Shyke Posted September 4, 2005 Author Posted September 4, 2005 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:Fail: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
Valuater Posted September 4, 2005 Posted September 4, 2005 (edited) at a friends house cant help much...but does this program run in dos??? 8) Edited September 4, 2005 by Valuater
Shyke Posted September 4, 2005 Author Posted September 4, 2005 The console is dos yes but that console just launches all the normal programs and runs everything together.
Valuater Posted September 5, 2005 Posted September 5, 2005 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)
Shyke Posted September 5, 2005 Author Posted September 5, 2005 (edited) 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 September 5, 2005 by Shyke
CodeMaster Rapture Posted September 6, 2005 Posted September 6, 2005 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
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