Jump to content
  • 0

How can i calculate respawn time ?


Question

15 answers to this question

Recommended Posts

  • 0
Posted

Can someone help me understand how that works ?

 

For example i have barakiel respawn_time : 1371557489832

 

How do i know when is that ?

 

Thats miliSeconds, it will respawn when system.currentTimeMilis() == 1371557489832

  • 0
Posted

Yeah, it should be miliseconds... anyway you can google it here are link that may help.

http://www.calculateme.com/Time/index.htm

 

nope, 1371557489832 cant be a countdown, it is very big so it can be a countdown, its just currentTimeMilis() , with some basic knowledge you can understand what I said above

  • 0
Posted

for some weird reason, couldnt edit my previous post,

 

so, to know how much time is left for the respawn, you have to use (1371557489832 - System.currentTimeMilis()) / 1000 to return how many seconds are left

  • 0
Posted

1371557489832 was an example.

You should try to divide this number, you're going to have a rest.

So the number was not used as default, developers use numbers without rest(in general).

  • 0
Posted

nope, 1371557489832 cant be a countdown, it is very big so it can be a countdown, its just currentTimeMilis() , with some basic knowledge you can understand what I said above

 

Well i don't have any basic knowledge

 

1.1574074074074074e - 8 Days

  • 0
Posted

Well i don't have any basic knowledge

 

We see, you're just copying someone's reply, in this case you agree with xdem.

  • 0
Posted

1371557489832 was an example.

You should try to divide this number, you're going to have a rest.

So the number was not used as default, developers use numbers without rest(in general).

 

dude, its obvius that this is not a countdown but the CurrentMilis which will trigger the spawn, 1371557489832  = 40 years so definetly its a feature System.currentTimeMilis(), so to get how much time remains you have to use the formula I gave before

  • 0
Posted

dude, its obvius that this is not a countdown but the CurrentMilis which will trigger the spawn, 1371557489832  = 40 years so definetly its a feature System.currentTimeMilis(), so to get how much time remains you have to use the formula I gave before

 

You didn't get my point.

  • 0
Posted

I don't know if I'm any help, but try this:

      long time = 1371557489832l;
      Calendar c = Calendar.getInstance();
      c.setTimeInMillis(time);
      System.out.println(c.getTime().toString());

If I'm not mistaken, all values in time in l2j are written like this: System.currentTimeMillis() + xTime

So with this I think you should get your answer.

Printed part:

Tue Jun 18 15:11:29 EEST 2013

Ps. if I'm mistaken please correct me! :D

  • 0
Posted

Wow thats a lot of answers!! Thanks guys and sorry i didnt reply earlier ..i was sleeping :P

 

So if i get this right the number in database is not a countdown .... its just the date and hour that the raid boss will respawn .

 

yeap its the same way as mine, but mine returns seconds left

 

he should rather use http://www.ruddwire.com/handy-code/date-to-millisecond-calculators/

 

to avoid java

 

That was really helpful thanks man :)

  • 0
Posted

Too late XD

 

I don't know if I'm any help, but try this:

      long time = 1371557489832l;
      Calendar c = Calendar.getInstance();
      c.setTimeInMillis(time);
      System.out.println(c.getTime().toString());

If I'm not mistaken, all values in time in l2j are written like this: System.currentTimeMillis() + xTime

So with this I think you should get your answer.

Printed part:Ps. if I'm mistaken please correct me! :D

Great example tho :)

 

Good job

Guest
This topic is now closed to further replies.


×
×
  • 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