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

    • the price is 220 + Payment Systems?
    • Discord         :  utchiha_market Telegram        : https://t.me/utchiha_market  
    • HELLO EVERYONE. WE ARE SELLING A LOT OF ADENA ON L2 REBORN / E-Global x Lu4 DISCORD - GODDARDSHOP   HURRY TO BUY OR YOU MAY NOT MAKE IT!!!
    • Added: 🎁 Seasonal Bonus System When the seasonal bonus is enabled, players receive additional bonus coins equal to bonus_season_percent of their donation amount. 💡 How it works (example): A player donates through their personal account and immediately receives regular coins. At the same time, bonus coins equal to 30% of the donation are credited. Example: Donation: 1000 coins → Bonus: 300 coins (30%) These bonus coins are not available immediately — they can be claimed later when the next season begins. 📅 When the bonus can be claimed: bonus_season_claim_start_date – the date when the "Claim" button becomes available. bonus_season_claim_end_date – the date after which the bonus can no longer be claimed. During this time window, the "Claim" button will appear in the personal account, allowing players to collect their accumulated bonus. 'bonus_season_enabled' => true, // Enable/disable the seasonal bonus system 'bonus_season_percent' => 30, // Percentage of the donation to be given as bonus coins (30 = 30%) 'bonus_season_claim_start_date' => '2025-07-30 00:00:00', // Date when the Claim button becomes available in the new season   'bonus_season_enabled' => true, // Вкл./Выкл Сезонную бонусную систему? 'bonus_season_percent' => 30, // Процент, при донате получает монеты в процентах 30 = 30%, которые может использовать в следующем открытии 'bonus_season_claim_start_date' => '2025-07-30 00:00:00', // Дата когда доступна кнопка Claim в новом сезоне 'bonus_season_claim_end_date' => '2025-08-15 20:00:00', // Дата окончания когда кнопка Claim в новом сезоне
  • 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