Skip to content

sdk.player

Snapshot wrapper for any creature (player, NPC, monster). Reads only; actions live on LocalPlayer. Kind is ClassifyKind (id band + npc/monster catalogs) plus the live TCreature.kind byte.

lua
local M = require("sdk.player")

new

function · new(data)

Wrap a snapshot table as a Player.

id

method · id(self: Player): integer?

A snapshot-backed creature. Any getter may return nil when that field was not present in the current client snapshot. Boolean state queries are tri-state: true, false, or nil when the SDK cannot answer authoritatively.

Returns

TypeSummary
integer?

name

method · name(self: Player): string?

A snapshot-backed creature. Any getter may return nil when that field was not present in the current client snapshot. Boolean state queries are tri-state: true, false, or nil when the SDK cannot answer authoritatively.

Returns

TypeSummary
string?

health

method · health(self: Player): integer?

A snapshot-backed creature. Any getter may return nil when that field was not present in the current client snapshot. Boolean state queries are tri-state: true, false, or nil when the SDK cannot answer authoritatively.

Returns

TypeSummary
integer?

maxHealth

method · maxHealth(self: Player): integer?

A snapshot-backed creature. Any getter may return nil when that field was not present in the current client snapshot. Boolean state queries are tri-state: true, false, or nil when the SDK cannot answer authoritatively.

Returns

TypeSummary
integer?

mana

method · mana(self: Player): integer?

A snapshot-backed creature. Any getter may return nil when that field was not present in the current client snapshot. Boolean state queries are tri-state: true, false, or nil when the SDK cannot answer authoritatively.

Returns

TypeSummary
integer?

maxMana

method · maxMana(self: Player): integer?

A snapshot-backed creature. Any getter may return nil when that field was not present in the current client snapshot. Boolean state queries are tri-state: true, false, or nil when the SDK cannot answer authoritatively.

Returns

TypeSummary
integer?

level

method · level(self: Player): integer?

A snapshot-backed creature. Any getter may return nil when that field was not present in the current client snapshot. Boolean state queries are tri-state: true, false, or nil when the SDK cannot answer authoritatively.

Returns

TypeSummary
integer?

vocationClientId

method · vocationClientId(self: Player): integer?

A snapshot-backed creature. Any getter may return nil when that field was not present in the current client snapshot. Boolean state queries are tri-state: true, false, or nil when the SDK cannot answer authoritatively.

Returns

TypeSummary
integer?

vocation

method · vocation(self: Player): string?

A snapshot-backed creature. Any getter may return nil when that field was not present in the current client snapshot. Boolean state queries are tri-state: true, false, or nil when the SDK cannot answer authoritatively.

Returns

TypeSummary
string?

experience

method · experience(self: Player): integer?

A snapshot-backed creature. Any getter may return nil when that field was not present in the current client snapshot. Boolean state queries are tri-state: true, false, or nil when the SDK cannot answer authoritatively.

Returns

TypeSummary
integer?

levelPercent

method · levelPercent(self: Player): Percent?

A snapshot-backed creature. Any getter may return nil when that field was not present in the current client snapshot. Boolean state queries are tri-state: true, false, or nil when the SDK cannot answer authoritatively.

Returns

TypeSummary
Percent?

soul

method · soul(self: Player): integer?

A snapshot-backed creature. Any getter may return nil when that field was not present in the current client snapshot. Boolean state queries are tri-state: true, false, or nil when the SDK cannot answer authoritatively.

Returns

TypeSummary
integer?

capacity

method · capacity(self: Player): integer?

A snapshot-backed creature. Any getter may return nil when that field was not present in the current client snapshot. Boolean state queries are tri-state: true, false, or nil when the SDK cannot answer authoritatively.

Returns

TypeSummary
integer?

speed

method · speed(self: Player): integer?

A snapshot-backed creature. Any getter may return nil when that field was not present in the current client snapshot. Boolean state queries are tri-state: true, false, or nil when the SDK cannot answer authoritatively.

Returns

TypeSummary
integer?

food

method · food(self: Player): integer?

Remaining food time in seconds, when known.

Returns

TypeSummary
integer?

stamina

method · stamina(self: Player): integer?

A snapshot-backed creature. Any getter may return nil when that field was not present in the current client snapshot. Boolean state queries are tri-state: true, false, or nil when the SDK cannot answer authoritatively.

Returns

TypeSummary
integer?

offlineTraining

method · offlineTraining(self: Player): table?

A snapshot-backed creature. Any getter may return nil when that field was not present in the current client snapshot. Boolean state queries are tri-state: true, false, or nil when the SDK cannot answer authoritatively.

Returns

TypeSummary
table?

xpGain

method · xpGain(self: Player): integer?

Client stores four floats (base, grinding, boost, stamina). Returned percents are * 100; rate = (base + grinding + boost) * stamina * 100.

Returns

TypeSummary
integer?

xpGainRate

method · xpGainRate(self: Player): number?

A snapshot-backed creature. Any getter may return nil when that field was not present in the current client snapshot. Boolean state queries are tri-state: true, false, or nil when the SDK cannot answer authoritatively.

Returns

TypeSummary
number?

xpBoost

method · xpBoost(self: Player): table?

A snapshot-backed creature. Any getter may return nil when that field was not present in the current client snapshot. Boolean state queries are tri-state: true, false, or nil when the SDK cannot answer authoritatively.

Returns

TypeSummary
table?

manaShield

method · manaShield(self: Player): integer?

A snapshot-backed creature. Any getter may return nil when that field was not present in the current client snapshot. Boolean state queries are tri-state: true, false, or nil when the SDK cannot answer authoritatively.

Returns

TypeSummary
integer?

healthPercent

method · healthPercent(self: Player): Percent?

A snapshot-backed creature. Any getter may return nil when that field was not present in the current client snapshot. Boolean state queries are tri-state: true, false, or nil when the SDK cannot answer authoritatively.

Returns

TypeSummary
Percent?

isDead

method · isDead(self: Player): boolean|nil

Return whether the creature is dead, preserving unknown snapshot state. Creature snapshots use health_percent; local-player snapshots may only have the IDA-confirmed TPlayerData.health value.

Returns

TypeSummary
boolean|nildead nil when neither health source is available.

onMap

method · onMap(self: Player): boolean|nil

A snapshot-backed creature. Any getter may return nil when that field was not present in the current client snapshot. Boolean state queries are tri-state: true, false, or nil when the SDK cannot answer authoritatively.

Returns

TypeSummary
boolean|nil

position

method · position(self: Player): Position?

A snapshot-backed creature. Any getter may return nil when that field was not present in the current client snapshot. Boolean state queries are tri-state: true, false, or nil when the SDK cannot answer authoritatively.

Returns

TypeSummary
Position?

kind

method · kind(self: Player): 'self'|'player'|'monster'|'npc'|nil

A snapshot-backed creature. Any getter may return nil when that field was not present in the current client snapshot. Boolean state queries are tri-state: true, false, or nil when the SDK cannot answer authoritatively.

Returns

TypeSummary
'self'|'player'|'monster'|'npc'|nil

isSelf

method · isSelf(self: Player): boolean

A snapshot-backed creature. Any getter may return nil when that field was not present in the current client snapshot. Boolean state queries are tri-state: true, false, or nil when the SDK cannot answer authoritatively.

Returns

TypeSummary
boolean

isPlayer

method · isPlayer(self: Player): boolean

A snapshot-backed creature. Any getter may return nil when that field was not present in the current client snapshot. Boolean state queries are tri-state: true, false, or nil when the SDK cannot answer authoritatively.

Returns

TypeSummary
boolean

isMonster

method · isMonster(self: Player): boolean

A snapshot-backed creature. Any getter may return nil when that field was not present in the current client snapshot. Boolean state queries are tri-state: true, false, or nil when the SDK cannot answer authoritatively.

Returns

TypeSummary
boolean

isNpc

method · isNpc(self: Player): boolean

A snapshot-backed creature. Any getter may return nil when that field was not present in the current client snapshot. Boolean state queries are tri-state: true, false, or nil when the SDK cannot answer authoritatively.

Returns

TypeSummary
boolean

creatureType

method · creatureType(self: Player): integer?

A snapshot-backed creature. Any getter may return nil when that field was not present in the current client snapshot. Boolean state queries are tri-state: true, false, or nil when the SDK cannot answer authoritatively.

Returns

TypeSummary
integer?

isSummon

method · isSummon(self: Player): boolean|nil

A snapshot-backed creature. Any getter may return nil when that field was not present in the current client snapshot. Boolean state queries are tri-state: true, false, or nil when the SDK cannot answer authoritatively.

Returns

TypeSummary
boolean|nil

isOwnSummon

method · isOwnSummon(self: Player): boolean|nil

A snapshot-backed creature. Any getter may return nil when that field was not present in the current client snapshot. Boolean state queries are tri-state: true, false, or nil when the SDK cannot answer authoritatively.

Returns

TypeSummary
boolean|nil

summonerId

method · summonerId(self: Player): integer?

A snapshot-backed creature. Any getter may return nil when that field was not present in the current client snapshot. Boolean state queries are tri-state: true, false, or nil when the SDK cannot answer authoritatively.

Returns

TypeSummary
integer?

skull

method · skull(self: Player): integer?

A snapshot-backed creature. Any getter may return nil when that field was not present in the current client snapshot. Boolean state queries are tri-state: true, false, or nil when the SDK cannot answer authoritatively.

Returns

TypeSummary
integer?

isSkull

method · isSkull(self: Player): boolean|nil

A snapshot-backed creature. Any getter may return nil when that field was not present in the current client snapshot. Boolean state queries are tri-state: true, false, or nil when the SDK cannot answer authoritatively.

Returns

TypeSummary
boolean|nil

party

method · party(self: Player): integer?

A snapshot-backed creature. Any getter may return nil when that field was not present in the current client snapshot. Boolean state queries are tri-state: true, false, or nil when the SDK cannot answer authoritatively.

Returns

TypeSummary
integer?

isPartyLeader

method · isPartyLeader(self: Player): boolean|nil

A snapshot-backed creature. Any getter may return nil when that field was not present in the current client snapshot. Boolean state queries are tri-state: true, false, or nil when the SDK cannot answer authoritatively.

Returns

TypeSummary
boolean|nil

isPartyMember

method · isPartyMember(self: Player): boolean|nil

A snapshot-backed creature. Any getter may return nil when that field was not present in the current client snapshot. Boolean state queries are tri-state: true, false, or nil when the SDK cannot answer authoritatively.

Returns

TypeSummary
boolean|nil

isOnScreen

method · isOnScreen(self: Player): boolean|nil

A snapshot-backed creature. Any getter may return nil when that field was not present in the current client snapshot. Boolean state queries are tri-state: true, false, or nil when the SDK cannot answer authoritatively.

Returns

TypeSummary
boolean|nil

state

method · state(self: Player): integer?

A snapshot-backed creature. Any getter may return nil when that field was not present in the current client snapshot. Boolean state queries are tri-state: true, false, or nil when the SDK cannot answer authoritatively.

Returns

TypeSummary
integer?

hasState

method · hasState(self: Player, bit: integer): boolean|nil

A snapshot-backed creature. Any getter may return nil when that field was not present in the current client snapshot. Boolean state queries are tri-state: true, false, or nil when the SDK cannot answer authoritatively.

Parameters

NameTypeSummary
bitinteger

Returns

TypeSummary
boolean|nil

isPoisoned

method · isPoisoned(self: Player): boolean|nil

A snapshot-backed creature. Any getter may return nil when that field was not present in the current client snapshot. Boolean state queries are tri-state: true, false, or nil when the SDK cannot answer authoritatively.

Returns

TypeSummary
boolean|nil

isBurning

method · isBurning(self: Player): boolean|nil

A snapshot-backed creature. Any getter may return nil when that field was not present in the current client snapshot. Boolean state queries are tri-state: true, false, or nil when the SDK cannot answer authoritatively.

Returns

TypeSummary
boolean|nil

isElectrified

method · isElectrified(self: Player): boolean|nil

A snapshot-backed creature. Any getter may return nil when that field was not present in the current client snapshot. Boolean state queries are tri-state: true, false, or nil when the SDK cannot answer authoritatively.

Returns

TypeSummary
boolean|nil

isDrunk

method · isDrunk(self: Player): boolean|nil

A snapshot-backed creature. Any getter may return nil when that field was not present in the current client snapshot. Boolean state queries are tri-state: true, false, or nil when the SDK cannot answer authoritatively.

Returns

TypeSummary
boolean|nil

isParalyzed

method · isParalyzed(self: Player): boolean|nil

A snapshot-backed creature. Any getter may return nil when that field was not present in the current client snapshot. Boolean state queries are tri-state: true, false, or nil when the SDK cannot answer authoritatively.

Returns

TypeSummary
boolean|nil

isHasted

method · isHasted(self: Player): boolean|nil

A snapshot-backed creature. Any getter may return nil when that field was not present in the current client snapshot. Boolean state queries are tri-state: true, false, or nil when the SDK cannot answer authoritatively.

Returns

TypeSummary
boolean|nil

isInFight

method · isInFight(self: Player): boolean|nil

A snapshot-backed creature. Any getter may return nil when that field was not present in the current client snapshot. Boolean state queries are tri-state: true, false, or nil when the SDK cannot answer authoritatively.

Returns

TypeSummary
boolean|nil

isDrowning

method · isDrowning(self: Player): boolean|nil

A snapshot-backed creature. Any getter may return nil when that field was not present in the current client snapshot. Boolean state queries are tri-state: true, false, or nil when the SDK cannot answer authoritatively.

Returns

TypeSummary
boolean|nil

isFreezing

method · isFreezing(self: Player): boolean|nil

A snapshot-backed creature. Any getter may return nil when that field was not present in the current client snapshot. Boolean state queries are tri-state: true, false, or nil when the SDK cannot answer authoritatively.

Returns

TypeSummary
boolean|nil

isDazzled

method · isDazzled(self: Player): boolean|nil

A snapshot-backed creature. Any getter may return nil when that field was not present in the current client snapshot. Boolean state queries are tri-state: true, false, or nil when the SDK cannot answer authoritatively.

Returns

TypeSummary
boolean|nil

isCursed

method · isCursed(self: Player): boolean|nil

A snapshot-backed creature. Any getter may return nil when that field was not present in the current client snapshot. Boolean state queries are tri-state: true, false, or nil when the SDK cannot answer authoritatively.

Returns

TypeSummary
boolean|nil

isBleeding

method · isBleeding(self: Player): boolean|nil

A snapshot-backed creature. Any getter may return nil when that field was not present in the current client snapshot. Boolean state queries are tri-state: true, false, or nil when the SDK cannot answer authoritatively.

Returns

TypeSummary
boolean|nil

isRooted

method · isRooted(self: Player): boolean|nil

A snapshot-backed creature. Any getter may return nil when that field was not present in the current client snapshot. Boolean state queries are tri-state: true, false, or nil when the SDK cannot answer authoritatively.

Returns

TypeSummary
boolean|nil

isFeared

method · isFeared(self: Player): boolean|nil

A snapshot-backed creature. Any getter may return nil when that field was not present in the current client snapshot. Boolean state queries are tri-state: true, false, or nil when the SDK cannot answer authoritatively.

Returns

TypeSummary
boolean|nil

hasPartyBuff

method · hasPartyBuff(self: Player): boolean|nil

A snapshot-backed creature. Any getter may return nil when that field was not present in the current client snapshot. Boolean state queries are tri-state: true, false, or nil when the SDK cannot answer authoritatively.

Returns

TypeSummary
boolean|nil

isInProtectionZone

method · isInProtectionZone(self: Player): boolean|nil

Returns boolean|nil: in_zone nil means live state and mapped tile are both unavailable

Returns

TypeSummary
boolean|nilin_zone nil means live state and mapped tile are both unavailable

isInPz

method · isInPz(self: Player): boolean|nil

Familiar compatibility spelling used by other Tibia bot APIs.

Returns

TypeSummary
boolean|nilin_zone

isPzLocked

method · isPzLocked(self: Player): boolean|nil

PvP entry lock, not current PZ occupancy.

Returns

TypeSummary
boolean|nil

hasManaShield

method · hasManaShield(self: Player): boolean|nil

A snapshot-backed creature. Any getter may return nil when that field was not present in the current client snapshot. Boolean state queries are tri-state: true, false, or nil when the SDK cannot answer authoritatively.

Returns

TypeSummary
boolean|nil

direction

method · direction(self: Player): integer?

Inclusive range 0..7 when known.

Returns

TypeSummary
integer?

targetId

method · targetId(self: Player): integer?

A snapshot-backed creature. Any getter may return nil when that field was not present in the current client snapshot. Boolean state queries are tri-state: true, false, or nil when the SDK cannot answer authoritatively.

Returns

TypeSummary
integer?

tactics

method · tactics(self: Player): PlayerTactics?

A snapshot-backed creature. Any getter may return nil when that field was not present in the current client snapshot. Boolean state queries are tri-state: true, false, or nil when the SDK cannot answer authoritatively.

Returns

TypeSummary
PlayerTactics?

isFullAttackMode

method · isFullAttackMode(self: Player): boolean|nil

A snapshot-backed creature. Any getter may return nil when that field was not present in the current client snapshot. Boolean state queries are tri-state: true, false, or nil when the SDK cannot answer authoritatively.

Returns

TypeSummary
boolean|nil

Arcane SDK catalog generated from scripts/sdk