Jump to content
Existing user? Sign In

Sign In



Sign Up

Gildartsthegreat

Members
  • Posts

    38
  • Joined

  • Last visited

Everything posted by Gildartsthegreat

  1. oo thanks ive been looking for this
  2. Welcome mate, hope you meet your goals here!
  3. maybe this but anything RSPS related [Hidden Content]
  4. This is a quick release/tutorial on getting 'Time Played' on a Valius or Vencillio base, only reason im posting it is because I haven't seen anyone release something like this and its my own work. I am OneTrueGodTet on R-S this is my work, Just wanted to post it here as well seeing as im new and not everyone may have access to it there [Hidden Content] not saying its perfect or that it dosen't need some tender love and care but here ya go.in rs2\entitiy\playerPlayer.java add the following imports: import com.mayhem.rs2.entity.player.net.TimePlayed import java.util.concurrent.TimeUnit; and add the following under: public class Player extends Entity { private TimePlayed time = new TimePlayed(this); public TimePlayed getTimePlayed(){ return time; } public long timePlayed; And still in Player.java add the following under: public void setShopCollection(long shopCollection) { public void setTimePlayed(long timePlayed) { this.timePlayed = timePlayed; } Next in rs2\entitiy\player\net Create a class called Timeplayed.java and add the following package com.mayhem.rs2.entity.player.net;import java.util.Calendar; import java.util.Date; import com.mayhem.rs2.entity.player.Player; import com.mayhem.rs2.entity.player.net.Client; public class TimePlayed { /** * The player */ private final Player player; /** * Initialized the start date */ private Calendar start = Calendar.getInstance(); /** *Initialized the end date */ private Calendar end = Calendar.getInstance(); /** * Constructor for the time played class * @param player - The player */ public TimePlayed(final Player player){ this.player = player; } /** * Records when the player logs in */ public void initilizeNewStart(){ start.setTime(new Date()); } /** * Records when the player logs out. */ public void initilizeNewEnd(){ end.setTime(new Date()); } /** * Gets the players start date * @return - the start date */ public Calendar getStartDate(){ return start; } /** * Gets the players end date * @return - The end date */ public Calendar getEndDate(){ return end; } /** * Gets the length of time that the player was logged in for * @return - Time */ public long getCurrentSession(){ return end.getTimeInMillis() - start.getTimeInMillis(); } /** * Formats the long into a time format * @return - The new format */ public String formatPlayersTime(){ long minute = (player.timePlayed / (1000 * 60)) % 60; long hour = (player.timePlayed / (1000 * 60 * 60)) % 24; long day = (player.timePlayed / (1000 * 60 * 60 * 24)); String format = day + " days " + hour + " hours " + minute + " min"; return format; } } Next step is optional i guess in playercommand.java add the following command case "playtime": { player.getTimePlayed().initilizeNewEnd(); player.timePlayed += player.getTimePlayed().getCurrentSession(); player.getTimePlayed().initilizeNewStart(); player.send(new SendMessage("You have played for @red@ " + player.getTimePlayed().formatPlayersTime())); } and add the following in CommandInterface.java "::playtime - updates and displays current playtime" in Playersave.java found in rs2\content\io: look for: public PlayerDetails(Player player) { and somewhere under that up to you add: timePlayed = (player.timePlayed + player.getTimePlayed().getCurrentSession()); Lastly in InformationTab.java, rs2\content\interfaces\impl\Quest Under "<col=ff9040>Online Staff: <col=75C934>" + World.getStaff(), Add "<col=ff9040>Time Played: <col=75C934>", "<col=75C934>" + player.getTimePlayed().formatPlayersTime(), Well thats it you should be able to get a decent working time played from that any criticism or improvements are welcome! If you found this helpful please leave a thanks or a rep+
  5. Hi guys, just recently got into coding and hosting my own project called TeraPS, im 23 years old live in London and enjoy playing a bit of BasketBall in my spare time.

Contact

[email protected]

astra.security

What is a RSPS?

A RSPS, also known as RuneScape private server, is an online game based on RuneScape, and controlled by independent individuals.

Popular RSPS Servers

Runewild Ikov RedemptionRSPS

Disclaimer

Runesuite is not affiliated with runescape, jagex in any way & exists solely for educational purposes.

×
×
  • Create New...