ID:984975
 
Keywords: and, day, night
(See the best response by LordAndrew.)
Code:
area
DNight
name=""
layer=10
New()
Change()
proc
Change()
sleep(72)
overlays+='Night.dmi'
world<<"<center><FONT SIZE=+1><FONT COLOR=#008080>T</FONT><FONT COLOR=#168b8d>h</FONT><FONT COLOR=#2c969a>e</FONT><FONT COLOR=#41a1a7> </FONT><FONT COLOR=#57adb4>S</FONT><FONT COLOR=#6db8c0>u</FONT><FONT COLOR=#83c3cd>n</FONT><FONT COLOR=#98ceda> </FONT><FONT COLOR=#add8e6>s</FONT><FONT COLOR=#b3dae8>e</FONT><FONT COLOR=#badbeb>t</FONT><FONT COLOR=#c0dded>s</FONT><FONT COLOR=#c7dfef> </FONT><FONT COLOR=#cde0f2>a</FONT><FONT COLOR=#d4e2f4>s</FONT><FONT COLOR=#dae4f6> </FONT><FONT COLOR=#e1e5f9>i</FONT><FONT COLOR=#e6e6fa>t</FONT><FONT COLOR=#e1e5f9> </FONT><FONT COLOR=#dae4f6>b</FONT><FONT COLOR=#d4e2f4>e</FONT><FONT COLOR=#cde0f2>c</FONT><FONT COLOR=#c7dfef>o</FONT><FONT COLOR=#c0dded>m</FONT><FONT COLOR=#badbeb>e</FONT><FONT COLOR=#b3dae8>s</FONT><FONT COLOR=#add8e6> </FONT><FONT COLOR=#9bcfdc>N</FONT><FONT COLOR=#87c5d0>i</FONT><FONT COLOR=#74bbc5>g</FONT><FONT COLOR=#61b1b9>h</FONT><FONT COLOR=#4da8ae>t</FONT><FONT COLOR=#3a9ea2>.</FONT><FONT COLOR=#279497>.</FONT><FONT COLOR=#138a8b>.</FONT><FONT COLOR=#008080>.</FONT></FONT><center>"
sleep(7200)
luminosity=1
overlays-='Night.dmi'
world<<"<center><FONT SIZE=+1><FONT COLOR=#ff4500>T</FONT><FONT COLOR=#fa5506>h</FONT><FONT COLOR=#f3650b>e</FONT><FONT COLOR=#ed7611> </FONT><FONT COLOR=#e78616>S</FONT><FONT COLOR=#e0961c>u</FONT><FONT COLOR=#daa520>n</FONT><FONT COLOR=#dfb21c> </FONT><FONT COLOR=#e5bf18>r</FONT><FONT COLOR=#eacc13>i</FONT><FONT COLOR=#f0d90e>s</FONT><FONT COLOR=#f5e609>e</FONT><FONT COLOR=#fbf305>s</FONT><FONT COLOR=#ffff00> </FONT><FONT COLOR=#fbf305>b</FONT><FONT COLOR=#f5e609>e</FONT><FONT COLOR=#f0d90e>c</FONT><FONT COLOR=#eacc13>o</FONT><FONT COLOR=#e5bf18>m</FONT><FONT COLOR=#dfb21c>i</FONT><FONT COLOR=#daa520>n</FONT><FONT COLOR=#e0961c>g</FONT><FONT COLOR=#e78616> </FONT><FONT COLOR=#ed7611>D</FONT><FONT COLOR=#f3650b>a</FONT><FONT COLOR=#fa5506>y</FONT><FONT COLOR=#ff4500>!</FONT></FONT> <center>"
Change()


Problem description: Ignoring the "world<<"It's day, It's night in HTML"" part, the problem is I thought I made a good day and night system, but night messes with Click proc, any idea how to fix it?

Best response
Set area to mouse_opacity = 0 and it'll be ignored by the mouse.
What LordAndrew said, plus, you should be using a while() loop instead of calling Change() again (it'll crash eventually because you aren't spawning that call, too). Also, you aren't setting luminosity to 0 for night.
Galactic Soldier wrote:
Mind you. It'll eventually crash if you create an infinite while() loop too. Use spawn() instead.

No it won't, assuming he doesn't leave the call to Change() at the end of the while() loop. It'll crash now because the recursion isn't being spawn()ed, which overflows the call stack.
That has to be if there's no delay. I've never had a while() loop crash on me because it iterated too many times.
Yes, the documentation is misleading. This test suggests that any loop with a delay (here, the minimum of 0) won't be crashed:

proc/InfiniteLoop()
world.log = null
if(fexists("testlog.txt"))
fdel("testlog.txt")
world.log = "testlog.txt"

var/started = world.timeofday
var/counter = 0

var/test = 100
while(TRUE)
counter++
if(!(--test))
test = 100
if(length(file("testlog.txt")) > 0)
break

world<<"Loop switched to background after [num2text(counter, 10)] (+/-100) iterations (Realtime: [world.timeofday - started])"

proc/DelayedLoop()
world.log = null
if(fexists("testlog.txt"))
fdel("testlog.txt")
world.log = "testlog.txt"

var/started = world.timeofday
var/counter = 0

var/test = 10000
var/display = 1000000
while(TRUE)
counter++
if(!(--test))
test = 10000
sleep(0)
if(length(file("testlog.txt")) > 0)
break

if(!(--display))
display = 1000000
world<<"Loop passed [num2text(counter, 10)] iterations"

world<<"Loop switched to background after [num2text(counter, 10)] (+/-10000) iterations (Realtime: [world.timeofday - started])"

mob/verb/TestMaximumInfinite()
spawn()
InfiniteLoop()

mob/verb/TestMaximumDelayed()
spawn()
DelayedLoop()


The delayed loop runs out of number precision before being crashed, and I doubt BYOND uses a double to track loop iterations, so it probably never crashes a loop with any delay.