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

    • Hi   I’m looking for npcname.dat for h5, it should have level of mobs + aggro   Currently I am using advext64, that’s why I am trying to make it through client side   I’ve seen someone already shared it before long time but unfortunately link is dead   If anyone has the file please share it
    • I'll stop playing, so I'll sell my (DC) Donator Coins  for cheap. Ask around; I have plenty. Here's the price list. Contact phone: +56 9 5429 4317    
    • Hi, im selling adena/items reborn signature C4   500kk  - 1kk = $2,90 ic set        pm here or discord  _flamber 
    • Want more engagement, reach, and traffic on Discord? Automate promotion of your server, members, reactions, and messages in minutes — no bots, no hassle, no overpayments. SocNet’s SMM Panel — fast launch, fair prices, real results. Use our SMM Panel to boost Facebook, Instagram, Telegram, Spotify, SoundCloud, YouTube, Reddit, Threads, Kick, Discord, LinkedIn, Likee, VK, Twitch, Kwai, Reddit, website traffic, TikTok, Trustpilot, Apple Music, TripAdvisor, Snapchat, and more digital services. Followers, likes, views, reposts, plays, viewers, reactions, comments. Get $1 bonus for your first trial order! Just open a ticket with the subject “Get Trial Bonus” on our website (Support) ➡ Go to SMM Panel (clickable) or contact our bot support How to order: ➡ SMM Panel: Click ➡ SMM Panel directly in our Telegram bot: Click (Menu ➡ SMM Panel) Our Digital Goods Store: ➡ Online Store: Click ➡ Telegram Bot: Click Regular customers get extra discounts and promo codes! Support: ➡ Telegram: https://t.me/solomon_bog ➡ Discord: https://discord.gg/y9AStFFsrh ➡ WhatsApp: https://wa.me/79051904467 ➡ ✉ Email: solomonbog@socnet.store ➡ Telegram Channel: https://t.me/accsforyou_shop You can also use these contacts to: — Get wholesale consultations — Discuss partnership deals (current partners: https://socnet.bgng.io/partners ) — Become our supplier SocNet — your source for digital goods and premium subscriptions Our project is also looking for new suppliers! — Snapchat accounts — Reddit accounts with karma — LinkedIn accounts with connections Message us directly or contact support — let’s discuss the terms! We are always open to other partnership offers as well. Our online store assortment: ➡ Accounts: Telegram, Facebook, Reddit, Twitter (X), Instagram, YouTube, TikTok, Discord, VK, LinkedIn, GitHub, Snapchat, Gmail, email accounts (Outlook, Firstmail, Rambler, Onet, Gazeta, GMX, Yahoo, Proton, Web.de), Google Voice, Google Ads ➡ Premium Subscriptions: Telegram Premium, Twitter Premium X, YouTube Premium, Spotify Premium, Netflix Premium, Discord Nitro, ChatGPT Plus/PRO, XBOX Game Pass ➡ Additional Services: Telegram Stars, proxies (IPv4, IPv6, ISP, Mobile), VPN (Outline, WireGuard, others), VDS/RDP servers Use promo code AUGUST2025 — get 10% off in our online store! SMM Panel Services: ➡ Use our SMM Panel to boost Facebook, Instagram, Telegram, Spotify, Soundcloud, YouTube, Reddit, Threads, Kick, Discord, LinkedIn, Likee, VK, Twitch, Kwai, Reddit, website traffic, TikTok, Trust Pilot, Apple Music, Tripadvisor, Snapchat, and other digital products. Get $1 for your first SMM Panel trial: Simply create a support ticket with the subject “Get Trial Bonus” on our website ➡ Go to SMM Panel (clickable) or contact support via bot Our Key Products: ➡ Online Store: Click ➡ Shop Telegram Bot: Click ➡ SMM Panel: Click Payments accepted: bank cards · cryptocurrency · other popular methods Loyal customers receive additional discounts and promo codes! Support: ➡ Telegram: https://t.me/solomon_bog ➡ Discord: https://discord.gg/y9AStFFsrh ➡ WhatsApp: https://wa.me/79051904467 ➡ ✉ Email: solomonbog@socnet.store ➡ Telegram Channel: https://t.me/accsforyou_shop You can also use these contacts to: — Consult on wholesale purchases — Form a partnership (current partners: https://socnet.bgng.io/partners ) — Become our supplier SocNet — digital goods and premium subscriptions store
  • 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