BAKU

API skryptera

Public Lua API 2.13 dla BAKU 15.24. Sygnatury, argumenty i wyniki 173 funkcji.

Pierwszy skrypt

Zaimportuj plik Lua przez Manager skryptów i aktywuj go w BAKU. Poniższy skrypt odczytuje nazwę postaci i wypisuje ją w logu skryptu.

required_api = 213

function main(ctx)
    local player = baku.player()
    if player.ready then
        baku.log(player.name)
    end
end

Wywołuj funkcje odczytu i akcji wewnątrz main lub w callbackach. Po akcji sprawdź jej wynik. Status ACCEPTED potwierdza przyjęcie polecenia.

Pobierz dokumentację w JSON

Postać i świat

baku.api_version

api_version() -> table

UserLuaRuntime/PublicApi projection; Bounded value table; fields with known/valid/ready must be checked

Argumenty
No positional arguments
Wynik
Bounded value table; fields with known/valid/ready must be checked
Potwierdzenie
NONE; query/host operation does not attest physical action success

baku.capability

capability(name) -> {supported,ready,status}

UserLuaRuntime/PublicApi projection; {supported,ready,status}

Argumenty
case-sensitive exact canonical key
Wynik
{supported,ready,status}
Potwierdzenie
NONE; query/host operation does not attest physical action success

baku.snapshot

snapshot() -> table

UserLuaRuntime/PublicApi projection; Bounded value table; fields with known/valid/ready must be checked

Argumenty
No positional arguments
Wynik
Bounded value table; fields with known/valid/ready must be checked
Potwierdzenie
NONE; query/host operation does not attest physical action success

baku.player

player() -> table

UserLuaRuntime/PublicApi projection; Bounded value table; fields with known/valid/ready must be checked

Argumenty
No positional arguments
Wynik
Bounded value table; fields with known/valid/ready must be checked
Potwierdzenie
NONE; query/host operation does not attest physical action success

baku.position

position() -> table

SelfIndex/ScriptReadFrame; Bounded value table; fields with known/valid/ready must be checked

Argumenty
No positional arguments
Wynik
Bounded value table; fields with known/valid/ready must be checked
Potwierdzenie
NONE; query/host operation does not attest physical action success

baku.status

status() -> table

UserLuaRuntime/PublicApi projection; Bounded value table; fields with known/valid/ready must be checked

Argumenty
No positional arguments
Wynik
Bounded value table; fields with known/valid/ready must be checked
Potwierdzenie
NONE; query/host operation does not attest physical action success

baku.target

target() -> table

UserLuaRuntime/PublicApi projection; Bounded value table; fields with known/valid/ready must be checked

Argumenty
No positional arguments
Wynik
Bounded value table; fields with known/valid/ready must be checked
Potwierdzenie
NONE; query/host operation does not attest physical action success

baku.creatures

creatures() -> table

UserLuaRuntime/PublicApi projection; Bounded value table; fields with known/valid/ready must be checked

Argumenty
No positional arguments
Wynik
Bounded value table; fields with known/valid/ready must be checked
Potwierdzenie
NONE; query/host operation does not attest physical action success

baku.item

item(item_id) -> table

UserLuaRuntime/PublicApi projection; Bounded value table; fields with known/valid/ready must be checked

Argumenty
item_id 0..65535
Wynik
Bounded value table; fields with known/valid/ready must be checked
Potwierdzenie
NONE; query/host operation does not attest physical action success

baku.find_items

find_items(item_id) -> table

UserLuaRuntime/PublicApi projection; Bounded value table; fields with known/valid/ready must be checked

Argumenty
item_id 1..65535
Wynik
Bounded value table; fields with known/valid/ready must be checked
Potwierdzenie
NONE; query/host operation does not attest physical action success

baku.containers

containers() -> table

UserLuaRuntime/PublicApi projection; Bounded value table; fields with known/valid/ready must be checked

Argumenty
No positional arguments
Wynik
Bounded value table; fields with known/valid/ready must be checked
Potwierdzenie
NONE; query/host operation does not attest physical action success

baku.loot

loot() -> table

UserLuaRuntime/PublicApi projection; Bounded value table; fields with known/valid/ready must be checked

Argumenty
No positional arguments
Wynik
Bounded value table; fields with known/valid/ready must be checked
Potwierdzenie
NONE; query/host operation does not attest physical action success

baku.chat

chat() -> table

UserLuaRuntime/PublicApi projection; Bounded value table; fields with known/valid/ready must be checked

Argumenty
No positional arguments
Wynik
Bounded value table; fields with known/valid/ready must be checked
Potwierdzenie
NONE; query/host operation does not attest physical action success

baku.channels

channels() -> table

UserLuaRuntime/PublicApi projection; Bounded value table; fields with known/valid/ready must be checked

Argumenty
No positional arguments
Wynik
Bounded value table; fields with known/valid/ready must be checked
Potwierdzenie
NONE; query/host operation does not attest physical action success

baku.look

look() -> table

UserLuaRuntime/PublicApi projection; Bounded value table; fields with known/valid/ready must be checked

Argumenty
No positional arguments
Wynik
Bounded value table; fields with known/valid/ready must be checked
Potwierdzenie
NONE; query/host operation does not attest physical action success

baku.alarm

alarm() -> table

UserLuaRuntime/PublicApi projection; Bounded value table; fields with known/valid/ready must be checked

Argumenty
No positional arguments
Wynik
Bounded value table; fields with known/valid/ready must be checked
Potwierdzenie
NONE; query/host operation does not attest physical action success

baku.effect

effect() -> table

UserLuaRuntime/PublicApi projection; Bounded value table; fields with known/valid/ready must be checked

Argumenty
No positional arguments
Wynik
Bounded value table; fields with known/valid/ready must be checked
Potwierdzenie
NONE; query/host operation does not attest physical action success

baku.social

social() -> table

UserLuaRuntime/PublicApi projection; Bounded value table; fields with known/valid/ready must be checked

Argumenty
No positional arguments
Wynik
Bounded value table; fields with known/valid/ready must be checked
Potwierdzenie
NONE; query/host operation does not attest physical action success

baku.npc_trade

npc_trade() -> table

UserLuaRuntime/PublicApi projection; Bounded value table; fields with known/valid/ready must be checked

Argumenty
No positional arguments
Wynik
Bounded value table; fields with known/valid/ready must be checked
Potwierdzenie
NONE; query/host operation does not attest physical action success

baku.player_trade

player_trade() -> table

UserLuaRuntime/PublicApi projection; Bounded value table; fields with known/valid/ready must be checked

Argumenty
No positional arguments
Wynik
Bounded value table; fields with known/valid/ready must be checked
Potwierdzenie
NONE; query/host operation does not attest physical action success

baku.market

market() -> table

UserLuaRuntime/PublicApi projection; Bounded value table; fields with known/valid/ready must be checked

Argumenty
No positional arguments
Wynik
Bounded value table; fields with known/valid/ready must be checked
Potwierdzenie
NONE; query/host operation does not attest physical action success

baku.resources

resources() -> table

UserLuaRuntime/PublicApi projection; Bounded value table; fields with known/valid/ready must be checked

Argumenty
No positional arguments
Wynik
Bounded value table; fields with known/valid/ready must be checked
Potwierdzenie
NONE; query/host operation does not attest physical action success

baku.progression

progression() -> table

UserLuaRuntime/PublicApi projection; Bounded value table; fields with known/valid/ready must be checked

Argumenty
No positional arguments
Wynik
Bounded value table; fields with known/valid/ready must be checked
Potwierdzenie
NONE; query/host operation does not attest physical action success

baku.module

module(name) -> table

UserLuaRuntime/PublicApi projection; Bounded value table; fields with known/valid/ready must be checked

Argumenty
one of ten module names
Wynik
Bounded value table; fields with known/valid/ready must be checked
Potwierdzenie
NONE; query/host operation does not attest physical action success

baku.diagnostic

diagnostic(name) -> result

Jawne UNSUPPORTED: maintenance modułu nie jest publiczną diagnostyką skryptu. Użyj baku.log.

Argumenty
See signature and typed selector variants; timeout 500..15000 ms where accepted
Wynik
result
Potwierdzenie
Always returns status=UNSUPPORTED; performs no maintenance.

baku.action_result

action_result(intent_id) -> table

UserLuaRuntime/PublicApi projection; Bounded value table; fields with known/valid/ready must be checked

Argumenty
intent_id 1..9223372036854775807
Wynik
Bounded value table; fields with known/valid/ready must be checked
Potwierdzenie
NOT_OBSERVABLE unless a canonical executor already owns proof; success means command execution, never universal physical success

baku.tile

tile(x: integer, y: integer, z: integer) -> table

UserLuaRuntime/PublicApi projection; Bounded value table; fields with known/valid/ready must be checked

Argumenty
x/y 0..65535, z 0..15
Wynik
Bounded value table; fields with known/valid/ready must be checked
Potwierdzenie
NONE; query/host operation does not attest physical action success

baku.spell

spell(id: integer) -> table

UserLuaRuntime/PublicApi projection; Bounded value table; fields with known/valid/ready must be checked

Argumenty
id 1..65535
Wynik
Bounded value table; fields with known/valid/ready must be checked
Potwierdzenie
NONE; query/host operation does not attest physical action success

baku.setting

setting(key: string) -> string | nil

ScriptRegistry; string | nil

Argumenty
[a-z0-9_]{1,48}
Wynik
string | nil
Potwierdzenie
NONE; query/host operation does not attest physical action success

baku.item_count

item_count(id: integer) -> table

UserLuaRuntime/PublicApi projection; Bounded value table; fields with known/valid/ready must be checked

Argumenty
id 1..65535
Wynik
Bounded value table; fields with known/valid/ready must be checked
Potwierdzenie
NONE; query/host operation does not attest physical action success

baku.equipment

equipment() -> table

UserLuaRuntime/PublicApi projection; Bounded value table; fields with known/valid/ready must be checked

Argumenty
No positional arguments
Wynik
Bounded value table; fields with known/valid/ready must be checked
Potwierdzenie
NONE; query/host operation does not attest physical action success

baku.cooldown

cooldown(spell_id: integer) -> table

UserLuaRuntime/PublicApi projection; Bounded value table; fields with known/valid/ready must be checked

Argumenty
spell_id 1..65535
Wynik
Bounded value table; fields with known/valid/ready must be checked
Potwierdzenie
NONE; query/host operation does not attest physical action success

baku.spell_by_name

baku.spell_by_name(name: string) -> table

PublicApi / MagicCatalog / NativeSpellCooldown / CombatStateCache; {status,found?,id?,primary_group?,secondary_group?} or {status,known,ready?,remaining_ms?,session_generation}; absent individual/group authority => UNAVAILABLE

Argumenty
name: string
Wynik
{status,found?,id?,primary_group?,secondary_group?} or {status,known,ready?,remaining_ms?,session_generation}; absent individual/group authority => UNAVAILABLE
Potwierdzenie
host result; gameplay actions preserve canonical result/postcondition

baku.spell_by_words

baku.spell_by_words(words: string) -> table

PublicApi / MagicCatalog / NativeSpellCooldown / CombatStateCache; {status,found?,id?,primary_group?,secondary_group?} or {status,known,ready?,remaining_ms?,session_generation}; absent individual/group authority => UNAVAILABLE

Argumenty
words: string
Wynik
{status,found?,id?,primary_group?,secondary_group?} or {status,known,ready?,remaining_ms?,session_generation}; absent individual/group authority => UNAVAILABLE
Potwierdzenie
host result; gameplay actions preserve canonical result/postcondition

baku.spell_groups

baku.spell_groups(spell_id: integer) -> table

PublicApi / MagicCatalog / NativeSpellCooldown / CombatStateCache; {status,found?,id?,primary_group?,secondary_group?} or {status,known,ready?,remaining_ms?,session_generation}; absent individual/group authority => UNAVAILABLE

Argumenty
spell_id: integer
Wynik
{status,found?,id?,primary_group?,secondary_group?} or {status,known,ready?,remaining_ms?,session_generation}; absent individual/group authority => UNAVAILABLE
Potwierdzenie
host result; gameplay actions preserve canonical result/postcondition

baku.spell_ready

baku.spell_ready(spell_id: integer) -> table

PublicApi / MagicCatalog / NativeSpellCooldown / CombatStateCache; {status,found?,id?,primary_group?,secondary_group?} or {status,known,ready?,remaining_ms?,session_generation}; absent individual/group authority => UNAVAILABLE

Argumenty
spell_id: integer
Wynik
{status,found?,id?,primary_group?,secondary_group?} or {status,known,ready?,remaining_ms?,session_generation}; absent individual/group authority => UNAVAILABLE
Potwierdzenie
host result; gameplay actions preserve canonical result/postcondition

baku.distance

baku.distance(x1: integer, y1: integer, z1: integer, x2: integer, y2: integer, z2: integer) -> table

PublicApi / WorldMapIndex; pure distance; unavailable arbitrary route/LOS query; {status,distance?} or {status,known,walkable?}; arbitrary reachable/shootable => FAIL_CLOSED

Argumenty
x1: integer, y1: integer, z1: integer, x2: integer, y2: integer, z2: integer
Wynik
{status,distance?}
Potwierdzenie
host result; gameplay actions preserve canonical result/postcondition

baku.is_walkable

baku.is_walkable(x: integer, y: integer, z: integer) -> table

PublicApi / WorldMapIndex; pure distance; unavailable arbitrary route/LOS query; {status,distance?} or {status,known,walkable?}; arbitrary reachable/shootable => FAIL_CLOSED

Argumenty
x: integer, y: integer, z: integer
Wynik
{status,known,walkable?}
Potwierdzenie
host result; gameplay actions preserve canonical result/postcondition

baku.is_reachable

baku.is_reachable(... ignored; always fail-closed) -> table

PublicApi / WorldMapIndex; pure distance; unavailable arbitrary route/LOS query; {status,distance?} or {status,known,walkable?}; arbitrary reachable/shootable => FAIL_CLOSED

Argumenty
... ignored; always fail-closed
Wynik
{status="FAIL_CLOSED",ready=false,reason}
Potwierdzenie
host result; gameplay actions preserve canonical result/postcondition

baku.is_shootable

baku.is_shootable(... ignored; always fail-closed) -> table

PublicApi / WorldMapIndex; pure distance; unavailable arbitrary route/LOS query; {status,distance?} or {status,known,walkable?}; arbitrary reachable/shootable => FAIL_CLOSED

Argumenty
... ignored; always fail-closed
Wynik
{status="FAIL_CLOSED",ready=false,reason}
Potwierdzenie
host result; gameplay actions preserve canonical result/postcondition

baku.script_state

script_state(script_id) -> {status,found,script_id?,name?,filename?,icon_id?,required_api?,enabled?,registered?,quarantined?,user_owned?,generation?,session_generation?,runs?,load_status?,run_status?}

Odczyt bieżącego stanu wskazanego skryptu z canonical Script Managera.

Argumenty
script_id; current manager state on game thread
Wynik
{status,found,script_id?,enabled?,registered?,quarantined?,generation?}
Potwierdzenie
host result; gameplay actions preserve canonical result/postcondition

baku.text_find

baku.text_find(text, needle [, start]) -> first|nil,last|nil

Bounded literal byte search, 1-based UTF-8 byte offsets; bez wzorców/regex i bez Lua string stdlib.

Argumenty
text, needle <=1024 B; optional start is 1-based byte index
Wynik
first,last byte positions or nil,nil
Potwierdzenie
pure bounded result; no mutation, scheduler or client side effect

baku.text_sub

baku.text_sub(text, first [, last]) -> string

Bounded wycinek tekstu po 1-based byte offsets; zachowuje bajty UTF-8, nie interpretuje znaków Unicode.

Argumenty
text<=1024 B; first>=1; last defaults to byte length
Wynik
string <=1024 B
Potwierdzenie
pure bounded result; no mutation, scheduler or client side effect

baku.text_trim_ascii

baku.text_trim_ascii(text) -> string

Usuwa wyłącznie ASCII whitespace z początku/końca; bounded 1024 B.

Argumenty
text<=1024 B
Wynik
trimmed string
Potwierdzenie
pure bounded result; no mutation, scheduler or client side effect

baku.text_lower_ascii

baku.text_lower_ascii(text) -> string

Zmienia A-Z na a-z, pozostałe bajty zachowuje bez zmian; deterministic/bounded.

Argumenty
text<=1024 B
Wynik
ASCII-lowercased string
Potwierdzenie
pure bounded result; no mutation, scheduler or client side effect

baku.text_starts_with

baku.text_starts_with(text,prefix) -> boolean

Literalny bounded test prefiksu, bez regex.

Argumenty
text,prefix<=1024 B
Wynik
boolean
Potwierdzenie
pure bounded result; no mutation, scheduler or client side effect

baku.text_ends_with

baku.text_ends_with(text,suffix) -> boolean

Literalny bounded test sufiksu, bez regex.

Argumenty
text,suffix<=1024 B
Wynik
boolean
Potwierdzenie
pure bounded result; no mutation, scheduler or client side effect

baku.now_ms

baku.now_ms() -> integer

Monotoniczny zegar hosta w ms do cooldown/debounce; epoka nie jest wall-clock i nie jest utrwalana.

Argumenty
no arguments
Wynik
monotonic milliseconds
Potwierdzenie
pure bounded result; no mutation, scheduler or client side effect

baku.text_contains

baku.text_contains(text,needle)->bool

Bounded literal text containment, max 1024 B.

Argumenty
text,needle <=1024 B
Wynik
boolean
Potwierdzenie
pure bounded result; no mutation, scheduler or client side effect

baku.text_split_once

baku.text_split_once(text,separator)->left,right|nil

Bounded first literal split.

Argumenty
text,separator <=1024 B
Wynik
two values
Potwierdzenie
pure bounded result; no mutation, scheduler or client side effect

baku.text_replace

baku.text_replace(text,from,to[,max])->text,count

Bounded literal replacement; max 64 replacements/output 1024 B.

Argumenty
text/from/to <=1024 B; max 0..64
Wynik
text,count
Potwierdzenie
pure bounded result; no mutation, scheduler or client side effect

baku.text_format

baku.text_format(format,...)->text

Bounded formatter supporting %s %d %0Nd %f and %% without Lua string stdlib.

Argumenty
format <=1024 bytes; %s accepts string/number/bool up to96 bytes, %d signed64 with width0..32, %f fixed3 decimals with numeric representation <=127 bytes; %% literal percent; total output <=1024 bytes; oversized numeric representation raises Lua error
Wynik
string
Potwierdzenie
pure bounded result; no mutation, scheduler or client side effect

baku.list_insert

baku.list_insert(table,[pos,]value)->pos

Bounded array insertion, max 128 items.

Argumenty
array table; optional 1-based position
Wynik
position
Potwierdzenie
Mutates input Lua array in-place; no host/gameplay mutation.

baku.list_remove

baku.list_remove(table[,pos])->value|nil

Bounded array removal, max 128 items.

Argumenty
array table; optional 1-based position
Wynik
removed value|nil
Potwierdzenie
Mutates input Lua array in-place; no host/gameplay mutation.

baku.list_concat

baku.list_concat(table,separator)->text

Bounded array concatenation, max 128 items/output 1024 B.

Argumenty
array table, separator
Wynik
string
Potwierdzenie
pure bounded result; no mutation, scheduler or client side effect

baku.list_sort

baku.list_sort(table[,descending])->table

Sortowanie leksykalne w miejscu, max 128 wartości. String/number/bool są zamieniane na string; to nie jest numeric table.sort.

Argumenty
array table, optional boolean
Wynik
same table
Potwierdzenie
Mutates input Lua array in-place; no host/gameplay mutation; returns the same array with string values.

baku.math_abs

baku.math_abs(number)->number

Bounded numeric absolute value.

Argumenty
number
Wynik
number
Potwierdzenie
pure bounded result; no mutation, scheduler or client side effect

baku.math_floor

baku.math_floor(number)->number

Bounded numeric floor.

Argumenty
number
Wynik
number
Potwierdzenie
pure bounded result; no mutation, scheduler or client side effect

baku.math_min

baku.math_min(...)->number

Minimum of provided numeric arguments within host call budget.

Argumenty
one or more numbers
Wynik
number
Potwierdzenie
pure bounded result; no mutation, scheduler or client side effect

baku.math_max

baku.math_max(...)->number

Maximum of provided numeric arguments within host call budget.

Argumenty
one or more numbers
Wynik
number
Potwierdzenie
pure bounded result; no mutation, scheduler or client side effect

baku.date_format

baku.date_format(unix_time,format)->text

Bounded local date formatting; format <=64 B/output <=127 B.

Argumenty
unix seconds, strftime-style format <=64 B
Wynik
string
Potwierdzenie
pure bounded result; no mutation, scheduler or client side effect

baku.hotkey_parse

baku.hotkey_parse(text)->{status,key,mods}

Parses bounded human hotkey combination without synthetic key injection.

Argumenty
CTRL/ALT/SHIFT/WIN + A-Z/0-9/F1-F12
Wynik
{status,key,mods}
Potwierdzenie
NONE; query/host operation does not attest physical action success

baku.creature_by_id

creature_by_id(id) -> {status,ready,found,complete,matches,generation,session_generation,creature?}

Lookup in bounded shared invocation frame. Absence is conclusive only if complete=true.

Argumenty
id: integer 1..4294967295
Wynik
{status,ready,found,complete,matches,generation,session_generation,creature?}
Potwierdzenie
NONE; read only

baku.creature_by_name

creature_by_name(name) -> {status,ready,found,complete,matches,generation,session_generation,creature?}

Exact name match; first matching row plus matches count. No independent native scan.

Argumenty
name: string, exact case-sensitive UTF-8
Wynik
{status,ready,found,complete,matches,generation,session_generation,creature?}
Potwierdzenie
NONE; read only

baku.container

container(index) -> {status,ready,found,complete,session_generation,container?}

Lookup in existing bounded frame. Container IDs are not Lua array positions.

Argumenty
index: integer 0..255
Wynik
{status,ready,found,complete,session_generation,container?}
Potwierdzenie
NONE; read only

baku.modules

modules() -> array<{name,supported,requested,applied,pending,needs_wake}>

Current canonical module requested/applied state; fresh after a control-plane change.

Argumenty
none
Wynik
array<{name,supported,requested,applied,pending,needs_wake}>
Potwierdzenie
NONE; read only

baku.config

config(section) -> {status,ready,generation,total,truncated,semantics,entries:array<{key,value,type,truncated}>}

Bounded, sorted published input values, max64 entries /1024 value bytes. Read-only; strings are not effective engine clamps. No file fallback.

Argumenty
section: public canonical config section or script.<own id>
Wynik
{status,ready,generation,total,truncated,semantics,entries:array<{key,value,type,truncated}>}
Potwierdzenie
NONE; read only

baku.profile_state

profile_state() -> {status,config_generation,session_generation,character,character_known,profile?,scope}

Active published profile identity for current character; no path traversal, file read or profile switch.

Argumenty
none
Wynik
{status,config_generation,session_generation,character,character_known,profile?,scope}
Potwierdzenie
NONE; read only

baku.scripts

scripts() -> array<ScriptMetadata>

All manager entries max32: name, filename, icon, required API, runs, load/run state, session/generation and flags. No executable source exposure.

Argumenty
none
Wynik
array<ScriptMetadata>
Potwierdzenie
NONE; read only

baku.script_callbacks

script_callbacks() -> array<{token,event_id,repeat,hud_handle,waypoint_number}>

Current VM owned callback metadata max8. No new scheduler/registration or callback execution.

Argumenty
none
Wynik
array<{token,event_id,repeat,hud_handle,waypoint_number}>
Potwierdzenie
NONE; read only

baku.movement_result

movement_result(intent_id) -> {status,found,terminal,execution_success,intent_id,command_id,action,command_state,script_generation,session_generation,stale_owner,postcondition,qualification}

Existing movement result facade. Executor success does not attest unobserved physical postcondition. Old owned generations readable with stale_owner flag.

Argumenty
intent_id: positive Lua integer, owned by calling script
Wynik
{status,found,terminal,execution_success,intent_id,command_id,action,command_state,script_generation,session_generation,stale_owner,postcondition,qualification}
Potwierdzenie
Explicit executor postcondition only when broker proves it; otherwise NOT_OBSERVABLE

baku.combat_result

combat_result(intent_id) -> {status,found,terminal,execution_success,intent_id,command_id,action,command_state,script_generation,session_generation,stale_owner,postcondition,qualification}

Existing combat result facade. Executor success does not attest unobserved physical postcondition. Old owned generations readable with stale_owner flag.

Argumenty
intent_id: positive Lua integer, owned by calling script
Wynik
{status,found,terminal,execution_success,intent_id,command_id,action,command_state,script_generation,session_generation,stale_owner,postcondition,qualification}
Potwierdzenie
Explicit executor postcondition only when broker proves it; otherwise NOT_OBSERVABLE

baku.social_result

social_result(intent_id) -> {status,found,terminal,execution_success,intent_id,command_id,action,command_state,script_generation,session_generation,stale_owner,postcondition,qualification}

Existing social result facade. Executor success does not attest unobserved physical postcondition. Old owned generations readable with stale_owner flag.

Argumenty
intent_id: positive Lua integer, owned by calling script
Wynik
{status,found,terminal,execution_success,intent_id,command_id,action,command_state,script_generation,session_generation,stale_owner,postcondition,qualification}
Potwierdzenie
Explicit executor postcondition only when broker proves it; otherwise NOT_OBSERVABLE

baku.commerce_result

commerce_result(intent_id) -> {status,found,terminal,execution_success,intent_id,command_id,action,command_state,script_generation,session_generation,stale_owner,postcondition,qualification}

Existing commerce result facade. Executor success does not attest unobserved physical postcondition. Old owned generations readable with stale_owner flag.

Argumenty
intent_id: positive Lua integer, owned by calling script
Wynik
{status,found,terminal,execution_success,intent_id,command_id,action,command_state,script_generation,session_generation,stale_owner,postcondition,qualification}
Potwierdzenie
Explicit executor postcondition only when broker proves it; otherwise NOT_OBSERVABLE

baku.progression_result

progression_result(intent_id) -> {status,found,terminal,execution_success,intent_id,command_id,action,command_state,script_generation,session_generation,stale_owner,postcondition,qualification}

Existing progression result facade. Executor success does not attest unobserved physical postcondition. Old owned generations readable with stale_owner flag.

Argumenty
intent_id: positive Lua integer, owned by calling script
Wynik
{status,found,terminal,execution_success,intent_id,command_id,action,command_state,script_generation,session_generation,stale_owner,postcondition,qualification}
Potwierdzenie
Explicit executor postcondition only when broker proves it; otherwise NOT_OBSERVABLE

Akcje

baku.set_module

set_module(name, enabled) -> result

UserLuaRuntime/PublicApi projection; result

Argumenty
one of ten module names; strict boolean
Wynik
result
Potwierdzenie
NONE; query/host operation does not attest physical action success

baku.say

say(text) -> receipt

ActionIntentBroker -> Runtime21 TimerLane; receipt

Argumenty
valid UTF-8, <=95 UTF-16 code units
Wynik
receipt
Potwierdzenie
NONE; query/host operation does not attest physical action success

baku.cast

cast(words) -> receipt

ActionIntentBroker -> Runtime21 TimerLane; receipt

Argumenty
valid UTF-8, <=95 UTF-16 code units
Wynik
receipt
Potwierdzenie
NONE; query/host operation does not attest physical action success

baku.use

use(item_id) -> receipt

ActionIntentBroker -> Runtime21 TimerLane; receipt

Argumenty
item_id 1..65535
Wynik
receipt
Potwierdzenie
NONE; query/host operation does not attest physical action success

baku.use_on

use_on(item_id, creature_id) -> receipt

ActionIntentBroker -> Runtime21 TimerLane; receipt

Argumenty
item_id 1..65535; creature_id 1..4294967295
Wynik
receipt
Potwierdzenie
NONE; query/host operation does not attest physical action success

baku.use_on_target

use_on_target(item_id: integer) -> receipt

ActionIntentBroker -> Runtime21 TimerLane; receipt

Argumenty
item_id 1..65535
Wynik
receipt
Potwierdzenie
DEFERRED/NOT_OBSERVABLE as a universal physical effect; receipt is admission and action_result reports command execution state.

baku.use_on_tile

use_on_tile(item_id, x, y, z) -> receipt

ActionIntentBroker -> Runtime21 TimerLane; receipt

Argumenty
item_id 1..65535; x/y 0..65535; z 0..15
Wynik
receipt
Potwierdzenie
DEFERRED/NOT_OBSERVABLE as a universal physical effect; receipt is admission and action_result reports command execution state.

baku.use_at

use_at(item_id, location) -> receipt

ActionIntentBroker -> Runtime21 TimerLane; receipt

Argumenty
item_id 1..65535; location={kind='inventory',slot=1..11}|{kind='container',container=0..255,index>=0}|{kind='world',x,y,z,stack?}
Wynik
receipt
Potwierdzenie
DEFERRED/NOT_OBSERVABLE as a universal physical effect; receipt is admission and action_result reports command execution state.

baku.use_with

use_with(source_item_id, source_location, target_item_id, target_location) -> receipt

ActionIntentBroker -> Runtime21 TimerLane; receipt

Argumenty
source/target item_id 1..65535; source/target location tables
Wynik
receipt
Potwierdzenie
DEFERRED/NOT_OBSERVABLE as a universal physical effect; receipt is admission and action_result reports command execution state.

baku.move_item

move_item(item_id, source_location, destination_location, count) -> receipt

ActionIntentBroker -> Runtime21 TimerLane; receipt

Argumenty
item_id 1..65535; exact source; destination inventory/container only; count 1..255
Wynik
receipt
Potwierdzenie
CONSUMER_OWNED by existing canonical domain owner; Lua action_result does not invent a universal physical postcondition.

baku.quick_loot

quick_loot(item_id, world_location) -> receipt

ActionIntentBroker -> Runtime21 TimerLane; receipt

Argumenty
item_id 1..65535; world location table only
Wynik
receipt
Potwierdzenie
CONSUMER_OWNED by existing canonical domain owner; Lua action_result does not invent a universal physical postcondition.

baku.equip

equip(item_id, slot [, tier_policy [, subtype_policy]]) -> receipt

ActionIntentBroker -> Runtime21 TimerLane; receipt

Argumenty
item_id 1..65535; slot 1..11; tier_policy -1..255; subtype_policy -1..65535; tier and subtype policy cannot both be active
Wynik
receipt
Potwierdzenie
CONSUMER_OWNED by existing canonical domain owner; Lua action_result does not invent a universal physical postcondition.

baku.container_close

container_close(index) -> receipt

ActionIntentBroker -> Runtime21 TimerLane; receipt

Argumenty
container index 0..255
Wynik
receipt
Potwierdzenie
CONSUMER_OWNED by existing canonical domain owner; Lua action_result does not invent a universal physical postcondition.

baku.container_up

container_up(index) -> receipt

ActionIntentBroker -> Runtime21 TimerLane; receipt

Argumenty
container index 0..255
Wynik
receipt
Potwierdzenie
CONSUMER_OWNED by existing canonical domain owner; Lua action_result does not invent a universal physical postcondition.

baku.container_next_page

container_next_page(index) -> receipt

ActionIntentBroker -> Runtime21 TimerLane; receipt

Argumenty
container index 0..255
Wynik
receipt
Potwierdzenie
CONSUMER_OWNED by existing canonical domain owner; Lua action_result does not invent a universal physical postcondition.

baku.container_previous_page

container_previous_page(index) -> receipt

ActionIntentBroker -> Runtime21 TimerLane; receipt

Argumenty
container index 0..255
Wynik
receipt
Potwierdzenie
CONSUMER_OWNED by existing canonical domain owner; Lua action_result does not invent a universal physical postcondition.

baku.container_update

container_update(index) -> receipt

ActionIntentBroker -> Runtime21 TimerLane; receipt

Argumenty
container index 0..255
Wynik
receipt
Potwierdzenie
CONSUMER_OWNED by existing canonical domain owner; Lua action_result does not invent a universal physical postcondition.

baku.attack

attack(creature_id) -> receipt

ActionIntentBroker -> Runtime21 TimerLane; receipt

Argumenty
creature_id 1..4294967295
Wynik
receipt
Potwierdzenie
NONE; query/host operation does not attest physical action success

baku.follow

follow(creature_id) -> receipt

ActionIntentBroker -> Runtime21 TimerLane; receipt

Argumenty
creature_id 1..4294967295
Wynik
receipt
Potwierdzenie
NONE; query/host operation does not attest physical action success

baku.cancel_attack

cancel_attack() -> receipt

ActionIntentBroker -> Runtime21 TimerLane; receipt

Argumenty
No positional arguments
Wynik
receipt
Potwierdzenie
EXECUTOR_OWNED; action_result may report executor-confirmed postcondition for this action.

baku.cancel_follow

cancel_follow() -> receipt

ActionIntentBroker -> Runtime21 TimerLane; receipt

Argumenty
No positional arguments
Wynik
receipt
Potwierdzenie
NONE; query/host operation does not attest physical action success

baku.cancel_attack_follow

cancel_attack_follow() -> receipt

ActionIntentBroker -> Runtime21 TimerLane; receipt

Argumenty
No positional arguments
Wynik
receipt
Potwierdzenie
NONE; query/host operation does not attest physical action success

baku.step

step(direction) -> receipt

ActionIntentBroker -> Runtime21 TimerLane; receipt

Argumenty
north/east/south/west/north_east/south_east/south_west/north_west
Wynik
receipt
Potwierdzenie
NONE; query/host operation does not attest physical action success

baku.turn

turn(direction) -> receipt

ActionIntentBroker -> Runtime21 TimerLane; receipt

Argumenty
north/east/south/west
Wynik
receipt
Potwierdzenie
NONE; query/host operation does not attest physical action success

baku.stop

stop() -> receipt

ActionIntentBroker -> Runtime21 TimerLane; receipt

Argumenty
No positional arguments
Wynik
receipt
Potwierdzenie
NONE; query/host operation does not attest physical action success

baku.set_tactics

set_tactics(fight, chase, secure, pvp) -> receipt

ActionIntentBroker -> Runtime21 TimerLane; receipt

Argumenty
fight 1..3, chase 0..1, secure boolean, pvp 0..3
Wynik
receipt
Potwierdzenie
NONE; query/host operation does not attest physical action success

baku.social_action

social_action(action, subject_id, name, timeout_ms) -> receipt

ActionIntentBroker -> Runtime21 TimerLane; receipt

Argumenty
See signature and typed selector variants; timeout 500..15000 ms where accepted
Wynik
receipt
Potwierdzenie
NONE; query/host operation does not attest physical action success

baku.trade_action

trade_action(action, item_id, amount, flags, timeout_ms) -> receipt

ActionIntentBroker -> Runtime21 TimerLane; receipt

Argumenty
See signature and typed selector variants; timeout 500..15000 ms where accepted
Wynik
receipt
Potwierdzenie
NONE; query/host operation does not attest physical action success

baku.market_action

market_action(action, item_id, tier, amount, price, offer_type, anonymous, timestamp, counter, timeout_ms) -> receipt

ActionIntentBroker -> Runtime21 TimerLane; receipt

Argumenty
See signature and typed selector variants; timeout 500..15000 ms where accepted
Wynik
receipt
Potwierdzenie
NONE; query/host operation does not attest physical action success

baku.progression_action

progression_action(action, arg0, arg1, arg2, upgrade, timeout_ms) -> receipt

ActionIntentBroker -> Runtime21 TimerLane; receipt

Argumenty
See signature and typed selector variants; timeout 500..15000 ms where accepted
Wynik
receipt
Potwierdzenie
NONE; query/host operation does not attest physical action success

baku.delay

delay(ms: integer, callback: function) -> integer

ScriptRegistry; integer

Argumenty
ms 1000..3600000; callback function; <=8 live tokens/script
Wynik
integer
Potwierdzenie
NONE; query/host operation does not attest physical action success

baku.on

on(event: string, callback: function) -> integer

Rejestracja w ScriptRegistry; callback przez istniejący TimerLane. Payload ctx.event. Rejestracja nie dowodzi dostarczenia eventu z klienta; źródło native wymaga acceptance. Message/Container fanout oraz seed/session guard mają test hostowy, live pozostaje PARTIAL. Subskrypcje dyskretnych eventow nie odtwarzaja danych sprzed rejestracji; TALK/TEXT_MESSAGE zachowują FIFO128 osobnych owned payloadów; inne eventy zachowują latest-edge. Canonical historia128 raportuje brakujące sequence; pełny callback FIFO jawnie odrzuca nowy rekord zamiast nadpisywać przyjęty.

Argumenty
declared derived event names; callback function; additive follow_changed/position_changed, canonical Self edges, coalesced latest, no kill inference.
Wynik
integer
Potwierdzenie
NONE; query/host operation does not attest physical action success

baku.when

when(event: string, predicate: function, callback: function) -> integer

Rejestracja w ScriptRegistry; callback przez istniejący TimerLane. Payload ctx.event. Rejestracja nie dowodzi dostarczenia eventu z klienta; źródło native wymaga acceptance. Message/Container fanout oraz seed/session guard mają test hostowy, live pozostaje PARTIAL. Subskrypcje dyskretnych eventow nie odtwarzaja danych sprzed rejestracji; pending zachowuje ostatni dokladny payload.

Argumenty
event, predicate(ctx)->boolean, callback(ctx); <=8 live tokens/script; additive follow_changed/position_changed, canonical Self edges, coalesced latest, no kill inference.
Wynik
integer
Potwierdzenie
NONE; query/host operation does not attest physical action success

baku.on_waypoint

on_waypoint(waypoint_number: integer, callback: function) -> integer

ScriptRegistry + canonical Cave event; integer

Argumenty
waypoint_number >= 1 (user-visible 1-based); callback function
Wynik
integer
Potwierdzenie
NONE; registration only; gameplay actions use Public API -> ActionIntentBroker.

baku.cancel

cancel(token: integer) -> boolean

ScriptRegistry; boolean

Argumenty
uint32 token from same script generation
Wynik
boolean
Potwierdzenie
NONE; query/host operation does not attest physical action success

baku.hotkey

baku.hotkey(vk: integer, modifiers: integer, callback: function) -> table

ScriptRegistry / existing GameThreadIngress WM_HOTKEY / Runtime21 TimerLane; registration={status,token?}; remove returns boolean; OFF/RELOAD/DELETE unregister OS IDs before generation revoke

Argumenty
vk: integer, modifiers: integer, callback: function
Wynik
registration={status,token?}; remove returns boolean; OFF/RELOAD/DELETE unregister OS IDs before generation revoke
Potwierdzenie
host result; gameplay actions preserve canonical result/postcondition

baku.hotkey_remove

baku.hotkey_remove(token: integer) -> boolean

ScriptRegistry / existing GameThreadIngress WM_HOTKEY / Runtime21 TimerLane; registration={status,token?}; remove returns boolean; OFF/RELOAD/DELETE unregister OS IDs before generation revoke

Argumenty
token: integer
Wynik
boolean
Potwierdzenie
host result; gameplay actions preserve canonical result/postcondition

baku.sound

baku.sound(alarm_name_or_supported_alias: string) -> table

AlarmEngine named sound backend; {status}; stop scoped to last script-owned sound; an alarm supersedes script sound

Argumenty
alarm_name_or_supported_alias: string
Wynik
{status}; stop scoped to last script-owned sound; an alarm supersedes script sound
Potwierdzenie
host result; gameplay actions preserve canonical result/postcondition

baku.sound_stop

baku.sound_stop() -> table

AlarmEngine named sound backend; {status}; stop scoped to last script-owned sound; an alarm supersedes script sound

Argumenty
No positional arguments
Wynik
{status}; stop scoped to last script-owned sound; an alarm supersedes script sound
Potwierdzenie
host result; gameplay actions preserve canonical result/postcondition

baku.script_set_enabled

baku.script_set_enabled(script_id, enabled) -> {status,script_id,requested_enabled}

Przełącza wskazany skrypt przez istniejący manager. ON planuje main w istniejącej TimerLane, nie wykonuje reentrant Lua. OFF usuwa jego HUD/callbacki. Sterownik ikony powinien być osobnym włączonym skryptem. Stan jest w RAM; brak autosave.

Argumenty
script_id, enabled; strict boolean; requires controller RUN owner
Wynik
{status,script_id,requested_enabled}
Potwierdzenie
host result; gameplay actions preserve canonical result/postcondition

baku.flash

baku.flash()->table

Flashes the current Tibia process window through existing AlarmEngine window owner; no raw HWND exposed.

Argumenty
no arguments
Wynik
{status}
Potwierdzenie
host result; gameplay actions preserve canonical result/postcondition

baku.quick_loot_area

baku.quick_loot_area([timeout_ms])->receipt

Submits existing semantic QuickLootAreaAtPlayer through canonical ActionIntentBroker; no direct GTQ/client call.

Argumenty
optional timeout 500..15000
Wynik
receipt
Potwierdzenie
CONSUMER_OWNED by existing canonical domain owner; Lua action_result does not invent a universal physical postcondition.

baku.module_plan

module_plan(patch) -> {status,accepted,postcondition}

Validate whole patch before canonical ApplyModulePlan. Existing Runtime21 rearm and last-writer-wins; acceptance is requested state, not applied gameplay.

Argumenty
patch: table of supported module names to strict boolean; omitted retain requested state
Wynik
{status,accepted,postcondition}
Potwierdzenie
REQUESTED_STATE; query applied/pending

baku.speak

speak(mode,text,destination?,timeout?) -> {status,intent_id,command_id}

Canonical ACTION.ActionSay admission + appended broker kind; existing ActionApi/Arbiter/GTQ/selected pack execution. No universal speech receive postcondition; no retry.

Argumenty
mode: normal|whisper|yell|npc|private|channel_yellow|channel_red, text:string (1..95 UTF16 units), destination?:recipient string(1..63 UTF16 units) for private or channel integer0..65535 for channel; nil for others; timeout?:500..15000(default3000)
Wynik
{status,intent_id,command_id}
Potwierdzenie
NOT_OBSERVABLE (speech receive)

Moduły i profile

baku.control_schema

control_schema(domain, options?) -> table

Schemat publicznych pól: typy, enumy, limity oraz stronicowanie.

Argumenty
domain: exact domain, or "*" for domain list. options?: {start=1,limit=64}; limit1..128.
Wynik
Schema fields without value; "*" returns {status,domains}.
Potwierdzenie
APPLIED/SAVED only after canonical apply/durable write; no claim about subsequent game actions

baku.control_state

control_state(domain, options?) -> table

Opublikowane ustawienia modułu i jego rzeczywisty stan ON/OFF.

Argumenty
domain: exact domain. options?: {start=1,limit=64}; limit1..128.
Wynik
Typed published values plus canonical runtime flags; complete page metadata.
Potwierdzenie
APPLIED/SAVED only after canonical apply/durable write; no claim about subsequent game actions

baku.control_apply

control_apply(domain, patch, expected_generation[, options]) -> table

Zmień ustawienia modułu przez wspólny ConfigAuthority. Cave: ON/OFF osobno; pace_* zapisuje do dokumentu roboczego trasy przy wyłączonym Cave i Recorder oraz aktualnym tokenie trasy. Odczytaj control_result; ACCEPTED nie oznacza zastosowania.

Argumenty
domain; patch: flat exact typed schema keys; expected_generation: exact current control_state token. Optional fourth options={expected_route_generation=token from cave_route()}. Cave: enabled alone OR a nonempty subset of five pace_* fields. Pace edits require Cave/Recorder OFF, no pending editor/save, v3 working route and current route generation. They commit the working route; explicit GUI Save exports the selected document.
Wynik
{status="ACCEPTED",accepted=true,operation_id} or {status,reason}. Wait for control_result.
Potwierdzenie
APPLIED/SAVED only after canonical apply/durable write; no claim about subsequent game actions
Przykład
local s=baku.control_state("cave")
local route=baku.cave_route()
local r=baku.control_apply("cave",{pace_enabled=true,pace_lure_from=8,pace_fast_again_enabled=true,pace_fast_again_from=12,pace_hysteresis=1},s.config_generation,{expected_route_generation=route.route_generation})
-- Check r.status, then poll baku.control_result(r.operation_id) in an existing callback.
-- APPLIED updates the working route. Use Save in Cave to export it.

baku.control_result

control_result(operation_id) -> table

Wynik własnej operacji konfiguracji lub pliku.

Argumenty
operation_id: exact token returned by admission; owner/script generation must match.
Wynik
Current PENDING or terminal receipt. Last32 terminal receipts per process, not durable history.
Potwierdzenie
APPLIED/SAVED only after canonical apply/durable write; no claim about subsequent game actions

baku.profiles

profiles(scope, options?) -> table

Rzeczywista lista zapisanych profili wybranego modułu albo całej postaci.

Argumenty
scope: character|target|magic|heal|equipment|timer|action_rules|support|alarm. options?: {start=1,limit=64,refresh=false}.
Wynik
Real catalog of current scope; refresh asynchronous. Cave uses cave_routes.
Potwierdzenie
APPLIED/SAVED only after canonical apply/durable write; no claim about subsequent game actions

baku.profile_load

profile_load(scope, profile_id, options) -> table

Wczytuje ustawienia wybranego profilu; profil modułu zachowuje główne ON/OFF.

Argumenty
scope; id: exact catalog id. options: {expected_generation=token,file_version=SHA256,discard_unsaved=false}. Whole character load requires all modules OFF and may revoke the calling script.
Wynik
Admission only; use control_result. Module presets preserve master requested ON/OFF.
Potwierdzenie
APPLIED/SAVED only after canonical apply/durable write; no claim about subsequent game actions

baku.profile_save

profile_save(scope, name, options) -> table

Zapisuje migawkę ustawień modułu lub postaci do pliku.

Argumenty
scope; name: 1..96 UTF8 bytes, stem without .json, no path/reserved characters. options: {expected_generation=token,overwrite=false,file_version=SHA256}. Existing filename needs overwrite=true and exact file_version.
Wynik
SAVED only after atomic durable write. SAVED_NOT_ACTIVATED means file was saved but owner/editor/session changed before metadata activation.
Potwierdzenie
APPLIED/SAVED only after canonical apply/durable write; no claim about subsequent game actions

baku.module_profiles

module_profiles(domain, options?) -> table

Odczytuje trzy stałe sloty modułu, aktywny slot, stan zmian i wersję dokumentu profilu postaci.

Argumenty
domain: target/magic/heal/equipment/timer/action_rules. options: {refresh=false}.
Wynik
{status,domain,active_slot,dirty,items={{slot,name,saved}},config_generation,session_generation,document_ready,file_version,disk_version,file_conflict}. Refresh prepares the on-disk version on the existing worker.
Potwierdzenie
APPLIED/SAVED only after canonical apply/durable write; no claim about subsequent game actions

baku.module_profile_select

module_profile_select(domain, slot, options) -> table

Przełącza moduł na Profil 1, 2 lub 3 przez wspólną konfigurację GUI/Lua.

Argumenty
domain; slot: integer 1..3; options: {expected_generation=token,discard_unsaved=false}.
Wynik
ACCEPTED zawiera operation_id. Oczekuj terminalnego APPLIED przez control_result; zachowuje główny stan modułu z istniejącymi bramkami pustej konfiguracji.
Potwierdzenie
APPLIED/SAVED only after canonical apply/durable write; no claim about subsequent game actions

baku.module_profile_save

module_profile_save(domain, options) -> table

Zapisuje aktywny slot modułu w bieżącym pełnym profilu postaci.

Argumenty
domain; options: {expected_generation=token,file_version=module_profiles().file_version}. document_ready musi być true; ABSENT oznacza nowy plik.
Wynik
ACCEPTED zawiera operation_id. SAVED potwierdza trwały zapis; FILE_CONFLICT wymaga odświeżenia. Nie wymaga osobnego zapisu całego profilu.
Potwierdzenie
APPLIED/SAVED only after canonical apply/durable write; no claim about subsequent game actions

Cave i ruch

baku.select_cave_route

select_cave_route(path: string) -> result

PublicApi::RequestScriptCaveRouteOnGameThread -> CaveModuleRuntime; result

Argumenty
route path/name as a bounded UTF-8 string; generic host string limit applies
Wynik
result
Potwierdzenie
Canonical owner acceptance only; does not attest physical movement success.

baku.cave

cave() -> table

UserLuaRuntime/PublicApi projection; Bounded value table; fields with known/valid/ready must be checked

Argumenty
No positional arguments
Wynik
Bounded value table; fields with known/valid/ready must be checked
Potwierdzenie
NONE; query/host operation does not attest physical action success

baku.cave_waypoint

baku.cave_waypoint(number)->table

Reads one waypoint from canonical Cave route snapshot; no filesystem or private route authority.

Argumenty
1-based waypoint number
Wynik
{status,found,index,number,type,label,position_valid,x,y,z,...}
Potwierdzenie
NONE; query/host operation does not attest physical action success

baku.cave_route

cave_route(start?,limit?) -> {status,ready,route_generation,route,count,editable,owner,session_generation,truncated,waypoints:array<Waypoint>}

Odczytuje stronę kanonicznej trasy roboczej, jej dokładną wersję oraz pełne parametry WP. Pusta trasa jest poprawnym dokumentem. editable nie oznacza zakończonego zapisu na dysku.

Argumenty
start?: integer >=1 (default1), limit?: integer1..128(default64)
Wynik
{status,ready,route_generation,route,count,editable,owner,session_generation,truncated,waypoints:array<Waypoint>}
Potwierdzenie
NONE; read only

baku.cave_wp_add

cave_wp_add(waypoint,expected_generation) -> RouteEditReceipt

Edytuje pełny, typowany waypoint w jednym modelu roboczym Recorder/Cave. Cave i Recorder muszą być OFF. Odczytaj aktualny route_generation z cave_route(); nie ponawiaj operacji po nieznanym wyniku bez ponownego odczytu. Add wymaga pozycji przy aktualnym Self; Edit zachowuje pominięte pola istniejącego WP. Parametry waypointu i granice opisuje WaypointInput. committed=true potwierdza pamięć i odbicie w Cave; zapis pliku wymaga zwykłego Save.

Argumenty
waypoint: WaypointInput; expected_generation: exact route_generation from cave_route (integer or decimal string). edit number: 1-based. Required type,x,y,z; optional fields in WaypointInput. Unknown fields rejected. Existing fields omitted in edit are preserved.
Wynik
RouteEditReceipt: status,committed,attempted,reason,before_generation,route_generation,count,postcondition,persistence,session_generation
Potwierdzenie
MEMORY_COMMITTED_AND_CAVE_MIRRORED; disk save not attested

baku.cave_wp_edit

cave_wp_edit(number,waypoint,expected_generation,move_to?) -> RouteEditReceipt

Edytuje pełny, typowany waypoint w jednym modelu roboczym Recorder/Cave. Cave i Recorder muszą być OFF. Odczytaj aktualny route_generation z cave_route(); nie ponawiaj operacji po nieznanym wyniku bez ponownego odczytu. Add wymaga pozycji przy aktualnym Self; Edit zachowuje pominięte pola istniejącego WP. Parametry waypointu i granice opisuje WaypointInput. committed=true potwierdza pamięć i odbicie w Cave; zapis pliku wymaga zwykłego Save.

Argumenty
waypoint: WaypointInput; expected_generation: exact route_generation from cave_route (integer or decimal string). edit number: 1-based. Required type,x,y,z; optional fields in WaypointInput. Unknown fields rejected. Existing fields omitted in edit are preserved. Optional move_to: destination waypoint number (1-based); preserves the complete payload and renumbers the route atomically.
Wynik
RouteEditReceipt: status,committed,attempted,reason,before_generation,route_generation,count,postcondition,persistence,session_generation
Potwierdzenie
MEMORY_COMMITTED_AND_CAVE_MIRRORED; disk save not attested

baku.cave_wp_delete

cave_wp_delete(number,expected_generation) -> RouteEditReceipt

Versioned delete through canonical editor, only Cave+Recorder OFF and no pending editor work.

Argumenty
number:integer>=1, expected_generation:exact uint64 token
Wynik
RouteEditReceipt{status,committed,attempted,reason,before_generation,route_generation,count,postcondition,persistence,session_generation}; attempted=true with committed=false means outcome unknown, re-query before retry.
Potwierdzenie
MEMORY_COMMITTED_AND_CAVE_MIRRORED; disk save not attested

baku.cave_wp_clear

cave_wp_clear(expected_generation) -> RouteEditReceipt

Versioned clear via canonical owner; empty route legal; no automatic Walker enable.

Argumenty
expected_generation:exact uint64 token
Wynik
RouteEditReceipt{status,committed,attempted,reason,before_generation,route_generation,count,postcondition,persistence,session_generation}; attempted=true with committed=false means outcome unknown, re-query before retry.
Potwierdzenie
MEMORY_COMMITTED_AND_CAVE_MIRRORED; disk save not attested

baku.cave_routes

cave_routes(options?) -> table

Rzeczywista lista plików tras z folderu waypoints.

Argumenty
options?: {start=1,limit=64,refresh=false}. Reads actual waypoints/*.json, bounded to128files.
Wynik
Same paginated catalog fields as profiles. file_version is required for open.
Potwierdzenie
APPLIED/SAVED only after canonical apply/durable write; no claim about subsequent game actions

baku.cave_route_open

cave_route_open(route_id, options) -> table

Otwiera wskazaną trasę także ze stale działającego skryptu; pozostawia Cave OFF.

Argumenty
id: exact cave_routes id. options: {expected_generation=token,file_version=SHA256,expected_route_generation=token,discard_unsaved=false}. Read route generation from cave_route; nonempty working route requires exact token and discard_unsaved=true. Recorder must be OFF with no pending editing/persistence.
Wynik
Available also to permanent scripts. STOP, validate/read file on worker, activate shared working model, walker OFF. ACCEPTED is not loaded.
Potwierdzenie
APPLIED/SAVED only after canonical apply/durable write; no claim about subsequent game actions

baku.cave_goto

baku.cave_goto({x=100, y=100, z=7, timeout_ms=30000})

Ręczne dojście do wskazanego punktu na bieżącym piętrze przez istniejący Cave D* Lite. Wymaga wyłączonego Walkera i Recorder. Nie zmienia dokumentu trasy.

Argumenty
cave_goto: options object with integer x,y=1..65535, z=0..15 (current floor), optional timeout_ms=1000..300000 default 30000; cancel/state: no arguments.
Wynik
table: status, reason, goto_status, active, request_id, command_id, target{x,y,z}, physical_arrival, stop_command_confirmed
Potwierdzenie
Exact fresh Self at target for ARRIVED; cancel requires terminal native Stop result. STOP_FAILED retains ownership until explicit Cancel retry. No route cursor advance, blind retry or cross-floor recovery.
Przykład
local state = baku.cave_goto({x=100, y=100, z=7, timeout_ms=30000})

baku.cave_goto_cancel

baku.cave_goto_cancel()

Anuluje własny ręczny cel skryptu. Stop przechodzi przez istniejący ActionApi/Arbiter/GTQ; brak automatycznego powrotu do Walkera.

Argumenty
cave_goto: options object with integer x,y=1..65535, z=0..15 (current floor), optional timeout_ms=1000..300000 default 30000; cancel/state: no arguments.
Wynik
table: status, reason, goto_status, active, request_id, command_id, target{x,y,z}, physical_arrival, stop_command_confirmed
Potwierdzenie
Exact fresh Self at target for ARRIVED; cancel requires terminal native Stop result. STOP_FAILED retains ownership until explicit Cancel retry. No route cursor advance, blind retry or cross-floor recovery.
Przykład
local state = baku.cave_goto_cancel()

baku.cave_goto_state

baku.cave_goto_state()

Zwraca stan ręcznego celu: ARRIVED oznacza dokładną pozycję świeżego Self, a nie samo zakończenie wywołania klienta.

Argumenty
cave_goto: options object with integer x,y=1..65535, z=0..15 (current floor), optional timeout_ms=1000..300000 default 30000; cancel/state: no arguments.
Wynik
table: status, reason, goto_status, active, request_id, command_id, target{x,y,z}, physical_arrival, stop_command_confirmed
Potwierdzenie
Exact fresh Self at target for ARRIVED; cancel requires terminal native Stop result. STOP_FAILED retains ownership until explicit Cancel retry. No route cursor advance, blind retry or cross-floor recovery.
Przykład
local state = baku.cave_goto_state()

Zdarzenia i czas

baku.every

every(ms: integer, callback: function) -> integer

ScriptRegistry; integer

Argumenty
ms 1000..3600000; callback function; <=8 live tokens/script
Wynik
integer
Potwierdzenie
NONE; query/host operation does not attest physical action success

baku.unix_time

baku.unix_time() -> integer

UTC Unix time w sekundach z host system clock; query-only.

Argumenty
no arguments
Wynik
Unix seconds
Potwierdzenie
pure bounded result; no mutation, scheduler or client side effect

baku.text_after

baku.text_after(text,needle)->text|nil

Returns bytes after first literal needle; bounded.

Argumenty
text,needle <=1024 B
Wynik
string|nil
Potwierdzenie
pure bounded result; no mutation, scheduler or client side effect

baku.runtime_info

runtime_info() -> {api_version,source_sha256,runtime_started,state_indexes_valid,config_generation,session_generation,self_generation,event_generation,script_id,script_generation,standard_libs,scheduler}

Read-only source and execution identity; no pointers, opcodes or runtime override.

Argumenty
none
Wynik
{api_version,source_sha256,runtime_started,state_indexes_valid,config_generation,session_generation,self_generation,event_generation,script_id,script_generation,standard_libs,scheduler}
Potwierdzenie
NONE; read only

HUD

baku.hud_text

baku.hud_text(x: integer, y: integer, text: string) -> table

Canonical ScriptHud: wizual jest renderowany wewnątrz mapWindow klienta Tibii i podlega clipping/stacking UI klienta; HUD skryptu jest wyłącznie na ekranie gry. Współrzędne x/y są lokalne dla mapWindow. Item używa canonical client_catalog PNG/BMP, ID jest wyłącznie fallbackiem gdy asset nie jest dostępny.

Argumenty
x: integer, y: integer, text: string
Wynik
{status,handle?}
Potwierdzenie
host result; gameplay actions preserve canonical result/postcondition

baku.hud_item

baku.hud_item(x: integer, y: integer, item_id: integer) -> table

Canonical ScriptHud: wizual jest renderowany wewnątrz mapWindow klienta Tibii i podlega clipping/stacking UI klienta; HUD skryptu jest wyłącznie na ekranie gry. Współrzędne x/y są lokalne dla mapWindow. Item używa canonical client_catalog PNG/BMP, ID jest wyłącznie fallbackiem gdy asset nie jest dostępny.

Argumenty
x: integer, y: integer, item_id: integer
Wynik
{status,handle?}
Potwierdzenie
host result; gameplay actions preserve canonical result/postcondition

baku.hud_rect

baku.hud_rect(x: integer, y: integer, width: integer, height: integer [, rgb: integer=0xffffff]) -> table

Canonical ScriptHud: wizual jest renderowany wewnątrz mapWindow klienta Tibii i podlega clipping/stacking UI klienta; HUD skryptu jest wyłącznie na ekranie gry. Współrzędne x/y są lokalne dla mapWindow. Item używa canonical client_catalog PNG/BMP, ID jest wyłącznie fallbackiem gdy asset nie jest dostępny.

Argumenty
x: integer, y: integer, width: integer, height: integer [, rgb: integer=0xffffff]
Wynik
{status,handle?}
Potwierdzenie
host result; gameplay actions preserve canonical result/postcondition

baku.hud_set_text

baku.hud_set_text(handle: integer, text: string) -> table

Canonical ScriptHud: wizual jest renderowany wewnątrz mapWindow klienta Tibii i podlega clipping/stacking UI klienta; HUD skryptu jest wyłącznie na ekranie gry. Współrzędne x/y są lokalne dla mapWindow. Item używa canonical client_catalog PNG/BMP, ID jest wyłącznie fallbackiem gdy asset nie jest dostępny.

Argumenty
handle: integer, text: string
Wynik
{status}; STALE_HANDLE when owner/generation check fails
Potwierdzenie
host result; gameplay actions preserve canonical result/postcondition

baku.hud_set_position

baku.hud_set_position(handle: integer, x: integer, y: integer) -> table

Canonical ScriptHud: wizual jest renderowany wewnątrz mapWindow klienta Tibii i podlega clipping/stacking UI klienta; HUD skryptu jest wyłącznie na ekranie gry. Współrzędne x/y są lokalne dla mapWindow. Item używa canonical client_catalog PNG/BMP, ID jest wyłącznie fallbackiem gdy asset nie jest dostępny.

Argumenty
handle: integer, x: integer, y: integer
Wynik
{status}; STALE_HANDLE when owner/generation check fails
Potwierdzenie
host result; gameplay actions preserve canonical result/postcondition

baku.hud_set_visible

baku.hud_set_visible(handle: integer, visible: boolean) -> table

Canonical ScriptHud: wizual jest renderowany wewnątrz mapWindow klienta Tibii i podlega clipping/stacking UI klienta; HUD skryptu jest wyłącznie na ekranie gry. Współrzędne x/y są lokalne dla mapWindow. Item używa canonical client_catalog PNG/BMP, ID jest wyłącznie fallbackiem gdy asset nie jest dostępny.

Argumenty
handle: integer, visible: boolean
Wynik
{status}; STALE_HANDLE when owner/generation check fails
Potwierdzenie
host result; gameplay actions preserve canonical result/postcondition

baku.hud_remove

baku.hud_remove(handle: integer) -> table

Canonical ScriptHud: wizual jest renderowany wewnątrz mapWindow klienta Tibii i podlega clipping/stacking UI klienta; HUD skryptu jest wyłącznie na ekranie gry. Współrzędne x/y są lokalne dla mapWindow. Item używa canonical client_catalog PNG/BMP, ID jest wyłącznie fallbackiem gdy asset nie jest dostępny.

Argumenty
handle: integer
Wynik
{status}; STALE_HANDLE when owner/generation check fails
Potwierdzenie
host result; gameplay actions preserve canonical result/postcondition

baku.hud_clear

baku.hud_clear() -> table

Canonical ScriptHud: wizual jest renderowany wewnątrz mapWindow klienta Tibii i podlega clipping/stacking UI klienta; HUD skryptu jest wyłącznie na ekranie gry. Współrzędne x/y są lokalne dla mapWindow. Item używa canonical client_catalog PNG/BMP, ID jest wyłącznie fallbackiem gdy asset nie jest dostępny.

Argumenty
No positional arguments
Wynik
{status}; STALE_HANDLE when owner/generation check fails
Potwierdzenie
host result; gameplay actions preserve canonical result/postcondition

baku.hud_on_click

baku.hud_on_click(handle, callback) -> {status,token?}

Klik używa istniejącego GUI input ownera jako niewidocznego regionowego proxy tylko gdy Tibia jest foreground; callback przechodzi przez canonical Script Manager/Runtime21. Wizual pozostaje in-client QML.

Argumenty
handle, callback; one callback per owned handle; repeat registration replaces callback and retains token; <=8 total callbacks
Wynik
{status,token?}
Potwierdzenie
host result; gameplay actions preserve canonical result/postcondition

baku.hud_set_color

baku.hud_set_color(handle,rgb)->table

Changes canonical ScriptHud text/rect color on existing in-client renderer.

Argumenty
owned handle, RGB 0..0xffffff
Wynik
{status}; STALE_HANDLE when owner/generation check fails
Potwierdzenie
host result; gameplay actions preserve canonical result/postcondition

baku.hud_set_size

baku.hud_set_size(handle,width,height)->table

Changes canonical ScriptHud rectangle bounds/hitbox.

Argumenty
owned handle; 1..8192 dimensions
Wynik
{status}; STALE_HANDLE when owner/generation check fails
Potwierdzenie
host result; gameplay actions preserve canonical result/postcondition

baku.hud_set_item_id

baku.hud_set_item_id(handle,item_id)->table

Changes item ID on an owned HUD item using canonical client_catalog asset pipeline.

Argumenty
owned item handle; item 1..65535
Wynik
{status}; STALE_HANDLE when owner/generation check fails
Potwierdzenie
host result; gameplay actions preserve canonical result/postcondition

baku.hud_set_font_size

baku.hud_set_font_size(handle,pixels)->table

Changes text pixel size on existing in-client ScriptHud renderer.

Argumenty
owned text handle; 8..32
Wynik
{status}; STALE_HANDLE when owner/generation check fails
Potwierdzenie
host result; gameplay actions preserve canonical result/postcondition

baku.hud_get_position

baku.hud_get_position(handle)->table

Reads canonical owned ScriptHud geometry/style; no renderer duplication.

Argumenty
owned HUD handle
Wynik
{status,x?,y?,width?,height?,color?,font_size?}
Potwierdzenie
NONE; query/host operation does not attest physical action success

Dane i diagnostyka

baku.dialog

dialog() -> table

UserLuaRuntime/PublicApi projection; Bounded value table; fields with known/valid/ready must be checked

Argumenty
No positional arguments
Wynik
Bounded value table; fields with known/valid/ready must be checked
Potwierdzenie
NONE; query/host operation does not attest physical action success

baku.log

log(message: string) -> nil

UserLuaRuntime/PublicApi projection; nil

Argumenty
string <=1024 bytes; output truncated to 191 bytes; 16 records/invocation
Wynik
nil
Potwierdzenie
NONE; query/host operation does not attest physical action success

baku.storage_get

baku.storage_get(key: string) -> table

ConfigAuthority bounded persistent user-data storage / canonical character identity; {status,value?,persistence="config_authority_user_data_disk",namespace="character+script_id"}; persists across process restart

Argumenty
key: string
Wynik
{status,value?,persistence="config_authority_user_data_disk",namespace="character+script_id"}
Potwierdzenie
host result; gameplay actions preserve canonical result/postcondition Return field storage_io_us measures host binding walltime. At most four storage_io debug records per invocation; no persistence/timing policy change.

baku.storage_set

baku.storage_set(key: string, value: string) -> table

ConfigAuthority bounded persistent user-data storage / canonical character identity; {status,value?,persistence="config_authority_user_data_disk",namespace="character+script_id"}; persists across process restart

Argumenty
key: string, value: string
Wynik
{status,persistence="config_authority_user_data_disk",namespace="character+script_id"}
Potwierdzenie
host result; gameplay actions preserve canonical result/postcondition Return field storage_io_us measures host binding walltime. At most four storage_io debug records per invocation; no persistence/timing policy change.

baku.storage_delete

baku.storage_delete(key: string) -> table

ConfigAuthority bounded persistent user-data storage / canonical character identity; {status,value?,persistence="config_authority_user_data_disk",namespace="character+script_id"}; persists across process restart

Argumenty
key: string
Wynik
{status,persistence="config_authority_user_data_disk",namespace="character+script_id"}
Potwierdzenie
host result; gameplay actions preserve canonical result/postcondition Return field storage_io_us measures host binding walltime. At most four storage_io debug records per invocation; no persistence/timing policy change.

baku.storage_clear

baku.storage_clear() -> table

ConfigAuthority bounded persistent user-data storage / canonical character identity; {status,value?,persistence="config_authority_user_data_disk",namespace="character+script_id"}; persists across process restart

Argumenty
No positional arguments
Wynik
{status,persistence="config_authority_user_data_disk",namespace="character+script_id"}
Potwierdzenie
host result; gameplay actions preserve canonical result/postcondition Return field storage_io_us measures host binding walltime. At most four storage_io debug records per invocation; no persistence/timing policy change.

baku.json_null

baku.json_null() -> table

bounded fixed-buffer host JSON codec; encode={status,json?,bytes}; decode={status,value?}; null/array helpers preserve tagged round trips; UTF-8 strict, duplicate keys/sparse arrays/cycles/overflow rejected

Argumenty
No positional arguments
Wynik
encode={status,json?,bytes}; decode={status,value?}; null/array helpers preserve tagged round trips; UTF-8 strict, duplicate keys/sparse arrays/cycles/overflow rejected
Potwierdzenie
host result; gameplay actions preserve canonical result/postcondition

baku.json_array

baku.json_array(value: table) -> table

bounded fixed-buffer host JSON codec; encode={status,json?,bytes}; decode={status,value?}; null/array helpers preserve tagged round trips; UTF-8 strict, duplicate keys/sparse arrays/cycles/overflow rejected

Argumenty
value: table
Wynik
encode={status,json?,bytes}; decode={status,value?}; null/array helpers preserve tagged round trips; UTF-8 strict, duplicate keys/sparse arrays/cycles/overflow rejected
Potwierdzenie
host result; gameplay actions preserve canonical result/postcondition

baku.json_encode

baku.json_encode(value) -> table

bounded fixed-buffer host JSON codec; encode={status,json?,bytes}; decode={status,value?}; null/array helpers preserve tagged round trips; UTF-8 strict, duplicate keys/sparse arrays/cycles/overflow rejected

Argumenty
value
Wynik
encode={status,json?,bytes}; decode={status,value?}; null/array helpers preserve tagged round trips; UTF-8 strict, duplicate keys/sparse arrays/cycles/overflow rejected
Potwierdzenie
host result; gameplay actions preserve canonical result/postcondition

baku.json_decode

baku.json_decode(json: string) -> table

bounded fixed-buffer host JSON codec; encode={status,json?,bytes}; decode={status,value?}; null/array helpers preserve tagged round trips; UTF-8 strict, duplicate keys/sparse arrays/cycles/overflow rejected

Argumenty
json: string
Wynik
encode={status,json?,bytes}; decode={status,value?}; null/array helpers preserve tagged round trips; UTF-8 strict, duplicate keys/sparse arrays/cycles/overflow rejected
Potwierdzenie
host result; gameplay actions preserve canonical result/postcondition

baku.random

baku.random([max]|[min,max])->number

Prywatny RNG VM. random()->[0,1); random(hi)->[1,hi]; random(lo,hi) obsługuje cały signed 64-bit zakres. Nie kryptograficzny.

Argumenty
optional integer bounds
Wynik
number
Potwierdzenie
pure bounded result; no mutation, scheduler or client side effect

baku.random_seed

baku.random_seed(seed)

Sets script-thread utility PRNG seed; no scheduler/client effect.

Argumenty
integer seed
Wynik
no values
Potwierdzenie
Reseeds only the current script VM RNG. Does not affect any other script; VM recreation resets state.

baku.debug_records

debug_records(limit?) -> {status,scope,count,items:array<DebugRecord>}

Own script records from canonical debugger ring, newest first. Does not emit completed logs, clear or expose another script records.

Argumenty
limit?:integer1..32(default16)
Wynik
{status,scope,count,items:array<DebugRecord>}
Potwierdzenie
NONE; read only