Jump to content

Recommended Posts

Posted

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

 

Posted

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

Posted

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

 

 

  • 3 weeks later...

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.




  • Posts

    • someone ban again this piece of shit this guy is a virus we should make an antikara or karabytes
    • 🍂 The cost on Vibe-sms is dropping, like autumn leaves falling from the trees.     It’s a little sad to watch the last days of summer fade away with its warmth, but that’s how the world works  every season has its own rules. The same goes for our prices: they are gradually but steadily going down, opening up new opportunities and great deals. 💸   🌍 USA is already at the minimum, and Europe, Asia, and dozens of other countries will follow soon. Don’t miss out  fresh rates are waiting for you!   Website link — https://vibe-sms.net/ Our Telegram channel — https://t.me/vibe_sms
    • You didn't tell me anywhere that you wanted core.jar as proof, I have everything ready for an independent developer to review. All the conversations, all your edits. I won't settle anything with you, so you can threaten me again and damage my name.
    • So what? Did i say anything wrong? You have no idea what source/compile is. I still wait for your .jar or source to be posted since you say i destroyed the compiled version of yours. Why you don't post it? Are you afraid that people will just see few addon lines and you did not even know that your source and compiled had different things? I should not even waste 2 minute to fix your raidboss_spawnlist thing.    Your mentally ill. What you posted is our primary deal nothing against me.  Because all he does is post whatever i write as if i hide and i did not say any mod to join and check my discord. i want him actual post something against me or any offenses i did. I also requested him several hours ago to post his .jar where my code "HACKED" his server but he wont post.    Nobody should allow open a random topic and cause issues to other's life without proofs. I demand punishment and soon unless he post evidence that i hurt his server or left him or did not make what he asked. 
  • Topics

×
×
  • Create New...

AdBlock Extension Detected!

Our website is made possible by displaying online advertisements to our members.

Please disable AdBlock browser extension first, to be able to use our community.

I've Disabled AdBlock