clock;time;watch
^wait$|^z$
true
game_clock.increment = minutes
time = game_clock.time + time
o = null
while (o = null) {
o = AttemptCreateEvent(time)
time = time + 1
}
o.look = script
o.alias = alias
game_clock.nextstep = step
game_clock.countdown = delay
//msg("delay=" + delay)
minutes = time % 60
hours24 = (time / 60) % 24
days = time / (60 * 24)
name = "event_" + DD(days) + "_" + DD(hours24) + "_" + DD(minutes)
//msg("Setting for: " + name)
o = GetObject(name)
if (o = null) {
create(name)
return (GetObject(name))
}
else {
return (null)
}
if (TypeOf(minutes) = "string") {
l = Split(minutes, ":")
if (not ListCount(l) = 3) error("SetTime failed to understand " + minutes)
game_clock.days = ToInt(StringListItem(l, 0))
game_clock.hours24 = ToInt(StringListItem(l, 1))
game_clock.minutes = ToInt(StringListItem(l, 2))
game_clock.time = (game_clock.days * 24 + game_clock.hours24) * 60 + game_clock.minutes
}
else {
game_clock.time = minutes
game_clock.minutes = game_clock.time % 60
game_clock.hours24 = (game_clock.time / 60) % 24
game_clock.days = game_clock.time / (60 * 24) + 1
}
game.clock = TimeAsString()
time)
]]>
return (game_clock.time)