Jump to content
  • 0

Question

Posted
I want to do this and I have no idea.
 
This image is a time counter that the character is online, the counter returns to 0 when it returns to login.
thump_9166879shot00009.jpg


This image is the same as the first, but the time that the server is online
thump_9166884shot00010.jpg

 

The part in the htm ready, but I need the java side

Thanks in advance and sorry for my english..

11 answers to this question

Recommended Posts

  • 0
Posted
// Server Time
private static String getServerRunTime()
{
int timeSeconds = (GameTimeController.getGameTicks() - 36000) / 10;
String timeResult = (timeSeconds >= 86400 ? Integer.toString(timeSeconds / 86400) + " Days " + Integer.toString((timeSeconds % 86400) / 3600) + " hours." : Integer.toString(timeSeconds / 3600) + " Hours " + Integer.toString((timeSeconds % 3600) / 60) + " mins.");
return timeResult;
}

  • 0
Posted

 

I want to do this and I have no idea.
 
This image is a time counter that the character is online, the counter returns to 0 when it returns to login.
thump_9166879shot00009.jpg

This image is the same as the first, but the time that the server is online
thump_9166884shot00010.jpg

 

The part in the htm ready, but I need the java side

Thanks in advance and sorry for my english..

 

you want that on npcright??

  • 0
Posted (edited)

Sorry for the delayed response, I was sick.

 

I am creating a npc/command which displays the statistics of the character and server. What I lack is the code to display the time line of the session character and server.

 

Sorry for my eng

Edited by ElBato
  • 0
Posted

so you actually need a time counter that will get increased until a player log out?

Yes

 

 

// Server Time
private static String getServerRunTime()
{
int timeSeconds = (GameTimeController.getGameTicks() - 36000) / 10;
String timeResult = (timeSeconds >= 86400 ? Integer.toString(timeSeconds / 86400) + " Days " + Integer.toString((timeSeconds % 86400) / 3600) + " hours." : Integer.toString(timeSeconds / 3600) + " Hours " + Integer.toString((timeSeconds % 3600) / 60) + " mins.");
return timeResult;
}

 

Thanks ExCaLiBuR®, u are amazing.. 1 less, lack the other :D
Guest
This topic is now closed to further replies.
×
×
  • Create New...