Skip to content

target

Gives a player the target cursor and runs a function with what it picked.

Source: src/Moongate.Server.Ultima/Modules/TargetModule.cs

target.cancel(player) -> boolean

Cancels the player's target cursor; its function runs with { kind = 'canceled' } on the next turn of the game loop. False for an NPC or a player not in the world.

ParameterTypeDefault
playerinteger

Returns boolean.

target.pick(player, callback) -> boolean

Gives the player a cursor to pick an item or a mobile; the function gets { kind = 'object', serial } or { kind = 'canceled', reason } (reason is 'canceled' for ESC, 'overridden' when another cursor took its place, 'disconnected' when the player left). A cursor a script replaces is told canceled on the next turn of the game loop. False for an NPC or a player not in the world.

ParameterTypeDefault
playerinteger
callbackfunction

Returns boolean.

target.pick_location(player, callback) -> boolean

Gives the player a cursor to pick a place; the function gets { kind = 'location', map, x, y, z, graphic, land } (graphic is the static picked there, which is really on the map, or 0 for the land; land is the land tile of the cell, read from the map), an object when one was clicked, or { kind = 'canceled', reason } (reason is 'canceled' for ESC, 'overridden' when another cursor took its place, 'disconnected' when the player left). A cursor a script replaces is told canceled on the next turn of the game loop. False for an NPC or a player not in the world.

ParameterTypeDefault
playerinteger
callbackfunction

Returns boolean.

Made with ❤️ by Tom

Buy me a coffee