def cmd_set(args)
case args
when nil, ""
sendto("What??")
when /desc\s+#(\d+)\s+(.*)/
o = get_object($1.to_i)
case o
when nil, 0
sendto("No object.")
else
o.desc = $2
sendto("Object #" + $1 + " description set.")
end
when /key\s+#(\d+)\s+(.*)/
o = get_object($1.to_i)
case o
when nil, 0
sendto("No object.")
else
o.key = $2
sendto("Object #" + $1 + " key set.")
end
when /timer\s+#(\d+)\s+(on|off)\s+(.*)/
o = get_object($1.to_i)
case o
when nil
sendto("No object.")
else
if $2 == 'on'
if $3 =~ /(\w+)\s+(\d+)/
world.set_timer(o.id, $1.to_sym, $2.to_i)
sendto("Object ##{o.id} registered with timer.")
else
sendto("Bad symbol or missing time")
end
else
if $3 =~ /(\w+)/
world.unset_timer(o.id, $1.to_sym)
sendto("Object ##{o.id} unregistered with timer.")
else
sendto("Bad symbol")
end
end
end
else
sendto("What??")
end
end