Jump to content
UBot Underground

Display Time Since Last...


Recommended Posts

I have a bot that submits data at random intervals between 30 seconds and 300 seconds.

 

I am wanting to use a stat monitor to display the time until the next submit to the user.

 

Any ideas on how to achieve that?... Example, random wait gets automatically set to: 128 seconds, so the stat monitor will show a countdown from 128 to zero 

Link to post
Share on other sites

You can try something like this:

ui button("start") {
    set wait()
}
ui stat monitor("Next Run:", #waiting)
define set wait {
    set(#waiting, $rand(30, 300), "Global")
    loop(#waiting) {
        decrement(#waiting)
        wait(1)
    }
    alert("done")
}
  • Like 1
Link to post
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.

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.

Loading...
×
×
  • Create New...