Lewati ke konten utama

Warp & Lookup Dunia

client:warp(name, special?)

FieldType
Signature(self: Client, name: string, special: boolean?) → string?
Returnsstring?nil saat sampai Status.IN_WORLD, kode Errors.* kalau gagal
Common errorsErrors.WORLD_FULL, Errors.INVALID_WORLD, Errors.WORLD_NOT_FOUND, Errors.TIMEOUT, Errors.DISCONNECTED, Errors.TUTORIAL_BUSY
Asyncyes

special=true buat dunia instanced (keluarga NETHER/MINES/MINEWORLD). Format "NAME:entryId" join lewat portal entry tertentu.

client:warp("MYWORLD")
client:warp("MYWORLD:portal-id")

client:warpRandom()

FieldType
Signature(self: Client) → string?
Returnsstring? — nama dunia tujuan kalau sukses, nil kalau timeout (12 d)
Asyncyes

client:leave()

FieldType
Signature(self: Client) → string?
Returnsstring?nil kalau sukses
Asyncyes

client:nether(level)

FieldType
Signature(self: Client, level: number) → string?
Returnsstring?nil kalau sukses
Asyncyes

Join dunia instanced NETHER di level yang diminta (0..4).

client:mines(level)

FieldType
Signature(self: Client, level: number) → string?
Returnsstring?nil kalau sukses
Asyncyes

Join dunia instanced MINES di level yang diminta (0..4).

client:enterPortal(point)

FieldType
Signature(self: Client, point: Vec2i) → string?
Returnsstring?nil kalau sukses
Common errorsErrors.NOT_IN_WORLD, Errors.DISCONNECTED
Asyncyes

Masuk lewat portal di point. Portal cross-world dirutekan via warp_to_entry; portal same-world ngirim GoFromPortal.

client:enterTutorial()

FieldType
Signature(self: Client) → string?
Returnsstring?nil kalau sukses
Common errorsErrors.WORLD_NOT_FOUND, Errors.TIMEOUT, Errors.DISCONNECTED
Asyncyes

Drive bootstrap join buat akun guest baru yang belum nyelesaiin tutorial.

client:recentWorlds(timeoutMs?)

FieldType
Signature(self: Client, timeoutMs: number?) → {string}
ReturnsTabel 1-indexed berisi row {name, id, count}. count bisa berupa sentinel — lihat WorldCount
Asyncyes

client:activeWorlds(timeoutMs?)

FieldType
Signature(self: Client, timeoutMs: number?) → {string}
ReturnsTabel 1-indexed berisi row {name, id, count}
Asyncyes

client:worldInfo(name, timeoutMs?)

FieldType
Signature(self: Client, name: string, timeoutMs: number?) → { name: string, count: number }
ReturnsLookup sekali jalan. count bisa salah satu sentinel WorldCount.* ATAU jumlah online beneran (>= 0). nil kalau timeout
Asyncyes

Timeout default ketiganya 3000ms.

local recent = client:recentWorlds() -- terakhir dikunjungi
local active = client:activeWorlds(5000) -- populer, custom timeout
local info = client:worldInfo("MYWORLD") -- lookup sekali jalan

for i, w in ipairs(recent) do
print("{} (id={}) — {} online", w.name, w.id, w.count)
end

if info.count >= 0 and info.count < 50 then
client:warp(info.name)
elseif info.count == WorldCount.doesNotExist then
print("dunia belum ada")
end

WorldCount.doesNotExist -- -3
WorldCount.instanced -- -1

Query world

client:isWalkable(point)

FieldType
Signature(self: Client, point: Vec2i) → boolean
Returnsbooleantrue kalau tile foreground di point itu udara. false buat OOB atau pas world belum di-load
Asyncyes

client:growingTileAt(point)

FieldType
Signature(self: Client, point: Vec2i) → Tree?
ReturnsTree? — metadata tile growing, atau nil kalau nggak ada yang tumbuh
Asyncyes

client:worldItems()

FieldType
Signature(self: Client) → {WorldItemRow}
ReturnsTabel 1-indexed berisi row {x, y, blockType, class, isOpen}. Kosong kalau world belum di-load
Asyncyes

client:findWorldItems(opts?)

FieldType
Signature(self: Client, opts: { class: string?, open: boolean? }?) → {WorldItemRow}
ReturnsVersi worldItems() yang difilter. class itu match substring case-insensitive (misal "Door" dapet WoodenDoorData). open filter berdasarkan state buka/tutup. Filter mana pun bisa dilewatin
Asyncyes

client:portals()

FieldType
Signature(self: Client) → {PortalRow}
ReturnsTabel 1-indexed berisi row {x, y, blockType, class, targetWorld, targetEntry, ownEntry, isOpen}
Asyncyes

client:dumpWorldTiles()

FieldType
Signature(self: Client) → string?
Returnsstring? — dump CSV dari grid tile foreground; string kosong kalau world belum di-load
Asyncyes

Berguna buat ngecek pathfinding yang nyangkut dari skrip.

client:hasItem(blockId, min?)

FieldType
Signature(self: Client, blockId: number, min: number?) → boolean
Returnsbooleantrue kalau bot punya minimal min (default 1) dari blockId
Asyncyes
client:isWalkable(Vector2i.new(5, 3))
client:growingTileAt(Vector2i.new(5, 3))
client:worldItems()
client:findWorldItems({ class = "Lock" })
client:portals()
client:dumpWorldTiles()
client:hasItem(blockId)
client:hasItem(blockId, 5)