ID:1310959
 
(See the best response by Neimo.)
Problem description: Not so much a problem as more how I could go about this better? More efficient? I don't want anything over complicated this is nothing but a simple maze game. Is there a way it could be set night/day by the host's system time? For example between 8pm and 6 am it's night etc.

Am I right in doing this via area instead of using a turf?

Code:
area/day
luminosity = 1
var/daynight = 0

New()
day()
..()

proc/day()
while(1)
if(!daynight)
daynight = 1
luminosity = 1
world<<"Daytime"
else
daynight = 0
luminosity = 0
world<<"Nighttime"
sleep(1000)




Best response
Using time2text(), world.timeofday and text2num() can help you here. You should run a global procedure that handles time for you. Loop through all area/day areas and change them accordingly.

var hour = text2num(time2text(world.timeofday, "hh"))

if(hour in 1 to 12)
if(hour in 13 to 23)