Clock1.Duration Error

22 views
Skip to first unread message

Raymond Mak

unread,
Sep 6, 2019, 10:08:56 PM9/6/19
to MIT App Inventor Forum
Hello friends. I want to make an idle earning system that gives you $10 every 5 mins. Everything is fine except for the Clock1.Duration block. Can you guys help me fix it? Here is my code:  

2019-09-07.png

Thanks!

TimAI2

unread,
Sep 7, 2019, 6:47:48 AM9/7/19
to MIT App Inventor Forum
quickly....
  1. Use Do It when running in Companion to test your blocks
  2. Set your Duration as Minutes as a variable at the top, then use that throughout, otherwise it may change during the calculations

Ghica

unread,
Sep 7, 2019, 7:04:23 AM9/7/19
to MIT App Inventor Forum
Are you prepared to leave your app running and open permanently?
Because App Inventor cannot run in the background.
If you still want to keep track of the time every time you open your app, be sure to store timestamps in an TinyDB.
Cheers, Ghica.

TimAI2

unread,
Sep 7, 2019, 7:17:36 AM9/7/19
to MIT App Inventor Forum
Durations are a bit weird

Try with millis, something like this:

blocksGetDuration.png


Raymond Mak

unread,
Sep 7, 2019, 9:25:13 AM9/7/19
to MIT App Inventor Forum
Thanks, it worked :D
Reply all
Reply to author
Forward
0 new messages