VERGELua API

items

Inventory, item schema, game coordinator.

inventory

inventory.Enumerate(callback:function)

Call callback(item) for each backpack item; stops if the callback errors.

inventory.GetItemByPosition(position:number):Item?

Return the item at a backpack position, or nil.

inventory.GetMaxItemCount():number

Return the number of items in the inventory.

inventory.GetItemByItemID(itemID:number):Item?

Return the item with a given 64-bit item ID.

itemschema

itemschema.GetItemDefinitionByID(id:number):ItemDefinition?

Return the item definition for a def index, or nil.

itemschema.GetItemDefinitionByName(name:string):ItemDefinition?

Look up an item definition by internal, class or display name.

itemschema.Enumerate(callback:function)

Call callback(def) for every item definition.

itemschema.GetAttributeDefinitionByName(name:string):AttributeDefinition?

Look up an attribute definition by name.

itemschema.EnumerateAttributes(callback:function)

Call callback(attribute) for every attribute definition.

gamecoordinator

gamecoordinator.GetDataCenterPingData():table

Return datacenter ping times keyed by region code.

gamecoordinator.ConnectedToGC():boolean

Return whether the game coordinator is connected.

gamecoordinator.HasLiveMatch():boolean

Return whether you are in a live match.

gamecoordinator.GetMatchAbandonStatus():number

Return the match abandon status; see MATCHABANDON_*.

gamecoordinator.GetNumMatchInvites():number

Return the number of pending match invites.

gamecoordinator.AbandonMatch()

Send the abandon-current-match message to the GC.

gamecoordinator.JoinMatchmakingMatch():boolean

Join the assigned match by connecting to its server.

gamecoordinator.GCSendMessage(typeID:number, data:string):boolean

Send a protobuf-encoded message to the GC; returns true when it was accepted.