Jump to content

Logging out after a certain amount of time?


Recommended Posts

Posted

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?  

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

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