Jump to content

Question

Posted (edited)

Hello all i am looking for Timer Counter for Event

i want you show in html a time like

 

"Time: 20 : 30 | 20 : 28"

 

i have try to make one and all my try is not work.

no have money but i can make 4 html for community board

or site or npc for this code.

 

if any can help pm tnx

Edited by tazerman2

14 answers to this question

Recommended Posts

  • 0
Posted

Hello all i am looking for Timer Counter for Event

i want you show in html a time like

 

"Time: 20 : 30 | 20 : 28"

 

i have try to make one and all my try is not work.

no have money but i can make 4 html for community board

or site or npc for this code.

 

if any can help pm tnx

i answered you already in greek section mate. "you want it on dish"?

  • 0
Posted (edited)

On which format do you get your time ? ms ? seconds ?

 

If you use aCis latest, you got StringUtil.getTimestamp which return a time formated under "h m s". Time must be on second so simply /1000 if you got ms time.

 

You can also do following on a more universal way. Simply choose the format of your dreams.

new SimpleDateFormat("yyyy-MM-dd HH:mm").format(castle.getSiegeDate().getTimeInMillis())
Edited by Tryskell
  • 0
Posted

tnx tryskell your info help

is working show the time all good and the time is countdown but

i dont know why is dont take the time from my event

 

here is the code:

 

npc.java

		
long time;
time = RandomFight.getInstance().getTime();
String PARENT_DIR = "data/html/mods/MiniEvent/menu.htm";
NpcHtmlMessage html = new NpcHtmlMessage(getObjectId());
html.setFile(PARENT_DIR);
html.replace("%objectId%", String.valueOf(getObjectId()));
html.replace("%timer%", String.valueOf("Time: " + new SimpleDateFormat("mm:ss").format(time)));
player.sendPacket(html);

Event.java

	private static int Time = Config.EVERY_MINUTES;

/**
	 * @return
	 */
	public long getTime()
	{
		return Time - System.currentTimeMillis();
	}
  • 0
Posted

On which base the timer is calculated ? Store the time on the event, and then you can retrieve it. _launchTime, getter/setter, set it when threadpool is setuped, get it when you need it. Refresh it (set it) when you launch back the event.

  • 0
Posted

It can't work with this writing style, you have to rewrite few parts to be able to handle it.

 

I must add your event currently run every Xmin but the start depends about your server launching time. So event can be 18h06:30sec, then 18h26:30sec (if you picked 20min), etc etc. Which is shitty way to handle an event, as you can't even rely properly on the hour.

 

Use global task system to care about launching time, that way you can also retrieve easily the next launching time. Atm you can't find it (or maybe _task.getDelay() if you store the task, but it's clunky).

  • 0
Posted

i answered you already in greek section mate. "you want it on dish"?

eisai sobaros twra ? h apantisi poy toy edoses sto elliniko section opos les itan telios theoritiki ( kai monos toy mporoyse na to skeyti ayto poy toy eipes sigoyra den xriazotan help gia ayto )

h apantisi toy Tryskell einai pio olokliromeni kai theoritika kai praktika 

 

san L2J Dev pleon sto maxcheater mipos eprepe na dinis pio siggekrimenes apantisis ?

h se kanane gia na exeis diaforetiko color name ? kai na min boithas stin ousia

  • 0
Posted

i can't understand is hard for me make this code. i can't understand how start and how stop time and how take

take time from event i need more example

  • 0
Posted

eisai sobaros twra ? h apantisi poy toy edoses sto elliniko section opos les itan telios theoritiki ( kai monos toy mporoyse na to skeyti ayto poy toy eipes sigoyra den xriazotan help gia ayto )

h apantisi toy Tryskell einai pio olokliromeni kai theoritika kai praktika 

 

san L2J Dev pleon sto maxcheater mipos eprepe na dinis pio siggekrimenes apantisis ?

h se kanane gia na exeis diaforetiko color name ? kai na min boithas stin ousia

ok

Guest
This topic is now closed to further replies.


×
×
  • Create New...