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.


  • Posts

    • What webhosting are you using? You'll need to talk with administrators of the webhosting to open outgoing connections to port 1433, maybe they won't open it for you, instead, you should get a webhosting for mu online since they always have 1433 port open for outgoing connections. Also, make sure you have your 1433 TCP port open for incoming connections, for security, I suggest you exclusively add the cPanel IP Address to connect to your port 1433 in your firewall, so no one else can try to connect to your database. Let me know if you have any questions, happy to help.
    • He just doesn't answer, I've tried everything, Telegram, his own forum, everything, I don't know what's his deal, but I've tried for months
    • Send direct message to @Maxtor
    • Hello guys , does anyone know what files needed to use those cloaks for H5 client? I’m not using an interface and I don’t want to use one so there are any way to use them without interface? 
    • Closed beta testing starts in early October!        We’re looking for the most active and attentive players to help fine-tune the project before launch. This is your chance to be among the first to try out our new features and directly influence how the server develops.   What beta testers will do: — Check the client and core mechanics — Find bugs, errors, and inconsistencies — Evaluate the convenience and practicality of current solutions — Share detailed, constructive suggestions for improvement      Your feedback will be key to making the project balanced and comfortable for everyone.   Requirements: — Willingness to complete specific tasks — Experience playing on Interlude (PTS, clean client) — Experience with the HF client is a plus   Ready to help? The server launch is planned for early December, so now is the perfect time to join the test and make your contribution. To participate, you must send a direct message (DM) to one of the following: - Send a DM to our Telegram channel - Send a DM to our forum moderators: PrintF or EchØ - Send a DM to our Discord server admin @EchØ
  • 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