Jump to content
  • 0

Question

Posted

help pedes katevasa ena aoutoanounce to evala ops lei \gameserver\data\jscript\custom\auto_announcements mesa sto fakelo exi ena init bat pou lei na to patiso to patisa ke ekana tis rithmisis sto _init_.py pou ine ke afto mesto fakelo ke ta evla etsi

 

print "Loading auto announcements..."

import sys

from net.sf.l2j.gameserver import Announcements

from net.sf.l2j.gameserver import ThreadPoolManager

from java.lang import Runnable

 

INTERVAL = 1

ANNOUNCEMENT_1="(^_^)"

ANNOUNCEMENT_2="Your announcement here"

 

class myTask( Runnable ):

    def __init__( self ):

        self.name = "autoAnnouncer"

    def run( self ):

        Announcements.getInstance().announceToAll(ANNOUNCEMENT_1)

        Announcements.getInstance().announceToAll(ANNOUNCEMENT_2)

 

startInstance = myTask()

ThreadPoolManager.getInstance().scheduleGeneralAtFixedRate(startInstance,INTERVAL*60000,INTERVAL*60000)

 

pataw save kano rr ke molis mpeno mesa den emfanizete tpt ti ftei ? voithiste ligo gyes opios kseri

4 answers to this question

Recommended Posts

  • 0
Posted

Αμα δεν εχεις l2j pack λογικο ειναι.

Βρες ενα auto announce που να εχει imports για το pack που εχεις.

 

from net.sf.l2j.gameserver import Announcements
from net.sf.l2j.gameserver import ThreadPoolManager

  • 0
Posted

filarakomu 1000 efxaristo tin vrika to epsaksa ligo ke to vrika eprep na ftiakso ena arxiaki . thnks bro asklisi kapios to topic lithikse to problem

  • 0
Posted

l2j free exo

Πηγαινε scripts\cron , ανοιξε ενα .txt και κανε c/p μεσα του αυτον τον code :

 

from com.l2jfree.gameserver import Announcements
Announcements.getInstance().announceToAll("Your message here")

 

Kαντο save και αποθηκευση ως announce.py

Μετα ανοιξε ενα αλλο .txt, και κανε c/p μεσα του αυτο :

INSERT INTO `global_tasks` VALUES ('1000', 'jython', 'TYPE_GLOBAL_TASK', '1224259092859', '1', '24:00:00', 'announce.py');

 

 

Αποθηκευση και καντο .sql

 

Τωρα αν θες να αλλαξεις την ωρα του Auto announce , απλα αλλαξε αυτο :

 

24:00:00 (αντιστοιχει στις 12 το βραδυ)

 

filarakomu 1000 efxaristo tin vrika to epsaksa ligo ke to vrika eprep na ftiakso ena arxiaki . thnks bro asklisi kapios to topic lithikse to problem

 

Α οκ, τωρα το ειδα, τεCπα αμα θες δες και αυτον τον τροπο...

Guest
This topic is now closed to further replies.


×
×
  • Create New...