

Gildartsthegreat
Members-
Posts
38 -
Joined
-
Last visited
Content Type
Profiles
Forums
Blogs
Top List
Everything posted by Gildartsthegreat
-
noice tyty
-
lol ty
-
thanks will definatly check this out
- 386 replies
-
- runite
- osfatality
-
(and 3 more)
Tagged with:
-
oo thanks ive been looking for this
-
gg ty
- 160 replies
-
(Hyperion/Rs2-Server based) Xaeron 498 (BH WORLD)
Gildartsthegreat replied to Lagoon's topic in Other (377-742)
ty -
tyty
-
tyty
-
Necrotic [Ruse Development] Late RS2/OSRS Hybrid, Customs, Ready for Hosting
Gildartsthegreat replied to MGK's topic in 317
ty -
xBox only cos of the controller
-
Welcome mate, hope you meet your goals here!
-
noice!
-
Thank you!
-
maybe this but anything RSPS related [Hidden Content]
-
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+
-
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.
-
Valius/ Vencillio 154 Cache
Gildartsthegreat replied to DecrepitDegenerate's topic in Other (377-742)
-
lol