This works nicely, except that I use a lot of on_command{} blocks within the locations{} block for room-specific commands and these are apparently processed first, so I've moved the darkness check inside the general on_command block{} to the specific on_command block{} for the room. Fortunately for me, I only have one dark room.