Lua API
On this page

World

Inherits from

Information about the world around your character. This is the class that scripts get access to at game.world.

Fields:

OpenContainer WorldObject

read only

The currently opened container, if any

PhysicsEnvironment PhysicsEnvironment

read only

Information about the physics environment around you

Selected WorldObject

read only

The currently selected weenie, if any

Vendor Vendor

read only

Information about the currently open vendor, if any

Events:

OnChannelMessage ChatEventArgs

Fired when a new "channel" message is received. Channel messages are ones in general / trade / lfg / roleplay / allegiance / society These can be fired for your own messages as well.

OnChatInput ChatInputEventArgs

Fired when something is typed into the chat input box and sent. This will trigger when a player manually types something into the box and hits enter, as well as when a script uses the InvokeChat action.

OnChatNameClicked ChatNameClickedEventArgs

Fired when a green / clickable name is clicked in chat.

OnChatText ChatEventArgs

This fires for all "chat" messages from the sevrer. like server motd, tells, all speech / emotes, etc. Check room / type to see what it is. to see what it is. These can be fired for your own messages as well.

OnConfirmationRequest ConfirmationRequestEventArgs

Fired when a confirmation popup dialog is shown. Use evtArgs.ClickYes=true to click yes, or evtArgs.ClickNo=true to click no.

OnContainerClosed ContainerClosedEventArgs

Fired when your character closes a landscape container.

OnContainerOpened ContainerOpenedEventArgs

Fired when your character opens a landscape container.

OnEmote ChatEventArgs

Fired when someone sends a custom emote These can be fired for your own messages as well.

OnFellowMessage ChatEventArgs

Fired when something is said in the fellowship chat. Note that SenderId is not available. If the name is blank, you are the sender.

OnLocalMessage ChatEventArgs

Fired when someone says something locally, like with /say. These can be fired for your own messages as well.

OnObjectCreated ObjectCreatedEventArgs

Fired when the client learns about a new weenie instance.

OnObjectReleased ObjectReleasedEventArgs

Fired when the client forgets about a weenie instance (because it can't be seen, doesn't mean it was actually destroyed).

OnObjectSelected ObjectSelectedEventArgs

Fired when an object is selected in the client.

OnSoulEmote ChatEventArgs

Fired when someone uses a builtin emote like atoyot These can be fired for your own messages as well.

OnTell ChatEventArgs

Fired when someone directly messages you

OnTick EventArgs

Fired once every second (ish).

Methods:

Exists(objectId: number) : boolean

Check if an object exists

Parameters:
NameTypeDefaultSummary
objectIdnumber

The id of the object to check

Returns:boolean

Get(objectId: number) : WorldObject

Get a object by id

Parameters:
NameTypeDefaultSummary
objectIdnumber

The object id to get

Returns:WorldObject

GetAll() : WorldObject[]

Gets a collections of all objects the client knows about

GetAll(matchFunction: fun(WorldObject) : nil ) : WorldObject[]

Gets a collections of all weenies that match the specified matchFunction. return true from matchFunction to desigate the object as a match

Parameters:
NameTypeDefaultSummary
matchFunctionfun(WorldObject) : nil

GetAll(objectClass: ObjectClass) : WorldObject[]

Gets a collections of all weenies that match the specified object class

Parameters:
NameTypeDefaultSummary
objectClassObjectClass

GetAll(type) type ObjectType

GetLandscape()

GetLandscape(matchFunction) matchFunction function

GetLandscape(objectClass) objectClass ObjectClass

GetLandscape(type) type ObjectType

GetNearest(matchFunction,distanceType) matchFunction function , distanceType DistanceType

GetNearest(name,distanceType) name string , distanceType DistanceType

GetNearest(objectClass,distanceType) objectClass ObjectClass , distanceType DistanceType

GetNearest(objectType,distanceType) objectType ObjectType , distanceType DistanceType

GetPropertyKeys(source)

ToString()

TryGet(objectId) objectId number