Discuss Scratch

Johnsnyder50
Scratcher
26 posts

for those who want to make a script that tells the exact time stored on their device

for those who want to make a script that tells the exact time stored on their device, heres how to do it.

define set time
set [second v] to (current [second v])
set [minute v] to (current [minute v])
set [hour v] to (current [hour v])
if <(length of (second)) = [1]> then
set [second v] to (join [0] (second))
end
if <(length of (minute)) = [60]> then
set [minute v] to (join [0] (minute))
end
if <(length of (hour)) = [3600]> then
set [hour v] to (join [0] (hour))
end
if <(current [hour v]) = [6]> then
set [part of day v] to [morning]
end
if <(current [hour v]) = [11]> then
set [part of day v] to [afternoon]
end
if <(current [hour v]) = [18]> then
set [part of day v] to [evening]
end
if <(current [hour v]) = [21]> then
set [part of day v] to [night]
end
if <(current [hour v]) = [23]> then
set [part of day v] to [midnight]
end
set [time v] to (join (join (join (join (hour) [:]) (minute)) [:]) (second))

when green flag clicked
forever
set time
end
Paddle2See
Scratch Team
1000+ posts

for those who want to make a script that tells the exact time stored on their device

It's really nice that you want to help out with a guide! However, we have a number of them in the forums already and we don't have a good way to showcase any more. If you want to make a guide in a Scratch project, that would be fine. You could advertise it in the “Show and Tell” section too.

There are lots of other ways to help out in the forums too. Helpful Scratchers are always welcome in the “Questions About Scratch”, “Help With Scripts”, “Requests” and other sections. Just look around and ask questions

Powered by DjangoBB