| View previous topic :: View next topic |
| Author |
Message |
acer5029 Expert Cheater
Reputation: 0
Joined: 21 Jul 2008 Posts: 134 Location: www.roadsidems.org
|
Posted: Thu Feb 05, 2009 5:40 am Post subject: [Request] A Simple .bat file that restarts actions |
|
|
Hi. My dedicated server is hosting a maplestory pserver and i want to make the boss monsters to spawn back and fix the lag that crashes the server about every 4 hours so i want my server to restart every 4 hours.
Here's the task.
I want the .bat file to execute,
open launch_world.bat
wait 5 seconds
open launch_login.bat
wait 5 seconds
open launch_channel.bat
and after 4 hours , it closes world, login and channel
and wait 10 seconds before opening back again.
-------Current Progress 80% completed thanks for Clopin------
@echo off
color b
:server
start /b launch_world.bat
ping -n 5 localhost > nul
start /b launch_login.bat
ping -n 5 localhost > nul
start /b launch_channel.bat
ping -n 14400 localhost > nul
TASKKILL /F /IM "launch_world.bat"
TASKKILL /F /IM "launch_login.bat"
TASKKILL /F /IM "launch_channel.bat"
ping -n 10 localhost > nul
goto server
The kind person that help a poor guy like me will get +Rep, Comeon
20% more then its done! Problem is that it doesnt closes world , login
and channel.bat at all.
Thank you.
_________________
Last edited by acer5029 on Thu Feb 05, 2009 4:20 pm; edited 4 times in total |
|
| Back to top |
|
 |
Zerith Master Cheater
Reputation: 1
Joined: 07 Oct 2007 Posts: 468
|
Posted: Thu Feb 05, 2009 5:56 am Post subject: |
|
|
Why use such an ugly solution?
You would be better off modifying the server source code for it to respawn the bosses every now and then.
|
|
| Back to top |
|
 |
acer5029 Expert Cheater
Reputation: 0
Joined: 21 Jul 2008 Posts: 134 Location: www.roadsidems.org
|
Posted: Thu Feb 05, 2009 6:18 am Post subject: |
|
|
the restart is also suppose to fix the lag that crashes the server about every 4 hours.
Serious matter help pls , thank you.
_________________
|
|
| Back to top |
|
 |
Jani Grandmaster Cheater
Reputation: 2
Joined: 29 Dec 2006 Posts: 804
|
Posted: Thu Feb 05, 2009 6:20 am Post subject: |
|
|
| ping (ie. wait/sleep/w/e) and pskill will do the job.
|
|
| Back to top |
|
 |
acer5029 Expert Cheater
Reputation: 0
Joined: 21 Jul 2008 Posts: 134 Location: www.roadsidems.org
|
Posted: Thu Feb 05, 2009 6:49 am Post subject: |
|
|
@echo off
color b
start /b launch_world.bat
start /b launch_login.bat
start /b launch_channel.bat
Here's what i got.
Can someone modify it so it restart every 4 hours.
NOTE: i have little or no experience in this kind of programming.
Thank you.
_________________
|
|
| Back to top |
|
 |
NothingToShow Grandmaster Cheater Supreme
Reputation: 0
Joined: 11 Jul 2007 Posts: 1579
|
Posted: Thu Feb 05, 2009 6:59 am Post subject: |
|
|
| Code: | @echo off
color b
:server
start /b launch_world.bat
ping -n 5 localhost > nul
start /b launch_login.bat
ping -n 5 localhost > nul
start /b launch_channel.bat
ping -n 180 localhost > nul
//Find out how to close it somehow
ping -n 10 localhost > nul
goto server |
I've read ping | Quote: | | -n 5 localhost > nul | could do the job.
I've not tested it, just did COPY PASTE
|
|
| Back to top |
|
 |
acer5029 Expert Cheater
Reputation: 0
Joined: 21 Jul 2008 Posts: 134 Location: www.roadsidems.org
|
Posted: Thu Feb 05, 2009 7:06 am Post subject: |
|
|
@Clopin
Thanks alot for Completing 80% of it!
The other 20% is pretty hard huh T.T
@echo off
color b
:server
start /b launch_world.bat
ping -n 5 localhost > nul
start /b launch_login.bat
ping -n 5 localhost > nul
start /b launch_channel.bat
ping -n 180 localhost > nul
//Find out how to close it somehow
ping -n 10 localhost > nul
goto server
@EVERYONE
Help please? , its almost complete awww..
_________________
|
|
| Back to top |
|
 |
Jani Grandmaster Cheater
Reputation: 2
Joined: 29 Dec 2006 Posts: 804
|
Posted: Thu Feb 05, 2009 7:29 am Post subject: |
|
|
| Code: | pskill "java.exe"
pskill "java.exe"
pskill "java.exe" |
There's the other kill application too, but can't remember it's name.
|
|
| Back to top |
|
 |
acer5029 Expert Cheater
Reputation: 0
Joined: 21 Jul 2008 Posts: 134 Location: www.roadsidems.org
|
Posted: Thu Feb 05, 2009 7:33 am Post subject: |
|
|
Problem is that i need the XXX.bat file to stay throughout , i want it to pop up world , login and channel and then
it will close world , login and channel every 4 hours and start it again.
It is basically a restart.
If anyone could do it, i will be very thankful.
, Thank you.
_________________
|
|
| Back to top |
|
 |
NothingToShow Grandmaster Cheater Supreme
Reputation: 0
Joined: 11 Jul 2007 Posts: 1579
|
Posted: Thu Feb 05, 2009 8:13 am Post subject: |
|
|
| Code: | @echo off
color b
:server
start /b launch_world.bat
ping -n 5 localhost > nul
start /b launch_login.bat
ping -n 5 localhost > nul
start /b launch_channel.bat
ping -n 180 localhost > nul
TASKKILL /F /IM "launch_world.bat"
TASKKILL /F /IM "launch_login.bat"
TASKKILL /F /IM "launch_channel.bat"
ping -n 10 localhost > nul
goto server |
Try Taskkill. I can't test it out right now, as I'm on Ubuntu.
(Dunno what /f and /im means, so type in TASKKILL /? and check the options.)
|
|
| Back to top |
|
 |
acer5029 Expert Cheater
Reputation: 0
Joined: 21 Jul 2008 Posts: 134 Location: www.roadsidems.org
|
Posted: Thu Feb 05, 2009 8:31 am Post subject: |
|
|
| Clopin wrote: | | Code: | @echo off
color b
:server
start /b launch_world.bat
ping -n 5 localhost > nul
start /b launch_login.bat
ping -n 5 localhost > nul
start /b launch_channel.bat
ping -n 180 localhost > nul
TASKKILL /F /IM "launch_world.bat"
TASKKILL /F /IM "launch_login.bat"
TASKKILL /F /IM "launch_channel.bat"
ping -n 10 localhost > nul
goto server |
Try Taskkill. I can't test it out right now, as I'm on Ubuntu.
(Dunno what /f and /im means, so type in TASKKILL /? and check the options.) |
Hmm does it waits 4 hours before closing world , login and channel and
open it up again?
Does the line "ping -n 180 localhost > nul"
means wait for 180 mins before closing world login and channel?
_________________
Last edited by acer5029 on Thu Feb 05, 2009 8:33 am; edited 1 time in total |
|
| Back to top |
|
 |
NothingToShow Grandmaster Cheater Supreme
Reputation: 0
Joined: 11 Jul 2007 Posts: 1579
|
Posted: Thu Feb 05, 2009 8:32 am Post subject: |
|
|
Yes, as 180 seconds = 4 hours, and at
goto server
it restarts the whole BAT.
|
|
| Back to top |
|
 |
acer5029 Expert Cheater
Reputation: 0
Joined: 21 Jul 2008 Posts: 134 Location: www.roadsidems.org
|
Posted: Thu Feb 05, 2009 8:33 am Post subject: |
|
|
| Clopin wrote: | Yes, as 180 seconds = 4 hours, and at
goto server
it restarts the whole BAT. |
Ok , i will test it and get back to this thread if it doesnt work again,
thanks clopin .
Is it 180 mins or seconds? Because 180 mins = 3 hours.
_________________
|
|
| Back to top |
|
 |
NothingToShow Grandmaster Cheater Supreme
Reputation: 0
Joined: 11 Jul 2007 Posts: 1579
|
Posted: Thu Feb 05, 2009 8:35 am Post subject: |
|
|
| acer5029 wrote: | | Clopin wrote: | Yes, as 180 seconds = 4 hours, and at
goto server
it restarts the whole BAT. |
Ok , i will test it and get back to this thread if it doesnt work again,
thanks clopin .
Is it 180 mins or seconds? Because 180 mins = 3 hours. |
Oh shit, you're right. You have to do 60x60x4, then put it in instead of 180.
|
|
| Back to top |
|
 |
acer5029 Expert Cheater
Reputation: 0
Joined: 21 Jul 2008 Posts: 134 Location: www.roadsidems.org
|
Posted: Thu Feb 05, 2009 8:40 am Post subject: |
|
|
k thanks , i will report to this thread if anything happens.
_________________
|
|
| Back to top |
|
 |
|