I made a clock.
The variable $time is in minutes
<<set $time to 1440>>
<<if $time > 1440>>
<<set $et to $time - 1440>>
<<set $time to 0 + $et>>
<<endif>>
<<set $hr to Math.trunc($time/60)>>
<<if $time < 60>>
<<set $hr to 12>>
<<endif>>
<<set $min to $time%60>>
<<if Math.trunc($min/10) < 1>>
<<set $min to "0" + $min>>
<<endif>>
<<if $time < 720>>
<<set $ampm to "am">>
<<set $clock = $hr + ":" + $min + $ampm>>
<<elseif $time == 1440>>
<<set $hr -= 12>>
<<set $ampm to "am">>
<<set $clock = $hr + ":" + $min + $ampm>>
<<elseif $time > 780>>
<<set $hr -= 12>>
<<set $ampm to "pm">>
<<set $clock = $hr + ":" + $min + $ampm>>
<<elseif $time >= 720>>
<<set $ampm to "pm">>
<<set $clock = $hr + ":" + $min + $ampm>>
<<endif>>
Might have made it more difficult than it should have been. I am not very good in coding.
The problem that I am facing is that I am trying to add time after the player clicks on sleep
<<click "Wake up">><<set $time += 5>><<goto [[Start of a new day]]>><</click>>
It still shows the time that was set above which is 12:00 am and not 12:05 am
I have no idea what went wrong.