Cheat Engine Forum Index Cheat Engine
The Official Site of Cheat Engine
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 


[Request] A Simple .bat file that restarts actions
Goto page 1, 2  Next
 
Post new topic   Reply to topic    Cheat Engine Forum Index -> General programming
View previous topic :: View next topic  
Author Message
acer5029
Expert Cheater
Reputation: 0

Joined: 21 Jul 2008
Posts: 134
Location: www.roadsidems.org

PostPosted: Thu Feb 05, 2009 5:40 am    Post subject: [Request] A Simple .bat file that restarts actions Reply with quote

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.

_________________

Click here
Have fun in RoadSideMS~!
Join Today~!


Last edited by acer5029 on Thu Feb 05, 2009 4:20 pm; edited 4 times in total
Back to top
View user's profile Send private message
Zerith
Master Cheater
Reputation: 1

Joined: 07 Oct 2007
Posts: 468

PostPosted: Thu Feb 05, 2009 5:56 am    Post subject: Reply with quote

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
View user's profile Send private message MSN Messenger
acer5029
Expert Cheater
Reputation: 0

Joined: 21 Jul 2008
Posts: 134
Location: www.roadsidems.org

PostPosted: Thu Feb 05, 2009 6:18 am    Post subject: Reply with quote

the restart is also suppose to fix the lag that crashes the server about every 4 hours.
Serious matter help pls , thank you.

_________________

Click here
Have fun in RoadSideMS~!
Join Today~!
Back to top
View user's profile Send private message
Jani
Grandmaster Cheater
Reputation: 2

Joined: 29 Dec 2006
Posts: 804

PostPosted: Thu Feb 05, 2009 6:20 am    Post subject: Reply with quote

ping (ie. wait/sleep/w/e) and pskill will do the job.
Back to top
View user's profile Send private message
acer5029
Expert Cheater
Reputation: 0

Joined: 21 Jul 2008
Posts: 134
Location: www.roadsidems.org

PostPosted: Thu Feb 05, 2009 6:49 am    Post subject: Reply with quote

@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.

_________________

Click here
Have fun in RoadSideMS~!
Join Today~!
Back to top
View user's profile Send private message
NothingToShow
Grandmaster Cheater Supreme
Reputation: 0

Joined: 11 Jul 2007
Posts: 1579

PostPosted: Thu Feb 05, 2009 6:59 am    Post subject: Reply with quote

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
View user's profile Send private message
acer5029
Expert Cheater
Reputation: 0

Joined: 21 Jul 2008
Posts: 134
Location: www.roadsidems.org

PostPosted: Thu Feb 05, 2009 7:06 am    Post subject: Reply with quote

@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..

_________________

Click here
Have fun in RoadSideMS~!
Join Today~!
Back to top
View user's profile Send private message
Jani
Grandmaster Cheater
Reputation: 2

Joined: 29 Dec 2006
Posts: 804

PostPosted: Thu Feb 05, 2009 7:29 am    Post subject: Reply with quote

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
View user's profile Send private message
acer5029
Expert Cheater
Reputation: 0

Joined: 21 Jul 2008
Posts: 134
Location: www.roadsidems.org

PostPosted: Thu Feb 05, 2009 7:33 am    Post subject: Reply with quote

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.
Smile , Thank you.

_________________

Click here
Have fun in RoadSideMS~!
Join Today~!
Back to top
View user's profile Send private message
NothingToShow
Grandmaster Cheater Supreme
Reputation: 0

Joined: 11 Jul 2007
Posts: 1579

PostPosted: Thu Feb 05, 2009 8:13 am    Post subject: Reply with quote

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
View user's profile Send private message
acer5029
Expert Cheater
Reputation: 0

Joined: 21 Jul 2008
Posts: 134
Location: www.roadsidems.org

PostPosted: Thu Feb 05, 2009 8:31 am    Post subject: Reply with quote

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?

_________________

Click here
Have fun in RoadSideMS~!
Join Today~!


Last edited by acer5029 on Thu Feb 05, 2009 8:33 am; edited 1 time in total
Back to top
View user's profile Send private message
NothingToShow
Grandmaster Cheater Supreme
Reputation: 0

Joined: 11 Jul 2007
Posts: 1579

PostPosted: Thu Feb 05, 2009 8:32 am    Post subject: Reply with quote

Yes, as 180 seconds = 4 hours, and at
goto server
it restarts the whole BAT.
Back to top
View user's profile Send private message
acer5029
Expert Cheater
Reputation: 0

Joined: 21 Jul 2008
Posts: 134
Location: www.roadsidems.org

PostPosted: Thu Feb 05, 2009 8:33 am    Post subject: Reply with quote

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 Smile.

Is it 180 mins or seconds? Because 180 mins = 3 hours.

_________________

Click here
Have fun in RoadSideMS~!
Join Today~!
Back to top
View user's profile Send private message
NothingToShow
Grandmaster Cheater Supreme
Reputation: 0

Joined: 11 Jul 2007
Posts: 1579

PostPosted: Thu Feb 05, 2009 8:35 am    Post subject: Reply with quote

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 Smile.

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
View user's profile Send private message
acer5029
Expert Cheater
Reputation: 0

Joined: 21 Jul 2008
Posts: 134
Location: www.roadsidems.org

PostPosted: Thu Feb 05, 2009 8:40 am    Post subject: Reply with quote

k thanks , i will report to this thread if anything happens.
_________________

Click here
Have fun in RoadSideMS~!
Join Today~!
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    Cheat Engine Forum Index -> General programming All times are GMT - 6 Hours
Goto page 1, 2  Next
Page 1 of 2

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Powered by phpBB © 2001, 2005 phpBB Group

CE Wiki   IRC (#CEF)   Twitter
Third party websites