Jump to content
  • 0

How can i calculate respawn time ?


spartakos77

Question

15 answers to this question

Recommended Posts

  • 0

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

Link to comment
Share on other sites

  • 0

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

 

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

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

Link to comment
Share on other sites

  • 0

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

Link to comment
Share on other sites

  • 0

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

Link to comment
Share on other sites

  • 0

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).

Link to comment
Share on other sites

  • 0

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

Link to comment
Share on other sites

  • 0

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

Link to comment
Share on other sites

  • 0

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.

Link to comment
Share on other sites

  • 0

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

Link to comment
Share on other sites

  • 0

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

Link to comment
Share on other sites

  • 0

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 :)

Link to comment
Share on other sites

  • 0

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

Link to comment
Share on other sites

Guest
This topic is now closed to further replies.


×
×
  • Create New...