Jump to content

Logging out after a certain amount of time?


CheckingItOut

Recommended Posts

Hi, I'm trying to do what the title talks about.  Currently I have 

public final class Range extends Script  {

    long start = System.currentTimeMillis();
    long end = start + 5*random(50,60)*random(60)*random(1000); // 60 seconds * 1000 ms/sec

Then in my onLoop method, I have if (System.currentTimeMillis() > end) { stop()}.  I'm trying to have the script shut down after a random amount of time between 5 and 6 hours.  It shut off after less than 1 hour though, am I converting my values incorrectly?  

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...