WhiteFace Posted June 26, 2009 Posted June 26, 2009 hi hommies,with this script as u can see at the title u can make auto restart/shutdown the server so lets begin: works for l2j and others just change the imports: in the quests folder create a new one called 4098_shutdown add the 4098_shutdown to the scripts.cfg file in the data folder #Created by Newface* #Date 21-June-2009 #L2J Server Restart/Shutdown Script # #Time will be in 24 hour format and must be 4 digits for example 6am is 06:00 and 6pm is 18:00 # #Days are as follows 00=Sunday 01=Monday 02=Tuesday 03=Wednesday 04=Thursday 05=Friday 06=Saturday # #If more restarts/shutdowns are required add more elif statements # #If less are required then remove elif statements # import sys import time from net.sf.l2j.gameserver import Announcements from net.sf.l2j.gameserver.model.quest.jython import QuestJython as JQuest from net.sf.l2j.gameserver import Shutdown from net.sf.l2j.gameserver.taskmanager.tasks import TaskShutdown from net.sf.l2j.gameserver.model.actor.instance import L2PcInstance from net.sf.l2j.gameserver.model import L2World from net.sf.l2j.gameserver.script import DateRange class Quest (JQuest) : def __init__(self,id,name,descr): JQuest.__init__(self,id,name,descr) self.startQuestTimer("timer199",60000,None,None,True) def onAdvEvent(self,event,npc,player) : if event == "timer199" : day = time.strftime("%w") now = time.strftime("%H:%M") if day == "01" and now == "23:00" : print "Shutdown Initiated" Shutdown.getInstance().startTelnetShutdown("Script Triggered Restart/Shutdown",60,0) #change the 60 to your required countdown in seconds and change the 0 to a 1 for restart instead of a shutdown elif day == "04" and now == "19:00" : print "Shutdown Initiated" Shutdown.getInstance().startTelnetShutdown("Script Triggered Restart/Shutdown",60,0) #change the 60 to your required countdown in seconds and change the 0 to a 1 for restart instead of a shutdown elif day == "06" and now == "03:00" : print "Shutdown Initiated" Shutdown.getInstance().startTelnetShutdown("Script Triggered Restart/Shutdown",60,0) #change the 60 to your required countdown in seconds and change the 0 to a 1 for restart instead of a shutdown QUEST = Quest(4098,"4098_shutdown","shutdown") print "Shutdown: Handler Loaded!" credits:Newface* if u find any errors post here thanks
OnlyLoveXxX Posted June 26, 2009 Posted June 26, 2009 Wow nice, i will put it on my server, i don't have so much time for my server So it will be very cool to me :D THX
3xpl0it3R Posted June 26, 2009 Posted June 26, 2009 Its works !!1 I test it on my server and its works ! Thx m8 ! I was looking for that !
CriticalError Posted June 26, 2009 Posted June 26, 2009 another good share of you man keep good work and keep sharing!!!
Matim Posted June 27, 2009 Posted June 27, 2009 Nice share , but I think better way is create .sql file with auto restarting serwer , someone share it already . Anyway its as good as .sql file
WhiteFace Posted June 27, 2009 Author Posted June 27, 2009 yeah also u can do it with this:D,but this is for restart INSERT INTO global_tasks(task,type,last_activation,param1,param2,param3) VALUES ('restart', 'TYPE_GLOBAL_TASK', '2147483647', '1', '00:00:00', '300'); -- At 00:00 in the night he will do a server restart players will have 5 minutes to logout INSERT INTO global_tasks(task,type,last_activation,param1,param2,param3) VALUES ('restart', 'TYPE_GLOBAL_TASK', '2147483647', '1', '12:00:00', '300');-- At 12:00 in the midday he will do a server restart players will have 5 minutes to logout
karma123 Posted June 27, 2009 Posted June 27, 2009 omg this is great man thx for sharing this i cant w8 to try it!!!
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