walkto

walkto <vnum> [pause]

Walk the owner mobile to a room, one step at a time.

walkto is a convenience form of stepto: the compiler expands it into a stepping loop that moves the owner one room closer to the destination, pauses, and repeats until the mob arrives or can no longer make progress. The mob travels under its own power along the shortest path it can find.

Arguments

Returns

null. Like the other action commands, a successful walkto in the handle phase suppresses the event's default action.

Owner

The owner must be a mobile, standing or better. For any other owner the expanded loop takes no steps.

Examples

after command (say) {
  walkto 3001 2
}

The mob walks toward room 3001, pausing two ticks between each step, until it arrives or gets stuck.

Omit the pause to step every tick:

after command (tick) {
  walkto 3001
}

See also