Jump to content

Gambling Script Timestamp needed!


talythan

Recommended Posts

I have a dicing script that does commands when you use a "!" for example !roll,!flower,!dd etc


 


so for example right now when a player does the command !roll, the bot will say "username rolled a 58 on the percentile dice".


 


But I would like there to be a timestamp at the end which reads:


 


"[username] rolled a [58] on the percentile dice @ [04:23:12]"


 


also if you could include the parenthesis like that it would be very helpful too!


 


Since this is a small fix, im willing to pay 5m osrs/$5, negotiable!


Link to comment
Share on other sites

Wait someone still hasn't helped this guy?

I did via PM.

For anyone else who wants to know:

Create a new SimpleDateFormat object:

SimpleDateFormat formatter = new SimpleDateFormat("hh:mm:ss");

Each time you want a new timestamp, simply format a new Date object:

String time = formatter.format(new Date());

This is not thread-safe. Let me know if someone needs a thread-safe alternative.

Edited by fixthissite
  • Like 2
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...