--!strict --- A fine scene coordinate with height: 1/128 of a tile per unit. --- --- Differs from `LocalPoint`, which is 2D scene-local with no height at all -- height --- comes separately from `Perspective.getTileHeight`. This carries all three, which is --- what the overlay projection needs. export type FinePoint = { px: number, h: number, pz: number } --- One tile of a [ReachedTile] map, from `reachability():reachabilityMap()`. export type ReachedTile = { --- The tile. tile: WorldPoint, --- Steps from the flood's source. cost: number, --- The tile stepped from to get here; absent at the source. cameFrom: WorldPoint?, } --- One edge of one tile, for `draw:tileEdges`. export type TileEdgeSpec = { --- Which tile the edge belongs to. tile: WorldPoint, --- Which of its four sides. side: TileSide, } --- Which layer `renderOverlay` is drawing. export type DrawLayer = "aboveScene" | "aboveWidgets" | "alwaysOnTop" --- The constants for [DrawLayer]. export type DrawLayerClass = { --- Over the 3D scene, under the interface. ABOVE_SCENE: DrawLayer, --- Over the interface. ABOVE_WIDGETS: DrawLayer, --- Over everything. ALWAYS_ON_TOP: DrawLayer, } --- One side of a tile. export type TileSide = "north" | "east" | "south" | "west" --- The constants for [TileSide]. export type TileSideClass = { --- The tile's northern edge. NORTH: TileSide, --- The tile's eastern edge. EAST: TileSide, --- The tile's southern edge. SOUTH: TileSide, --- The tile's western edge. WEST: TileSide, } --- What an actor is interacting with. export type InteractKind = "none" | "npc" | "player" | "loc" --- The constants for [InteractKind]. export type InteractKindClass = { --- Nothing. NONE: InteractKind, --- An NPC. NPC: InteractKind, --- A player. PLAYER: InteractKind, --- A scenery object. LOC: InteractKind, } --- Which combat style is selected. export type AttackStyle = "melee" | "ranged" | "magic" --- The constants for [AttackStyle]. export type AttackStyleClass = { --- Melee. MELEE: AttackStyle, --- Ranged. RANGED: AttackStyle, --- Magic. MAGIC: AttackStyle, } --- How a webwalk ended, or that it has not. export type WebwalkResult = "running" | "arrived" | "closest" | "failed" --- The constants for [WebwalkResult]. export type WebwalkResultClass = { --- Still walking. RUNNING: WebwalkResult, --- Reached the destination. ARRIVED: WebwalkResult, --- Ended on the nearest tile that can be reached, within 10 tiles of the destination and on --- its plane; nothing reaches the destination. CLOSEST: WebwalkResult, --- Gave up. FAILED: WebwalkResult, } --- Where a world hop has got to. export type WorldHopStage = "idle" | "requested" | "openingSwitcher" | "switching" | "confirming" | "complete" | "failed" --- The constants for [WorldHopStage]. export type WorldHopStageClass = { --- No hop is running. IDLE: WorldHopStage, --- A hop was asked for and has not started. REQUESTED: WorldHopStage, --- Opening the world switcher. OPENING_SWITCHER: WorldHopStage, --- Choosing the world. SWITCHING: WorldHopStage, --- Confirming the switch. CONFIRMING: WorldHopStage, --- The hop finished. COMPLETE: WorldHopStage, --- The hop gave up; `status().error` says why. FAILED: WorldHopStage, } --- Which read failed when PvP danger cannot be decided. export type PvpUnknownReason = "localPlayer" | "worldType" | "areaState" | "combatRange" | "coordinates" --- The constants for [PvpUnknownReason]. export type PvpUnknownReasonClass = { --- The local player could not be read. LOCAL_PLAYER: PvpUnknownReason, --- The world's type is not known yet. WORLD_TYPE: PvpUnknownReason, --- The wilderness/PvP area state could not be read. AREA_STATE: PvpUnknownReason, --- The combat range could not be worked out. COMBAT_RANGE: PvpUnknownReason, --- The player's position could not be read. COORDINATES: PvpUnknownReason, } --- What the looter is doing. export type LootStep = "idle" | "taking" | "dropping" | "openingBag" | "depositingBag" | "alching" | "waiting" --- The constants for [LootStep]. export type LootStepClass = { --- Nothing in progress. IDLE: LootStep, --- Picking an item up. TAKING: LootStep, --- Dropping something to make room. DROPPING: LootStep, --- Opening the looting bag. OPENING_BAG: LootStep, --- Putting loot into the bag. DEPOSITING_BAG: LootStep, --- Casting high alchemy on loot. ALCHING: LootStep, --- Idle on purpose; the reason is a [LootWaitReason]. WAITING: LootStep, } --- What the looter decided to do next. export type LootDecision = "none" | "lootItem" | "dropForSpace" | "depositLootingBag" | "alchItem" | "wait" --- The constants for [LootDecision]. export type LootDecisionClass = { --- Nothing to decide. NONE: LootDecision, --- Take a pile. LOOT_ITEM: LootDecision, --- Drop something to make room. DROP_FOR_SPACE: LootDecision, --- Put loot into the bag. DEPOSIT_LOOTING_BAG: LootDecision, --- Alch a piece of loot. ALCH_ITEM: LootDecision, --- Do nothing this tick. WAIT: LootDecision, } --- Why the looter is idle. export type LootWaitReason = "nothingToLoot" | "inventoryFull" | "limitReached" | "lowValuePaused" | "lootingBagFull" | "moving" | "noOwnership" --- The constants for [LootWaitReason]. export type LootWaitReasonClass = { --- No pile matched. NOTHING_TO_LOOT: LootWaitReason, --- No room, and nothing worth dropping. INVENTORY_FULL: LootWaitReason, --- The configured take limit is hit. LIMIT_REACHED: LootWaitReason, --- Everything left is under the value floor. LOW_VALUE_PAUSED: LootWaitReason, --- The bag will not take more. LOOTING_BAG_FULL: LootWaitReason, --- The player is still walking. MOVING: LootWaitReason, --- The pile is not ours to take yet. NO_OWNERSHIP: LootWaitReason, } --- What the sustain manager is doing. export type SustainStep = "idle" | "consuming" | "waiting" --- The constants for [SustainStep]. export type SustainStepClass = { --- Nothing in progress. IDLE: SustainStep, --- Eating or drinking. CONSUMING: SustainStep, --- Idle on purpose; the reason is a [SustainWaitReason]. WAITING: SustainStep, } --- Why the sustain manager is idle. export type SustainWaitReason = "onCooldown" | "midSwing" | "nothingNeeded" | "noSupplies" --- The constants for [SustainWaitReason]. export type SustainWaitReasonClass = { --- A consume cycle is still counting down. ON_COOLDOWN: SustainWaitReason, --- Consuming now would cost an attack. MID_SWING: SustainWaitReason, --- No threshold fired. NOTHING_NEEDED: SustainWaitReason, --- A threshold fired and the supply is not held. NO_SUPPLIES: SustainWaitReason, } --- Where a restock run has got to. export type RestockStep = "signature" | "openGe" | "offer" | "collect" | "buy" | "risk" | "confirm" | "complete" --- The constants for [RestockStep]. export type RestockStepClass = { --- Working out what the run needs. SIGNATURE: RestockStep, --- Opening the Grand Exchange. OPEN_GE: RestockStep, --- Waiting for a confirmed offer to show in its slot. OFFER: RestockStep, --- Collecting a placed offer. COLLECT: RestockStep, --- Setting an offer up: its item, quantity and price. BUY: RestockStep, --- Checking the coins and the buy limit before confirming. RISK: RestockStep, --- Confirming. CONFIRM: RestockStep, --- The run finished. COMPLETE: RestockStep, } --- Where a bank-loadout run has got to. export type LoadoutStep = "bankClosed" | "serviceModal" | "phaseOneCleanup" | "planInventory" | "executeSchedule" | "ready" --- The constants for [LoadoutStep]. export type LoadoutStepClass = { --- The bank is not open. BANK_CLOSED: LoadoutStep, --- A bank service dialog is in the way. SERVICE_MODAL: LoadoutStep, --- Equipping what is worn, and depositing what the loadout does not want. PHASE_ONE_CLEANUP: LoadoutStep, --- Working out what to withdraw. PLAN_INVENTORY: LoadoutStep, --- Withdrawing and equipping. EXECUTE_SCHEDULE: LoadoutStep, --- The loadout is set. READY: LoadoutStep, } --- A held item a spell needs. export type SpellItem = "bookOfTheDead" | "ibanStaff" | "slayerStaff" | "saradominStaff" | "zamorakStaff" | "guthixStaff" --- The constants for [SpellItem]. export type SpellItemClass = { --- Book of the dead. BOOK_OF_THE_DEAD: SpellItem, --- Iban's staff. IBAN_STAFF: SpellItem, --- A slayer staff. SLAYER_STAFF: SpellItem, --- Saradomin staff. SARADOMIN_STAFF: SpellItem, --- Zamorak staff. ZAMORAK_STAFF: SpellItem, --- Guthix staff. GUTHIX_STAFF: SpellItem, } --- One rune, as a rune cost names it. export type Rune = "air" | "water" | "earth" | "fire" | "mind" | "chaos" | "death" | "blood" | "cosmic" | "nature" | "law" | "soul" | "body" | "astral" | "wrath" | "mist" | "dust" | "mud" | "lava" | "steam" | "smoke" | "sunfire" | "aether" --- The constants for [Rune], and lookups on a rune, as statics over its name. export type RuneClass = { --- Air rune. AIR: Rune, --- Water rune. WATER: Rune, --- Earth rune. EARTH: Rune, --- Fire rune. FIRE: Rune, --- Mind rune. MIND: Rune, --- Chaos rune. CHAOS: Rune, --- Death rune. DEATH: Rune, --- Blood rune. BLOOD: Rune, --- Cosmic rune. COSMIC: Rune, --- Nature rune. NATURE: Rune, --- Law rune. LAW: Rune, --- Soul rune. SOUL: Rune, --- Body rune. BODY: Rune, --- Astral rune. ASTRAL: Rune, --- Wrath rune. WRATH: Rune, --- Mist rune. MIST: Rune, --- Dust rune. DUST: Rune, --- Mud rune. MUD: Rune, --- Lava rune. LAVA: Rune, --- Steam rune. STEAM: Rune, --- Smoke rune. SMOKE: Rune, --- Sunfire rune. SUNFIRE: Rune, --- Aether rune. AETHER: Rune, --- The rune's own item id: `ItemID.AIRRUNE` for `Rune.AIR`. A static, since a `Rune` is its --- name (`"air"`). A staff a spell needs is a `SpellItem`, not a rune. --- --- @param rune A `Rune` constant or a rune's name. itemId: (Rune) -> number, --- Every item id that pays for the rune in a spell's cost: its own item first, then each --- combination rune carrying it, ordered as the `Rune` constants are. It also lists sunfire --- runes for fire and aether runes for soul and cosmic, which the game accepts. --- --- @param rune A `Rune` constant or a rune's name. itemIds: (Rune) -> { number }, --- The rune whose own item an item id is. A combination rune's item answers the combination --- rune (`Rune.fromItemId(ItemID.MISTRUNE) == Rune.MIST`). --- --- @param itemId Any item id. --- @returns `nil` for an item that is no rune. fromItemId: (number) -> Rune?, --- The rune a rune-pouch slot's type varbit (`VarbitID.RUNE_POUCH_TYPE_1` to `_6`) names. --- --- @param value The varbit's value. --- @returns `nil` for 0 or a value that names no rune. fromVarbit: (number) -> Rune?, --- The staves that supply each elemental rune, by rune: a table from `Rune.AIR`, `WATER`, --- `EARTH` and `FIRE` to the item ids of the staves that supply the rune without using any. --- That is the plain, battle and mystic staves, each combination staff carrying it, and the --- ornament steam and lava staves (`*_PRETTY`), which the game treats as their base staff. mainhandProviders: () -> { [Rune]: { number } }, --- The tomes that supply each elemental rune, by rune: a table from `Rune.WATER`, `EARTH` and --- `FIRE` to the item ids of the tomes that supply the rune without using any (fire has two: --- `TOME_OF_FIRE` and the untradeable `BR_TOME_OF_FIRE`). offhandProviders: () -> { [Rune]: { number } }, --- Whether a worn staff or tome supplies the rune. --- --- A static over the rune, since a `Rune` is its name (`"air"`), a string with no methods; a --- `game` argument after the rune is ignored. True when a worn item's name contains "staff" --- and one of the rune's names ("Air", "Smoke", "Mist" and "Dust" for `AIR`, ...), or starts --- with "Tome of", does not end with "(empty", and contains one. The ornament staves count, --- and so does an uncharged tome ("Tome of fire (empty)"); a members staff on a free world --- ("Members object") does not. The combination runes, `SUNFIRE` and `AETHER` are never --- supplied. It reads the worn items, so it raises outside a callback. --- --- @param rune A `Rune` constant or a rune's name. isSuppliedByEquipment: (Rune) -> boolean, } --- The interface tabs, as `Tab` spells them. export type Tab = "combat" | "skills" | "quests" | "inventory" | "equipment" | "prayer" | "magic" | "chatChannel" | "account" | "friends" | "logout" | "settings" | "emotes" | "music" --- The constants for [Tab]. export type TabClass = { --- Combat options. COMBAT: Tab, --- Skills. SKILLS: Tab, --- Quest list. QUESTS: Tab, --- Inventory. INVENTORY: Tab, --- Worn equipment. EQUIPMENT: Tab, --- Prayers. PRAYER: Tab, --- Spellbook. MAGIC: Tab, --- Chat channel. CHAT_CHANNEL: Tab, --- Account management. ACCOUNT: Tab, --- Friends list. FRIENDS: Tab, --- Logout. LOGOUT: Tab, --- Settings. SETTINGS: Tab, --- Emotes. EMOTES: Tab, --- Music player. MUSIC: Tab, } --- Which interface tab is open, and opening one. export type Tabs = { --- The open side-panel tab's name. --- --- @returns `nil` when none is, or it could not be read. current: (Tabs) -> Tab?, --- Open a side-panel tab, by its key or a click on its stone. Does nothing when it is open. --- --- @param tab Which one, e.g. `Tab.INVENTORY`. open: (Tabs, Tab) -> boolean, } --- The rune pouch. export type RunePouch = { --- Whether the pouch is in the inventory. isCarried: (RunePouch) -> boolean, --- What a spell can draw on from the pouch now: empty while no pouch is carried. contents: (RunePouch) -> { { rune: Rune, quantity: number } }, --- The pouch's contents as the game's vars hold them, which stay set while the pouch is --- banked. To ask what a spell can use, read `contents`. storedContents: (RunePouch) -> { { rune: Rune, quantity: number } }, --- Which of `runes` the pouch does not hold enough of, read as `storedContents` is. --- @param runes Each `{ rune, amount }`, at least `amount` of `rune`. --- @returns The runes that are absent or short; empty when it holds them all. missing: (RunePouch, { { rune: Rune, amount: number } }) -> { Rune }, --- One step towards a pouch holding `runes`, with the bank open: open the pouch, empty it --- when it holds a rune the list does not want or has no room for one that it does, withdraw --- all of each missing rune into it, close it. It leaves the bank open. --- --- ```luau --- local status, reason = player:magic():runePouch():fillFromBank({ --- { rune = Rune.LAW, amount = 500 }, --- { rune = Rune.WATER, amount = 1000 }, --- }) --- if status == "blocked" then log:warn(reason) end --- -- "running": a click was queued, call again next tick. "done": it holds them, shut. --- ``` --- --- @param runes Each `{ rune, amount }`, at least `amount` of `rune`. --- @returns `"done"` when the pouch holds them and its bank-side interface is shut, --- `"running"` when a click was queued, and `"blocked"` with the reason when the bank is not --- open, no pouch is carried, or the bank lacks a rune. fillFromBank: (RunePouch, { { rune: Rune, amount: number } }) -> (RunStatus, string?), } --- A farming patch's kind. export type PatchKind = "mushroom" | "hespori" | "allotment" | "herb" | "flower" | "bush" | "fruitTree" | "hops" | "tree" | "hardwoodTree" | "redwood" | "spiritTree" | "anima" | "belladonna" | "cactus" | "coral" | "seaweed" | "calquat" | "celastrus" | "grapes" | "crystalTree" | "compost" | "bigCompost" --- The constants for [PatchKind]. export type PatchKindClass = { --- Morytania's mushroom patch. MUSHROOM: PatchKind, --- The Farming Guild's Hespori patch. HESPORI: PatchKind, --- An allotment. ALLOTMENT: PatchKind, --- A herb patch. HERB: PatchKind, --- A flower patch. FLOWER: PatchKind, --- A bush patch. BUSH: PatchKind, --- A fruit tree patch. FRUIT_TREE: PatchKind, --- A hops patch. HOPS: PatchKind, --- A tree patch. TREE: PatchKind, --- A hardwood tree patch. HARDWOOD_TREE: PatchKind, --- The Farming Guild's redwood patch. REDWOOD: PatchKind, --- A spirit tree patch. SPIRIT_TREE: PatchKind, --- The Farming Guild's anima patch. ANIMA: PatchKind, --- A belladonna patch. BELLADONNA: PatchKind, --- A cactus patch. CACTUS: PatchKind, --- A coral patch (the Great Conch). CORAL: PatchKind, --- A seaweed patch. SEAWEED: PatchKind, --- A calquat patch. CALQUAT: PatchKind, --- The Farming Guild's celastrus patch. CELASTRUS: PatchKind, --- A grape vine (Hosidius). GRAPES: PatchKind, --- Prifddinas' crystal tree patch. CRYSTAL_TREE: PatchKind, --- A compost bin. COMPOST: PatchKind, --- The Farming Guild's big compost bin. BIG_COMPOST: PatchKind, } --- What a farming patch's crop is doing. export type CropState = "harvestable" | "growing" | "diseased" | "dead" | "empty" | "filling" --- The constants for [CropState]. export type CropStateClass = { --- Ready to harvest (or, for a compost bin, to take). HARVESTABLE: CropState, --- Growing (or composting). GROWING: CropState, --- Diseased. DISEASED: CropState, --- Dead. DEAD: CropState, --- An empty compost bin. EMPTY: CropState, --- A compost bin being filled. FILLING: CropState, } --- What a farming patch was treated with. export type CompostState = "compost" | "supercompost" | "ultracompost" --- The constants for [CompostState]. export type CompostStateClass = { --- Compost. COMPOST: CompostState, --- Supercompost. SUPERCOMPOST: CompostState, --- Ultracompost. ULTRACOMPOST: CompostState, } --- How the Farming Guild contract stands. export type FarmingSummary = "completed" | "inProgress" | "occupied" | "empty" | "unknown" --- The constants for [FarmingSummary]. export type FarmingSummaryClass = { --- The contract crop is ready. COMPLETED: FarmingSummary, --- The contract crop is growing, diseased or dead. IN_PROGRESS: FarmingSummary, --- The guild's patch holds another crop. OCCUPIED: FarmingSummary, --- The guild's patch is empty. EMPTY: FarmingSummary, --- Nothing is known. UNKNOWN: FarmingSummary, } --- What a bird house space holds. export type BirdhouseState = "seeded" | "built" | "empty" | "unknown" --- The constants for [BirdhouseState]. export type BirdhouseStateClass = { --- A bird house with seeds in it, catching birds. SEEDED: BirdhouseState, --- A bird house without seeds. BUILT: BirdhouseState, --- No bird house. EMPTY: BirdhouseState, --- A varp value that names no known state. UNKNOWN: BirdhouseState, } --- Which farming patch a status is for. export type FarmingPatchInfo = { --- The patch's kind. kind: PatchKind, --- Its name in its region (`"North"`), `""` for the region's only patch of its kind. name: string, --- The farming region id (`11062` is Catherby's allotments). regionId: number, --- The varbit the game sends its state in. varbit: number, } --- One farming patch as the client last saw it, with its predicted state for now. export type FarmingPatchStatus = { --- The farming region's name (`"Catherby"`). region: string, --- Which patch. patch: FarmingPatchInfo, --- The name of what grows there (`"RANARR"`, `"WEEDS"`). produce: string, --- The crop's state when the client last saw it. state: CropState, --- The growth stage now, predicted from when it was seen; from 0. stage: number, --- How many stages the crop has. stages: number, --- When it is fully grown, Unix ms; nil when no growth is pending (harvestable, diseased, dead, empty). readyAt: number?, --- When the client last saw the patch, Unix ms. seenAt: number, --- The compost the patch was treated with, nil for none. compost: CompostState?, --- Whether a gardener is paid to protect it. protected: boolean, } --- The Farming Guild contract. export type FarmingContract = { --- The name of the produce the guild asks for (`"CABBAGE"`). produce: string, --- How it stands, from the guild's patches. summary: FarmingSummary, --- The guild patch's crop that counts, nil when none does. cropState: CropState?, --- When that crop is ready, Unix ms (0 once it is); nil while none grows. readyAt: number?, } --- How the farming ticks line up with the clock. export type FarmingTickOffset = { --- The longest growth tick the offset was measured on, in minutes. precisionMins: number, --- Minutes the farming ticks are shifted from the clock's tick boundaries. offsetMins: number, } --- The account's farming patches as the client tracks them: saved per account, and read even --- while the time-tracking plugin is off. export type Farming = { --- Every patch the client has seen on this account, with its predicted state now. The --- game sends a patch's state only while the player stands in its region, so a patch not --- visited since the client began tracking is missing. patches: (Farming) -> { FarmingPatchStatus }, --- The Farming Guild contract and how it stands, nil when there is none. contract: (Farming) -> FarmingContract?, --- The farming tick offset the client measured, nil until it has seen a crop grow. tickOffset: (Farming) -> FarmingTickOffset?, } --- What the boat's helm shows: no one can steer, the player is not steering, the player is --- steering, or a crewmate is. export type BoatHelmStatus = "unavailable" | "notSteering" | "steering" | "crewSteering" --- How the boat moves under its sails: stopped, the slowest speed forward, faster, or in --- reverse. export type BoatMotion = "stopped" | "slow" | "fast" | "reversing" --- A boat's customisable part slots. export type BoatPartKind = "keel" | "hull" | "sail" | "sailPattern" | "steering" | "flag" | "trim" | "brazier" --- Which state a facility shows: none read, the crystal extractor's, a wind or gale --- catcher's, or a trawling net's. export type BoatFacilityStateKind = "none" | "crystalExtractor" | "catcher" | "net" --- Where one of the player's boats is: docked, in a bottle, capsized or lost at sea (the --- last two need a shipwright). export type BoatLocationKind = "docked" | "bottled" | "capsized" | "lostAtSea" --- A boat's teleport focus: none, a focus, or a greater focus. export type BoatTeleportFocus = "none" | "focus" | "greater" --- What a crewmate is stationed at; `"hotspot"` is one of the boat's facility hotspots. export type CrewStation = "none" | "sails" | "helm" | "helmAndSails" | "hullRepairs" | "hotspot" --- The crew stat a crewmate's station works by. export type CrewStat = "helmsmanship" | "privateering" | "deckhandiness" --- A port with a gangplank, or an island's mooring point. export type DockKind = "port" | "mooring" --- The rule a dock's disembark area follows: `"ring"`, strictly inside the ring of buoys --- round a port's gangplank; `"reach"`, within 12 tiles of a mooring point, or of the --- gangplank of a port with no ring buoys. export type DockAreaKind = "ring" | "reach" --- A port task's kind. export type PortTaskKind = "courier" | "bounty" --- A Barracuda Trial. export type TrialKind = "temporTantrum" | "jubblyJive" | "gwenithGlide" --- The rank a Barracuda Trial is attempted at. export type TrialRank = "unranked" | "swordfish" | "shark" | "marlin" --- A shipwreck's kind. export type ShipwreckKind = "small" | "fisherman" | "barracuda" | "large" | "pirate" | "mercenary" | "fremennik" | "merchant" --- Where a boat is in the top level. export type BoatPosition = { --- The sea tile it is on. tile: WorldPoint, --- Its fine x in the top level's scene, 128 to a tile. fineX: number, --- Its fine y in the top level's scene, 128 to a tile. fineY: number, } --- Where a boat faces, and where it is turning to. export type BoatHeading = { --- The boat's orientation, 0 to 2047. orientation: number, --- The orientation rounded to the 16 headings a boat sails at, 0 to 15: heading `k` is --- orientation `128 * k`. step: number, --- The orientation the boat is turning to; `orientation` when it is not turning. targetOrientation: number, --- `targetOrientation` rounded to a heading, as `step` is. targetStep: number, } --- A boat's speed stats, as its side panel shows them. export type BoatSpeed = { --- Base speed. base: number, --- Speed cap. cap: number, --- Acceleration. acceleration: number, } --- A wind mote's speed boost. export type BoatSpeedBoost = { --- Whether the boost is on. active: boolean, --- Game ticks until it ends; nil when it is not on, or the client cannot read its timer. ticksLeft: number?, } --- The sails' trim, as the buff panel shows it. export type BoatTrim = { --- Whether the trim window is open: trimming now catches the gust. ready: boolean, --- Game ticks left in the window; nil when it is not open, or the client cannot read it. ticksLeft: number?, --- Whether the sails wait for a gust (not while a speed boost is on). waiting: boolean, --- Game ticks until the gust; nil when not waiting, or the client cannot read it. ticksToGust: number?, } --- A boat's resistances. `fetid`, `crystalFlecked`, `tangledKelp` and `icy` are 0 or 1. export type BoatResistances = { --- Storm resistance. storm: number, --- Rapids resistance. rapids: number, --- Fetid water resistance. fetid: number, --- Crystal-flecked water resistance. crystalFlecked: number, --- Tangled kelp resistance. tangledKelp: number, --- Icy seas resistance. icy: number, --- The crystal helm's resistance. crystalHelm: number, } --- A boat's stats: the sum of its parts' and facilities' stats. export type BoatStats = { --- Maximum hit points. hpMax: number, --- Armour. armour: number, --- Storm resistance. storm: number, --- Rapids resistance. rapids: number, --- The crystal helm's resistance. crystalHelm: number, --- Base speed. baseSpeed: number, --- Speed cap. speedCap: number, --- Acceleration. acceleration: number, --- How many items the cargo hold takes. cargoSize: number, --- Fetid water resistance, 0 or 1. fetid: number, --- Crystal-flecked water resistance, 0 or 1. crystalFlecked: number, --- Tangled kelp resistance, 0 or 1. tangledKelp: number, --- Icy seas resistance, 0 or 1. icy: number, --- The most wind motes the boat holds. maxWindMotes: number, } --- A boat type, from the game's boat table. export type BoatKind = { --- The boat type: 0 raft, 1 skiff, 2 sloop, 3 Will and Anne's boat. typeId: number, --- Its row in the game's boat table. row: number, --- Its name (`"Sloop"`). name: string, --- Its size. size: number, --- How many players it carries. playerCapacity: number, --- How many crewmates it carries. crewCapacity: number, --- The Sailing level it needs. level: number, } --- A part a boat wears. export type BoatPart = { --- Which part slot. kind: BoatPartKind, --- Its row in the part's table. row: number, --- Its name (`"Bronze keel"`). name: string, --- The Sailing level it needs. sailingLevel: number, } --- A facility a boat carries, from the game's facility table. export type BoatFacilityKind = { --- Its row in the facility table. row: number, --- Its name (`"Bronze salvaging hook"`). name: string, --- The facility's type, as the game numbers it. facilityType: number, --- The facility's subtype, as the game numbers it. subtype: number, --- The crew facility a crewmate works it as, as the game numbers it. crewFacility: number, --- The object ids that show the facility on the deck. locs: { number }, } --- A facility's state, from where the game shows it. A field that does not apply to its --- `kind` is nil. export type BoatFacilityState = { --- Which state this is; `"none"` for a facility with no state read (hooks, kegs, --- stations, cannons). kind: BoatFacilityStateKind, --- The crystal extractor or catcher is activated. active: boolean?, --- The activated crystal extractor has a mote to harvest. moteReady: boolean?, --- A trawling net's depth: 0 raised, 1 to 3 lowered. depth: number?, } --- A facility in one of the boarded boat's hotspots. export type BoatFacility = { --- The hotspot, 0 to 12. hotspot: number, --- What the facility is. kind: BoatFacilityKind, --- Whether a player (any, not only you) is at it. occupied: boolean, --- The crewmate stationed at it, nil for none. crewmate: Crewmate?, --- Its state. state: BoatFacilityState, --- Its object on the deck, in the boat's world view, to `interact` with --- (`facility.object:interact("Harvest")`); nil when the deck shows none. Objects pair with --- hotspots in the deck's order, so two hotspots holding the same facility may take each --- other's object, and with it each other's `state`. object: TileObject?, } --- Where one of the player's boats is. export type BoatLocation = { --- Docked, bottled, capsized or lost at sea. kind: BoatLocationKind, --- The dock it is at, when `kind` is `"docked"`. dock: Dock?, } --- A crewmate's kind, from the game's crew table. export type CrewmateKind = { --- The crewmate's id in the crew table. id: number, --- The NPC it is on the deck. boatNpc: number, --- The first NPC it shows as in the cargo hold, -1 for none. cargoNpc: number, --- Helmsmanship: steering and the sails. helmsmanship: number, --- Privateering: cannons. privateering: number, --- Deckhandiness: repairs, hooks, nets, chum and the wind catcher. deckhandiness: number, } --- A crewmate. export type Crewmate = { --- The crew slot, 1 to 5. slot: number, --- Who the crewmate is. kind: CrewmateKind, --- What the crewmate is stationed at. station: CrewStation, --- The hotspot, 0 to 12, when `station` is `"hotspot"`. hotspot: number?, --- The stat the station works by: helmsmanship at the helm and sails, deckhandiness at hull --- repairs, hooks, nets, chum and the wind catchers, privateering at cannons; nil with no --- station, or at a hotspot whose facility cannot be read. stat: CrewStat?, } --- A port or mooring point, from the game's dock table. Where it is (its tile) is not in the --- table. export type Dock = { --- The dock's id, 0 to 60. id: number, --- Its name (`"Port Sarim"`). name: string, --- A port or a mooring point. kind: DockKind, --- The Sailing level it needs. level: number, --- The quest it needs, nil for none. quest: Quest?, --- Its gangplank or mooring object's id, nil when the game has none by the dock's name. object: number?, } --- Where a boat may disembark at a dock (`player:sailing():dockArea(id)`): the tiles the --- boat's tile may be on, `sw` to `ne` inclusive, on plane 0. export type DockArea = { --- The area's south-west corner. sw: WorldPoint, --- The area's north-east corner. ne: WorldPoint, --- The rule it follows. kind: DockAreaKind, } --- A facility a port task names. export type PortTaskFacility = { --- The facility's object id. object: number, --- What the task calls it. name: string, } --- An item and an amount of it, in a port task. export type PortTaskItem = { --- The item id. item: number, --- How many. amount: number, } --- A port task the player has taken. export type PortTask = { --- The task slot, 0 to 4. slot: number, --- The task's id. id: number, --- Its name. name: string, --- A courier or a bounty task. kind: PortTaskKind, --- The Sailing level it needs. level: number, --- The dock it starts at; nil when the game's table leaves it out. starting: Dock?, --- The dock the cargo is collected at; nil when the table leaves it out. cargoPort: Dock?, --- The dock it ends at; nil when the table leaves it out. ending: Dock?, --- Whether it can be cancelled: the task's own setting, else the game's default (it can). cancellable: boolean, --- The facilities the boat must have; empty when the game's table names none (the client's --- copy of the table holds none today). facilitiesRequired: { PortTaskFacility }, --- The facilities the task recommends; empty as `facilitiesRequired` is. facilitiesRecommended: { PortTaskFacility }, --- The item delivered; nil when the game's table names none (the client's copy holds none --- today). deliveryObject: number?, --- The cargo to deliver; nil when there is none. cargo: PortTaskItem?, --- The NPC to defeat in a bounty task. bountyTarget: number?, --- The item a bounty task collects, and how many. bountyObject: PortTaskItem?, --- How much cargo has been taken. taken: number, --- How much cargo has been delivered. delivered: number, } --- The Barracuda Trial the player is in. export type Trial = { --- Which trial. kind: TrialKind, --- The rank attempted. rank: TrialRank, --- How many collectables are still present. remaining: number, --- How many collectables the rank attempted needs; nil when the game's trial table cannot --- be read. total: number?, --- Game ticks since the trial began. ticks: number, } --- A shipwreck object. export type Shipwreck = { --- What wreck it is. kind: ShipwreckKind, --- Whether it has been salvaged empty. depleted: boolean, --- The Sailing level it needs. level: number, } --- The boat the player is on (`player:sailing():boarded()`). Its methods read when called. export type BoardedBoat = { --- The boat's world view id. worldView: (BoardedBoat) -> number, --- Where the boat is now; nil when its position cannot be read. position: (BoardedBoat) -> BoatPosition?, --- The boat's orientation, 0 to 2047; nil when it cannot be read. orientation: (BoardedBoat) -> number?, --- Where the boat faces and where it is turning to; nil when it cannot be read. heading: (BoardedBoat) -> BoatHeading?, --- Whether the server is moving the boat; nil when it cannot be read. moving: (BoardedBoat) -> boolean?, --- Where the boat is moving to, else where it is; nil when it cannot be read. target: (BoardedBoat) -> BoatPosition?, --- Whether the boat is one of the player's own. own: (BoardedBoat) -> boolean, --- The player's boat slot, 1 to 5, while the boat is the player's own; nil otherwise. slot: (BoardedBoat) -> number?, --- The boat type; nil when the client cannot read the game's boat table. kind: (BoardedBoat) -> BoatKind?, --- Whether the player is at the helm. navigating: (BoardedBoat) -> boolean, --- Whether the player is at the sails. atSails: (BoardedBoat) -> boolean, --- What the helm shows. helm: (BoardedBoat) -> BoatHelmStatus, --- How the boat moves under its sails. motion: (BoardedBoat) -> BoatMotion, --- The boat's hit points. hp: (BoardedBoat) -> number, --- The boat's maximum hit points. maxHp: (BoardedBoat) -> number, --- Repair kits aboard. repairKits: (BoardedBoat) -> number, --- Base speed, speed cap and acceleration. speed: (BoardedBoat) -> BoatSpeed, --- The wind mote speed boost. speedBoost: (BoardedBoat) -> BoatSpeedBoost, --- Wind motes held. windMotes: (BoardedBoat) -> number, --- The most wind motes the boat holds. maxWindMotes: (BoardedBoat) -> number, --- Whether the wind catcher is on. windCatcherOn: (BoardedBoat) -> boolean, --- The sails' trim. trim: (BoardedBoat) -> BoatTrim, --- The boat's resistances, as its side panel shows them. resistances: (BoardedBoat) -> BoatResistances, --- How many players are aboard. playersAboard: (BoardedBoat) -> number, --- The game's code for the player's role aboard. role: (BoardedBoat) -> number, --- The parts the boat wears. On a boat that is not the player's own, only the sail, --- steering and hull. parts: (BoardedBoat) -> { BoatPart }, --- The facilities in the boat's hotspots, each with its object on the deck. facilities: (BoardedBoat) -> { BoatFacility }, --- The crew aboard, by slot. crew: (BoardedBoat) -> { Crewmate }, --- The cargo hold's items; nil while the game names no hold. The items are read-only. cargo: (BoardedBoat) -> { ItemHandle }?, } --- One of the player's boats (`player:sailing():boats()`), readable ashore. Its methods read --- when called. export type OwnedBoat = { --- The boat slot, 1 to 5. slot: (OwnedBoat) -> number, --- Whether the slot holds a boat. owned: (OwnedBoat) -> boolean, --- The boat type; nil when the client cannot read the game's boat table. kind: (OwnedBoat) -> BoatKind?, --- The boat's name, its words joined by spaces; nil when none can be read. name: (OwnedBoat) -> string?, --- The parts the boat wears. parts: (OwnedBoat) -> { BoatPart }, --- The boat's teleport focus. teleportFocus: (OwnedBoat) -> BoatTeleportFocus, --- The facilities in the boat's hotspots. facilities: (OwnedBoat) -> { BoatFacilityKind }, --- The boat's stats: the only place its resistances come from while the player is not --- aboard. nil when the client cannot read the game's tables, never a boat of zeros. stats: (OwnedBoat) -> BoatStats?, --- The hit points the boat was left with; nil when none are stored. storedHp: (OwnedBoat) -> number?, --- The maximum hit points the boat was left with; nil when none are stored. storedMaxHp: (OwnedBoat) -> number?, --- Where the boat is; nil when the game names a dock the client cannot read. location: (OwnedBoat) -> BoatLocation?, --- Whether this is the boat in the world now. spawned: (OwnedBoat) -> boolean, --- Where the boat is, while it is the boat in the world and loaded near you; nil otherwise. position: (OwnedBoat) -> BoatPosition?, --- The boat's orientation, 0 to 2047, while it is the boat in the world and loaded near --- you; nil otherwise. orientation: (OwnedBoat) -> number?, --- The cargo hold's items, read-only. Its size is `stats().cargoSize`. cargo: (OwnedBoat) -> { ItemHandle }, } --- Sailing (`player:sailing()`): the boat the player is on, the player's boats, crew, docks, --- port tasks, Barracuda Trials and shipwrecks, read from what the game sets. Reads that need --- the game's tables answer nil or empty off the game thread. export type Sailing = { --- The boat the player is on; nil ashore. boarded: (Sailing) -> BoardedBoat?, --- The player's boats, by slot: the slots that hold one. boats: (Sailing) -> { OwnedBoat }, --- The slot of the player's boat last boarded; nil for none. lastBoarded: (Sailing) -> number?, --- The player's crew, by slot. crew: (Sailing) -> { Crewmate }, --- Every port and mooring point, in the game's table order. docks: (Sailing) -> { Dock }, --- The dock with this id; nil for an id the game does not list. --- @param id The dock's id, 0 to 60. dock: (Sailing, number) -> Dock?, --- The dock a boat at `point` may disembark at: strictly inside the ring of buoys round a --- port's gangplank, else within 12 tiles of a mooring point or of the gangplank of a port --- with no ring buoys. nil away from every dock, or ashore with no point given. --- @param point The boat's tile; the boat the player is on, where the server has it, when --- omitted. dockAt: (Sailing, WorldPoint?) -> number?, --- Where a boat may disembark at a dock; nil for an id no dock has. --- @param id The dock's id, 0 to 60. dockArea: (Sailing, number) -> DockArea?, --- The port tasks the player holds, by slot. portTasks: (Sailing) -> { PortTask }, --- How many port task slots the player has, 1 to 5. portTaskSlots: (Sailing) -> number, --- The Barracuda Trial the player is in; nil outside one. trial: (Sailing) -> Trial?, --- A trial's master state: 0 talk only, 1 can start, 2 none. --- @param kind The trial: `"temporTantrum"`, `"jubblyJive"` or `"gwenithGlide"`. trialMasterState: (Sailing, TrialKind) -> number, --- The player's fastest personal best at a trial, in game ticks, across its ranks; nil --- before any. --- @param kind The trial, e.g. `"jubblyJive"`. trialBest: (Sailing, TrialKind) -> number?, --- The player's personal best at one rank of a trial, in game ticks; nil before any, and --- always for `"unranked"`, which keeps none. --- @param kind The trial, e.g. `"jubblyJive"`. --- @param rank The rank, e.g. `"shark"`. trialRankBest: (Sailing, TrialKind, TrialRank) -> number?, --- The shipwreck an object is, live or depleted; nil for any other object. --- @param id The object's id. shipwreck: (Sailing, number) -> Shipwreck?, --- This plugin's trial pilot, which sails a lap of a Barracuda Trial on the boat the player --- is on. There is one per plugin, and one helm: its `start` stops the plugin's webwalk and --- drops its voyage, and a voyage's or a webwalk's `start` stops it. Raises where --- no plugin's code is running to own it, as `player:webwalk()` does; so does `start`. pilot: (Sailing) -> TrialPilot, --- This plugin's voyage, which sails the boat the player is on through areas to a goal area, its --- click there made for you. There is one per plugin, and one helm: its `start` stops the --- plugin's webwalk and drops its trial pilot, and either of those started drops it. Raises --- where no plugin's code is running to own it, as `player:webwalk()` does; so does `start`. voyage: (Sailing) -> Voyage, } --- A lap for the pilot (`TrialPilot:start`), every part of it your own: plain texts, e.g. read from your --- package (`Asset.text`). The pilot sails nothing it is not given. export type PilotLap = { --- Where everything a lap may do lies, a line each (`#` a comment; a line that starts with any other --- word is yours, and passed over): `start x,y heading` (the boat at rest there, facing heading step --- 0-15: 0 south, 4 west, 8 north, 12 east); `crates x,y ...` (numbered from 1 as given); --- `rapids x,y ...` (each rapid's middle tile, a crossing adding the stacks); --- `click x,y` (a target you click from the boat, by a name of yours); `pools x,y ...` (tiles that --- slow a boat on them unless a boost begun a few moves before protects it); `pickups x,y ...` (passed --- over by the pilot); `portal sw_x,sw_y ne_x,ne_y exit_x,exit_y heading` (a teleport area, and --- where it puts the boat, facing the heading step); `runout ` (ticks the game takes to end a --- sailed lap, the boat kept clear meanwhile; 12 when not given). course: string, --- What is open water: `base x y`, `size w h`, `grid`, then a row a line from `y = base y` up, `#` a --- tile that is not. sea: string, --- The order the lap takes the course's objectives in, words apart: a crate's number, a click's name, --- a portal's name. order: string, --- The planned laps, by the hull's base speed each was planned for (fine units a tick, e.g. `256`): the --- one for the fastest base not above the boat's is sailed. A line a tick: `x y orientation heading` --- (fine units, the move's heading step), and `1` (a trim) or `2` (a wind mote) after it on a tick one --- is clicked for. plans: { [number]: string }, } --- How a pilot's lap stands (`TrialPilot:status()`). --- How a trial pilot's lap stands (`TrialPilot:status()`). export type PilotStatus = { --- `"idle"` no lap since the last `stop()`, `"preparing"` it is taking the helm or opening --- the sail controls, `"sailing"` the lap is being sailed, `"done"` every objective is --- done (the pilot keeps the boat clear of the rocks, by its heading, until the game ends --- the lap), `"failed"` it gave up and un-set the sails, which stays so until the next --- `start` or `stop()`. state: "idle" | "preparing" | "sailing" | "done" | "failed", --- Why it failed, in words. --- @returns `nil` unless `state` is `"failed"`. reason: string?, --- How many of the lap's objectives (its crates, click steps, portals) are still to do; 0 when idle. remaining: number, --- The click step that is next and due (of those you give as `remaining`), by its name in the --- course (`click x,y`), for you to click its target. It is raised on every tick the boat is in reach, and from one move before (you --- read it a tick after the pilot's tick): click on every tick it is raised. --- @returns `nil` while no click step is due. due: string?, --- Lines for your log, new since the last `status()`: the boost the lap started with, each --- heading click with the tick it showed, each trim and each wind mote released. notes: { string }, --- Ticks the boat's heading is held from now as the pilot steers it (0 while it turns): a --- facility worked at the helm that steering would cancel (a crystal extractor's harvest, 4 --- ticks) is worked in them, the pilot asked to `hold`. steady: number, } -- Sails a lap you hand it (`PilotLap`) on the boat the player is on, a game tick at a time: takes -- the helm, opens the sail controls, sets the sails, and every tick follows the planned lap from -- where the boat is through the objectives still to do, steering, trimming the sails when a gust -- comes, releasing wind motes, and going through portals. It navigates; the game's state is -- yours: give it what is still to do every tick (`remaining`), and click each click step's target -- yourself while `status().due` names it. -- `start` returns at once; read `status()` whenever you like. export type TrialPilot = { --- Start a lap. Returns at once; the lap goes on by itself. A lap already under way is --- dropped, whether or not this one starts. --- @param lap The lap: its course, sea, order and planned laps. --- @returns `true` once the lap is started; else `false` and why (a text that does not read, a --- word of the order that is no crate, click or portal of the course, no planned lap). start: (TrialPilot, PilotLap) -> (boolean, string?), --- The lap's objectives still to do, as you read the game: their positions in the lap's --- order, from 1. Give it every tick: the pilot keeps no count of its own, and steers --- through these alone. One left out is done (and stays done for this lap). --- @param positions The positions still to do. remaining: (TrialPilot, { number }) -> (), --- Tell the pilot a lightning strike hit the boat (the game's "A lightning strike reduces --- the speed of the boat!"): its reckoning of the boat's rapid stacks falls as the game's does. lightningStruck: (TrialPilot) -> (), --- Click no heading for the next `ticks` ticks (a facility worked at the helm that steering --- would cancel), unless the boat's next move would put it on rock. hold: (TrialPilot, number) -> (), --- How the lap stands, without advancing it. Its `notes` are handed over once. status: (TrialPilot) -> PilotStatus, --- End the lap and un-set the sails: the boat is not left sailing with nobody steering. --- The button is pressed at once where it can be, and again over the next ticks until the --- boat reads stopped; a boat already at rest gets no click. The status reads `"idle"`. stop: (TrialPilot) -> (), } --- An area of a voyage: the tiles from `sw` to `ne`, inclusive, on `sw`'s plane (a dock's area from --- `Sailing:dockArea` is one), less `notOver`'s. export type VoyageArea = { --- The south-west corner. sw: WorldPoint, --- The north-east corner, on `sw`'s plane. ne: WorldPoint, --- Tiles inside the area the boat is never to be over (an encounter's footprint), corners --- inclusive. `nil`: none. notOver: { sw: WorldPoint, ne: WorldPoint }?, } --- The click a voyage makes in its goal, when the boat's tile after the move it steers is in it: on --- a scene object (`object`, its id, on `tile`), an NPC (`npc`, its index) or an inventory item --- (`item`, its id). An object's or an NPC's waits while the player is busy; an item's does not. export type VoyageClick = { --- The object's id. object: number?, --- The object's tile. tile: WorldPoint?, --- The NPC's index. npc: number?, --- The item's id. item: number?, --- The menu option, e.g. `"Pry-open"`. option: string, } --- How a voyage ends: `"halt"` un-sets the sails so the boat comes to rest in the goal, at the helm; --- `"leaveHelm"` the same by "Stop-navigating", off the helm; `"sailOn"` with a click, once it is --- clicked and the boat reads stopped (the sails come down 2 ticks after the click), and with none, --- on entering the goal with the sails still set. export type VoyageArrival = "halt" | "leaveHelm" | "sailOn" --- Why a voyage gave up. export type VoyageFailure = "NOT_ABOARD" | "CARGO_IN_HAND" | "NO_HELM" | "NO_SAIL_CONTROLS" | "UNREACHABLE" | "STUCK" | "CAPSIZED" --- What `Voyage:start` sails. export type VoyageOptions = { --- Where the voyage ends: the area its click is made in, or the boat comes to rest in. goal: VoyageArea, --- Areas to pass through on the way, in order (each met when a tick ends with the boat's tile --- in it); at most 64. `nil`: none. through: { VoyageArea }?, --- The click made in the goal. `nil`: none. click: VoyageClick?, --- How it ends; `nil` for `"halt"`. arrival: VoyageArrival?, --- The way to the goal past the loaded scene, the boat's end first (a webwalk's tiles); at most --- 4096. `nil`: the scene's own sea. route: { WorldPoint }?, --- Keep the wind motes for you to release; `nil` or `false`: the pilot keeps them for the fetid pools, releasing one as --- its way runs onto a pool unprotected, and one at once whenever a catcher is full (a full one holds the wind). holdMotes: boolean?, } --- How a voyage stands (`Voyage:status()`). export type VoyageStatus = { --- `"idle"` no voyage since the last `stop()`, `"preparing"` it is taking the helm or opening --- the sail controls, `"sailing"` under way, `"arrived"` there as its arrival says, `"failed"` it --- gave up and un-set the sails, which stays so until the next `start` or `stop()`. state: "idle" | "preparing" | "sailing" | "arrived" | "failed", --- Why it failed. --- @returns `nil` unless `state` is `"failed"`. failure: VoyageFailure?, --- The failure in words. --- @returns `nil` unless `state` is `"failed"`. reason: string?, --- The game tick the goal's click last went out. --- @returns `nil` before the click, and after a `missed()`. clicked: number?, --- The boat's tile is in the goal. inArea: boolean, --- How many of the areas to pass through are met. passed: number, --- Lines for your log, new since the last `status()`. notes: { string }, } -- Sails the boat the player is on through areas to a goal area, a game tick at a time, with the -- boat's own turning, speed, coast and half sails: takes the helm, opens the sail controls, sets the -- sails, steers round what is solid, gives a charter ship on its way room till it has sailed on, -- keeps clear of a sea creature's reach and a lightning cloud about to strike, sails through strong -- winds near its way when that costs little, trims the sails when a gust comes, makes its click in -- the goal and ends as its arrival says. -- Near a goal it makes no way toward it sails the rest at half sails; one no tile of which the -- boat's hull lies in fails at once. `start` returns at once; read `status()` whenever you like. export type Voyage = { --- Start a voyage. Returns at once; the voyage goes on by itself. One already under way is --- dropped. Raises for options it cannot read. --- @param options What to sail. --- @returns `true` once the voyage is started. start: (Voyage, VoyageOptions) -> (boolean, string?), --- Tell the voyage the game showed its click done (the game's word): it arrives as its arrival --- says. Nothing with no voyage started. done: (Voyage) -> (), --- Tell the voyage the game refused its click ("I can't reach that!"): its goal is a tile --- tighter and the boat comes round for it, three times at the most, then it fails --- `"UNREACHABLE"`. missed: (Voyage) -> (), --- Whether it wants the ticks the host gives it: under way, awaiting the game's word, or --- un-setting the sails after a stop or a failure. isSailing: (Voyage) -> boolean, --- How the voyage stands, without advancing it. Its `notes` are handed over once. status: (Voyage) -> VoyageStatus, --- End the voyage and un-set the sails: the boat is not left sailing with nobody steering. The --- button is pressed at once where it can be, and again over the next ticks until the boat reads --- stopped. The status reads `"idle"`. stop: (Voyage) -> (), } --- One bird house space on Fossil Island as the client last saw it. export type BirdhouseStatus = { --- The space's name (`"MEADOW_NORTH"`). space: string, --- The name of the bird house built there (`"OAK"`), nil when none is. kind: string?, --- What the space holds. state: BirdhouseState, --- When the birds are caught, Unix ms: 50 minutes after it was seeded; nil unless seeded. readyAt: number?, --- The space's varp value as the client last saw it. varp: number, --- When the client saw that value appear, Unix ms. placedAt: number, } --- How many charges an item has, and how the client knows (`player:charges()`). export type Charges = { --- The count: doses, teleports, uses. charges: number, --- `true` when the item id says it (a potion's doses, a games necklace's 8); --- `false` for a count the client tracked from the game's messages. fixed: boolean, --- A tracked count's last observation, Unix milliseconds: 0 when its time is not known. --- `nil` for a fixed count. seenAt: number?, --- Whether a tracked count was set this session, so the client has seen every --- change since. `nil` for a fixed count. live: boolean?, } --- Item charges: jewellery, the chronicle, the ring of endurance and the like. The client --- tracks them whether or not a plugin is on and saves them per account. Items of one kind --- share a count (every explorer's ring has the one). export type ItemCharges = { --- One item's charges. --- @param itemId The item id. --- @returns `nil` when the client knows none: not a charged item, or a counted --- one whose count has never been seen. of: (ItemCharges, number) -> Charges?, } --- Which typed-input box a dialogue is asking for. export type TypedInputKind = "amount" --- The constants for [TypedInputKind]. export type TypedInputKindClass = { --- The bank/Grand Exchange "Enter amount" box. AMOUNT: TypedInputKind, } --- Which container an item came out of. export type ItemSource = "inventory" | "worn" | "bank" | "other" --- The constants for [ItemSource]. export type ItemSourceClass = { --- The player's inventory. INVENTORY: ItemSource, --- Worn equipment. WORN: ItemSource, --- The bank. BANK: ItemSource, --- A read-only container using none of the three interaction encodings -- --- the seed vault or a shared bank, say. OTHER: ItemSource, } --- Where a world is hosted. export type WorldRegionCode = "US" | "GB" | "AU" | "DE" | "BR" | "JP" | "SG" | "ZA" --- A kind of world, as `world:hasType` and `WorldQuery:hasType` ask about it. export type WorldTypeName = "members" | "pvp" | "bounty" | "pvpArena" | "skillTotal" | "questSpeedrunning" | "highRisk" | "hardcore" | "lastManStanding" | "beta" | "legacyOnly" | "eocOnly" | "noSave" | "tournament" | "freshStart" | "deadman" | "seasonal" export type WorldInfo = { --- The world number. id: number, --- The world's hostname. address: string, --- The activity label the directory shows, e.g. a minigame's name. activity: string, --- How many players the directory last reported. players: number, --- Whether the world is up. online: boolean, --- Whether it is a members world. members: boolean, --- The country the world is hosted in; `"??"` for a location this client does not know. region: WorldRegionCode | "??", } export type WorldLocationInfo = { --- The datacenter's code, such as `"US-E"` or `"GB"`. code: string, --- The country's name. name: string, --- The country the datacenter is in; `"??"` for a location this client does not know. region: WorldRegionCode | "??", } export type WorldPing = { --- Round-trip time in milliseconds. --- @returns `nil` when the measurement failed. latencyMs: number?, } --- A narrowing NPC query, from `scene:npcs()`. --- --- A query reads the scene ONCE and narrows the rows in the host, so the whole chain crosses --- into Luau a single time, at its own terminal: --- --- ```luau --- local weak = scene:npcs():within(8):combatLevelBelow(50):collect() --- ``` --- --- There is deliberately no `filter` taking a Luau function: it would call back --- into the VM once per candidate, inside a native loop where the callback --- deadline cannot fire. For an arbitrary predicate, `collect()` and filter the --- returned table -- one crossing for the whole set instead of one per row. --- --- The terminals CONSUME the query -- it owns the rows it narrowed -- so calling --- a second one raises rather than silently re-reading the scene. Open another --- with `scene:npcs()`. export type NPCQuery = { --- Keep only those whose whole name matches, ignoring case and markup: `|` separates --- alternatives and `*` is any run of characters, so `"Goblin"` is not a Hobgoblin and --- `"Guard|*goblin"` is a guard, a goblin and a Hobgoblin. --- Alternative to walking the NPCs with an `if` on each `getName()` to find the ones --- of a name each tick: the host narrows the scene by name, one crossing for the set. --- @param names The name pattern. named: (NPCQuery, string) -> NPCQuery, --- Keep only those whose name contains the text, ignoring case and markup: `|` separates --- alternatives, so `"goblin"` is a Goblin and a Hobgoblin. --- @param text The text to look for. containing: (NPCQuery, string) -> NPCQuery, --- Keep only these ids. --- @param ids The ids to keep. ids: (NPCQuery, { number }) -> NPCQuery, --- Keep only those within a radius of the local player. --- @param radius Chebyshev distance in tiles. within: (NPCQuery, number) -> NPCQuery, --- Keep only those inside an area. --- @param area The area to stay inside. withinArea: (NPCQuery, WorldArea) -> NPCQuery, --- Keep only those a walk of at most `steps` reaches from the local player. --- @param steps The longest path to allow. withinPath: (NPCQuery, number) -> NPCQuery, --- Keep only those above a combat level. --- @param min The level to beat. combatLevelAbove: (NPCQuery, number) -> NPCQuery, --- Keep only those below a combat level. --- @param max The level to stay under. combatLevelBelow: (NPCQuery, number) -> NPCQuery, --- Keep only those between two combat levels, both ends included. --- @param low The lowest level to keep. --- @param high The highest level to keep. combatLevelBetween: (NPCQuery, number, number) -> NPCQuery, --- Keep only those the local player can walk to. reachable: (NPCQuery) -> NPCQuery, --- Keep only those the local player can act on right now: a tile beside the NPC's --- footprint, on any side, can be walked to. interactable: (NPCQuery) -> NPCQuery, --- Keep only those actable from within a range of their footprint. --- @param range How far away to allow, in tiles. --- @param requireLineOfSight Whether the line of sight must be clear. interactableWithin: (NPCQuery, number, boolean) -> NPCQuery, --- Drop an NPC -- the one already being fought, say -- or several. Takes the handles, not --- ids: an id is not unique in a scene full of the same monster. --- @param npcs The NPC or NPCs to leave out. exclude: (NPCQuery, NPC | { NPC }) -> NPCQuery, --- Keep only those with a clear line of sight to the local player. hasLineOfSight: (NPCQuery) -> NPCQuery, --- How many survived the narrowing. Consumes the query. count: (NPCQuery) -> number, --- The nearest survivor. Consumes the query. --- @returns `nil` when none survived. nearest: (NPCQuery) -> NPC?, --- Every survivor, nearest first. Consumes the query. collect: (NPCQuery) -> { NPC }, } --- A narrowing query over the other players in the scene, from `scene:players()`. The local --- player is never among them: `client:getLocalPlayer()` is that handle. --- --- A query reads the scene ONCE and narrows the rows in the host, so the whole chain crosses --- into Luau a single time, at its own terminal: --- --- ```luau --- local rivals = scene:players():within(10):interactable():collect() --- ``` --- --- There is deliberately no `filter` taking a Luau function: it would call back --- into the VM once per candidate, inside a native loop where the callback --- deadline cannot fire. For an arbitrary predicate, `collect()` and filter the --- returned table -- one crossing for the whole set instead of one per row. --- --- The terminals CONSUME the query -- it owns the rows it narrowed -- so calling --- a second one raises rather than silently re-reading the scene. Open another --- with `scene:players()`. export type PlayerQuery = { --- Keep only those whose whole name matches, ignoring case and markup: `|` separates --- alternatives and `*` is any run of characters. --- @param names The name pattern. named: (PlayerQuery, string) -> PlayerQuery, --- Keep only those whose name contains the text, ignoring case and markup: `|` separates --- alternatives. --- @param text The text to look for. containing: (PlayerQuery, string) -> PlayerQuery, --- Keep only those within a radius of the local player. --- @param radius Chebyshev distance in tiles. within: (PlayerQuery, number) -> PlayerQuery, --- Keep only those inside an area. --- @param area The area to stay inside. withinArea: (PlayerQuery, WorldArea) -> PlayerQuery, --- Keep only those a walk of at most `steps` reaches from the local player. --- @param steps The longest path to allow. withinPath: (PlayerQuery, number) -> PlayerQuery, --- Keep only those the local player can walk to. reachable: (PlayerQuery) -> PlayerQuery, --- Keep only those the local player can act on right now. interactable: (PlayerQuery) -> PlayerQuery, --- Keep only those actable from within a range. --- @param range How far away to allow, in tiles. --- @param requireLineOfSight Whether the line of sight must be clear. interactableWithin: (PlayerQuery, number, boolean) -> PlayerQuery, --- Keep only those with a clear line of sight to the local player. hasLineOfSight: (PlayerQuery) -> PlayerQuery, --- How many survived the narrowing. Consumes the query. count: (PlayerQuery) -> number, --- The nearest survivor. Consumes the query. --- @returns `nil` when none survived. nearest: (PlayerQuery) -> Player?, --- Every survivor, nearest first. Consumes the query. collect: (PlayerQuery) -> { Player }, } --- A narrowing scene object query, from `scene:objects()`. --- --- A query reads the scene ONCE and narrows the rows in the host, so the whole chain crosses --- into Luau a single time, at its own terminal: --- --- ```luau --- local bank = scene:objects():named("Bank booth"):interactable():nearest() --- ``` --- --- There is deliberately no `filter` taking a Luau function: it would call back --- into the VM once per candidate, inside a native loop where the callback --- deadline cannot fire. For an arbitrary predicate, `collect()` and filter the --- returned table -- one crossing for the whole set instead of one per row. --- --- The terminals CONSUME the query -- it owns the rows it narrowed -- so calling --- a second one raises rather than silently re-reading the scene. Open another --- with `scene:objects()`. export type ObjectQuery = { --- Keep only those whose whole name matches, ignoring case and markup: `|` separates --- alternatives and `*` is any run of characters. --- @param names The name pattern. named: (ObjectQuery, string) -> ObjectQuery, --- Keep only those whose name contains the text, ignoring case and markup: `|` separates --- alternatives. --- @param text The text to look for. containing: (ObjectQuery, string) -> ObjectQuery, --- Keep only these ids. --- @param ids The ids to keep. ids: (ObjectQuery, { number }) -> ObjectQuery, --- Keep only those whose definition offers one of `actions`: an option or a list of --- them, each matched whole, in any case and with markup ignored (`"open"` keeps an --- `Open` door, not an `Open-gate` one). --- --- `scene:objects():named(name):hasAction(action):nearest()`, then `interact(action)` on it --- when it is not `nil`, clicks the nearest object of that name whose definition offers --- `action`, found in one host crossing. `named` splits `|` alternatives, and objects at the --- same distance keep the scan order. --- --- `ids(ids):hasAction(actions):nearest()` (`named(table.concat(names, "|"))` for names), --- then `interact` with the first of `actions` its definition offers --- (`client:getObjectDefinition(o:getId()):getActions()`), clicks the nearest object of any --- listed id offering any listed action. --- --- @param actions An option, or a list of options. hasAction: (ObjectQuery, string | { string }) -> ObjectQuery, --- Keep only those within a radius of the local player. --- @param radius Chebyshev distance in tiles. within: (ObjectQuery, number) -> ObjectQuery, --- Keep only those inside an area. --- @param area The area to stay inside. withinArea: (ObjectQuery, WorldArea) -> ObjectQuery, --- Keep only those the local player can act on right now. interactable: (ObjectQuery) -> ObjectQuery, --- Keep only those actable from within a range. --- @param range How far away to allow, in tiles. --- @param requireLineOfSight Whether the line of sight must be clear. interactableWithin: (ObjectQuery, number, boolean) -> ObjectQuery, --- How many survived the narrowing. Consumes the query. count: (ObjectQuery) -> number, --- The nearest survivor. Consumes the query. --- @returns `nil` when none survived. nearest: (ObjectQuery) -> TileObject?, --- Every survivor, nearest first. Consumes the query. collect: (ObjectQuery) -> { TileObject }, } --- A narrowing floor item query, from `scene:groundItems()`. --- --- A query reads the scene ONCE and narrows the rows in the host, so the whole chain crosses --- into Luau a single time, at its own terminal: --- --- ```luau --- local loot = scene:groundItems():within(12):stackValueAtLeast(5000):lootable():collect() --- ``` --- --- There is deliberately no `filter` taking a Luau function: it would call back --- into the VM once per candidate, inside a native loop where the callback --- deadline cannot fire. For an arbitrary predicate, `collect()` and filter the --- returned table -- one crossing for the whole set instead of one per row. --- --- The terminals CONSUME the query -- it owns the rows it narrowed -- so calling --- a second one raises rather than silently re-reading the scene. Open another --- with `scene:groundItems()`. export type GroundItemQuery = { --- Keep only those whose whole item name matches, ignoring case and markup: `|` separates --- alternatives and `*` is any run of characters. --- @param names The name pattern. named: (GroundItemQuery, string) -> GroundItemQuery, --- Keep only those whose item name contains the text, ignoring case and markup: `|` separates --- alternatives. --- @param text The text to look for. containing: (GroundItemQuery, string) -> GroundItemQuery, --- Keep only these ids. A noted id and its unnoted id are the same item here. --- @param ids The ids to keep. ids: (GroundItemQuery, { number }) -> GroundItemQuery, --- Keep only those within a radius of the local player. --- @param radius Chebyshev distance in tiles. within: (GroundItemQuery, number) -> GroundItemQuery, --- Keep only those inside an area. --- @param area The area to stay inside. withinArea: (GroundItemQuery, WorldArea) -> GroundItemQuery, --- Keep only those the local player can walk to. reachable: (GroundItemQuery) -> GroundItemQuery, --- Keep only piles whose ONE item is worth at least this at Grand Exchange price, a noted --- pile as the item it notes. --- @param coins The lowest unit price to keep. unitGeValueAtLeast: (GroundItemQuery, number) -> GroundItemQuery, --- Keep only piles whose ONE item alchs for at least this, a noted pile as the item it --- notes. --- @param coins The lowest unit high alchemy value to keep. unitAlchValueAtLeast: (GroundItemQuery, number) -> GroundItemQuery, --- Keep only piles worth at least this whole: price times quantity, coins at 1 each and --- platinum tokens at 1,000. --- --- ```luau --- local stack = scene:groundItems():within(10):stackValueAtLeast(5000):lootable():nearest() --- if stack then stack:interact("Take") end --- ``` --- @param coins The lowest stack value to keep. stackValueAtLeast: (GroundItemQuery, number) -> GroundItemQuery, --- Keep the stacks nobody else owns: the player's, unowned and group stacks --- (`item:getOwnership() ~= TileItem.OWNERSHIP_OTHER`). --- --- `scene:groundItems():ids(ids):within(dist)`, then `:mine()` for stacks nobody else --- owns or `:lootable()` for stacks the player may pick up, then `:collect()`, nearest first. --- Stacks at the same distance keep the scan order. mine: (GroundItemQuery) -> GroundItemQuery, --- Keep the stacks the player may pick up: `mine` ones, or every stack when --- the account is not an ironman. --- --- Then `:nearest()` and `interact("Take")` take that stack (its id and its tile). Stacks at --- the same distance keep the scan order. lootable: (GroundItemQuery) -> GroundItemQuery, --- How many survived the narrowing. Consumes the query. count: (GroundItemQuery) -> number, --- The nearest survivor. Consumes the query. --- @returns `nil` when none survived. nearest: (GroundItemQuery) -> TileItem?, --- Every survivor, nearest first. Consumes the query. collect: (GroundItemQuery) -> { TileItem }, } -- Pathing over the loaded scene, from `scene:reachability()`. All of it -- is computed from collision data, so nothing here causes input. export type Reachability = { --- Every tile within a step budget of the local player. --- @param cost Maximum path length in steps. tilesWithinCost: (Reachability, number) -> { WorldPoint }, --- Whether a tile can be walked to from where the player stands. --- @param tile The destination. reachable: (Reachability, WorldPoint) -> boolean, --- The tile the flood was run from. --- --- A handle outlives the call that made it, and `reachabilityFrom` can seed --- one somewhere other than the player, so "reachable from where?" is not --- answerable without this. source: (Reachability) -> WorldPoint, --- Step cost to a tile. --- @param tile Where to. --- @returns `nil` when the tile cannot be reached. pathLength: (Reachability, WorldPoint) -> number?, --- The full walk to a tile. --- @param tile Where to. --- @returns An empty array when the tile cannot be reached. pathTo: (Reachability, WorldPoint) -> { WorldPoint }, --- Every tile at EXACTLY this step cost -- the ring. `tilesWithinCost` is --- the disc. --- @param cost The step cost to match. tilesAtCost: (Reachability, number) -> { WorldPoint }, --- Every reachable tile touching an area -- the tiles to stand on to use it. --- @param area The area to stand next to. reachableAdjacentTiles: (Reachability, WorldArea) -> { WorldPoint }, --- The walk to a tile that fronts an area. --- @param area The area to walk up to. --- @returns An empty array when nothing fronting it can be reached. pathToArea: (Reachability, WorldArea) -> { WorldPoint }, --- Step cost to the nearest tile that fronts an area. --- @param area The area to measure to. --- @returns `nil` when nothing fronting it can be reached. pathLengthToArea: (Reachability, WorldArea) -> number?, --- A tile to stand on to attack an area from within a range. --- @param area The target's footprint. --- @param range How far away, in tiles. --- @param requireLineOfSight Whether the line of sight must be clear. --- @returns `nil` when no such tile is reachable. reachableTileWithinRange: (Reachability, WorldArea, number, boolean) -> WorldPoint?, --- Whether a tile is one of `reachableAdjacentTiles(area)`: the flood reached it, and it --- touches the area across no wall. Standing there is enough to act on the area, with no --- line of sight asked; `seesArea` is the other way to act on one. --- @param from The tile to stand on. --- @param area The target's footprint. frontsArea: (Reachability, WorldPoint, WorldArea) -> boolean, --- Whether a tile has a clear line of sight to an area. --- @param from The tile to stand on. --- @param area The target's footprint. seesArea: (Reachability, WorldPoint, WorldArea) -> boolean, --- Whether one step between adjacent tiles is legal. --- @param from The tile stepped off. --- @param to The adjacent tile stepped onto. canStep: (Reachability, WorldPoint, WorldPoint) -> boolean, --- Whether one tile can see another. --- @param from The looking tile. --- @param to The looked-at tile. hasLineOfSight: (Reachability, WorldPoint, WorldPoint) -> boolean, --- The walk toward a tile: the path to it, or when it cannot be reached the path to the --- closest tile the flood did reach. `pathTo` is the one that answers empty instead. --- --- ```luau --- local path = scene:reachability():pathToward(tile) --- local stop = path[#path] --- ``` --- @param tile The destination. --- @returns An empty array off the flood's plane, or with nothing reached. pathToward: (Reachability, WorldPoint) -> { WorldPoint }, --- The whole flood: every reached tile, its step cost, and the tile it was --- stepped from. --- --- This is what a reachability map is -- costs and came-froms from the --- source. Cost and came-from are what the flood computes, and what a caller --- cannot recover afterwards without searching again. --- --- One call, because the alternative is a `pathLength` and a `cameFrom` per --- tile and a scene flood is thousands of them. reachabilityMap: (Reachability) -> { ReachedTile }, --- The tile stepped from to reach one tile, for walking a path back --- without holding the whole map. --- @param tile Where to. --- @returns `nil` at the source, or when the tile is unreachable. cameFrom: (Reachability, WorldPoint) -> WorldPoint?, --- Every tile within a radius that an origin can see. --- @param origin Where to look from. --- @param radius How far out, in tiles. tilesInSight: (Reachability, WorldPoint, number) -> { WorldPoint }, } -- A projected screen position, from the `worldToScreen*` family. -- -- Opaque: it is handed straight back to a draw call and has no fields to -- read. --- An opaque projected anchor, from `draw:worldToScreen` and friends. --- --- It has no fields on purpose: it wraps a fine-space `(px, height, pz)` --- vertex that the renderer projects at draw time, NOT a canvas x/y. --- --- The only thing to do with one is hand it back to a draw call. export type ScreenAnchor = {} -- Drawing baked by `Draw.record`, to be handed back to `Draw.replay`. -- -- Opaque: it has no fields, and is only useful as the argument to `replay`. export type PrimBuffer = {} --- Drawing over the game, handed to `renderOverlay`. --- --- Every tile here is a `WorldPoint`. A tile outside the loaded scene draws nothing, and --- `worldToScreen` of one answers `nil`. --- --- ```luau --- function plugin:renderOverlay(draw, layer) --- if layer ~= DrawLayer.ABOVE_SCENE then return end --- local here = player:tile() --- draw:tilePoly(here, Color.YELLOW, Color.new(255, 255, 0, 40)) --- local label = draw:worldToScreen(here, 120) --- if label then draw:renderText(label, "me", Color.WHITE) end --- end --- ``` export type Draw = { --- Text at a canvas position, its top-left corner at (`x`, `y`): `y` is the top edge --- of the text, not its baseline. --- @param x Canvas x of the text's left edge. --- @param y Canvas y of the text's top edge. --- @param text What to draw. --- @param color The text colour. screenText: (Draw, number, number, string, Color) -> (), --- A line between two canvas positions. --- @param x1 Start x. --- @param y1 Start y. --- @param x2 End x. --- @param y2 End y. --- @param color The line colour. --- @param thickness Line width in pixels. screenLine: (Draw, number, number, number, number, Color, number) -> (), --- A rectangle outline in canvas space. --- @param x Left. --- @param y Top. --- @param width Width. --- @param height Height. --- @param color The outline colour. screenRect: (Draw, number, number, number, number, Color) -> (), --- A filled rectangle in canvas space. --- @param x Left. --- @param y Top. --- @param width Width. --- @param height Height. --- @param color The fill colour. screenRectFilled: (Draw, number, number, number, number, Color) -> (), --- A tile's outline and fill on the ground. --- @param tile The tile. --- @param stroke Outline colour. --- @param fill Fill colour; a zero alpha draws no fill. tilePoly: (Draw, WorldPoint, Color, Color) -> (), --- Text centred on a tile. --- @param tile The tile. --- @param text What to draw. --- @param color The text colour. textAtWorld: (Draw, WorldPoint, string, Color) -> (), --- A line between two tiles' centres. Both have to be in the loaded scene. --- @param from Start tile. --- @param to End tile. --- @param color The line colour. --- @param thickness Line width in pixels. Defaults to 1.5. lineWorld: (Draw, WorldPoint, WorldPoint, Color, number?) -> (), --- A line between two sub-tile points, for edges and corners. --- @param from Start, in fine scene coordinates. --- @param to End, in fine scene coordinates. --- @param color The line colour. --- @param thickness Line width in pixels. lineWorldFine: (Draw, FinePoint, FinePoint, Color, number) -> (), --- Text centred on a projected point. --- @param at A point from `worldToScreen`. --- @param text What to draw. --- @param color The text colour. --- @param liftPixels Pixels above the point, so several labels on one entity do not --- overlap. Defaults to 0. renderText: (Draw, ScreenAnchor, string, Color, number?) -> (), --- An arrow between two projected points. --- @param from A point from `worldToScreen`. --- @param to A point from `worldToScreen`. --- @param color The arrow colour. --- @param thickness Line width in pixels. --- @param headAtStart Draw a head at the start. --- @param headAtEnd Draw a head at the end. worldArrow: (Draw, ScreenAnchor, ScreenAnchor, Color, number, boolean, boolean) -> (), --- A point to hand `renderText` or `worldArrow`. Whether it is on screen is decided when --- it is drawn, so it stays on its tile as the camera turns. --- @param tile The tile. --- @param raise How far above the ground, in fine units. Defaults to 0. --- @returns `nil` when logged out, or the tile is outside the loaded scene. worldToScreen: (Draw, WorldPoint, number?) -> ScreenAnchor?, --- `worldToScreen` of a sub-tile point. --- @param px Fine x. --- @param height Height above the ground. --- @param pz Fine z. --- @returns `nil` when logged out. worldToScreenFine: (Draw, number, number, number) -> ScreenAnchor?, --- `worldToScreen` of the centre of a multi-tile footprint, so a label sits on the --- middle of a big NPC rather than its corner. --- @param tile The south-west tile. --- @param width Footprint width in tiles. --- @param height Footprint height in tiles. --- @param raise How far above the ground, in fine units. Defaults to 0. --- @returns `nil` when logged out, or the tile is outside the loaded scene. worldToScreenArea: (Draw, WorldPoint, number, number, number?) -> ScreenAnchor?, --- A tile's four ground corners, for drawing edges rather than the whole --- tile. --- @param tile The tile. --- @returns Corners south-west, south-east, north-east, north-west, or --- `nil` when logged out, or the tile is outside the loaded scene. tileCorners: (Draw, WorldPoint) -> { FinePoint }?, --- Fill many tiles in one call. --- @param tiles The tiles. --- @param stroke Outline colour. --- @param fill Fill colour. fillTiles: (Draw, { WorldPoint }, Color, Color) -> (), --- Draw individual tile edges -- walls, collision boundaries, the outline --- of a region -- in one call. --- @param edges Entries of `{ tile = WorldPoint, side = TileSide }`. --- @param color The line colour. --- @param thickness Line width in pixels. tileEdges: (Draw, { TileEdgeSpec }, Color, number) -> (), --- Draw into a HUD panel pinned to a screen corner, laid out so it does not overlap --- infoboxes or other panels. Coordinates in the body are the panel's own. --- --- Inside `record` or another `hudBlock` this draws nothing: a panel has to be drawn --- straight from the frame's own `draw`. --- @param corner Which corner. Another string raises. --- @param width Panel width. --- @param height Panel height. --- @param priority Its order against other blocks. Another string raises. --- @param body Called immediately, with the panel's own `draw`. hudBlock: (Draw, "top_left" | "top_right" | "bottom_left" | "bottom_right", number, number, "low" | "normal" | "high", (Draw) -> ()) -> (), --- Bake drawing into a buffer that can be replayed. --- --- Geometry that only changes on a game tick costs a lot to rebuild every --- frame. Record it once and `replay` it until it changes. Text drawn in the body is --- dropped: a buffer holds geometry only. --- @param body Called immediately, with a recording `draw`. record: (Draw, (Draw) -> ()) -> PrimBuffer, --- Draw a recorded buffer again. --- @param buffer A buffer from `record`. replay: (Draw, PrimBuffer) -> (), } -- ---- Panel options ------------------------------------------------------------- -- -- Swing configures a component with setters; a Panel control takes the same -- settings as a trailing options table, every pass. Each option names the -- Swing setter it stands for. --- The three RS fonts, by name: `FontManager.getRunescapeFont()`, --- `getRunescapeSmallFont()` and `getRunescapeBoldFont()`. export type PanelFontFamily = "runescape" | "runescape_small" | "runescape_bold" --- A text colour: a `Color`, or one of the theme's three tokens. export type PanelColor = Color | "muted" | "accent" | "header" --- The icons `panel:iconButton` draws. export type PanelIconName = "Dashboard" | "Accounts" | "Marketplace" | "Data" | "Settings" | "Mouse" | "Plugins" | "User" | "Gear" | "Wrench" | "Chart" | "Bank" | "Crosshair" | "Search" | "Close" | "Star" --- The face a control's text is laid out in: the alternative to --- `JComponent#setFont`. export type PanelFontOptions = { --- Draw in the monospace face (`new Font(Font.MONOSPACED, ...)`). mono: boolean?, --- An RS font (`setFont(FontManager.getRunescapeSmallFont())`), drawn at 16 --- points; wins over `mono`. family: PanelFontFamily?, --- The size in points (`Font#deriveFont(size)`). size: number?, } --- How a control's text is drawn: the alternative to `JComponent#setFont` and --- `setForeground`. export type PanelTextOptions = PanelFontOptions & { --- The text colour (`setForeground`). color: PanelColor?, --- Bold (`Font.BOLD`). strong: boolean?, --- Italic (`Font.ITALIC`). italics: boolean?, --- Underlined. underline: boolean?, --- Struck through. strikethrough: boolean?, --- The colour behind the text. bg: Color?, } --- The alternative to `setHorizontalAlignment` / `setAlignmentX`. export type PanelAlign = "left" | "center" | "right" --- `panel:label` / `heading` options: a `JLabel`'s setters. export type PanelLabelOptions = PanelTextOptions & { --- `setHorizontalAlignment`. align: PanelAlign?, --- true wraps; false ends a line that does not fit in "...", as a --- `JLabel` does. wrap: boolean?, --- `setIcon(new ImageIcon(img))`: drawn before the text. icon: PanelImageSource?, --- The icon's width and height in points. iconSize: number?, --- `setToolTipText`: text, or styled runs (an `` tooltip's spans). tooltip: PanelTooltipText?, } --- `panel:button` / `toggleValue` options: a `JButton`'s (`JToggleButton`'s) --- setters. export type PanelButtonOptions = PanelTextOptions & { --- `setBackground`. fill: Color?, --- The border's colour (`setBorder(new LineBorder(color))`). stroke: Color?, --- `setIcon(new ImageIcon(img))`, or `new JButton(text, icon)`; with an --- empty text the button is the icon alone. icon: PanelImageSource?, --- The icon's width and height in points. iconSize: number?, --- `setPreferredSize`'s width. width: number?, --- `setPreferredSize`'s height (with `width`). height: number?, --- A compact button. small: boolean?, --- false: no button chrome (`setContentAreaFilled(false)`, --- `setBorderPainted(false)`). frame: boolean?, --- `setSelected`: drawn pressed. selected: boolean?, --- `setToolTipText`: text, or styled runs (an `` tooltip's spans). tooltip: PanelTooltipText?, --- `setEnabled`. enabled: boolean?, } --- `panel:checkbox` / `radio` / `hyperlink` options. export type PanelCheckOptions = PanelTextOptions & { --- `setPreferredSize`'s width. width: number?, --- `setPreferredSize`'s height (with `width`). height: number?, --- `setToolTipText`: text, or styled runs (an `` tooltip's spans). tooltip: PanelTooltipText?, --- `setEnabled`. enabled: boolean?, } --- `panel:textEdit` options: a `JTextField`'s (`JPasswordField`'s) setters. --- A field takes the font, not the label styles (bold, italic, underline). export type PanelTextEditOptions = PanelFontOptions & { --- The text colour (`setForeground`). color: PanelColor?, --- The field's background (`setBackground`). bg: Color?, --- The field's identity between frames, where its place in the panel moves. id: string?, --- `setPreferredSize`'s width. Without it the field is egui's 280 wide. width: number?, --- `setPreferredSize`'s height: a single line is centred in it. height: number?, --- Grey text shown while the field is empty (a placeholder). hint: string?, --- `setEditable(false)`: selectable and copyable, not editable. readOnly: boolean?, --- `requestFocusInWindow()`: asks again every pass it is set. focus: boolean?, --- A `JPasswordField`. password: boolean?, --- The most characters it takes (a length `DocumentFilter`). charLimit: number?, --- false: no border or box (a `FlatTextField`). frame: boolean?, --- `setToolTipText`: text, or styled runs (an `` tooltip's spans). tooltip: PanelTooltipText?, --- `setEnabled`. enabled: boolean?, } --- `panel:textEditMultiline` options: a `JTextArea`'s setters. export type PanelTextAreaOptions = PanelTextEditOptions & { --- `setRows`: the height in lines, when neither `height` nor `fill` is set. rows: number?, --- Take the height left, as a `JTextArea` in `BorderLayout.CENTER` of a --- `PluginPanel(false)` does (inside a `scrollArea`, `rows` instead). fill: boolean?, } --- `panel:grid` options: a `GridLayout`'s or `GroupLayout`'s gaps and sizes. export type PanelGridOptions = { --- Shade every other row. Default true. striped: boolean?, --- The horizontal gap (`GridLayout`'s `hgap`). Default 10. spacingX: number?, --- The vertical gap (`vgap`). Default 3. spacingY: number?, --- The narrowest a column may be; equal cells set both widths. minColWidth: number?, --- The widest a column may be. maxColWidth: number?, --- The lowest a row may be. minRowHeight: number?, --- Every column one width, `(width - spacingX * (n - 1)) / n`, half the width --- left over before the first column: `GridLayout`'s equal cells. Text that --- does not fit a cell ends in "...", as a squeezed Swing label's does. --- Differs: each row takes its own height (`GridLayout` gives every row the --- tallest cell's: set `minRowHeight`), and a fixed-size control wider than --- a cell (an image, a field with `width`) widens its column. equalColumns: boolean?, } --- A `JScrollPane`'s bar policy: `VERTICAL_SCROLLBAR_ALWAYS`, `_NEVER` or --- `_AS_NEEDED`. export type PanelScrollbarPolicy = "always" | "never" | "auto" --- `panel:scrollArea` / `scrollRows` options: a `JScrollPane`'s. export type PanelScrollOptions = { --- Its identity between passes (the scroll position is kept under it). id: string?, --- `getVerticalScrollBar().setValue(offset)`: scroll there this pass. offset: number?, --- Stay at the end as the content grows (a log). stickToBottom: boolean?, --- The tallest it grows before scrolling. maxHeight: number?, --- The bar policy: `"always"`, `"never"` or `"auto"` --- (`VERTICAL_SCROLLBAR_ALWAYS` / `_NEVER` / `_AS_NEEDED`). scrollbar: PanelScrollbarPolicy?, --- Scroll both ways (`scrollArea` only). horizontal: boolean?, } --- Four edge widths. export type PanelInsets = { --- Above. top: number?, --- Left. left: number?, --- Below. bottom: number?, --- Right. right: number?, } --- A margin: one number for all four sides, or a `PanelInsets`. export type PanelMargin = number | PanelInsets --- `panel:frame` options: `setBorder` and `setBackground`. export type PanelFrameOptions = { --- `setBackground` + `setOpaque(true)`. fill: Color?, --- A uniform border's colour (`LineBorder`). stroke: Color?, --- The uniform border's width. Default 1. strokeWidth: number?, --- A `MatteBorder`'s widths: they take room like Swing's insets. strokeSides: PanelInsets?, --- The `MatteBorder`'s colour (else `stroke`). strokeColor: Color?, --- An `EmptyBorder` inside the border: a number for all four sides. margin: PanelMargin?, --- Room outside the border. outerMargin: PanelMargin?, --- Corner radius. rounding: number?, --- Span the width, as a child of a vertical `BoxLayout` does. Default true. fillWidth: boolean?, --- Take clicks over the whole frame (a row that selects on click). clickable: boolean?, --- The background while the pointer is over the frame, this same pass: a --- `mouseEntered` that sets the background. hoverFill: Color?, --- `setToolTipText`: text, styled runs or a body. tooltip: PanelTooltip?, } --- `panel:sized` options: `setPreferredSize`, `setMinimumSize`, `setMaximumSize`. export type PanelSizedOptions = { --- The width, preferred and fixed. width: number?, --- The height, preferred and fixed. height: number?, --- `setMinimumSize`'s width. minWidth: number?, --- `setMinimumSize`'s height. minHeight: number?, --- `setMaximumSize`'s width. maxWidth: number?, --- `setMaximumSize`'s height. maxHeight: number?, } --- An image a Panel control draws: an `Image` (a `BufferedImage`, an --- `AsyncBufferedImage`, an `ImageUtil`, `itemManager` or `spriteManager` --- result: Swing's `new ImageIcon(img)`), PNG bytes (`Asset.bytes(...)`), or a --- `PanelImageSpec`. export type PanelImageSource = Image | string | PanelImageSpec --- An image named by what it is rather than held: one of `sprite`, --- `item`, `spell`, `widget` or `argb`. export type PanelImageSpec = { --- A sprite archive group, as `spriteManager:getSprite(sprite, file)`. sprite: number?, --- The frame of `sprite`. Default 0. file: number?, --- An item's icon, as `itemManager:getImage(item, quantity, ...)`. item: number?, --- The item icon's quantity. quantity: number?, --- The item icon noted. noted: boolean?, --- The item icon's border. border: number?, --- The item icon's shadow colour. shadow: Color?, --- The item icon's quantity mode (`ItemQuantityMode`). stackMode: number?, --- A spellbook icon by its name (`"HIGH_LEVEL_ALCHEMY"`). spell: string?, --- A widget's sprite, by its packed id. widget: number?, --- Pixels, row-major (`BufferedImage#setRGB`'s), `width` by `height`. argb: { Color }?, --- The width of `argb`'s image. width: number?, --- The height of `argb`'s image. height: number?, --- Which `argb` image this is: one texture, rewritten as it changes. id: string?, --- Which version of `argb`'s pixels: they are read only when it changes. key: string?, } --- `panel:image` options. export type PanelImageOptions = { --- The width drawn (the height keeps the ratio unless set). width: number?, --- The height drawn. height: number?, --- Multiplies every pixel's colour. tint: Color?, --- `setToolTipText`: text, or styled runs (an `` tooltip's spans). tooltip: PanelTooltipText?, } --- `panel:canvas` options. export type PanelCanvasOptions = { --- Its identity (default its place in the panel). id: string?, --- Skip `draw` and reuse the last pixels while it is unchanged (Swing --- repaints only when asked). key: string?, --- `setToolTipText`: text, or styled runs (an `` tooltip's spans). tooltip: PanelTooltipText?, } --- `panel:spinner` options: a `SpinnerNumberModel`'s. export type PanelSpinnerOptions = { --- The model's minimum. min: number?, --- The model's maximum. max: number?, --- The drag speed per point. Default 1. step: number?, --- Decimal places; 0 for an integer field. decimals: number?, --- Text before the number. prefix: string?, --- Text after the number. suffix: string?, --- `setPreferredSize`'s width. width: number?, --- `setToolTipText`: text, or styled runs (an `` tooltip's spans). tooltip: PanelTooltipText?, --- `setEnabled`. enabled: boolean?, } --- `panel:combo` options. export type PanelComboOptions = { --- `setPreferredSize`'s width. width: number?, --- `setToolTipText`: text, or styled runs (an `` tooltip's spans). tooltip: PanelTooltipText?, --- `setEnabled`. enabled: boolean?, } --- One styled run of a tooltip: an `` tooltip's span. export type PanelTooltipRun = { --- The run's text; "\n" breaks the line. text: string, --- Its colour. color: Color?, --- The colour behind it. bg: Color?, --- Size in points. size: number?, --- An RS font. family: PanelFontFamily?, --- Monospace. mono: boolean?, --- In the strong text colour, when it sets no `color`. strong: boolean?, --- Italic. italics: boolean?, } --- A tooltip (`setToolTipText`): text, styled runs (the alternative to an --- `` tooltip), or a function that draws it with Panel controls, run --- only while it shows. export type PanelTooltip = string | { PanelTooltipRun } | (Panel) -> () --- A control's `tooltip` option: text, or styled runs (the alternative to an --- `` tooltip). A tooltip drawn with Panel controls is `panel:tooltip(fn)` --- after the control. export type PanelTooltipText = string | { PanelTooltipRun } --- One styled run inside a `panel:rowSpans` row. export type RowSpan = { --- The run's text. text: string, --- Text colour. Defaults to the panel's text colour. color: Color?, --- Background colour behind this run. This is what a search-match highlight uses. bg: Color?, --- Font size in points. Defaults to 12. size: number?, --- An RS font; wins over `mono`. family: PanelFontFamily?, --- Draw in the monospace face rather than the proportional one. mono: boolean?, --- Draw italic. italics: boolean?, --- Fix the run's width, truncating with an ellipsis. This is how a --- tree row keeps its columns aligned. width: number?, } --- A `panel:rowSpans` row's disclosure marker. export type RowTwist = "open" | "closed" | "leaf" --- Row-level styling for `panel:rowSpans`. `bg` paints always, `fill` only when the row --- is selected, `hover` only when it is hovered and unselected, and `bar` is the 2px left --- edge of a selected row. export type RowOpts = { --- The row's width. Defaults to everything available; set it to leave room for --- something else on the same line, such as a log row's action buttons. width: number?, --- Left inset in points, for nesting a tree row. indent: number?, --- The disclosure marker: a fold state, or `"leaf"` for a row that --- cannot open. Its own hit region, so folding does not also select. Another string --- raises. twist: RowTwist?, --- Marker colour. twistColor: Color?, --- A small label before the text: `{ text, color, border? }`. badge: { text: string, color: Color, border: Color? }?, --- A run pinned to the right edge. Laid out first, so it decides how --- much width the runs before it may claim. trailing: RowSpan?, --- Row background, drawn whatever the row's state. bg: Color?, --- Background when the row is selected. fill: Color?, --- Background when the pointer is over the row. hover: Color?, --- A 2px accent down the row's left edge when selected. bar: Color?, --- Multiplies the row's text, badge, twist and `bg`, 0 to 1, for a row a filter kept --- only as context. `fill`, `hover` and `bar` are not faded. alpha: number?, } -- The side panel, drawn in immediate mode. -- -- Everything here is called every frame: there is no widget tree to build and -- no state to hold. A control returns what the user did on THIS frame, so the -- shape is always `state = ui:control(label, state)` and the plugin owns the -- state between frames. --- The plugin's own side panel: the surface `sidePanel` draws on. --- --- Valid only for the pass it is handed to. This and [Ui] are two surfaces: the panel a --- plugin draws, and the game's interface domain. `ui:label("x")` and --- `panel:createChild(...)` do not typecheck. Interface components hang off the client; a --- plugin's panel is its own thing. export type Panel = { --- One line of text: the alternative to a `JLabel`. Its setters are the --- options: `setFont`/`setForeground` (the text options), --- `setHorizontalAlignment` (`align`), `setIcon` (`icon`, an `Image` or --- any image source), `setToolTipText` (`tooltip`). label: (Panel, string, PanelLabelOptions?) -> (), --- `label` in the panel's heading style. heading: (Panel, string, PanelLabelOptions?) -> (), --- A label that takes clicks, highlighted while `selected`. --- @param text The text. --- @param selected Whether it draws selected. --- @param color For a state the three theme tokens cannot name. --- @returns `true` only on the frame it was clicked. selectableLabel: (Panel, string, boolean, Color?) -> boolean, --- ONE full-width, single-line, selectable row assembled out of styled runs, --- so a tree row can colour its name, its id and its text differently and still --- hover, highlight and click as the single row it looks like. Returns --- `(rowClicked, twistClicked)` — the twist has its own hit region, so folding a --- node does not also select it. `width` on a run fixes a column and truncates --- with an ellipsis; `bg` on a run is the search-match highlight. --- --- ```luau --- local clicked, folded = panel:rowSpans( --- { { text = name, color = Color.ORANGE }, { text = tostring(id), mono = true } }, --- selected == id, --- { indent = depth * 12, twist = open and "open" or "closed" } --- ) --- ``` rowSpans: (Panel, { RowSpan }, boolean, RowOpts?) -> (boolean, boolean), --- A push button: the alternative to `JButton` + `addActionListener`. --- `new JButton(text, icon)` / `setIcon` is the `icon` option (an `Image` --- or any image source; an empty text draws the icon alone), --- `setBackground` `fill`, `setPreferredSize` `width`/`height`, --- `setContentAreaFilled(false)` `frame = false`, `setEnabled` `enabled`. --- @returns `true` only on the frame it was clicked. button: (Panel, string, PanelButtonOptions?) -> boolean, --- A small square button drawn as an icon. --- @param icon Which icon. Another string raises. --- @param hover Tooltip text. --- @returns `true` only on the frame it was clicked. iconButton: (Panel, PanelIconName, string) -> boolean, --- A labelled checkbox: the alternative to `JCheckBox` + --- `addItemListener`; the plugin keeps the state. --- @param label Text beside the box. --- @param checked Current state. --- @returns The new state. Assign it back. checkbox: (Panel, string, boolean, PanelCheckOptions?) -> boolean, --- A toggle *button* — filled when on, not a checkbox: the alternative to --- `JToggleButton`. The options are `button`'s (`icon` for an icon toggle). --- @param label Button text. --- @param selected Current state. --- @returns The new state. Assign it back. --- @example `on = panel:toggleValue("NPCs", on)` toggleValue: (Panel, string, boolean, PanelButtonOptions?) -> boolean, --- A single-line text field: the alternative to `JTextField` (and --- `JPasswordField`, `password`). `setEditable(false)` is `readOnly`, --- `requestFocusInWindow` `focus`, `setPreferredSize` `width`/`height`. --- Without a width the field is 280 wide, which is wider than some panes and --- pushes whatever follows the field off the edge. --- @returns The text, and whether Enter was pressed in the field this pass --- (`addActionListener`). textEdit: (Panel, string, PanelTextEditOptions?) -> (string, boolean), --- A horizontal rule across the available width: the alternative to --- `JSeparator`. separator: (Panel) -> (), --- Blank vertical space. --- @param points How much space to add. addSpace: (Panel, number) -> (), --- Did this frame see a copy command (Ctrl+C / Cmd+C)? So a plugin that draws --- its own selectable content can answer the normal copy gesture rather than --- growing a Copy button beside it. egui routes the same event to a focused --- text field, so only act on this when nothing of your own has focus. copyRequested: (Panel) -> boolean, --- Keyboard modifiers held this frame, so a plugin can offer range and --- additive selection: { shift, ctrl, alt, command }. modifiers: (Panel) -> { shift: boolean, ctrl: boolean, alt: boolean, command: boolean }, --- Width left on the current row, in points. availableWidth: (Panel) -> number, --- Lay the body out left to right on one row. --- @param body Called immediately, with the row's own `ui`. horizontal: (Panel, (Panel) -> ()) -> (), --- Lay the body out right to left, for trailing controls on a row. --- @param body Called immediately, with the row's own `ui`. rightToLeft: (Panel, (Panel) -> ()) -> (), --- Indent the body one level. --- @param body Called immediately, with the indented `ui`. indent: (Panel, (Panel) -> ()) -> (), --- Draw the body inside a bordered group. --- @param body Called immediately, with the group's own `ui`. group: (Panel, (Panel) -> ()) -> (), --- Draw the body inside a vertical scroll area: the alternative to --- `JScrollPane` (a default `PluginPanel` scrolls; the host does not wrap --- the panel). --- @param body Called immediately, with the scrolled `ui`. --- @returns The scroll offset (`getVerticalScrollBar().getValue()`), the --- content's height and the view's height. scrollArea: (Panel, (Panel) -> (), PanelScrollOptions?) -> (number, number, number), --- A collapsible section with a disclosure triangle. --- @param label Header text; also its identity between frames. --- @param body Called immediately when open, with the section's `ui`. --- @param defaultOpen Open on first sight. Defaults to closed. collapsing: (Panel, string, (Panel) -> (), boolean?) -> (), --- A striped, column-aligned grid: the alternative to `GridLayout`, --- `GroupLayout` and `JTable`. Call `endRow` to finish each row. Equal --- cells (`GridLayout`) set `minColWidth` and `maxColWidth` to one width; --- `spacingX`/`spacingY` are its `hgap`/`vgap`. --- @param id Identity between frames; must be unique in this panel. --- @param columns How many columns. --- @param body Called immediately, with the grid's own `ui`. grid: (Panel, string, number, (Panel) -> (), PanelGridOptions?) -> (), --- A two-pane split. `ratio` is the left pane's share of the width (0.5 when --- omitted, clamped to 0.15..0.85); a tree pane and a key/value pane rarely --- want the same width. Each pane has its own id namespace, so sibling scroll --- areas do not share a scroll offset. columns2: (Panel, (Panel) -> (), (Panel) -> (), number?) -> (), --- End the current row inside a `grid` body. endRow: (Panel) -> (), --- Put text on the system clipboard. --- @param text What to copy. copyText: (Panel, string) -> (), --- A framed group: a border, a fill, margins. The alternative to --- `JComponent#setBorder` (`EmptyBorder`, `LineBorder`, `MatteBorder`, --- nested for a `CompoundBorder`), `setBackground`, and a `mouseEntered` --- hover background (`hoverFill`). The body is laid out as the frame's --- parent lays out (left to right inside a `horizontal` row); for a --- vertical column inside a row, use `aligned`. --- @param body Draws the frame's contents. --- @returns Whether the frame was clicked (with `clickable`), and whether --- it is hovered. frame: (Panel, (Panel) -> (), PanelFrameOptions?) -> (boolean, boolean), --- Lay the body out in a region of a set size: the alternative to --- `setPreferredSize`/`setMinimumSize`/`setMaximumSize`. --- @param body Draws the contents; taller content overflows, as in Swing --- without a scroll pane. sized: (Panel, (Panel) -> (), PanelSizedOptions) -> (), --- Lay the body's items out top to bottom, aligned: the alternative to --- `setHorizontalAlignment`, and to a vertical `BoxLayout` panel or a --- `GroupLayout` parallel group inside a row (`aligned("left", body)` in a --- `horizontal` row stacks `body`'s items in a column beside the rest). --- @param align `"fill"` stretches every item to the width, a --- `BorderLayout.CENTER`. Another string raises. aligned: (Panel, "left" | "center" | "right" | "fill", (Panel) -> ()) -> (), --- Grey out and disable everything in the body when `on` is false: the --- alternative to `JComponent#setEnabled(false)` on a container. enabled: (Panel, boolean, (Panel) -> ()) -> (), --- An image: the alternative to `new JLabel(new ImageIcon(img))`. `img` --- is an `Image` (a `BufferedImage`/`AsyncBufferedImage`: drawn from its --- pixels in Rust, uploaded again only when they change), PNG bytes, or a --- `PanelImageSpec`. A game sprite, and an `AsyncBufferedImage` before it --- loads, take their room and draw nothing. --- @returns Whether it was clicked. image: (Panel, PanelImageSource, PanelImageOptions?) -> boolean, --- A `Graphics2D` canvas drawn into an image: the alternative to --- overriding `JComponent#paintComponent`. `draw` runs on every pass --- unless `opts.key` is unchanged, which reuses the last pixels. The `Graphics2D` is --- good only while `draw` runs: one kept past it raises. --- --- ```luau --- panel:canvas(200, 20, function(g) --- g:setColor(Color.GREEN) --- g:fillRect(0, 0, 200 * health, 20) --- end, { key = tostring(health) }) --- ``` --- @param width Width, clamped to 1..2048. --- @param height Height, clamped to 1..2048. --- @param draw Paints the canvas. --- @returns Whether it was clicked; `lastResponse` has the details. canvas: (Panel, number, number, (Graphics2D) -> (), PanelCanvasOptions?) -> boolean, --- A drag-or-type number field: the alternative to `JSpinner` with a --- `SpinnerNumberModel` (and `JFormattedTextField`). --- @returns The value, clamped to `min`..`max`. spinner: (Panel, number, PanelSpinnerOptions?) -> number, --- A drop-down: the alternative to `JComboBox`. --- @param id The control's identity. --- @param selected 1-based index into `items`; `nil` or 0 selects nothing. --- @param items The labels. --- @returns The selected index. combo: (Panel, string, number?, { string }, PanelComboOptions?) -> number, --- One radio button: the alternative to `JRadioButton` in a --- `ButtonGroup`. The plugin keeps the group's choice. --- @returns Whether it was clicked. radio: (Panel, string, boolean, PanelCheckOptions?) -> boolean, --- A wrapping multi-line text field: the alternative to `JTextArea` --- (`setLineWrap(true)`, `setRows` `rows`, `setEditable(false)` --- `readOnly`; `fill` takes the height left, as a `BorderLayout.CENTER` --- text area does). --- @returns The text. textEditMultiline: (Panel, string, PanelTextAreaOptions?) -> string, --- A link: the alternative to a link `JLabel` and `LinkBrowser.browse`. --- Only `http` and `https`, opened at once on a click. A marketplace plugin's --- link must be `https` to oldschool.runescape.wiki, runescape.wiki or --- runescape.com (or a subdomain of one); any other raises. --- @returns Whether it was clicked. hyperlink: (Panel, string, string, PanelCheckOptions?) -> boolean, --- A right-click menu on the LAST control drawn: the alternative to --- `setComponentPopupMenu`. The body runs only while the menu is open. --- @returns Whether the menu is open. contextMenu: (Panel, (Panel) -> ()) -> boolean, --- How the LAST control drawn was used this pass: the alternative to a --- `MouseListener`/`FocusListener`. lastResponse: (Panel) -> PanelResponse?, --- The height left. availableHeight: (Panel) -> number, --- Only the rows in view of a long list: the alternative to a `JList` --- over a large model in a `JScrollPane`. Each row is `rowHeight` tall. --- @param body Gets the panel and the 1-based, inclusive range of --- visible rows. --- @returns The scroll offset in points. scrollRows: (Panel, number, number, (Panel, number, number) -> (), PanelScrollOptions?) -> number, --- A tooltip on the LAST control drawn: the alternative to --- `setToolTipText` for a control that took no `tooltip` option. Text, --- styled runs (an `` tooltip's colour spans), or a function that --- draws the tooltip with Panel controls (a progress bar in it). Runs are --- read and laid out only while the tooltip shows; runs that do not read --- show why there (as the `tooltip` option's do), rather than raise. With no control --- drawn before it in this pass, it raises. tooltip: (Panel, PanelTooltip) -> (), } --- What kind of dialogue is open. export type DialogueKind = "NpcChat" | "PlayerChat" | "DualChat" | "Options" | "Sprite" | "MessageBox" | "LevelUp" | "QuestComplete" | "MakeX" | "ConfirmDestroy" | "BankPin" | "Unknown" --- One option in an open dialogue. export type DialogueOption = { --- The option's text. text: (DialogueOption) -> string, --- Which numbered option this is, from 1. optionNumber: (DialogueOption) -> number, --- Pick it with a click. click: (DialogueOption) -> boolean, --- Pick it with the number key, which is what a person usually does. press: (DialogueOption) -> boolean, } --- The open dialogue, from `ui:dialogue()`. --- --- Reads what an NPC said, and picks an option. export type Dialogue = { --- Whether a dialogue is open. isOpen: (Dialogue) -> boolean, --- What kind it is. --- @returns `nil` when nothing is open. kind: (Dialogue) -> DialogueKind?, --- The body text. --- @returns `nil` when nothing is open, or it carries no text. text: (Dialogue) -> string?, --- Who is speaking. --- @returns `nil` when nobody is named. speaker: (Dialogue) -> string?, --- The dialogue's title. --- @returns `nil` when it has none. title: (Dialogue) -> string?, --- Whether a continue prompt is showing. canContinue: (Dialogue) -> boolean, --- Which typed-input box is up, if any. --- --- Today that is only the bank/Grand Exchange "Enter amount" box. --- @returns `nil` when nothing is asking for typed input. typedInput: (Dialogue) -> TypedInputKind?, --- Type a number into the open amount box and submit it. --- @param amount The number to enter. typeAmount: (Dialogue, number) -> boolean, --- Click the continue prompt. clickContinue: (Dialogue) -> boolean, --- Press space when an open surface answers it: a continue dialogue, or the --- make-X box (`Skillmulti`), where space makes the highlighted product. `false` --- otherwise. On an interface with no such surface (smithing, silver or gold crafting), --- `ui:typeText(" ")` presses space whatever is open. pressSpace: (Dialogue) -> boolean, --- Every option currently offered. options: (Dialogue) -> { DialogueOption }, --- The first option matching a pattern. --- @param pattern Text to look for. --- @returns `nil` when nothing matches. find: (Dialogue, string) -> DialogueOption?, } --- The interface registry, narrowed in Rust. --- --- Every method here filters rows the query already holds and hands the SAME query --- back, so a whole chain crosses the boundary once; a terminal hands out --- `Widget` handles (`client:getWidget(id)` gives the same userdata). --- --- A terminal (`count`, `first`, `collect`) CONSUMES the query. Calling a second --- one raises rather than silently re-reading the registry. export type WidgetQuery = { --- On screen and not hidden. visible: (WidgetQuery) -> WidgetQuery, --- Hidden only. hidden: (WidgetQuery) -> WidgetQuery, --- Text holds this substring; `"a|b"` takes either. --- @param pattern Substring of the widget's text. textContaining: (WidgetQuery, string) -> WidgetQuery, --- Carries a menu action holding this substring; `"a|b"` takes either. --- @param action Substring of an action. actionContaining: (WidgetQuery, string) -> WidgetQuery, --- Holds this item id. --- @param itemId Item id. item: (WidgetQuery, number) -> WidgetQuery, --- Widget kind. --- @param kind Widget type id. kind: (WidgetQuery, number) -> WidgetQuery, --- Child of this packed parent id. --- @param packedId Packed parent id. parent: (WidgetQuery, number) -> WidgetQuery, --- How many matched. Consumes the query. count: (WidgetQuery) -> number, --- The first match, as a handle. Consumes the query. first: (WidgetQuery) -> Widget?, --- Every match, as handles. Consumes the query. collect: (WidgetQuery) -> { Widget }, } --- The game's interface: tabs, keys, dialogues, and the host's dialogs. --- --- Reached ambiently, not from a render pass -- this is client state, not --- drawing. See [Panel] for the surface a plugin draws its own panel on. export type Ui = { --- The interface tabs. tabs: (Ui) -> Tabs, --- Press and release a key. `true` means queued. --- --- For an "Enter amount" prompt, `ui:dialogue():typeAmount(n)` types the amount and --- Enter, only while the prompt is open. --- --- ```luau --- ui:pressKey(KeyEvent.VK_ESCAPE) --- ``` --- --- @param vk A `KeyEvent.VK_*` code. Enter is `KeyEvent.VK_ENTER`, 10. pressKey: (Ui, number) -> boolean, --- Type a string as key presses, sent to whatever has keyboard focus. It does not click a --- text field or give one focus: a box that takes keys only once it is clicked gets --- nothing until it is. `true` means queued, not typed: nothing checks where the keys --- landed. --- --- @param text What to type. --- @param pressEnter Whether to follow it with Enter. Defaults to false. typeText: (Ui, string, boolean?) -> boolean, --- The open dialogue. dialogue: (Ui) -> Dialogue, --- The interface registry as a QUERY, narrowed in Rust. --- --- Filters run in Rust before anything crosses into Luau; the terminals hand --- out `Widget` handles. widgets: (Ui) -> WidgetQuery, --- A message box: the immediate-mode alternative to --- `JOptionPane.showMessageDialog`; in the Swing retained UI, use `JOptionPane` --- itself. Non-blocking: it returns at once. Drawn over the game, naming the plugin --- that opened it; the callback runs in one of the plugin's ticks after the user --- answers. With eight open, the ninth raises. --- @param spec What it shows. --- @param onClose Runs once the user dismisses it. --- @returns The dialog's id. messageDialog: (Ui, MessageDialogSpec, (() -> ())?) -> number, --- A question with buttons: the immediate-mode alternative to --- `JOptionPane.showConfirmDialog`; in the Swing retained UI, use `JOptionPane` itself. --- Drawn over the game, non-blocking; the callback runs in one of the plugin's ticks --- after the user answers. With eight open, the ninth raises. --- @param spec What it shows. --- @param onResult Gets the 1-based option and its label, or `nil` when --- the window was closed. confirmDialog: (Ui, ConfirmDialogSpec, (number?, string?) -> ()) -> number, --- A text prompt: the immediate-mode alternative to --- `JOptionPane.showInputDialog`; in the Swing retained UI, use `JOptionPane` itself. --- Drawn over the game, non-blocking; the callback runs in one of the plugin's ticks --- after the user answers. With eight open, the ninth raises. --- @param spec What it shows. --- @param onResult Gets the text, or `nil` on cancel. inputDialog: (Ui, InputDialogSpec, (string?) -> ()) -> number, --- A colour picker: the alternative to `ColorPickerManager`. Drawn over the game, --- non-blocking; the callbacks run in the plugin's ticks. With eight open, the ninth --- raises. --- @param spec What it starts on. --- @param onClose Gets the final colour. --- @param onChange Gets the colour as it changes. colorPicker: (Ui, ColorPickerSpec, (Color) -> (), ((Color) -> ())?) -> number, --- Open a file: the alternative to `JFileChooser#showOpenDialog`. The plugin never sees --- a path. Drawn over the game, non-blocking; the callback runs in one of the plugin's --- ticks after the user answers. With eight open, the ninth raises. --- @param spec What it offers. --- @param onResult Gets the bytes and base name, or `nil` on cancel. fileOpen: (Ui, FileOpenSpec, (string?, string?) -> ()) -> number, --- Save a file: the alternative to `JFileChooser#showSaveDialog`. Drawn over the game, --- non-blocking; the callback runs in one of the plugin's ticks after the user answers. --- With eight open, the ninth raises. --- @param spec What it saves. --- @param onResult Gets whether it was written, and why not. fileSave: (Ui, FileSaveSpec, ((boolean, string?) -> ())?) -> number, --- Open an `http(s)` link in the browser, at once, with no confirmation. A marketplace --- plugin opens only an `https` link to oldschool.runescape.wiki, runescape.wiki or --- runescape.com (or a subdomain of one). Any other link raises. --- @param onDone Gets whether the browser was asked to open it, and why not. --- @returns The dialog's id with `onDone`, through which the answer comes; else `nil`. openUrl: (Ui, string, ((boolean, string?) -> ())?) -> number?, --- Close a dialog this plugin opened. Its callback never runs. --- @returns Whether there was one to close. closeDialog: (Ui, number) -> boolean, --- Whether a dialog this plugin opened is still up. dialogOpen: (Ui, number) -> boolean, } -- A window handle, valid only for the `renderWindows` pass it came from. export type Window = { --- Open a separate OS window and draw into it. --- --- Its body may open another; the nesting runs on the native stack, so --- keep it shallow. --- @param id Identity between frames; must be unique in this plugin. --- @param title Window title. --- @param width Initial width in points. --- @param height Initial height in points. --- @param body Called immediately, with the window's own `ui`. --- @returns `true` on the pass the window's close button was pressed: --- `if win:viewport(...) then open = false end`. viewport: (Window, string, string, number, number, (Panel) -> ()) -> boolean, } --- A loadout the user built in the Loadouts editor, in the shapes the goals take, so a plugin --- reads the setting and hands it straight on without ever knowing what a loadout looks like --- inside. --- --- ```luau --- local picked = config:trip() -- a `loadout` config item, through the config proxy --- local trip = bank:newLoadout(picked.equipment, picked.inventory) --- -- with the bank open, once `trip:run()` answers "done": --- local status, reason = player:magic():runePouch():fillFromBank(picked.runePouch) --- ``` export type ConfigLoadout = { --- What the user called it. name: string, --- The worn items, as an equipment goal for `bank:newLoadout`. An exact quantity is spelled --- `=n`, and a slot the editor keeps empty is a `slot:empty` entry (`"4151:1,shield:empty"`). equipment: string, --- The carried items, as an inventory goal for `bank:newLoadout`: a table rather than the --- goal string, because a slot can accept alternates (a half summer pie satisfies a summer --- pie). A slot with alternates is a `kind = "anyOf"` row, the primary id first. inventory: { InventoryGoalEntry }, --- The rune pouch's contents, as `runePouch:fillFromBank` and `runePouch:missing` take them. runePouch: { { rune: Rune, amount: number } }, --- The spell to autocast, as `magic:setAutocast` takes it. --- @returns `nil` when the loadout sets none. autocast: string?, } --- Why a webwalk failed. export type WebwalkFailureCode = "NO_ROUTE" | "SERVER_UNAVAILABLE" | "STUCK" | "MISSING_ITEMS" | "NO_ROOM" | "WILDERNESS_REFUSED" | "STEP_FAILED" | "HELD_TOO_LONG" | "NO_BOAT" | "BOAT_UNREACHABLE" | "CARGO_IN_HAND" | "UNKNOWN_DOCK" export type WebwalkStatus = { --- How the walk stands: `"idle"` no walk since the last `stop()`, `"running"` the route is --- being walked, `"arrived"` the destination was reached, `"closest"` the walk ended as near --- as any route goes, because nothing reaches the destination (only within 10 tiles of it and --- on its plane: a nearest tile farther off fails the walk `"NO_ROUTE"`), and `"failed"` it --- gave up, which stays so until `stop()` or the next `start`. state: "idle" | "running" | "arrived" | "closest" | "failed", --- Why it failed. --- @returns `nil` unless `state` is `"failed"`. failure: WebwalkFailureCode?, --- The failure in words, or what the walk has to say on ending: why it stopped short, --- or what putting the old gear back said. --- @returns `nil` when there is nothing to say. reason: string?, --- What the walk is doing now, such as `"Configure Fairy ring 29495 at 3202,3200,0"`. --- @returns `nil` unless a route is being walked. step: string?, --- The tile the walk is going to. A walk to several candidates, or to the nearest bank, --- picks one with its first route and keeps it through every replan. --- @returns `nil` until a route has picked it. destination: WorldPoint?, } --- One step of a route, from `Webwalk:snapshot()` and `PathQuery:steps()`. --- How a route to a dock ends (`PathQuery.toDock`). export type DockOptions = { --- `true` to end at the dock's berth, aboard; `nil` or `false` to disembark onto its --- landing. stayAboard: boolean?, } --- How near an open-sea tile a route ends (`Webwalk:startSea`, `PathQuery.toSea`). export type SeaOptions = { --- How many tiles from the sea tile the boat may stop (Chebyshev): a whole number 0 to 64; --- `0` for the tile itself. `nil` for 2, the tolerance a dock trip ends within. within: number?, } --- What `PathQuery.seaCosts` asks from, with which boat, and how far. export type SeaCostOptions = { --- Start at this dock's berth (`Dock.id`, 0 to 60). --- `nil`: `from`, else where the boat is (aboard, or its dock). fromDock: number?, --- Start on this sea tile; not with `fromDock`. from: WorldPoint?, --- The boat: a slot, 1 to 5. `nil`: the boat aboard, else the lowest-slot boat moored at a dock. boat: number?, --- How many tiles from each of the tiles asked for the boat may stop (Chebyshev): a whole number 0 --- to 64. `nil` for 2. within: number?, --- Stop the flood past this route cost (`PathQuery:cost()`'s units): a target further is --- `"CUTOFF_REACHED"`. `nil`: no bound. maxCost: number?, } --- The cheapest sail to one target (`SeaCostQuery:costs()`). export type SeaCost = { --- The boat sails there. reached: boolean, --- Sailing ticks at the boat's pace: from rest, without boosts, boarding, the helm or landing. --- @returns `nil` when not `reached`. ticks: number?, --- The route's cost as `PathQuery:cost()` counts it (a tick a straight tile, more in danger). --- @returns `nil` when not `reached`. cost: number?, --- The route's sail moves along an axis. --- @returns `nil` when not `reached`. straight: number?, --- The route's diagonal sail moves. --- @returns `nil` when not `reached`. diagonal: number?, --- Where the boat stops: a dock's berth, or the sea tile near the one asked. --- @returns `nil` when not `reached`. stopsAt: WorldPoint?, --- A dock the player may disembark at now: its Sailing level, quest and gates. --- `false` for a tile. landable: boolean, --- Why it is not reached: `"NO_BOAT"`, `"BOAT_UNREACHABLE"` or `"CUTOFF_REACHED"`. --- @returns `nil` when `reached`. problem: string?, } --- A sea step's data (`RouteStep.sail`). export type RouteSail = { --- A `BOARD_BOAT` or `DISEMBARK` step's dock, `Dock.id`. --- @returns `nil` for a `"sail"` step. dock: number?, --- A `BOARD_BOAT` step's boat slot, 1 to 5. --- @returns `nil` for any other step. slot: number?, --- A `"sail"` step's fit: the width the path server checked the boat at there, the boat's, --- or 1 on a tight tile (a dock's buoy ring). --- @returns `nil` for any other step. fit: number?, } export type RouteStep = { --- What the step does: walk, take a transport, or sail one sea tile to the next aboard. kind: "walk" | "transport" | "sail", --- Where the step starts. from: WorldPoint, --- Where the step ends: a teleport's landing tile, for one. to: WorldPoint, --- The ticks the path server expects the step to take. durationTicks: number, --- The transport's class, such as `"TELEPORTATION_ITEM"`, `"FAIRY_RING"` or `"CHARTER_SHIP"`. --- @returns `nil` for a walk. transportType: string?, --- What the path server calls it: an item teleport's item (`"Games necklace"`), a spell or --- minigame teleport (`"Lumbridge Home Teleport"`), else an object's text (`"Open Door 9398"`). --- @returns `nil` for a walk. name: string?, --- The menu option that fires it: `"Burthorpe"` on a games necklace, `"Open"` on a door. --- @returns `nil` for a walk. option: string?, --- The object it interacts with. --- @returns `nil` unless it is an object transport. objectId: number?, --- Every item id that can fire it (an item teleport's charge variants); empty for anything --- else. itemIds: { number }, --- Whether it is a teleport: a spell, an item, a portal, a lever, a minigame teleport or the --- jewellery box. isTeleport: boolean, --- Whether it is a home teleport spell, which share one cooldown. isHomeTeleport: boolean, --- Whether it is a minigame teleport, which share one cooldown. isMinigameTeleport: boolean, --- What it needs: every clause is needed, and any one item of a clause satisfies it, with --- `amount` of it held. An `amount` of `0` means none of the clause's items may be held. items: { { { id: number, amount: number } } }, --- A sea step's data: a `"sail"` step's fit, a `BOARD_BOAT`'s dock and slot, a --- `DISEMBARK`'s dock. --- @returns `nil` on land. sail: RouteSail?, } export type WebwalkSnapshot = { --- Which of `steps` the walk is on, from 1; `#steps + 1` once it has walked them all. index: number, --- The route; a replan keeps it until the new one comes, a new walk starts empty. steps: { RouteStep }, } -- Long-distance pathing: walking, doors, ladders, boats, teleports, bank stops. -- -- `start` sets a walk going and returns; Bento walks it from there, a game tick at a time -- until it arrives, gets as near as it can or gives up. -- Read `isWalking()` or `status()` whenever you like. A plugin has one webwalk, which -- `player:webwalk()` hands you from anywhere, so there is no handle to keep. -- A walk keeps its route, replanning only when it must: off the route, stalled, a step -- that did not go, or settings that avoid more. It waits through a humanization pause -- and a logout, and stops with the plugin. export type Webwalk = { --- Walk to a tile. Returns at once; the walk goes on by itself. The same tile again --- keeps the route under way, another replaces it. A tile nothing can stand on ends --- beside it, and one nothing reaches ends on the nearest tile that can be reached when --- that tile is within 10 tiles of it on its plane; farther, the walk fails `"NO_ROUTE"`. --- @param destination Where to end up. --- @param config This walk's route settings in place of the webwalker's; `nil` for the --- webwalker's. Its planned inventory is `PathQuery`'s alone: a walk routes with the --- items held. start: (Webwalk, WorldPoint, RouteOptions?) -> (), --- Walk to whichever of several tiles is cheapest. The first route picks one. Raises for --- none, or more than 256. --- @param destinations Candidate tiles. --- @param config As `start`'s. startTiles: (Webwalk, { WorldPoint }, RouteOptions?) -> (), --- Walk to a specific object, such as one staircase or ladder among several. The path --- server picks that object and routes through it. --- @param tile The object's tile. --- @param id The object's id. --- @param config As `start`'s. startObject: (Webwalk, WorldPoint, number, RouteOptions?) -> (), --- Walk to the nearest bank. The first route picks one. --- @param config As `start`'s. startNearestBank: (Webwalk, RouteOptions?) -> (), --- Travel to a Sailing dock with the boat: walk to a dock where one of the player's boats is --- moored, board it, sail to the dock, and disembark there unless `stayAboard`. Started --- aboard, the boat the player is on sails. Ends `"NO_BOAT"` at once when the player has no --- boat. Raises for an id outside 0 to 60. --- @param dockId The dock's id (`Dock.id`, `player:sailing():docks()`), 0 to 60. --- @param options `{ stayAboard = true }` to end at the dock's berth, aboard; `nil` to end --- ashore on its landing. --- @param config As `start`'s. startDock: (Webwalk, number, { stayAboard: boolean? }?, RouteOptions?) -> (), --- Travel to open sea with the boat: walk to a dock where one of the player's boats is --- moored, board it, and sail to `tile`, ending aboard with the boat within `within` tiles --- of it (a charting spot, a fishing spot), halted, the player at the helm. Started aboard, the --- boat the player is on sails. Never ends `"closest"`: a spot no route reaches ends --- `"BOAT_UNREACHABLE"` (no sea route fits the boat, no sea tile near `tile`, or the boat --- halted outside reach of it four times), `"NO_BOAT"` (no usable boat; at once when the --- player has none) or `"NO_ROUTE"`. Raises for a `within` outside 0 to 64. --- @param tile The sea tile (its plane is ignored: the sea is plane 0). --- @param options `{ within = n }`: how near `tile` the boat may stop, 0 to 64; `nil` for 2. --- @param config As `start`'s. startSea: (Webwalk, WorldPoint, SeaOptions?, RouteOptions?) -> (), --- Whether a started walk is still under way. isWalking: (Webwalk) -> boolean, --- Where a started walk stands, without advancing it: `"idle"` when there has been none --- since the last `stop()`, else how it is going or how it ended. status: (Webwalk) -> WebwalkStatus, --- The current route and the position in it. Read-only: this does not advance anything. snapshot: (Webwalk) -> WebwalkSnapshot, --- End the walk where the player stands; it clicks nothing more, its route is forgotten, --- and gear swapped for a step stays on. A walk stopped while it sails the boat brings it to rest: --- the sails are un-set at once where they can be, and again over the next ticks till the boat reads --- stopped (your voyage's `isSailing` is true meanwhile). A voyage started does not stop the boat: it --- takes it over under way. stop: (Webwalk) -> (), } --- The local player's own house as the client last saw it inside (`player:house()`). export type House = { --- The `POH_HOUSE_LOCATION` varbit: the town the house portal stands in, as the game --- numbers it. location: number, --- The portal chamber's destinations, by name (`"VARROCK"`, --- `"KHARYLL"`), sorted. portals: { string }, --- Whether a portal nexus is built. nexus: boolean, --- The jewellery box. jewelleryBox: "NONE" | "BASIC" | "FANCY" | "ORNATE", --- Whether a fairy ring is built (a spirit ring counts). fairyRing: boolean, --- Whether a spirit tree is built (a spirit ring counts). spiritTree: boolean, --- Whether a wilderness obelisk is built. obelisk: boolean, --- The mounted teleport items, sorted. mounted: { "GLORY" | "XERICS_TALISMAN" | "DIGSITE_PENDANT" | "MYTHICAL_CAPE" }, --- The pool (`"FANCY"` and `"ORNATE"` are the fancy and ornate rejuvenation pools). pool: "NONE" | "RESTORATION" | "REVITALISATION" | "REJUVENATION" | "FANCY" | "ORNATE", --- The chapel altar, or `nil` when none is built. altar: HouseAltar?, --- The spellbook altar, or `nil` when none is built. spellbookAltar: ("ANCIENT" | "LUNAR" | "DARK" | "OCCULT")?, --- Whether an armour repair stand is built. repairStand: boolean, --- When the client last saw the house from inside, Unix milliseconds. seenAt: number, --- Whether the player is inside it now. live: boolean, } --- A house's chapel altar. export type HouseAltar = { --- Whose altar it is. god: "SARADOMIN" | "ZAMORAK" | "GUTHIX", --- 1 (oak) to 7 (gilded). tier: number, } -- Which world the player is on, and the others on offer. -- -- The world list comes from Jagex's directory, fetched in the background. The -- `hasType` and `isPvp` questions without a world argument ask about the current world. export type WorldDomain = { --- World hopping. hopper: (WorldDomain) -> WorldHopper, --- Wilderness threat reads. pvp: (WorldDomain) -> WorldPvp, --- The current world's directory entry. --- @returns `nil` before the directory has been fetched. current: (WorldDomain) -> WorldInfo?, --- One world's directory entry. --- @param world World number. --- @returns `nil` when it is not in the directory. find: (WorldDomain, number) -> WorldInfo?, --- A query over the directory. --- --- ```luau --- local everywhere = world:search():collect() --- local nearby = world:search():region(world:current().region):online():first() --- ``` search: (WorldDomain) -> WorldQuery, --- Whether the current world is PvP: a PvP or a Deadman world. isPvp: (WorldDomain) -> boolean, --- A world's datacenter, which also tells US East from US West. --- @param world World number. --- @returns `nil` when it is not in the directory. location: (WorldDomain, number) -> WorldLocationInfo?, --- Whether a world is of a kind. Raises for a name outside `WorldTypeName`. --- --- ```luau --- local members = world:hasType("members", 301) --- local hereIsLeagues = world:hasType("seasonal") --- ``` --- @param kind The kind of world. --- @param world World number; omit for the current world. --- @returns `false` when it is not in the directory. hasType: (WorldDomain, WorldTypeName, number?) -> boolean, --- The last measured latency to a world. --- @param world World number. --- @returns `nil` when it has not been measured. ping: (WorldDomain, number) -> WorldPing?, --- Measure a world's latency, on a later tick. --- @param world World number. --- @param force Measure again even when it has been measured. requestPing: (WorldDomain, number, boolean?) -> boolean, } -- The orbs: what the client shows for health, prayer, energy and special. export type Vitals = { --- Current hitpoints. hp: number, --- Hitpoints at full. hpMax: number, --- Current prayer points. prayer: number, --- Prayer points at full. prayerMax: number, --- Run energy, 0 to 100. runEnergyPercent: number, --- Special attack energy, 0 to 100. specEnergyPercent: number, } -- One item in a container, from `ContainerQuery` (`player:inventory():search()`, `bank:item`, -- `equipment:itemIn`). Differs from `Item` (`client:getItemContainer(id):getItem(slot)`): -- its reads are methods, `item:id()`, `item:quantity()`, `item:slot()`, where `Item`'s are -- `getId()`, `getQuantity()` and `getSlot()`. Both take -- `interact("Eat")`. export type ItemHandle = { --- The item's id. id: (ItemHandle) -> number, --- The stack size in this slot. quantity: (ItemHandle) -> number, --- Which slot the item occupies. slot: (ItemHandle) -> number, --- The item's name. --- @returns `nil` when the id has no definition. name: (ItemHandle) -> string?, --- Whether this is the noted form. Noted items cannot be eaten, drunk or --- used, which is why food and dose counts exclude them. isNoted: (ItemHandle) -> boolean, --- Which container the item came out of. source: (ItemHandle) -> ItemSource, --- Whether `interact` would find an option: on a carried item its own options and their --- sub-menus, on a worn item its worn options (`"Remove"`, `"Examine"`, a jewellery --- destination). A bank or read-only row answers for the item once carried. --- @param option The option text, e.g. `"Drink"`. hasOption: (ItemHandle, string) -> boolean, --- Interact with this exact item. --- @param options An option (`"Eat"`), or options to try in order; the first the item --- exposes wins, counting sub-menu options. --- @returns `false` when no listed option resolves. Raises on a row another domain handed --- out (`bank:item`, `bank:search()`, `bank:cached()`, ...): act through that domain, with --- `bank:withdraw` or `bank:click`. interact: (ItemHandle, string | { string }) -> boolean, } -- A snapshot of a container's items, narrowed in place. Each filter returns the query, so calls -- chain, and the terminals can be read any number of times. -- -- local doses = player:inventory():search():named("Prayer potion(*)"):count() -- local q = bank:search():containing("potion") -- if q:count() > 0 then log:info(q:first():name()) end export type ContainerQuery = { --- Keep only items whose id is in the list. --- @param itemIds Item ids to keep. ids: (ContainerQuery, { number }) -> ContainerQuery, --- Keep only items whose whole name matches, ignoring case: `|` separates alternatives and --- `*` is any run of characters, so `"Grimy *|Shark"` is every grimy herb and a shark, and --- `"shark"` is not a Raw shark. --- @param name The name pattern. named: (ContainerQuery, string) -> ContainerQuery, --- Keep only items whose name contains the text, ignoring case: `|` separates alternatives. --- @param text The text to look for. containing: (ContainerQuery, string) -> ContainerQuery, --- How many items survived the filters. Slots, not stack quantities. count: (ContainerQuery) -> number, --- The first surviving item in slot order. --- @returns `nil` when nothing matched. first: (ContainerQuery) -> ItemHandle?, --- Every surviving item, in slot order. collect: (ContainerQuery) -> { ItemHandle }, } --- A narrowing world-list query, from `world:search()`. --- --- The refinements return the query, so calls chain. The terminals CONSUME it --- -- it owns the list it narrowed -- so calling a second one raises rather --- than silently answering off a spent query. --- --- ```luau --- local target = world:search():online():members(true):playersAtMost(1200):random() --- ``` export type WorldQuery = { --- Keep only these world numbers. --- @param worlds World numbers to keep. ids: (WorldQuery, { number }) -> WorldQuery, --- Keep only members worlds, or only free ones. --- @param members `true` for members, `false` for free. members: (WorldQuery, boolean) -> WorldQuery, --- Keep only worlds that are up. online: (WorldQuery) -> WorldQuery, --- Keep only worlds in one country. Raises for another code, in any case. --- @param code The country's code, as `WorldInfo.region` carries it: `"??"` is the worlds --- whose location is unknown. region: (WorldQuery, WorldRegionCode | "??") -> WorldQuery, --- Keep only worlds whose activity label contains this, ignoring case and markup. --- @param text What to look for in the directory's activity label. activityContaining: (WorldQuery, string) -> WorldQuery, --- Keep only worlds of a kind. Raises for a name outside `WorldTypeName`. --- @param kind The kind of world. hasType: (WorldQuery, WorldTypeName) -> WorldQuery, --- Keep only worlds NOT of a kind. Raises for a name outside `WorldTypeName`. --- @param kind The kind of world. withoutType: (WorldQuery, WorldTypeName) -> WorldQuery, --- Keep only worlds at or below a player count. --- @param players The ceiling. playersAtMost: (WorldQuery, number) -> WorldQuery, --- How many worlds survived the filters. Consumes the query. count: (WorldQuery) -> number, --- The first world that survived the filters. Consumes the query. --- @returns `nil` when nothing matched. first: (WorldQuery) -> WorldInfo?, --- One survivor, chosen at random. Consumes the query. --- @returns `nil` when nothing matched. random: (WorldQuery) -> WorldInfo?, --- Every world that survived the filters. Consumes the query. collect: (WorldQuery) -> { WorldInfo }, } --- A weapon's combat class, from its id alone. export type WeaponClass = "RANGED" | "MAGIC" | "MELEE" export type Combat = { --- Ticks between auto-attacks for the current setup: 4 unarmed or for a weapon with --- no stats; the worn weapon's speed, one less on a ranged style's Rapid; a few fixed --- overrides (the Keris partisan of Amascut 4, the Twinflame staff 6 in a magic --- style, the echo Venator bow read as the Venator bow); 1 for a Scurrius bone weapon --- at a Giant rat. An autocast is 5, the game's cast cycle (the Twinflame staff's 6 still --- wins). attackSpeedTicks: (Combat) -> number, --- Whether the special attack is switched on, the combat tab's special attack bar. isSpecialAttackEnabled: (Combat) -> boolean, --- How far the worn weapon reaches now, in tiles: its base plus the long-range bonus on the --- long-range style (ranged weapons, powered staves), a staff's reach only while casting, --- the spell range while autocasting, 1 for melee. attackRange: (Combat) -> number, --- A weapon's class: `"RANGED"`, `"MAGIC"` or `"MELEE"`. Unlike `currentAttackStyle`, which --- follows the selected style, this changes the moment the weapon does. --- @param itemId The weapon to ask about; omit for the worn one. Nothing worn is `"MELEE"`. weaponClass: (Combat, number?) -> WeaponClass, --- The current attack style: `AttackStyle.MELEE`, `RANGED` or `MAGIC`, decided by the worn --- weapon's category and the selected style slot rather than the style's name, and `nil` --- when the weapon category cannot be read. --- --- @returns `nil` when it cannot be read. currentAttackStyle: (Combat) -> AttackStyle?, --- Ticks left before the next attack may land. --- --- A 4-tick weapon reads 3, 2, 1, 0, 3, ...: 0 on the tick before each swing. One tracker --- per client, observed every tick and brought up to date before a read, so `onGameTick` --- reads this tick's swing. It arms on an attack animation (the worn weapon's own, or --- another known attack animation) while attacking an NPC with an Attack option or a level --- and health, a player, or nothing, and on a new attackable NPC target while it reads 0; --- never on a block, an eat or a drink. The speed is the same as `attackSpeedTicks` (4 --- unarmed, one less on Rapid, the fixed overrides), and one less under the Blood moon set. --- An autocast counts 5 ticks, the game's cycle; an animation that outlasts the cycle (the --- Blowpipe, the Eye of Ayak) arms once the delay is 0; an eat's delay is added only for an --- eat the sustain manager queues (when it queues it), never from the "You eat" line; a --- spell cast with no animation and the Salamander are not counted --- (`setAttackCooldownTicks` and `reduceNextAttackCooldownTicks` correct it); on a client --- build that cannot read the animation's frame, a swing that restarts under the same --- animation is seen only once the animation ends. attackCooldownTicks: (Combat) -> number, --- Ticks left before another consumable may be used: the longest of the eat, --- potion and karambwan cycles, from the same tracker as `attackCooldownTicks`. consumableCooldownTicks: (Combat) -> number, --- Whether special energy covers the worn weapon's cost. canSpec: (Combat) -> boolean, --- A weapon's special attack energy cost, as a percentage. --- --- @param itemId The weapon to ask about; omit for the worn one. --- @returns `nil` when the item has no special attack. specCostPercent: (Combat, number?) -> number?, --- The attack delay is `ticks` now (`attackCooldownTicks` reads it this tick), and the next --- tick counts it down. For an encounter that resets the player's cooldown (Tormented Demons' --- shield). --- @param ticks A whole number; a negative one is 0. setAttackCooldownTicks: (Combat, number) -> (), --- The next swing that arms the attack delay arms it `ticks` shorter, once, and a later call --- replaces an earlier one. For an encounter that refunds the cooldown at the cast (the Royal --- Titans). --- @param ticks A whole number; a negative one is 0. reduceNextAttackCooldownTicks: (Combat, number) -> (), --- The best special attack weapon worn or carried, as an item id; the worn weapon wins a --- tie. --- @returns `nil` when neither holds a weapon with a special attack. bestSpecWeapon: (Combat) -> number?, --- Wield `bestSpecWeapon` from the inventory, when there is the energy for its special. --- @returns `false` when nothing was queued: it is already worn, or the energy is short. wieldBestSpecWeapon: (Combat) -> boolean, } --- A spellbook. export type Spellbook = "Standard" | "Ancient" | "Lunar" | "Arceuus" --- A prayerbook. export type Prayerbook = "Standard" | "Ruinous Powers" --- What a state machine's `run` answers, always with a second value, a `string?` reason: --- --- ```luau --- local status, reason = machine:run() --- ``` --- --- `"running"`: it is acting, or waiting for its last click to land; call it again next tick. --- `"done"`: the goal is met. `"blocked"`: it cannot get there until something changes, and --- `reason` says what. `"idle"`: a policy machine (loot, sustain) has nothing to do now, and --- `reason` says why when it deferred. The one-step setters that end on a goal --- (`magic:setAutocast`, `grandExchange:setOfferPrice`, ...) answer the same way. From --- `renderOverlay`, which cannot act, every `run` answers `"blocked"` and leaves its machine as it --- was. export type RunStatus = "running" | "done" | "blocked" | "idle" --- The constants for [RunStatus]. export type RunStatusClass = { --- Acting, or waiting for its last click to land: call again next tick. RUNNING: RunStatus, --- The goal is met. DONE: RunStatus, --- It cannot get there until something changes. BLOCKED: RunStatus, --- Nothing to do now. IDLE: RunStatus, } export type SpellInfo = { --- The spell's name, as `magic:cast` takes it. name: string, --- Magic level required. level: number, --- Which spellbook it belongs to. spellbook: Spellbook, --- Packed id of the spell's icon in the spellbook interface. widgetId: number, --- The autocast slot id. --- @returns `nil` when the spell cannot be autocast. autocastId: number?, --- The spell's icon sprite. --- @returns `nil` when it has none. spriteId: number?, --- What the spell is cast on; `"none"` for a spell `magic:cast` casts as it is. target: "none" | "npcOrPlayer" | "npc" | "player" | "groundItem" | "object" | "inventory" | "groundItemOrInventory", --- Rune cost, each `{ rune, quantity }`. requiredRunes: { { rune: Rune, quantity: number } }, } --- Why a spell can or cannot be cast. --- --- `canCast` is the answer. The per-requirement fields are the reason, for a --- panel that wants to say WHICH requirement failed. export type Castability = { --- Whether every requirement is met. --- @returns `nil` when a requirement could not be read -- no scene yet, not --- logged in. Not a third answer about the spell. canCast: boolean?, --- Whether a blighted sack is what satisfies the rune cost. usingBlightedSack: boolean, --- The spell this describes. spell: SpellInfo, --- Whether the right spellbook is open. spellbook: RequirementStatus, --- Whether the Magic level requirement is met. magicLevel: RequirementStatus, --- Whether the runes are carried. runes: RequirementStatus, --- Per-item requirements, each `{ status, requirement }`. items: { { status: RequirementStatus, requirement: SpellItem } }, } --- Whether one requirement is satisfied. export type RequirementStatus = "met" | "unmet" | "unknown" --- The constants for [RequirementStatus]. export type RequirementStatusClass = { --- The requirement is satisfied. MET: RequirementStatus, --- The requirement is not satisfied. UNMET: RequirementStatus, --- It could not be read: no scene yet, or not logged in. UNKNOWN: RequirementStatus, } -- Spells are named by a `Spells` constant (`Spells.HIGH_LEVEL_ALCHEMY`, its own -- name) or a display name, e.g. `"Wind Strike"`, `"High Level Alchemy"`. -- -- A direct spell casts with `cast`. A targeted spell is two halves — select the -- spell, then target something — and the `castOn*` helpers do both. export type Magic = { --- The rune pouch. runePouch: (Magic) -> RunePouch, --- The active spellbook. --- @returns `nil` when the varbit has not been read yet. activeSpellbook: (Magic) -> Spellbook?, --- The spell currently set to autocast. --- @returns `nil` when autocast is off, or the game's autocast id is not a spell Bento knows. autocastSpell: (Magic) -> SpellInfo?, --- A spell's static facts: level, runes, requirements. --- @param spell Spell name. spellInfo: (Magic, string) -> SpellInfo, --- Whether every requirement is met: spellbook, level, runes, items. --- @param spell Spell name. --- @returns `nil` when a requirement could not be read: no scene yet, not logged in. canCast: (Magic, string) -> boolean?, --- Every requirement and whether it is met, rather than one boolean. --- --- `assumedEquipped` is for an equip and a cast queued together, where the gear that --- satisfies the spell is not on yet; its `canCast` field is the answer. --- --- @param spell Spell name. --- @param assumedEquipped Item ids to treat as worn. Omit to check what is actually worn. castability: (Magic, string, { number }?) -> Castability, --- How many of a rune are carried, counting the rune pouch as well as the --- inventory. --- @param rune Which rune, e.g. `Rune.AIR`. runeCount: (Magic, Rune) -> number, --- Cast a direct spell, one with no target, when it can be cast. --- --- @param spell A `Spells` constant or a spell name. cast: (Magic, string) -> boolean, --- Select a spell, ready for a following `inventory:target(itemId)`. The `castOn*` members --- do both halves. --- --- @param spell A `Spells` constant or a spell name. --- @param assumedEquipped Item ids to treat as worn for the requirement check. --- @returns `false` when it takes no target or its requirements are not met. select: (Magic, string, { number }?) -> boolean, --- Select a spell and cast it on an NPC, the two together in one tick. --- --- @param spell A `Spells` constant or a spell name. --- @param npc An `NPC` (the top level or the boat the player stands in; `false` for one --- outside the top level and the boat the player stands in, one that is gone, or once --- another NPC has taken its index). --- @param assumedEquipped Item ids to treat as worn for the requirement --- check -- ask whether the cast would work once a swap lands, before --- swapping. Omit to check what is actually equipped. castOnNpc: (Magic, string, NPC, { number }?) -> boolean, --- Select a spell and cast it on a scene object, the two together in one tick. --- --- @param spell A `Spells` constant or a spell name. --- @param object A `TileObject` (the top level on the player's plane, or the deck of the --- boat the player stands in; `false` for one outside the top level and the boat the --- player stands in, removed, of a reloaded scene, or under a bridge). --- @param assumedEquipped Item ids to treat as worn for the requirement --- check -- ask whether the cast would work once a swap lands, before --- swapping. Omit to check what is actually equipped. castOnObject: (Magic, string, TileObject, { number }?) -> boolean, --- Select a spell and cast it on a player, the two together in one tick. Nothing is selected --- for a spell that cannot be cast on a player. --- --- @param spell A `Spells` constant or a spell name. --- @param player A `Player` (top-level world view). --- @param assumedEquipped Item ids to treat as worn for the requirement check. castOnPlayer: (Magic, string, Player, { number }?) -> boolean, --- Select a spell and cast it on a ground item (Telekinetic Grab), that stack only, the two --- together in one tick. Nothing is selected for a spell that cannot be cast on a ground item. --- --- @param spell A `Spells` constant or a spell name. --- @param item A `TileItem` (the top level or the boat the player stands in). --- @param assumedEquipped Item ids to treat as worn for the requirement check. castOnGroundItem: (Magic, string, TileItem, { number }?) -> boolean, --- Select a spell and cast it on an inventory item, the two together in one tick. --- --- @param spell A `Spells` constant or a spell name. --- @param item An `Item` (its slot when it carries one, else the first --- slot holding its id), an item id, or an item handle from a container query. --- @param assumedEquipped Item ids to treat as worn for the requirement --- check -- ask whether the cast would work once a swap lands, before --- swapping. Omit to check what is actually equipped. castOnItem: (Magic, string, Item | ItemHandle | number, { number }?) -> boolean, --- One step towards autocasting a spell: opens the autocast chooser, then picks the spell. --- Call it each tick until it stops answering `"running"`. --- --- local status, why = player:magic():setAutocast(Spells.FIRE_SURGE) --- if status == "blocked" then log:warn(why) end --- --- @param spell A `Spells` constant or a spell name. --- @param defensive `true` for defensive autocast. --- @returns `"done"` when it is set that way, `"running"` when a step was queued, and --- `"blocked"` with the reason when it cannot be set (a spell that cannot be autocast, a --- spellbook or staff that does not offer it). setAutocast: (Magic, string, boolean?) -> (RunStatus, string?), --- One step towards no autocast, by picking a combat style. Call it each tick until it stops --- answering `"running"`. --- @returns `"done"` when autocast is off, `"running"` when a step was queued, and --- `"blocked"` with the reason when it could not be queued. clearAutocast: (Magic) -> (RunStatus, string?), } -- A prayer is a `Prayer` constant (`Prayer.PIETY`) or a name: the display name -- (`"Protect from Magic"`), the constant's name, ignoring case and underscores. -- -- Flicking is a first-class operation here rather than something a plugin -- builds out of activate/deactivate: a flick goes together in a single game tick, which two -- separate calls would not. export type Prayers = { --- Whether quick prayers are switched on. quickPrayersActive: (Prayers) -> boolean, --- Whether any prayers are assigned to the quick-prayer slot. quickPrayersConfigured: (Prayers) -> boolean, --- The active prayerbook. --- @returns `nil` when it has not been read yet. prayerbook: (Prayers) -> Prayerbook?, --- Every prayer currently on, by display name. active: (Prayers) -> { string }, --- Whether one prayer is on. --- --- Takes a `Prayer` constant (or a name); `client:isPrayerActive(prayer)` answers the same. --- --- @param prayer A `Prayer` constant or a prayer's name. isActive: (Prayers, Prayer | string) -> boolean, --- Whether the prayer is in the active book and its level and unlock --- requirements are met. Uses the boosted Prayer level inside LMS. --- @param prayer A `Prayer` constant or a prayer's name. isAvailable: (Prayers, Prayer | string) -> boolean, --- Switch a prayer on. --- --- Does nothing when it is on, unavailable, or the live Prayer level is 0. To fall back to --- what the account has unlocked (Piety to Chivalry to the separate prayers), use --- `activateOffensivePrayers(style)`. To toggle: --- --- if prayer:isActive(p) then prayer:deactivate(p) else prayer:activate(p) end --- --- @param prayer A `Prayer` constant or a prayer's name. activate: (Prayers, Prayer | string) -> boolean, --- Switch a prayer off, when it is on. --- --- `deactivate(Prayer.PIETY)` on an account without Piety answers `false` and --- leaves the fallback prayers on. `deactivateOffensivePrayers()`, the counterpart of --- `activateOffensivePrayers(style)`, takes the fallbacks too (Piety not unlocked: --- Chivalry, else Ultimate Strength and Incredible Reflexes; Rigour: Deadeye or Eagle Eye; --- Augury: Mystic Vigour or Mystic Might). --- --- @param prayer A `Prayer` constant or a prayer's name. deactivate: (Prayers, Prayer | string) -> boolean, --- Flick prayers: on ones are toggled off and back on, off ones are switched on, every press --- together in one game tick or not at all, joining an open `Actions.sameTick()`. An inactive --- prayer the account cannot use is not pressed: `activateOffensivePrayers(style)` and --- `deactivateOffensivePrayers()` take the fallbacks. To flick the best offensive set: --- --- prayer:flick(prayer:offensivePrayers(player:combat():currentAttackStyle())) --- --- @param prayers `Prayer` constants or names; duplicates are dropped. --- @returns `false` when the live Prayer level is 0. flick: (Prayers, { Prayer | string }) -> boolean, --- The best available offensive set for an attack style, by display name, without causing --- any input. --- @param style Attack style, e.g. `AttackStyle.MELEE`. offensivePrayers: (Prayers, AttackStyle) -> { string }, --- Switch on the best offensive set for an attack style. --- @param style Attack style, e.g. `AttackStyle.MELEE`; omit for the current one. --- @returns `false` when nothing was switched on, or the current style cannot be read. activateOffensivePrayers: (Prayers, AttackStyle?) -> boolean, --- Switch off the offensive prayers that are on. deactivateOffensivePrayers: (Prayers) -> boolean, --- Switch off every prayer that is on, or the quick-prayer orb when quick prayers are on. deactivateAllPrayers: (Prayers) -> boolean, --- Switch quick prayers on. --- --- `activateQuickPrayers()` / `deactivateQuickPrayers()` ask for a state rather than a flip --- (`quickPrayersActive()` tells which). activateQuickPrayers: (Prayers) -> boolean, --- Switch quick prayers off. deactivateQuickPrayers: (Prayers) -> boolean, --- Flick quick prayers in one tick. --- @returns `false` at zero prayer points, or when none are configured. flickQuickPrayers: (Prayers) -> boolean, } --- A worn-equipment slot. export type WornSlot = "head" | "cape" | "amulet" | "weapon" | "body" | "shield" | "legs" | "hands" | "feet" | "ring" | "ammo" export type Equipment = { --- A query over what is worn. search: (Equipment) -> ContainerQuery, --- What is worn in one slot. --- @param slot Which slot, e.g. `"weapon"`; another name raises. --- @returns `nil` when the slot is empty. itemIn: (Equipment, WornSlot) -> ItemHandle?, --- Whether an item occupies both hands, from its equipment stats, so equipping it would --- unequip the shield. --- --- @param itemId Exact item id. isTwoHandedWeapon: (Equipment, number) -> boolean, --- Interact with a worn item by id. --- @param itemId Exact item id. --- @param options An option (`"Remove"`), or options to try in order. interact: (Equipment, number, string | { string }) -> boolean, --- Interact with a worn item by name. --- @param name Name pattern, matched as for `ContainerQuery.named`. --- @param options An option (`"Remove"`), or options to try in order. interactName: (Equipment, string, string | { string }) -> boolean, } export type Quests = { --- A quest's state: not started, in progress, or finished. --- @param quest The quest, as its constant: `Quest.DRAGON_SLAYER_I`. --- @returns `nil` when the quest's var is unread. state: (Quests, Quest) -> QuestState?, --- Whether a quest is finished. --- @param quest The quest, as its constant. isCompleted: (Quests, Quest) -> boolean, --- The raw progress var behind a quest, for the steps within it. --- @param quest The quest, as its constant. --- @returns `nil` when the quest's var is unread. progressValue: (Quests, Quest) -> number?, --- Every quest with a `Quest` constant, with its state and progress value; `state` and --- `value` are `nil` while its var is unread. allProgress: (Quests) -> { { quest: Quest, state: QuestState?, value: number? } }, } -- Eating, drinking and curing. -- -- Every call here but `consumeTripleFood` decides for itself whether the thing is worth doing -- and returns `false` when it is not, so it is safe to call every tick. `consumeTripleFood` has -- no gate: the caller decides when it is warranted. export type Consumables = { --- Poison and venom state, and incoming damage with it. poisonState: (Consumables) -> { isPoisoned: boolean, isVenomed: boolean, incomingDamage: number, rawValue: number }, --- Cure poison or venom with the best potion carried, else Cure Me. --- --- Venom is always cured. Poison is cured when no threshold is given, or --- when incoming poison damage has reached it. --- @param damageThreshold Only cure poison at or above this damage. --- @returns `false` when not afflicted, or below the threshold. curePoison: (Consumables, number?) -> boolean, --- Eat one food when hitpoints are low. Any carried food that heals counts, karambwans --- included, but the gout tuber, Recipe for Disaster's quest foods and rock cakes. Fewest --- bites first (a cake is 3), then inventory order; tick-eat foods (karambwans, halibut, the --- gnome foods) after all the rest. --- @param threshold Eat at or below this boosted hitpoints level. Omit to eat at or below 60% --- of real hitpoints with a food that would not overheal, or at 5 hitpoints or fewer. --- @param includeBlighted Whether blighted food counts. Omit for the default: only inside the --- Wilderness. --- @returns `false` when there is no food, or it is not time to eat. consumeFood: (Consumables, number?, boolean?) -> boolean, --- Eat food and a karambwan together in one tick, or neither: the combo eat. --- @param threshold Eat at or below this boosted hitpoints level. --- @param includeBlighted Whether blighted food counts. Omit for the default. consumeKarambwanFood: (Consumables, number?, boolean?) -> boolean, --- Eat food, a karambwan and drink a Saradomin brew together in one tick, or none of them. --- Whatever of the three is carried; no hitpoints gate. --- @param includeBlighted Whether blighted food counts. Omit for the default. consumeTripleFood: (Consumables, boolean?) -> boolean, --- Drink a prayer restore when prayer points are low enough. --- @param atOrBelowPoints Drink at or below this many prayer points; default 10. consumePrayerRestore: (Consumables, number?) -> boolean, --- Drink a magic boost when it has run down. --- @param boostLeftAtMost Drink when at most this much of the boost is left (boosted level --- less real level); default 5. consumeMagicBoost: (Consumables, number?) -> boolean, --- Drink a strength boost when it has run down. --- @param boostLeftAtMost As `consumeMagicBoost`'s. consumeStrengthBoost: (Consumables, number?) -> boolean, --- Drink an attack boost when it has run down. --- @param boostLeftAtMost As `consumeMagicBoost`'s. consumeAttackBoost: (Consumables, number?) -> boolean, --- Drink a defence boost when it has run down. --- @param boostLeftAtMost As `consumeMagicBoost`'s. consumeDefenceBoost: (Consumables, number?) -> boolean, --- Drink a ranging boost when it has run down. --- @param boostLeftAtMost As `consumeMagicBoost`'s. consumeRangingBoost: (Consumables, number?) -> boolean, --- Top up run energy: below 5% an energy potion; below 40% with no stamina buff running a --- stamina potion; otherwise nothing. consumeEnergyPotion: (Consumables) -> boolean, } -- Hopping. The `hopToAny` / `hopToSameRegion` / `hopToSafe` / `hopToActivity` calls each pick a -- world from the compatible candidates and hop to it in one go; `hopTo` names -- the world itself. Each answers `false` when no world qualifies. export type WorldHopper = { --- Where a hop this plugin started has got to. status: (WorldHopper) -> { target: number?, stage: WorldHopStage, openAttempts: number, error: string? }, --- Hop to a named world. --- --- Hops to `world` through the world switcher, opening it first; `status()` follows the hop. --- --- @param world World number. --- @returns `false` for world `0`, a world not in the directory, or the world already on. hopTo: (WorldHopper, number) -> boolean, --- Hop to a random compatible world. --- --- A random online world with the current world's profile: members, seasonal, hardcore, --- deadman, beta, legacy-only, fresh start, EoC-only, quest speedrunning, PvP Arena, --- tournament and no-save each on both or on neither. PvP, high-risk, bounty, skill --- total and Last Man Standing worlds may be picked. The skill total is met and the --- world has at most 1,950 players. hopToAny: (WorldHopper) -> boolean, --- Hop to a random world in the current world's region and location. --- --- A random world of the current world's region AND its `WORLD_LOCATIONS` location (US East --- and US West are one region), through the filter `hopToAny` describes. The hop goes --- through the world switcher. hopToSameRegion: (WorldHopper) -> boolean, --- Hop to a random compatible world, excluding PvP, high-risk and bounty. --- --- As `hopToAny()`, also without PvP, high-risk and bounty worlds, optionally in the current --- region. --- --- @param restrictRegion Also stay in the current country. hopToSafe: (WorldHopper, boolean) -> boolean, --- Hop to a random compatible world whose activity label contains the text, ignoring case. --- --- @param text What to look for in the directory's activity label. hopToActivity: (WorldHopper, string) -> boolean, --- Every world this account could hop to: the worlds `hopToAny` picks from. candidates: (WorldHopper) -> { WorldInfo }, --- Quick-hop one step down the directory. --- @param outOfDanger Skip dangerous worlds. --- @returns `false` when not logged in. hopPrevious: (WorldHopper, boolean) -> boolean, --- Quick-hop one step up the directory. --- @param outOfDanger Skip dangerous worlds. --- @returns `false` when not logged in. hopNext: (WorldHopper, boolean) -> boolean, } export type WorldPvp = { --- Whether the local player is somewhere they can be attacked, and how. state: (WorldPvp) -> { kind: "safe" | "active" | "unknown", combatRange: { min: number, max: number }?, reason: PvpUnknownReason? }, --- Who can attack the local player right now. --- --- `unreadableCandidates` counts nearby players whose combat level could --- not be read — treat a non-zero count as "the threat list is incomplete" --- rather than as "no threat". threats: (WorldPvp) -> { kind: "safe" | "active" | "unknown", reason: PvpUnknownReason?, combatRange: { min: number, max: number }?, unreadableCandidates: number?, players: { Player }? }, } export type DepositBox = { --- Whether the deposit box interface is open. isOpen: (DepositBox) -> boolean, --- Open the nearest deposit box. Already open is success. --- @returns `false` when none is in range. open: (DepositBox) -> boolean, --- Close the deposit box with its close button. --- @returns `false` when it is not open. close: (DepositBox) -> boolean, --- Press the box's Deposit inventory button. --- @returns `false` when it is not open. depositInventory: (DepositBox) -> boolean, --- Press the box's Deposit worn items button. --- @returns `false` when it is not open. depositEquipment: (DepositBox) -> boolean, --- Press the box's button that empties the looting bag and other containers. --- @returns `false` when it is not open. depositContainers: (DepositBox) -> boolean, --- One step towards depositing an amount of a carried item. Call it each tick until it --- answers `"done"`, and `amount` goes in once, not again each call. An amount other than 1, --- 5, 10 or `"all"` opens the amount prompt, and a later call types into it. --- --- @param itemId Exact item id. --- @param amount A whole number from 1, or `"all"`. --- @returns `"running"` while it is being made, `"done"` once it has landed or there is --- nothing to do (the box is shut, the item is not carried), and `"blocked"` with the reason --- when it could not be queued. deposit: (DepositBox, number, number | "all") -> (RunStatus, string?), } --- A container as the client last saw it (the bank shut, the looting bag unchecked): what --- it held, when, and whether it is in view now. The client saves it per account, so it --- outlives a relog or a restart. export type RememberedItems = { --- What it held, slot by slot: empty slots left out, a placeholder at quantity 0. --- Read-only: acting on an item needs the container open. items: { ItemHandle }, --- When it was last seen, in Unix milliseconds. seenAt: number, --- Whether it is in view right now, so `items` are current. live: boolean, } export type Inventory = { --- Free inventory slots, out of 28. --- --- @returns `28` minus the number of occupied slots. emptySlots: (Inventory) -> number, --- Whether all 28 slots are occupied. isFull: (Inventory) -> boolean, --- Whether any inventory slot holds at least one item of `itemId`. --- --- @param itemId Exact item id. contains: (Inventory, number) -> boolean, --- Whether the inventory holds an item whose whole name matches, ignoring case: `|` --- separates alternatives and `*` is any run of characters. For part of a name, use --- `search():containing(text)`. --- @param name The name pattern, e.g. `"Shark|Manta ray"` or `"Prayer potion(*)"`. containsName: (Inventory, string) -> boolean, --- Total quantity of `itemId` held, counting stack sizes. --- @param itemId Exact item id. --- @returns `0` when the item is absent. itemAmount: (Inventory, number) -> number, --- Total quantity held of every item whose name matches. --- @param name The name pattern, matched as for `containsName`. itemAmountName: (Inventory, string) -> number, --- Total quantity of edible food carried that heals at least `minHeal` at the current --- Hitpoints level. Noted food is excluded: it still carries heal data but cannot be eaten. --- @param minHeal The smallest heal that counts; default 1, anything that heals. foodAmount: (Inventory, number?) -> number, --- Total prayer-restore doses carried, doses multiplied by quantity. --- --- Noted potions are excluded, for the same reason as `foodAmount`. prayerDoses: (Inventory) -> number, --- How many carried potions cure poison or venom: items, not doses, so a 4-dose antidote --- counts 1. --- --- Exactly the list `consumables:curePoison()` drinks from, so this --- counts what that would actually find. cureAmount: (Inventory) -> number, --- Hitpoints all the carried food would heal: heal at the current Hitpoints level times bites --- left, over every stack. Noted food and Hitpoints-boosting potions (Saradomin brew) do not --- count. totalHeal: (Inventory) -> number, --- Prayer points all the carried potions would restore: points per dose times doses, over --- every stack. Noted potions do not count. totalPrayerRestore: (Inventory) -> number, --- Open a query over the inventory's items. --- @returns A `ContainerQuery` snapshot; see `ids`, `named` and `first`. search: (Inventory) -> ContainerQuery, --- The looting bag's contents as this account last saw them. --- --- `nil` until the bag has been checked or filled with Bento running. `live` while --- its check view or the bank's view of it is open. lootingBag: (Inventory) -> RememberedItems?, --- Interact with the first item of `itemId`. --- @param itemId Exact item id. --- @param options An option (`"Eat"`), or options to try in order; the first the item --- exposes wins, counting sub-menu options as well as top-level ones. --- @returns `false` when the item is absent or no listed option resolves. interact: (Inventory, number, string | { string }) -> boolean, --- Interact with the first item whose whole name matches. --- @param name The name pattern, matched as for `containsName`. --- @param options An option (`"Eat"`), or options to try in order. --- @returns `false` when no item matches or no listed option resolves. interactName: (Inventory, string, string | { string }) -> boolean, --- Interact with the first of `itemIds` that is carried and offers one of `options`. --- --- It takes each id's first slot, and matches option names ignoring case and markup. --- --- @param itemIds Item ids, tried in list order rather than by slot. --- @param options The options to look for; the item's own option order picks among --- them, not this list's. interactAny: (Inventory, { number }, string | { string }) -> boolean, --- Select an item as the source of a following target action. --- --- Pairs with `target`: select the source, then target what it is used on. --- `useOnItem`, `useOnNpc` and `useOnObject` do both halves for you. --- --- @param itemId Exact item id; the first matching slot is selected. --- @returns `false` when the item is absent. select: (Inventory, number) -> boolean, --- Apply an already-selected source to an inventory item. --- --- Uses what this plugin selected (`select(id)`, `magic:select(spell)`) on the item in that --- slot when the slot holds `itemId`, once per selection. --- --- @param itemId Exact item id of the destination item. --- @param slot The inventory slot (0-based) holding it; the first slot holding it when --- left out. --- @returns `false` when the item is absent from that slot, or nothing is selected. target: (Inventory, number, number?) -> boolean, --- Use one inventory item on another: select, then target, together in one tick. --- --- `useOnItem(a, a)` targets a second slot, never the source's own. It takes the first slot --- holding each id. --- --- @param sourceItemId The item being used. --- @param targetItemId The item it is used on. --- @returns `false` when either item is absent. useOnItem: (Inventory, number, number) -> boolean, --- Use an inventory item on an NPC: select, then target the NPC. --- --- Takes an `NPC` (the top level or the boat the player stands in; `false` for one outside --- the top level and the boat the player stands in, one that is gone, or once another NPC --- has taken its index) or an NPC id (the nearest NPC with it); the select and the use --- together in one tick. --- --- @param sourceItemId The item being used. --- @param npc An `NPC` (the top level or the boat the player stands in), or an NPC id. --- @returns `false` when the item is absent or the NPC is gone. useOnNpc: (Inventory, number, NPC | number) -> boolean, --- Use an inventory item on a scene object: select, then target it. --- --- Takes a `TileObject` (the top level on the player's plane, or the deck of the boat the --- player stands in; `false` for one outside the top level and the boat the player stands --- in, removed, of a reloaded scene, or under a bridge) or an object id (the nearest object --- with it); the select and the use together in one tick. --- --- @param sourceItemId The item being used. --- @param object A `TileObject` (the top level or the boat the player stands in), or an --- object id. --- @returns `false` when the item is absent or the object is gone. useOnObject: (Inventory, number, TileObject | number) -> boolean, --- Use an inventory item on a player: select, then use it on the player, together in one --- tick. --- --- @param sourceItemId The item being used (the first slot holding it). --- @param player A `Player` (top-level world view). --- @returns `false` when the item is absent, or the player is gone or in another world view. useOnPlayer: (Inventory, number, Player) -> boolean, --- Use an inventory item on a ground item: select, then use it on that stack (its id and its --- tile), together in one tick. --- --- @param sourceItemId The item being used (the first slot holding it). --- @param item A `TileItem` (the top level or the boat the player stands in). --- @returns `false` when the item is absent, or the stack is gone or outside the top level --- and the boat the player stands in. useOnGroundItem: (Inventory, number, TileItem) -> boolean, } --- An essence pouch's size. export type EssencePouchSize = "SMALL" | "MEDIUM" | "LARGE" | "GIANT" | "COLOSSAL" --- One essence pouch as the game has it now (`player:essencePouches()`). export type EssencePouch = { --- Which pouch. size: EssencePouchSize, --- Essence in it now. stored: number, --- What it holds at its current wear and, for the colossal pouch, Runecraft level. capacity: number, --- Whether it has worn down: it holds less than a repaired pouch. degraded: boolean, --- Its wear counter; `nil` for the small pouch, which never wears. degradation: number?, --- The wear at which it next loses capacity; `nil` for the small pouch. nextBreakpoint: number?, } --- An achievement diary area. export type DiaryArea = "ARDOUGNE" | "DESERT" | "FALADOR" | "FREMENNIK" | "KANDARIN" | "KARAMJA" | "KOUREND" | "LUMBRIDGE" | "MORYTANIA" | "VARROCK" | "WESTERN" | "WILDERNESS" --- A diary tier's difficulty. export type DiaryDifficulty = "EASY" | "MEDIUM" | "HARD" | "ELITE" --- Achievement diary completion (`player:diaries()`), always current: the game sends the --- completion vars at login. export type Diaries = { --- Whether `area`'s `difficulty` tier is complete; `false` logged out. --- @param area The diary area, e.g. `"ARDOUGNE"`. --- @param difficulty `"EASY"`, `"MEDIUM"`, `"HARD"` or `"ELITE"`. isComplete: (Diaries, DiaryArea, DiaryDifficulty) -> boolean, } --- The Kingdom of Miscellania as the client last recorded it (`player:kingdom()`). export type Kingdom = { --- Approval as the game keeps it, 0 to 127. approval: number, --- Approval as the percent the game shows. approvalPercent: number, --- Coins in the coffer. coffer: number, --- An estimate of today's approval percent: it falls each day since `lastChangedAt`. estimatedApprovalNow: number, --- An estimate of today's coffer. estimatedCofferNow: number, --- When approval or coffer last changed, Unix milliseconds. lastChangedAt: number, --- When the client last saw them live, Unix milliseconds. seenAt: number, --- Whether the game shows them right now (in the kingdom, or both above 0). live: boolean, } --- The local player's slayer task (`player:slayer()`). export type SlayerTask = { --- The task as the game names it. name: string, --- How many are left to kill. amount: number, --- How many the task was given at, after an extend or shorten. initialAmount: number, --- The area a Konar task names, or `nil` for none. location: string?, --- The `SLAYER_MASTER` varbit: which master gave it (7 is Krystilia, 10 Mortimer). master: number, --- The task streak with that master. streak: number, --- Slayer reward points. points: number, } --- Which daily reminder. export type DailyKind = "HERB_BOXES" | "STAVES" | "ESSENCE" | "RUNES" | "SAND" | "FLAX" | "ARROWS" | "BONEMEAL" | "DYNAMITE" --- One daily reminder (`player:dailies()`). export type Daily = { --- Which one. kind: DailyKind, --- Whether the account qualifies (the diary or quest done; not an ironman where that --- matters). eligible: boolean, --- Whether it qualifies and today's supply has not been claimed. available: boolean, } --- One timer from `player:buffs():active()`. export type Buff = { --- The timer's name ("STAMINA", "DIVINE_SUPER_COMBAT"). timer: string, --- Game ticks left, rounded up. remainingTicks: number, --- Milliseconds left. remainingMs: number, --- When the timer started, Unix ms. A timer the game restarts --- has a new start; one it shortens keeps its start and moves `endsAt`. startedAt: number, --- When it runs out, Unix ms. endsAt: number, } --- The local player's timers and buffs, which the client tracks whether or not the --- timers-and-buffs plugin is on. Kept for the session. export type Buffs = { --- Every running timer, in a fixed order. active: (Buffs) -> { Buff }, --- Whether a timer runs now. --- @param timer The timer's name ("STAMINA"); another name raises. has: (Buffs, string) -> boolean, --- Every buff counter that is up, by its name ("COLOSSEUM_DOOM"), with its count. counters: (Buffs) -> { [string]: number }, --- One counter's count. --- @param counter The counter's name; another name raises. --- @returns `nil` while the counter is down. counter: (Buffs, string) -> number?, } export type PlayerDomain = { --- Whether the local player is walking or running. isMoving: (PlayerDomain) -> boolean, --- Whether a character is logged in. --- --- Almost every hook should start here: the rest of this domain answers --- with defaults rather than errors when nobody is logged in. isLoggedIn: (PlayerDomain) -> boolean, --- Whether the local player is playing an animation. isAnimating: (PlayerDomain) -> boolean, --- Whether the local player has an interaction target. isInteracting: (PlayerDomain) -> boolean, --- Whether run is toggled on. Says nothing about remaining energy. isRunEnabled: (PlayerDomain) -> boolean, --- Turn run on or off. --- --- Asks for a STATE, not a flip, so it will not turn run off because it happened to already --- be on. --- @param enabled What it should be. --- @returns `false` when it is already that. setRunEnabled: (PlayerDomain, boolean) -> boolean, --- Turn the boat the player is sailing to a compass step. --- @param step 0 to 15, as the "Set heading" entry captures it. Anything else raises. setBoatHeading: (PlayerDomain, number) -> boolean, --- Whether the player is idle enough to be given something to do. --- --- Neither animating nor moving. A cheap guard against queueing a second --- action on top of one already playing out. isIdle: (PlayerDomain) -> boolean, --- Whether the local player is inside a player-owned house. isInPoh: (PlayerDomain) -> boolean, --- The local player's own house as the client last saw it inside: its portals, --- jewellery box, pool, altars and travel furniture. Saved per account and refreshed in --- full on each visit, so removed furniture is noticed; a friend's house is never --- recorded. --- @returns `nil` when this account's house has never been seen. house: (PlayerDomain) -> House?, --- Current hitpoints, as the orb reads them. currentHitpoints: (PlayerDomain) -> number, --- Current prayer points, as the orb reads them. currentPrayerPoints: (PlayerDomain) -> number, --- Hitpoints, prayer, run energy and special attack energy, as the orbs read them. vitals: (PlayerDomain) -> Vitals, --- The local player's combat level. combatLevel: (PlayerDomain) -> number, --- The tile the local player stands on, in the coordinates of the scene loaded now. Inside an --- instance this is the instance's tile, the space `getWorldLocation()` answers in; on an --- ordinary map it is the same tile as `trueTile`. --- @returns `nil` when logged out. tile: (PlayerDomain) -> WorldPoint?, --- The tile the local player stands on in the real world: inside an instance, the map tile --- the instance was copied from. --- @returns `nil` before there is a local player. trueTile: (PlayerDomain) -> WorldPoint?, --- Walk to a tile in the loaded scene, on-screen or not. A tile of the boat you stand on (a --- deck tile, as `getWorldLocation()` gives one aboard) walks on the deck; at the helm no --- walk is made. For anywhere further, use `webwalk`. --- --- player:walkTo(WorldPoint.new(3200, 3200, 0)) --- player:walkTo(bankTile, 3) -- anywhere within 3 tiles will do --- --- @param tile Destination. --- @param distance How close is close enough, in tiles. With it, already being within it --- answers `true` and causes no input, and the walk goes to a reachable tile within it. --- @returns `false` when no walk was queued. walkTo: (PlayerDomain, WorldPoint, number?) -> boolean, --- Walk to the cheapest reachable tile in an area. Already being inside it answers `true` and --- causes no input. --- @param area Destination area. --- @returns `false` when no tile of it can be reached. walkToArea: (PlayerDomain, WorldArea) -> boolean, --- Cancel a walk by walking to the tile already stood on. stopWalking: (PlayerDomain) -> boolean, --- This plugin's webwalk: long-distance pathing across the world. There is one per plugin, and --- every call answers it. Raises where no plugin's code is running to own it, as in --- `coroutine.wrap(player.webwalk)(player)`; the walk's `start` calls raise there too. --- --- player:webwalk():start(WorldPoint.new(3165, 3487, 0)) --- if player:webwalk():isWalking() then return end --- webwalk: (PlayerDomain) -> Webwalk, --- Whether the local player is teleblocked. isTeleblocked: (PlayerDomain) -> boolean, --- The local player's Wilderness level, read off the HUD. --- @returns `0` when not in the Wilderness. wildernessLevel: (PlayerDomain) -> number, --- Ask the client to log out. logout: (PlayerDomain) -> boolean, --- The 28-slot inventory. inventory: (PlayerDomain) -> Inventory, --- Attack range and speed, cooldowns, special attack, and attack style. combat: (PlayerDomain) -> Combat, --- Spellbook, runes, castability, and casting. magic: (PlayerDomain) -> Magic, --- Prayerbook, activation, flicking, and quick prayers. prayer: (PlayerDomain) -> Prayers, --- Worn gear. equipment: (PlayerDomain) -> Equipment, --- Quest states and progress. quests: (PlayerDomain) -> Quests, --- Food, potions, and poison cures. consumables: (PlayerDomain) -> Consumables, --- The account's farming patches and the Farming Guild contract, as the client tracks them. farming: (PlayerDomain) -> Farming, --- Sailing: the boat the player is on, their boats, crew, docks, port tasks, --- Barracuda Trials and shipwrecks. sailing: (PlayerDomain) -> Sailing, --- The four Fossil Island bird house spaces as the client last saw them, saved per --- account; empty until the player has been there with the client running. birdhouses: (PlayerDomain) -> { BirdhouseStatus }, --- Item charges: fixed by the item id, or counted by the client (jewellery, the --- chronicle, the ring of endurance) and saved per account. charges: (PlayerDomain) -> ItemCharges, --- Timers and buffs, tracked whether or not the timers-and-buffs plugin is on. buffs: (PlayerDomain) -> Buffs, --- The daily reminders, in a fixed order, read live from the game's vars. dailies: (PlayerDomain) -> { Daily }, --- The slayer task, read from the game. --- @returns `nil` without a task, or before the client has read it (it does within a --- tick of a change). slayer: (PlayerDomain) -> SlayerTask?, --- The Kingdom of Miscellania's approval and coffer, saved per account, with an estimate of --- their decay since they were last seen. --- @returns `nil` before the client has recorded them for this account. kingdom: (PlayerDomain) -> Kingdom?, --- The five essence pouches as the game has them now, small to colossal: what each --- holds, what it can hold, and its wear. Empty when logged out. essencePouches: (PlayerDomain) -> { EssencePouch }, --- Achievement diary completion, read from the game's own completion vars. diaries: (PlayerDomain) -> Diaries, } -- The bank, and the loadout machine built on it. -- -- An amount is a whole number from 1, or `"all"`; anything else raises. Rows the bank hands out -- (`search`, `item`, `cached`) are read-only: act with `withdraw` and `click`. export type Bank = { --- Whether the bank interface is open. A pure read. isOpen: (Bank) -> boolean, --- Whether the bank is open, or a bank booth, chest or banker is in range. isNearBank: (Bank) -> boolean, --- The bank as this account last saw it, kept across relogs and restarts. --- --- `nil` until this account's bank has been opened with Bento running: an unseen bank and an --- empty one are different answers. `live` while the bank is open. The rows are read-only: to --- act on an item, `withdraw` or `click` with the bank open. cached: (Bank) -> RememberedItems?, --- The seed vault as this account last saw it, kept across relogs and restarts. --- --- `nil` until the seed vault has been opened with Bento running. `live` while it is --- open. seedVault: (Bank) -> RememberedItems?, --- Whether the bank PIN keypad is open. A read only: no call types a PIN, so a plugin stops --- here and hands back to the player. onPinScreen: (Bank) -> boolean, --- Lets the number keys the player types press the bank PIN keypad's digits, with no click --- and no mouse movement. It lasts one opening of the keypad: call it each time the keypad --- is set up (the `bankpinButtonSetup` script callback). The player types the PIN; no call --- types one. enablePinKeyboard: (Bank) -> (), --- Whether the bank's Note withdrawal mode is on. withdrawNotesEnabled: (Bank) -> boolean, --- The nearest banker NPC exposing Bank. --- @returns `nil` when none is reachable. nearestBanker: (Bank) -> NPC?, --- The deposit box interface. depositBox: (Bank) -> DepositBox, --- A query over the bank's contents, live or last-known. An unseen bank reads as empty: --- `cached() ~= nil` tells the two apart. search: (Bank) -> ContainerQuery, --- The first bank slot holding an item. --- --- `bank:item(id) ~= nil` says whether the bank holds it, and its `quantity()` how many. Read --- from the bank container, which is remembered after the bank closes. --- --- @param itemId Exact item id. --- @returns `nil` when the bank does not hold it. item: (Bank, number) -> ItemHandle?, --- Deposit from the inventory. --- --- `bank:deposit(id, "all")` deposits every one; it takes any amount. A repeat of the same --- call is not throttled. --- --- @param itemId Exact item id. --- @param amount A whole number from 1, or `"all"`. --- @returns `false` when the bank is shut or the inventory does not hold it. deposit: (Bank, number, number | "all") -> boolean, --- Withdraw from the bank. --- --- `bank:withdraw(id, "all")` and `bank:withdraw(id, n)`. Withdraw-X opens the amount prompt; --- `ui:dialogue():typeAmount(n)` answers it. --- --- @param itemId Exact item id. --- @param amount A whole number from 1, or `"all"`. --- @returns `false` when the bank is shut or does not hold it. withdraw: (Bank, number, number | "all") -> boolean, --- Press the bank's Deposit inventory button. --- @returns `false` when the bank is shut. depositInventory: (Bank) -> boolean, --- Press the bank's Deposit worn items button. --- @returns `false` when the bank is shut. depositEquipment: (Bank) -> boolean, --- Click Deposit on the looting bag in the inventory. --- @returns `false` when the bank is closed or the inventory holds no looting bag. depositLootingBag: (Bank) -> boolean, --- Press the bank's Deposit loot bags and other containers button. --- @returns `false` when the bank is shut. depositContainers: (Bank) -> boolean, --- Turn Note withdrawal mode on or off. The bank's button flips the mode, so this presses it --- only when the mode differs. --- @param on What it should be. --- @returns `true` when it already is, or the click was queued; `false` when it differs and --- the bank is shut. setWithdrawNotes: (Bank, boolean) -> boolean, --- Toggle placeholders. --- @returns `false` when the bank is shut. togglePlaceholders: (Bank) -> boolean, --- Use one named option on one bank item, the route to an option `withdraw` has no amount for --- (`"Withdraw-All-but-1"`). --- @param item The name pattern, matched as for `inventory:containsName`. --- @param option The option to use, e.g. `"Withdraw-All"`. --- @returns `false` when the bank is shut, no item matches, or it has no such option. click: (Bank, string, string) -> boolean, --- Open the nearest bank. --- --- Already open is success. Returns `false` when no bank target is in range (logged once per --- run of misses). One search a tick per client: a second call in the tick reuses the first's --- result, so a miss costs nothing the second time. --- --- The nearest banker or bank object by path. It does not answer the PIN-settings warning, and --- it banks on an ultimate ironman. --- --- @param target Name pattern to prefer; omit for the nearest of any kind. open: (Bank, string?) -> boolean, --- Close the bank with its frame's close button. --- --- The button is `Bankmain.FRAME` op 1 on child 11. Not Escape --- (`ui:pressKey(KeyEvent.VK_ESCAPE)`), which closes the bank only while the game's --- Escape-closes-interfaces setting is on. --- --- @returns `false` when the bank is not open. close: (Bank) -> boolean, --- A bank trip towards a goal: open the bank, deposit what the goal does not want, withdraw and --- equip what it does. The goal is fixed here, and a malformed goal raises here, so a typo --- cannot leave an item out of a goal and deposit it. It reads no game state, so make it once, --- when the plugin loads or starts, and keep it: its `run` advances one step a tick. --- --- ```luau --- local trip = bank:newLoadout("4151:1,1704:1", { { itemId = ItemID.SHARK, quantity = 10 } }) --- --- function plugin:onGameTick() --- local status, reason = trip:run() --- if status == "done" then --- -- worn and carried: move on --- elseif status == "blocked" then --- log:warn(reason) -- it will not get there by itself: fetch what it lacks, or stop --- end --- -- "running": it acted, or is waiting for its last click to land --- end --- ``` --- --- @param equipment What to wear, and which slots to keep empty. A slot it does not name is --- left as it is, so an empty goal changes nothing worn. --- @param inventory What to carry; everything else carried is deposited. newLoadout: (Bank, EquipmentGoal, InventoryGoal) -> Loadout, } --- One item to wear. export type EquippedLoadoutItem = { --- The item to wear. itemId: number, --- How many: more than one only for stackable ammo. quantity: number?, --- For stackable ammo: when fewer than `quantity` can be had, and no more than this many are --- left worn, carried and banked together, `run` answers `"blocked"`. Above it the trip goes --- with what there is. Nothing restocks it. --- @returns `nil` when the entry has no threshold. lowAmountThreshold: number?, } --- One slot to keep empty: whatever is worn there goes to the bank. export type EmptyLoadoutSlot = { --- The slot to keep empty. emptySlot: WornSlot, } --- One row of an equipment goal: an item to wear, or a slot to keep empty. export type EquipmentGoalRow = EquippedLoadoutItem | EmptyLoadoutSlot --- What a loadout wears: a goal string, `"itemId:quantity"` entries separated by commas with an --- optional third `:lowThreshold` field (`"4151:1,892:5000:200"`), or rows. A slot the goal does --- not name is left as it is. To have one emptied, name it: a `"slot:empty"` entry in the string --- (`"4151:1,shield:empty"`), or an `{ emptySlot = "shield" }` row. An item the goal wears stays --- on, whatever its slot says. A malformed entry raises. --- --- ```luau --- -- wear nothing in the hands, whatever is there now; leave every other slot alone --- local trip = bank:newLoadout({ { emptySlot = "weapon" }, { emptySlot = "shield" } }, {}) --- ``` export type EquipmentGoal = string | { EquippedLoadoutItem } | { EquipmentGoalRow } --- One item of an inventory goal and how many: `quantity` is a whole number, `"all"`, or `"=n"` --- as `ConfigLoadout` spells an exact one; the bank counts `"=n"` as `n`. export type InventoryGoalItem = { itemId: number, quantity: number } | { itemId: number, quantity: string } --- One line of an inventory goal: an item, or any one of several (a half summer pie satisfies a --- summer pie). export type InventoryGoalEntry = InventoryGoalItem | { kind: "anyOf", items: { InventoryGoalItem } } --- What a loadout carries: a goal string, `"itemId:quantity"` entries separated by commas --- (`"385:10,2434:4"`), or rows. A malformed entry raises. export type InventoryGoal = string | { InventoryGoalEntry } --- One thing `loadout:deficit()` says is still to do. export type LoadoutRequirement = { --- `"withdraw"` take `amount` from the bank, `"fill"` take all the bank holds up to the free --- slots, `"deposit"` put `amount` back. kind: "withdraw" | "fill" | "deposit", --- The item the requirement is about. itemId: number, --- How many. amount: number, --- Whether the item stacks, which decides slot arithmetic. stackable: boolean, --- On a `"withdraw"`: whether some of it is already carried. --- @returns `nil` on the other kinds. alreadyHeld: boolean?, } -- A bank trip with its goal, from `bank:newLoadout`. Make it once and keep it; `run` advances one -- step a tick. export type Loadout = { --- Advance the trip one step: open the bank, answer the prompt an equip opens, deposit what --- the goal does not want, withdraw and equip what it does. Stop calling it once it answers --- `"done"`: with the bank shut, a further call opens it again. --- --- ```luau --- local status, reason = trip:run() --- ``` --- --- @returns `"done"` when the goal is worn and carried with the bank open. `"running"` when it --- acted or is waiting. `"blocked"` with the reason when no bank is in range or the goal cannot --- be met from the bank, the inventory and what is worn: that holds until the goal is met or --- `reset()`, so fetch what it lacks and reset. run: (Loadout) -> (RunStatus, string?), --- What `run` would do next, in words, for a log. The words are not a contract. intent: (Loadout) -> string, --- The step it is on, for a status line. step: (Loadout) -> LoadoutStep, --- Whether the player already wears and carries the goal, so no bank trip is needed. It --- answers with the bank shut, and counts at least the goal's quantities; with the bank open it --- also says `false` while something unwanted is carried. isReady: (Loadout) -> boolean, --- Whether the goal could be assembled from what the player has and the open bank holds. --- `false` whenever the bank is shut, whatever is remembered: open it first. isAvailable: (Loadout) -> boolean, --- What the inventory goal still lacks or carries too much of, as rows; the bank's side read --- from what is remembered. It leaves out what is worn, and what nothing can supply. deficit: (Loadout) -> { LoadoutRequirement }, --- Forget the trip, and what blocked it, and start again towards the same goal. reset: (Loadout) -> (), } -- What is loaded around the local player. Everything here is a snapshot of the -- current scene; a handle taken from one goes stale when the entity leaves, and -- says so through `isPresent`. --- A tile in a hazard spec: a `WorldPoint`, or `{ x, y }` where the plane does not matter. export type HazardPoint = WorldPoint | { x: number, y: number, plane: number? } --- An inclusive rectangle in a hazard spec. export type HazardRect = { min: HazardPoint, max: HazardPoint } --- Which hazard groups a question is about: one group `0` to `7`, or an array of them. --- Anything else raises, a group outside `0` to `7` included. export type HazardGroups = number | { number } --- Where a timed hazard reaches. --- --- `tile` is one tile and `area` an inclusive rectangle. `ray` is a stationary --- emitter's line of fire: `len` tiles along `(dx, dy)`, starting `skip` tiles --- out from `origin`, `width` tiles across. `sweep` is something travelling: --- at each tick it has moved `speed` tiles further along `(dx, dy)`, and every --- tile it crossed getting there is covered too, which is what makes a fast --- projectile safe to model at all. export type HazardShape = { --- Which shape. kind: "tile" | "area" | "ray" | "sweep", --- `tile`: the tile. tile: HazardPoint?, --- `area`: south-west corner, inclusive. min: HazardPoint?, --- `area`: north-east corner, inclusive. max: HazardPoint?, --- `ray` and `sweep`: where it starts. origin: HazardPoint?, --- `ray` and `sweep`: x direction, one of `-1`, `0`, `1`. dx: number?, --- `ray` and `sweep`: y direction, one of `-1`, `0`, `1`. dy: number?, --- `ray`: tiles to skip before the first covered one, the emitter's own --- footprint. Defaults to `1`. skip: number?, --- `ray`: covered tiles along the direction. len: number?, --- `ray`: tiles across, centred on the axis. Defaults to `1`. width: number?, --- `sweep`: tiles travelled per tick. speed: number?, --- `sweep`: footprint side length in tiles. Defaults to `1`. size: number?, --- `sweep`: steps already travelled at tick zero, for a telegraph that --- projects something forward from where it will appear. lead: number?, --- `sweep`: tiles at the rear of the sweep to leave clear, because you may --- step in behind something that has just vacated them. trailClear: number?, } --- When a timed hazard is live. --- --- `always` is every tick. `window` is between two absolute ticks. `pattern` --- repeats: live when `active[(tick - anchor) % #active]`, which is a cycling --- emitter whose phase you know, or know only up to a candidate set, in which --- case OR the candidates together and the field fails closed. `frames` gives --- an explicit footprint per tick and overrides the source's own shape, which --- is how a hazard whose reach MOVES through its cycle is described. export type HazardSchedule = { --- Which schedule. kind: "always" | "window" | "pattern" | "frames", --- `window`: first live tick. from: number?, --- `window`: last live tick. to: number?, --- `pattern` and `frames`: the absolute tick that maps to index 1. anchor: number?, --- `pattern`: one flag per phase. active: { boolean }?, --- `frames`: one footprint per phase, as `{ min, max }` or a bare point. --- Write `false` for a phase the hazard covers nothing: `nil` would end --- the array. frames: { HazardRect | HazardPoint | false }?, } --- One hazard handed to `scene:hazardField`. export type HazardSourceSpec = { --- Which bucket, `0` to `7`; another raises. Lets a later query ask about one class of --- hazard alone: "will the BLADE reach this tile" is a different question --- from "is anything lethal here". Defaults to `0`. group: number?, --- `"block"` (impassable while live) or `"cost"` (passable, discouraged). --- Defaults to `"block"`. kind: ("block" | "cost")?, --- For `"cost"`: what to add to the tile's entry cost while live. cost: number?, --- Where it reaches. Optional only when the schedule is `frames`. shape: HazardShape?, --- When it is live. Defaults to always. schedule: HazardSchedule?, --- Whether it still blocks a mover inside a grace window. A grace that --- covers one hazard rarely covers all of them. piercesGrace: boolean?, } --- What `scene:hazardField` expands. export type HazardFieldSpec = { --- The absolute tick of the field's first layer. Defaults to the current --- game tick. now: number?, --- How many ticks ahead to expand. Everything past it answers clear, so --- size it to how far ahead you plan. Defaults to `16`. horizonTicks: number?, --- The hazards. sources: { HazardSourceSpec }, } --- A `tile x tick` hazard expansion: which tiles are lethal on which ticks. --- --- Asking whether a tile is dangerous NOW is the right question for a standing --- threat and the wrong one for anything on a schedule: a blade sweeping a --- corridor makes the whole corridor dangerous to a now-only model, so a route --- through it is never planned and you wait forever. The question that has an answer is whether the tile is lethal at --- the tick you ARRIVE. --- --- Build one per game tick and query it freely; the expansion is the expensive --- half and it happens once, in the host. A spec field of the wrong type raises, naming the --- field, as a group outside `0` to `7` does. --- --- ```luau --- local field = scene:hazardField({ --- horizonTicks = 8, --- sources = { --- { group = 0, shape = { kind = "tile", tile = blade }, schedule = { kind = "pattern", anchor = start, active = { true, false } } }, --- }, --- }) --- local search = scene:timedSearch(field, { run = true }) --- local ticks = search and search:arrivalTicks(goal) --- if ticks and not field:blocked(goal, field:now() + ticks) then player:walkTo(goal) end --- ``` export type HazardField = { --- The absolute tick of the field's first layer. now: (HazardField) -> number, --- How many ticks ahead it answers for. horizonTicks: (HazardField) -> number, --- Whether a tile is impassable at a tick. --- @param tile The tile. --- @param tick Absolute tick. --- @param groups One group, an array of groups, or omitted for all. --- @param graced Whether the mover is inside a grace window. blocked: (HazardField, WorldPoint, number, HazardGroups?, boolean?) -> boolean, --- Extra entry cost for a tile at a tick, summed over every costing source. --- @param tile The tile. --- @param tick Absolute tick. cost: (HazardField, WorldPoint, number) -> number, --- The first tick in a range at which a tile is impassable: `nil` is safe to WAIT on for --- the whole range, as opposed to running through it. --- @param tile The tile. --- @param from First tick. --- @param to Last tick. --- @param groups One group, an array of groups, or omitted for all. --- @param graced Whether the mover is inside a grace window. --- @returns `nil` when it is clear for the whole range. firstBlocked: (HazardField, WorldPoint, number, number, HazardGroups?, boolean?) -> number?, --- Whether a group EVER reaches a tile across the horizon: "am I standing --- in the corridor", asked without caring when. --- @param tile The tile. --- @param groups One group, an array of groups, or omitted for all. inReach: (HazardField, WorldPoint, HazardGroups?) -> boolean, --- Which groups block a tile at a tick. --- @param tile The tile. --- @param tick Absolute tick. groupsAt: (HazardField, WorldPoint, number) -> { number }, --- Every tile a group blocks at a tick. For an overlay, not a hot path. --- @param tick Absolute tick. --- @param groups One group, an array of groups, or omitted for all. blockedTiles: (HazardField, number, HazardGroups?) -> { WorldPoint }, } --- One directed shortcut edge for a timed search. export type ShortcutEdge = { --- Step onto this tile... from: WorldPoint, --- ...and end up here, on the following tick, having covered no ground. to: WorldPoint, } --- How a timed search treats the field it floods against. export type TimedSearchOpts = { --- Where to flood from. Defaults to the local player's tile. from: WorldPoint?, --- Move two tiles per tick, charging weight only on landed tiles. run: boolean?, --- Zero-ground-cost edges: warps, shortcuts, stairs, anything that moves --- you without walking. shortcuts: { ShortcutEdge }?, --- Ticks of hazard grace traversing a shortcut grants. graceTicks: number?, --- Require every landed tile to also be clear one tick after arrival: the --- tick you still occupy while the next move resolves. Without it a plan --- reaches tiles the executor refuses, so nothing is ever committed. dwell: boolean?, --- The landed tiles the dwell check waives. Omitted, every shortcut's --- `from` tile is waived, because the shortcut moves you off it before the --- next move resolves. Given, exactly these tiles are waived, shortcut --- sources or not, and `{}` waives none: name the one warp source you --- commit to stepping this tick, and any other you land on is checked like --- any other tile. dwellExempt: { WorldPoint }?, --- Ticks the mover is ALREADY graced for. A mover mid-invulnerability plans --- differently from one about to enter it. gracedForTicks: number?, --- Which hazard groups block on arrival. Omitted means all of them. blockGroups: HazardGroups?, --- Which hazard groups block at departure, for the dwell check. A hazard --- that matters on the way through need not matter while standing. dwellGroups: HazardGroups?, --- Tiles that block regardless of tick. excluded: { WorldPoint }?, --- Stop expanding past this many ticks. Omitted means the field's horizon. --- --- A value LARGER than the horizon keeps flooding, treating everything past --- the horizon as clear. That is how you reach a goal further away than you --- can see: the tail of the route is planned blind and refined next tick. --- Leave it out and any goal beyond the horizon is simply unreachable. maxTicks: number?, } --- One tile of a timed route. export type TimedStep = { --- The tile. tile: WorldPoint, --- Ticks from the source at which the covering move happens. Add `field:now()` for the --- tick a `HazardField` is asked about. arrivalTicks: number, --- Click-hop index; `0` is the segment committed now. hop: number, --- Whether you stand here at a tick boundary: a legal place to stop. A --- tile with `landed = false` was passed over mid-move: still lethal if --- something sweeps it that tick, but not somewhere you can wait. landed: boolean, --- Whether this tile was reached by traversing a shortcut. shortcut: boolean, } --- A flood that asks a [HazardField] about the tick you ARRIVE at each tile. --- --- `scene:reachability()` answers where you can GET; this answers where it is --- safe to be, and when. It also carries the three things a timed route needs --- that an untimed one does not: shortcut edges, the grace they grant, and the --- landed-tile departure check. export type TimedSearch = { --- The tile this flood was run from. --- @returns `nil` when the source was off-scene. source: (TimedSearch) -> WorldPoint?, --- Whether the tile was reached. --- @param tile The tile. reachable: (TimedSearch, WorldPoint) -> boolean, --- Ground steps to a tile: the walking distance travelled, which a --- shortcut does not add to. --- @param tile The tile. --- @returns `nil` when unreachable. pathLength: (TimedSearch, WorldPoint) -> number?, --- Weighted cost to a tile. --- @param tile The tile. --- @returns `nil` when unreachable. cost: (TimedSearch, WorldPoint) -> number?, --- How many ticks from the source you arrive at a tile. Add `field:now()` to ask the field --- about that tick: `field:blocked(tile, field:now() + ticks)`. --- @param tile The tile. --- @returns `nil` when unreachable. arrivalTicks: (TimedSearch, WorldPoint) -> number?, --- Whether the tile is reached by traversing a shortcut as its final move. --- @param tile The tile. viaShortcut: (TimedSearch, WorldPoint) -> boolean, --- Landed tiles from the source to a tile, source excluded. --- @param tile The tile. pathTo: (TimedSearch, WorldPoint) -> { WorldPoint }, --- Every tile of the route, landed and passed over. Hazard checks want --- this one; a two-tile move is lethal if either of its tiles is. --- @param tile The tile. pathToFull: (TimedSearch, WorldPoint) -> { WorldPoint }, --- The walk toward a tile: the route to it, or when it cannot be reached the route to the --- closest tile the flood did reach. `pathTo` is the one that answers empty instead. --- @param tile The tile. pathToward: (TimedSearch, WorldPoint) -> { WorldPoint }, --- The tile stepped from to reach one tile. --- @param tile The tile. --- @returns `nil` at the source, or when unreachable. cameFrom: (TimedSearch, WorldPoint) -> WorldPoint?, --- The route as an execution schedule: every tile with the tick of the move --- that covers it, its click-hop, and whether you stand on it. --- @param tile The destination. schedule: (TimedSearch, WorldPoint) -> { TimedStep }, --- The farthest tile on the route whose NATURAL walk still matches the --- plan: click it and the engine's own pathing follows the route you --- chose, instead of its own. --- @param tile The destination. --- @returns `nil` when unreachable. clickTile: (TimedSearch, WorldPoint) -> WorldPoint?, --- The cheapest reachable tile among several. A longer, safer way round can --- win, which is the point of asking rather than measuring distance. --- @param goals The candidates. --- @returns `nil` when none is reachable. bestOf: (TimedSearch, { WorldPoint }) -> WorldPoint?, --- The hazard-blind walking distance from the source: what the game would --- do if you clicked the tile yourself. For measuring how much a safer way round costs. --- @param tile The tile. --- @returns `nil` when unreachable. naturalPathLength: (TimedSearch, WorldPoint) -> number?, } --- The local player's dwarf multicannon (`scene:cannon()`), read live. export type Cannon = { --- The cannon's tile (the south-west corner of its 3x3 area), or `nil` --- while the game holds none. tile: WorldPoint?, --- Cannonballs loaded. cannonballs: number, --- Whether it has decayed and must be repaired. decayed: boolean, } --- The loaded scene, as queries and pathing. Everything it hands out is the ordinary handle --- -- `NPC`, `Player`, `TileObject`, `TileItem`, `Tile` -- --- the same userdata `client:getTopLevelWorldView()` and the events give for the same thing. export type SceneDomain = { --- What stands on one tile: the `Tile` of the top-level scene. --- --- The other scene reads are queries; this is the other question. `nil` --- when the tile is outside the loaded scene, which is ordinary -- a plugin --- walking a path runs off the edge routinely. --- @param tile Which tile. tileAt: (SceneDomain, WorldPoint) -> Tile?, --- A query over every NPC in the scene, whose terminals hand out `NPC` handles. npcs: (SceneDomain) -> NPCQuery, --- A query over every other player in the scene, whose terminals hand out `Player` handles. players: (SceneDomain) -> PlayerQuery, --- A query over every scene object: walls, decorations, doors, resources. --- Every loc in the LOADED SCENE, not a window around the player. Narrow it with --- `:within(n)` if you only care about what is nearby -- that filters the full answer --- rather than truncating the question. --- --- The terminals hand out `TileObject` handles (a `GameObject`, `WallObject`, --- `DecorativeObject` or `GroundObject`). The alternative to walking --- `Scene:getTiles()` in Luau, which builds a handle per tile: --- `scene:objects():ids(ids):collect()` reads the whole scene once, in the host. objects: (SceneDomain) -> ObjectQuery, --- A query over every item on the floor, whose terminals hand out `TileItem` --- handles (`item:getTile()` is where one lies). groundItems: (SceneDomain) -> GroundItemQuery, --- Reachability flood from the local player: where you can GET. --- @returns `nil` when there is no scene. reachability: (SceneDomain) -> Reachability?, --- The same flood seeded somewhere other than the local player -- "could I --- reach that from over there", which is what a route or a safespot check --- is actually asking. --- @param source The tile to flood from. --- @returns `nil` when the tile is outside the loaded scene. reachabilityFrom: (SceneDomain, WorldPoint) -> Reachability?, --- Expand a set of scheduled hazards over the scene: which tiles are lethal --- on which ticks. --- --- The hazards are DECLARED as data rather than tested by a callback, --- because the expansion is where the cost is -- a predicate called once per --- tile per tick is a hundred thousand crossings into the VM inside a native --- loop, with no deadline that can fire. Declared, it is one call in and one --- handle out whatever the scene size. --- @param spec The hazards, the horizon, and which tick is now. --- @returns `nil` when there is no scene to expand over. hazardField: (SceneDomain, HazardFieldSpec) -> HazardField?, --- Flood against a hazard field, asking it about the tick you ARRIVE at each --- tile rather than the tick the flood was built. --- --- This is `scene:reachability()` for anything that moves on a schedule, --- plus the three things a timed route needs and an untimed one does not: --- shortcut edges, the grace traversing one grants, and the landed-tile --- departure check. --- @param field The field to consult. --- @param opts Source, run cadence, shortcuts, grace and dwell. --- @returns `nil` when there is no scene, or the source is off-plane. timedSearch: (SceneDomain, HazardField, TimedSearchOpts?) -> TimedSearch?, --- Whether a tile can be stood on at all -- terrain only, no flood. For --- whether a path reaches it, use `scene:reachability()`. --- @param tile The tile to test. isWalkable: (SceneDomain, WorldPoint) -> boolean, --- Ticks left before NPCs in the area lose interest. --- @returns `nil` when no aggression timer is running. aggressionRemainingTicks: (SceneDomain) -> number?, --- Whether NPCs in the area have become tolerant. aggressionTolerant: (SceneDomain) -> boolean, --- The current NPC aggression area's safe centers, oldest first: none until the --- client has calibrated (a teleport or a long run), then one or two. The area is --- the 21x21 square around each. The client saves the area per account and brings it --- back after a relog where the player logged out. aggressionCenters: (SceneDomain) -> { WorldPoint }, --- Whether an NPC can still aggro the local player: never once the area is --- tolerant, and otherwise the level rule (an NPC with a combat level does not --- aggro a player more than twice its level, except in the Wilderness). --- @param level The NPC's combat level. --- @param tile The tile the NPC stands on. npcMayAggro: (SceneDomain, number, WorldPoint) -> boolean, --- The local player's cannon, read live from the game's vars. --- @returns `nil` when no cannon is placed. cannon: (SceneDomain) -> Cannon?, } -- One line of a Grand Exchange restock. export type RestockItem = { --- Exact item id to buy. itemId: number, --- How many to buy, a whole number from 1, whatever is already held. quantity: number, } -- A Grand Exchange restock with its list, from `grandExchange:newRestock`. Make it once and keep it; -- `run` advances one step a tick. export type RestockHandle = { --- Advance the restock one step: open the Grand Exchange, place an offer for each row (the --- guide price plus 15%), wait for it, and collect it to the bank. --- --- ```luau --- local status, reason = restock:run() --- ``` --- --- @returns `"done"` when every row has been bought or skipped: an offer the coins known to be --- held cannot pay for, or that the item's buy limit would refuse, is skipped and counts as --- finished, so read the bank to see what arrived. `"running"` when it acted or is waiting on --- an offer. `"blocked"` with the reason when no Grand Exchange is in range. run: (RestockHandle) -> (RunStatus, string?), --- The step it is on, for a status line. step: (RestockHandle) -> RestockStep, --- Forget the run and start the same list again from its first row, buying it all again. reset: (RestockHandle) -> (), } --- The Grand Exchange buy limits the client tracks for this account --- (`grandExchange:buyLimits()`): every purchase it sees, the restock executor's offers --- included, saved per account. export type BuyLimits = { --- How many more of an item can be bought before its buy limit. --- @param itemId The item. --- @returns `nil` when the item's limit is not in the item table, or the count bought in --- its window is not known. remaining: (BuyLimits, number) -> number?, --- When the item's current 4-hour window ends, Unix milliseconds. --- @param itemId The item. --- @returns `nil` when no window is open. resetsAt: (BuyLimits, number) -> number?, } -- The Grand Exchange. -- -- The low-level calls drive one offer at a time: start it, search for the item and pick the result, -- set the quantity and the price, confirm. `newRestock` wraps all of that in a state machine and is -- what a plugin usually wants. export type GrandExchange = { --- Whether the Grand Exchange interface is open. isOpen: (GrandExchange) -> boolean, --- Whether the main offer list is showing, rather than one offer. mainOfferListOpen: (GrandExchange) -> boolean, --- The first offer slot with nothing in it, as the game numbers them from 0. --- @returns `nil` when all slots are busy. firstOpenSlot: (GrandExchange) -> number?, --- What item a slot is trading. --- @param slot Offer slot, as the game numbers them from 0. --- @returns `nil` when the slot is empty. slotItemId: (GrandExchange, number) -> number?, --- Which slot is trading an item, as the game numbers them from 0. --- @param itemId Exact item id. --- @returns `nil` when no slot is. slotByItemId: (GrandExchange, number) -> number?, --- Open the Grand Exchange. Already open is success. --- @param target Name pattern to prefer; omit for the nearest clerk or booth. --- @returns `false` when none is in range. open: (GrandExchange, string?) -> boolean, --- Collect finished offers to the inventory. --- @returns `false` when there is nothing to collect. collect: (GrandExchange) -> boolean, --- Collect finished offers to the bank. --- @returns `false` when there is nothing to collect. collectBank: (GrandExchange) -> boolean, --- Confirm the offer being set up. --- @returns `false` when no offer is being set up. confirmOffer: (GrandExchange) -> boolean, --- Dismiss the interface's notice popup. No notice is success. closeNotice: (GrandExchange) -> boolean, --- Start a buy offer in the first free slot. --- @returns `false` when no slot is free. startBuyOffer: (GrandExchange) -> boolean, --- One step towards the offer being set up at this price per item. --- @param price Price per item, in coins. --- @returns `"done"` once the offer reads that price, `"running"` while a click or a typed --- amount is queued, and `"blocked"` with the reason when no offer is being set up. setOfferPrice: (GrandExchange, number) -> (RunStatus, string?), --- One step towards the offer being set up for this quantity. --- @param quantity How many. --- @returns `"done"` once the offer reads that quantity, `"running"` while a click or a typed --- amount is queued, and `"blocked"` with the reason when no offer is being set up. setOfferQuantity: (GrandExchange, number) -> (RunStatus, string?), --- Type into the offer's item search, which lists the results. It only types: --- `selectSearchResult` picks one. --- @param text What to search for. --- @returns `false` when the item search is not open. typeOfferSearch: (GrandExchange, string) -> boolean, --- Pick the search result for an item. By id, because the rows reorder. --- @param itemId Exact item id. --- @returns `false` when the results are not showing, or none of them is that item. selectSearchResult: (GrandExchange, number) -> boolean, --- One step towards raising the offer's price by a percentage, with the interface's custom +% --- button. Calling again after `"done"` raises it again. --- @param percent How much to add, a whole number. --- @returns `"done"` once the click that applies it is queued, `"running"` while the button's --- percentage is being set, and `"blocked"` with the reason when no offer is being set up. increasePricePercent: (GrandExchange, number) -> (RunStatus, string?), --- A restock of `items`: each row bought on the Grand Exchange and collected to the bank. The --- list is fixed here, and a row without an item id and a quantity raises here. It reads no game --- state, so make it once, when the plugin loads or starts, and keep it: its `run` advances one --- step a tick, and it opens the Grand Exchange itself. --- --- ```luau --- local restock = grandExchange:newRestock({ --- { itemId = ItemID.SHARK, quantity = 200 }, --- { itemId = ItemID.LOBSTER, quantity = 50 }, --- }) --- --- function plugin:onGameTick() --- local status, reason = restock:run() --- if status == "done" then --- -- every row was bought or skipped: read the bank to see what arrived --- elseif status == "blocked" then --- log:warn(reason) -- walk to the Grand Exchange, then call again --- end --- -- "running": it acted, or is waiting on an offer --- end --- ``` --- --- @param items What to buy. newRestock: (GrandExchange, { RestockItem }) -> RestockHandle, --- The buy limits the client tracks for this account. buyLimits: (GrandExchange) -> BuyLimits, } export type ShopItem = { --- The item's id. id: (ShopItem) -> number, --- How many the shop has. stock: (ShopItem) -> number, --- Which shop slot it sits in. slot: (ShopItem) -> number, --- The item's name. --- @returns `nil` when the id has no definition. name: (ShopItem) -> string?, --- Every menu option this shop slot exposes. actions: (ShopItem) -> { string }, --- Which buy quantities this row actually offers, in menu order. --- --- Usually `{1, 5, 10, 50}`, but not always -- some shops have no --- `Buy 50`. Read this rather than assuming the full four. buyOptions: (ShopItem) -> { number }, --- Buy one. buy1: (ShopItem) -> boolean, --- Buy five. buy5: (ShopItem) -> boolean, --- Buy ten. buy10: (ShopItem) -> boolean, --- Buy fifty. The game truncates to available stock, so this buys twelve --- when twelve are stocked. buy50: (ShopItem) -> boolean, } export type Shop = { --- Whether a shop interface is open. isOpen: (Shop) -> boolean, --- Close the shop. --- @returns `false` when no shop is open. close: (Shop) -> boolean, --- Whether the shop stocks an item. --- @param itemId Exact item id. contains: (Shop, number) -> boolean, --- Whether the shop stocks an item whose whole name matches, ignoring case: `|` separates --- alternatives and `*` is any run of characters. --- @param name The name pattern, e.g. `"Air rune"` or `"* rune"`. containsName: (Shop, string) -> boolean, --- Everything the shop has in stock; empty when it is shut. items: (Shop) -> { ShopItem }, --- The row stocking an item, resolved live. --- --- Shop layout is not fixed, so a slot is not a stable way to name what --- you want -- an id is. --- @param itemId Exact item id. --- @returns `nil` when the shop is shut or does not stock it. item: (Shop, number) -> ShopItem?, --- How many of an item the shop currently holds. --- @param itemId Exact item id. --- @returns `0` when it is not stocked, or the shop is shut. stock: (Shop, number) -> number, --- Which buy quantities the shop offers for an item, in menu order. --- --- A shop quantity is a MENU OPTION, not a number: the row's right-click --- is `Value / Buy 1 / Buy 5 / Buy 10 / Buy 50`, and some shops omit 50. --- That is why the buys below are four named calls rather than one taking --- a count -- an unavailable quantity has no option to click. --- @param itemId Exact item id. buyOptions: (Shop, number) -> { number }, --- Buy one of an item by id. --- @param itemId Exact item id, e.g. `ItemID.AIR_RUNE`. buy1: (Shop, number) -> boolean, --- Buy five of an item by id. --- @param itemId Exact item id. buy5: (Shop, number) -> boolean, --- Buy ten of an item by id. --- @param itemId Exact item id. buy10: (Shop, number) -> boolean, --- Buy fifty of an item by id. --- --- The game truncates to available stock, so this buys twelve when twelve --- are stocked. Keep the option at or below your own remaining target. --- @param itemId Exact item id. buy50: (Shop, number) -> boolean, --- Which sell quantities the shop offers for an item, in menu order. --- @param itemId Exact item id. sellOptions: (Shop, number) -> { number }, --- Sell one, by id. --- @param itemId Exact item id. sell1: (Shop, number) -> boolean, --- Sell five, by id. --- @param itemId Exact item id. sell5: (Shop, number) -> boolean, --- Sell ten, by id. --- @param itemId Exact item id. sell10: (Shop, number) -> boolean, --- Sell fifty, by id. --- @param itemId Exact item id. sell50: (Shop, number) -> boolean, } --- Whose piles a looter may take. export type LootOwnership = "drops" | "takeable" | "all" --- Items a looter treats alike. export type LootGroup = { --- The items, unnoted: a noted pile counts as the item it notes. ids: { number }, --- Stop taking this group once this many of them are carried. Omit for no limit. limit: number?, } --- What a loot manager picks up. Each tick it takes the first thing on this list that is on the --- ground, nearest first: `priority`, `highValue`, a pile worth `highValueStackThreshold`, --- `lowValue`; with nothing to take and the player standing still, it alchs what `alch` lists. A --- config naming no group and no threshold raises, since it would never pick anything up, and so --- does a field that is not on this list. export type LootConfig = { --- Taken first; it makes room when the inventory is full. priority: { LootGroup }?, --- Taken next; it makes room when the inventory is full. highValue: { LootGroup }?, --- Taken last; it makes room only with `lowValueMayMakeSpace`. lowValue: { LootGroup }?, --- Carried items to alch while nothing is left to take. alch: { LootGroup }?, --- Carried items that may go into the looting bag to make room. lootingBag: { number }?, --- Carried items that may be dropped to make room. drop: { number }?, --- While any of these is carried, `lowValue` waits. pauseLowValue: { number }?, --- Any other pile whose price times quantity is at least this counts as high value. Omit it, or --- 0, for no such rule. highValueStackThreshold: number?, --- Whose piles it may take: `"drops"` (the default) yours, your group's and unowned ones, --- `"takeable"` any this account may take, `"all"` any at all. ownership: LootOwnership?, --- Whether `lowValue` may also drop or bag something to make room. lowValueMayMakeSpace: boolean?, --- Whether `priority` items may themselves go into the looting bag to make room. bagPriorityItems: boolean?, } -- A looter with its config, from `manager:newLoot`. Make it once and keep it; `run` advances one -- step a tick. export type LootManagerHandle = { --- Advance one tick: finish what is in flight, or decide what is next and act on it. It tries --- again when an action did not take, and drops a take whose pile has gone. --- --- ```luau --- local status, reason = loot:run() --- ``` --- --- @returns `"running"` when it acted or is waiting, or `"idle"` with nothing to do, the reason --- being a `LootWaitReason` when it deferred and `nil` when there is simply nothing to loot. run: (LootManagerHandle) -> (RunStatus, string?), --- What it would do next, without doing it. plan: (LootManagerHandle) -> LootDecision, --- The step it is on, for a status line. step: (LootManagerHandle) -> LootStep, --- Forget what is in flight. The config stays. reset: (LootManagerHandle) -> (), } -- A sustain machine, from `manager:newSustain`. Make it once and keep it; `run` advances one step a -- tick. export type SustainManagerHandle = { --- Advance one tick: eat below 45% Hitpoints, waiting out a swing unless at 30% or below, and --- drink a prayer restore at 10 prayer points or fewer, finishing what is in flight first. --- --- ```luau --- local status, reason = sustain:run() --- ``` --- --- @returns `"running"` when it acted or is waiting, or `"idle"` with nothing to do, the reason --- being a `SustainWaitReason` when it deferred. run: (SustainManagerHandle) -> (RunStatus, string?), --- The step it is on, for a status line. step: (SustainManagerHandle) -> SustainStep, --- Forget what is in flight. reset: (SustainManagerHandle) -> (), } -- Long-lived helpers a plugin makes once and drives every tick. -- -- A machine holds state between calls, so make it when the plugin loads or starts and keep it: -- making one per tick throws away everything it learned. export type Manager = { --- A looter for `config`. It reads no game state, and a config it cannot use raises here. --- --- ```luau --- local loot = manager:newLoot({ --- priority = { { ids = { ItemID.ABYSSAL_WHIP } } }, --- lowValue = { { ids = { ItemID.COINS } } }, --- highValueStackThreshold = 50000, --- drop = { ItemID.LOBSTER }, --- }) --- --- function plugin:onGameTick() --- local status, reason = loot:run() --- if status == "idle" then --- -- nothing to take: `reason` is a `LootWaitReason` when it deferred, and `nil` --- -- when there is no loot. Get on with the fight. --- end --- -- "running": it acted, or is waiting for its last click to land --- end --- ``` --- --- @param config What to pick up. newLoot: (Manager, LootConfig) -> LootManagerHandle, --- An eat-and-drink machine on its defaults: see `SustainManagerHandle.run`. --- --- ```luau --- local sustain = manager:newSustain() --- --- function plugin:onGameTick() --- local status, reason = sustain:run() --- if status == "running" then return end -- a consume is in flight: this tick is taken --- if reason == SustainWaitReason.NO_SUPPLIES then --- -- a threshold fired and there is nothing to consume: time to bank --- end --- -- "idle": get on with the fight --- end --- ``` newSustain: (Manager) -> SustainManagerHandle, } export type Utils = { --- Milliseconds since the client started, fractional. --- --- For timing your own code. The game's tick only moves every 600ms and there is --- no `os` in the sandbox, so this is the only way to answer "which part of --- my tick is slow?". Monotonic and relative to an arbitrary origin, so it --- is not a wall clock and differences between two readings are the only --- meaningful thing to do with it. elapsedMs: (Utils) -> number, } -- Files bundled in the plugin package, addressed by package-relative path. -- -- The path is what you write either way. Locally it is read from the folder; -- in a marketplace artifact the builder has already rewritten every asset path -- into a content id, and a path the artifact does not carry is an error rather -- than a filesystem lookup. export type AssetClass = { --- Read a bundled asset as raw bytes. --- @param path Package-relative path, e.g. `"assets/icon.png"`. bytes: (string) -> string, --- Read a bundled asset as UTF-8 text. --- @param path Package-relative path. --- @returns Errors when the bytes are not valid UTF-8. text: (string) -> string, } -- JSON, on the host. Pure computation, so it needs no capability. export type JsonClass = { --- Parse a JSON document into Luau values. --- @param text The document. --- @returns Errors on malformed input rather than returning `nil`. parse: (string) -> any, --- Serialise a Luau value to JSON. --- @param value The value to encode. --- @param options `{ pretty = true }` writes two spaces of indent, `": "`, HTML-safe escaping, --- and leaves out an object member whose value is `JsonNull.INSTANCE`. Without it, compact --- JSON. encode: (any, { pretty: boolean? }?) -> string, } -- Bento's Luau shell: a window the host draws over the game, where the user types Luau -- that runs in this plugin. A plugin may open it and nothing more: the window, what is -- typed in it and what it shows are the host's, and none of it reaches the plugin's code. export type ShellClass = { --- Open this plugin's Luau shell, or bring it forward with the caret in its editor when --- it is open already. One shell per plugin, titled with the plugin's id and then --- `title` (or "Shell"): a script editor that completes this API, over a console. Run --- (Ctrl+R or F10) runs the editor's text, or its selection, in this plugin's VM on its --- next tick, in a fresh environment each run that reads the plugin's globals: a lone --- expression shows its values, `print` writes to the console, an error is shown there --- and the plugin carries on, and a run is stopped after 300 ms. Returns nothing; --- nothing typed or shown there is ever handed to the plugin. --- @param title The window's title after the plugin's id; at most 80 characters. open: (string?) -> (), } --- How the last control drawn was used this pass: `panel:lastResponse()`. --- Its bounds are `x`, `y`, `width` and `height`, in screen points. export type PanelResponse = { --- Left edge. x: number, --- Top edge. y: number, --- Width. width: number, --- Height. height: number, --- The pointer is over it. hovered: boolean, --- A primary click landed on it. clicked: boolean, --- A secondary (right) click landed on it. secondaryClicked: boolean, --- A middle click landed on it. middleClicked: boolean, --- A double click landed on it. doubleClicked: boolean, --- It is being dragged. dragged: boolean, --- A drag of it started this pass. dragStarted: boolean, --- A drag of it ended this pass. dragStopped: boolean, --- How far it was dragged this pass, across. dragDeltaX: number, --- How far it was dragged this pass, down. dragDeltaY: number, --- The pointer's x inside it; `nil` when the pointer is elsewhere. pointerX: number?, --- The pointer's y inside it; `nil` when the pointer is elsewhere. pointerY: number?, --- It has keyboard focus. hasFocus: boolean, --- It lost keyboard focus this pass. lostFocus: boolean, --- Its value changed this pass. changed: boolean, } --- What `ui:messageDialog` shows. export type MessageDialogSpec = { --- The window title. title: string?, --- The text in it. message: string?, } --- What `ui:confirmDialog` shows. export type ConfirmDialogSpec = { --- The window title. title: string?, --- The text in it. message: string?, --- The buttons' labels. Defaults to `{ "Yes", "No" }`. options: { string }?, --- Which button Enter answers, from 1. Defaults to 1. default: number?, } --- What `ui:inputDialog` shows. export type InputDialogSpec = { --- The window title. title: string?, --- The text in it. message: string?, --- The text it starts with. initial: string?, --- Grey text shown while the field is empty. hint: string?, --- Take more than one line. multiline: boolean?, } --- What `ui:colorPicker` starts on. export type ColorPickerSpec = { --- The window title. title: string?, --- The colour it starts on. Defaults to white. initial: Color?, --- Let the user pick transparency too. alpha: boolean?, } --- What `ui:fileOpen` offers. export type FileOpenSpec = { --- The window title. title: string?, --- The file extensions it lists, e.g. `{ "json" }`. Defaults to every file. extensions: { string }?, --- The largest file it reads. maxBytes: number?, } --- What `ui:fileSave` saves. export type FileSaveSpec = { --- The window title. title: string?, --- The file name it suggests. name: string?, --- The file extensions it lists, e.g. `{ "json" }`. extensions: { string }?, --- The file's contents. bytes: string, } -- The globals come in two kinds, and the CASING is the rule: -- -- lowercase the live game, refreshed every callback -- player, scene, bank, -- client. Reading one outside a callback raises. -- Capitalised frozen tables: constants, constructors, and helpers that take what -- they need as arguments -- Skill, VarbitID, WorldPoint, QuestState. -- Fixed for the VM's life; safe to alias. -- -- So `player` is where the game is now and `Skill` is what a skill is called. -- There is no namespace over either: Luau has no import, so a container would -- only add a line to every plugin. --- The local player, and everything hanging off them. declare player: PlayerDomain --- Walking, regions, the Wilderness, world hopping. declare world: WorldDomain --- The bank, and the loadout machinery built on it. declare bank: Bank --- What is loaded around the local player. declare scene: SceneDomain --- The game's interface: tabs, keys, dialogues, and the host's dialogs. declare ui: Ui --- Long-lived helpers: loot, sustain, tile safety. declare manager: Manager --- The Grand Exchange, and restock runs. declare grandExchange: GrandExchange --- A shop, when one is open. declare shop: Shop --- Timing your own code: `utils:elapsedMs()`. declare utils: Utils --- What an actor is interacting with: `InteractKind.NONE`. declare InteractKind: InteractKindClass --- Which combat style is selected: `AttackStyle.MELEE`. declare AttackStyle: AttackStyleClass --- How a webwalk ended, or that it has not: `WebwalkResult.RUNNING`. declare WebwalkResult: WebwalkResultClass declare TileSide: TileSideClass --- Which layer `renderOverlay` is drawing: `DrawLayer.ABOVE_SCENE`. declare DrawLayer: DrawLayerClass declare Tab: TabClass declare TypedInputKind: TypedInputKindClass declare ItemSource: ItemSourceClass --- A farming patch's kind: `PatchKind.HERB`. declare PatchKind: PatchKindClass --- What a farming patch's crop is doing: `CropState.GROWING`. declare CropState: CropStateClass --- What a farming patch was treated with: `CompostState.ULTRACOMPOST`. declare CompostState: CompostStateClass --- How the Farming Guild contract stands: `FarmingSummary.IN_PROGRESS`. declare FarmingSummary: FarmingSummaryClass --- What a bird house space holds: `BirdhouseState.SEEDED`. declare BirdhouseState: BirdhouseStateClass declare WorldHopStage: WorldHopStageClass declare PvpUnknownReason: PvpUnknownReasonClass --- What a state machine's `run` answers: `RunStatus.DONE`. declare RunStatus: RunStatusClass declare LootStep: LootStepClass declare LootDecision: LootDecisionClass declare LootWaitReason: LootWaitReasonClass declare SustainStep: SustainStepClass declare SustainWaitReason: SustainWaitReasonClass declare RestockStep: RestockStepClass declare LoadoutStep: LoadoutStepClass declare SpellItem: SpellItemClass declare Rune: RuneClass --- Whether one spell requirement is satisfied: `RequirementStatus.MET`. declare RequirementStatus: RequirementStatusClass --- Files bundled in this plugin's package. declare Asset: AssetClass --- Parse and encode JSON, on the host. declare Json: JsonClass --- This plugin's Luau shell, which the host owns: a plugin may open it, nothing more. declare Shell: ShellClass --- Load another Luau file from this plugin's own package. --- --- The path is the module's place under the package's `src/` folder, `/`-separated and --- without the `.luau` extension: `require("overlays/entities")` loads --- `src/overlays/entities.luau`. `require("src/overlays/entities")` and --- `require("overlays/entities.luau")` find nothing. --- --- Local paths only. There are no package imports: a `@bento/sdk` require is --- rejected at upload, and the host API arrives as globals instead. --- @param path The module's path under `src/`, without `.luau`, as `"overlays/entities"`. declare function require(path: string): any --- An NPC's health bar, with the hitpoints estimated from it: what `npc:health()` answers. export type NpcHealth = { --- The bar's fill (`getHealthRatio()`), 0 to `scale`. ratio: number, --- The bar's width (`getHealthScale()`). scale: number, --- The NPC type's hitpoints from the NPC info table; `nil` when the table does not --- know the NPC or has not loaded yet. maxHp: number?, --- The hitpoints the bar stands for, an estimate; `nil` without --- `maxHp`. estimatedHp: number?, } -- BEGIN GENERATED: classes (do not edit; BENTO_DECL_BLESS=1 cargo test -p bento-plugin-luau --lib declaration_is_generated, then python client/tools/sync_declaration.py) --- A tile: `x`, `y` and `plane`. A native Luau `vector(x, y, plane)`, so `==` compares by value and a point is a table key by value. `wp.x`/`wp.y` read natively; the plane is `wp.z` or `wp:getPlane()`. Vector arithmetic (`a + b`) adds planes too; use `dx`/`dy`/`dz`. Declared as this class, so the analyzer knows the methods: build one with `WorldPoint.new`, not `vector.create`, which the analyzer types as a plain `vector`. export type WorldPoint = { --- World x: Luau's own vector component read, the same number as `getX()`. x: number, --- World y: Luau's own vector component read, the same number as `getY()`. y: number, --- The plane: Luau's own vector component read, the same number as `getPlane()`. z: number, --- World x. getX: (WorldPoint) -> number, --- World y. getY: (WorldPoint) -> number, --- The plane, 0 being ground level. getPlane: (WorldPoint) -> number, --- This point moved `dx` tiles east; the add wraps at 32 bits. dx: (WorldPoint, number) -> WorldPoint, --- This point moved `dy` tiles north; the add wraps at 32 bits. dy: (WorldPoint, number) -> WorldPoint, --- This point moved `dz` planes up. Not clamped to 0-3. dz: (WorldPoint, number) -> WorldPoint, --- `(WorldPoint, WorldPoint) -> number`: --- The Chebyshev distance to `other`, or `2147483647` when the planes differ. --- --- `(WorldPoint, WorldArea) -> number`: --- The shortest distance to any tile of `other`, or `2147483647` when it is on another plane. distanceTo: ((WorldPoint, WorldPoint) -> number) & ((WorldPoint, WorldArea) -> number), --- The Chebyshev distance to `other`, ignoring the plane. distanceTo2D: (WorldPoint, WorldPoint) -> number, --- The id of the 64x64 region holding this tile: `x >> 6 << 8 | y >> 6`. getRegionID: (WorldPoint) -> number, --- The x within the region, 0-63. getRegionX: (WorldPoint) -> number, --- The y within the region, 0-63. getRegionY: (WorldPoint) -> number, --- The 1x1 area of this tile. toWorldArea: (WorldPoint) -> WorldArea, --- Whether any of the areas contains this tile. Pass the areas as arguments, or one array of them. isInArea: (WorldPoint, ...WorldArea) -> boolean, --- Whether any of the areas contains this tile, ignoring planes. isInArea2D: (WorldPoint, ...WorldArea) -> boolean, --- Whether this tile is on the player's plane and in the loaded scene (deprecated). Pass the `client` global; it reads the running callback's client. isInScene: (WorldPoint, Client) -> boolean, --- Whether `other` is the same tile. `==` answers the same. equals: (WorldPoint, any) -> boolean, --- A hash of `x`, `y` and `plane`. hashCode: (WorldPoint) -> number, --- `WorldPoint(x=3200, y=3200, plane=0)`. `tostring(wp)` answers the same. toString: (WorldPoint) -> string, } export type WorldPointClass = { --- The tile `x`, `y` on `plane`: `vector(x, y, plane)`. new: (number, number, number) -> WorldPoint, --- A tile from a packed Jagex coordinate, `plane << 28 | x << 14 | y`. fromCoord: (number) -> WorldPoint, --- The tile at `regionX`, `regionY` in region `regionId`. fromRegion: (number, number, number, number) -> WorldPoint, --- The same tile in a mirrored region's other copy (Prifddinas); any other tile unchanged. getMirrorPoint: (WorldPoint, boolean) -> WorldPoint, --- The tile holding `local`, on its world view's plane. Pass the `client` global. Raises with no scene loaded (the client's plane cannot be read) and when `local`'s world view is no longer loaded; `fromLocalMainWorld` answers `nil` for both. fromLocal: (Client, LocalPoint) -> WorldPoint, --- `(Client, LocalPoint) -> WorldPoint`: --- The tile holding `local` with instancing undone: in an instance, the template tile it was copied from. Pass the `client` global. Raises with no scene loaded (the client's plane cannot be read) and when `local`'s world view is no longer loaded; `fromLocalMainWorld` answers `nil` for both, and converts a boat's point too. --- --- `(Client, LocalPoint, number) -> WorldPoint`: --- `fromLocalInstance` on the given plane. Raises as it does. --- --- `(Scene, LocalPoint, number) -> WorldPoint`: --- The tile holding `localPoint` with instancing undone, against `scene`'s own world view: in an instance, the template tile it was copied from; otherwise the tile on `plane`. A scene whose world view is no longer loaded raises. fromLocalInstance: ((Client, LocalPoint) -> WorldPoint) & ((Client, LocalPoint, number) -> WorldPoint) & ((Scene, LocalPoint, number) -> WorldPoint), --- The real-world tile holding `local`, whichever world view it is in: a point on a boat through its entity's `transformToMainWorld` first, and instancing undone either way (the template tile an instance's tile was copied from). What to measure from, or test against a zone written in template coordinates. `nil` when it cannot be told: no scene loaded, `local`'s world view or its entity gone, or a client whose table does not place the entity's fields. Never raises for those, so a per-tick caller needs no guard. The reverse is `LocalPoint.fromWorldInstance`. fromLocalMainWorld: (Client, LocalPoint) -> WorldPoint?, --- `(Client, number, number, number) -> WorldPoint`: --- Scene tile to world tile, against the top-level world view. --- --- `(WorldView, number, number, number) -> WorldPoint`: --- Scene tile `x`, `y` of world view `wv` to the world tile on `plane`: `x + wv:getBaseX()`, `y + wv:getBaseY()`. A world view that is no longer loaded raises. fromScene: ((Client, number, number, number) -> WorldPoint) & ((WorldView, number, number, number) -> WorldPoint), --- Whether world tile `x`, `y` is in the loaded top-level scene, any plane. isInScene: (Client, number, number) -> boolean, --- `(Client, WorldPoint) -> {WorldPoint}`: --- Every scene tile that is a copy of this template tile (an instance can use one chunk several times); outside an instance the tile itself if the scene holds it. Empty with no scene loaded. --- --- `(Scene, WorldPoint) -> {WorldPoint}`: --- Every tile of `scene` that is a copy of this template tile, ordered by plane, then chunk x, then chunk y; outside an instance the tile itself if it lies in the scene's 104-tile square, whatever its plane (deprecated). Empty when its world view is no longer loaded. --- --- `(WorldView, WorldPoint) -> {WorldPoint}`: --- Every tile of world view `wv` that is a copy of this template tile, ordered by plane, then chunk x, then chunk y; outside an instance the tile itself if `wv` contains it. Empty when `wv` is no longer loaded or has no scene. toLocalInstance: ((Client, WorldPoint) -> {WorldPoint}) & ((Scene, WorldPoint) -> {WorldPoint}) & ((WorldView, WorldPoint) -> {WorldPoint}), } --- `WorldPoint`'s static functions and constants. declare WorldPoint: WorldPointClass --- A point in a world view's scene in 1/128ths of a tile, with that world view's id. Only meaningful until the scene next loads. `==` compares by value. A point in a boat's world view converts back through the `Client` overloads (`WorldPoint.fromLocal(client, lp)`) and to the main world through `WorldPoint.fromLocalMainWorld`, and `Perspective` projects it where the boat has put it. export type LocalPoint = { --- Scene x in 1/128ths of a tile. getX: (LocalPoint) -> number, --- Scene y in 1/128ths of a tile. getY: (LocalPoint) -> number, --- The id of the world view (`WorldView.TOPLEVEL`, 0, is the top level). getWorldView: (LocalPoint) -> number, --- The scene tile x, flooring. getSceneX: (LocalPoint) -> number, --- The scene tile y, flooring. getSceneY: (LocalPoint) -> number, --- The Euclidean distance in local units, truncated, or `2147483647` across world views. distanceTo: (LocalPoint, LocalPoint) -> number, --- Whether the point is inside the basic 104x104 scene (deprecated). isInScene: (LocalPoint) -> boolean, --- This point moved `dx` local units east. dx: (LocalPoint, number) -> LocalPoint, --- This point moved `dy` local units north. dy: (LocalPoint, number) -> LocalPoint, --- This point moved by `dx`, `dy` local units. plus: (LocalPoint, number, number) -> LocalPoint, --- Whether `other` is a local point with the same coordinates and world view. `==` answers the same. equals: (LocalPoint, any) -> boolean, --- A hash of `x`, `y` and the world view. hashCode: (LocalPoint) -> number, --- `LocalPoint(x=…, y=…, worldView=…)`. toString: (LocalPoint) -> string, } export type LocalPointClass = { --- `(number, number) -> LocalPoint`: --- A local point in the top-level world view (deprecated). --- --- `(number, number, number) -> LocalPoint`: --- A local point in world view `worldView`. --- --- `(number, number, WorldView) -> LocalPoint`: --- A local point in world view `wv` (its `getId()`; nothing is read). new: ((number, number) -> LocalPoint) & ((number, number, number) -> LocalPoint) & ((number, number, WorldView) -> LocalPoint), --- `(Client, WorldPoint) -> LocalPoint?`: --- The centre of the tile in the world view holding it (a boat's for a tile in a boat's scene, else the top level, as `findWorldViewFromWorldPoint`), or `nil` when it is not on that view's plane or is outside its scene, and with no scene loaded. Pass the `client` global. --- --- `(Client, number, number) -> LocalPoint?`: --- The centre of world tile `x`, `y` in the top-level scene, or `nil` outside it and with no scene loaded. The plane is not checked. --- --- `(WorldView, WorldPoint) -> LocalPoint?`: --- The centre of the tile in world view `wv`, or `nil` when it is not on `wv`'s plane (`getPlane()`) or is outside its scene, and when `wv` is no longer loaded or has no scene. --- --- `(WorldView, number, number) -> LocalPoint?`: --- The centre of world tile `x`, `y` in world view `wv`, or `nil` outside its scene and when `wv` is no longer loaded or has no scene. The plane is not checked. --- --- `(Scene, number, number) -> LocalPoint?`: --- The centre of world tile `x`, `y` in `scene`'s world view, or `nil` outside the 104-tile square at its base (a `Scene` is 104 tiles whatever its world view's size) and when its world view is no longer loaded. The plane is not checked. fromWorld: ((Client, WorldPoint) -> LocalPoint?) & ((Client, number, number) -> LocalPoint?) & ((WorldView, WorldPoint) -> LocalPoint?) & ((WorldView, number, number) -> LocalPoint?) & ((Scene, number, number) -> LocalPoint?), --- Every local point of world view `wv` that is a copy of this template tile, ordered by plane, then chunk x, then chunk y: an instance can use one chunk several times, and outside an instance it is the tile itself. `WorldPoint.toLocalInstance` then `fromWorld` on each, as a plugin marking a tile would write it, in one call. Empty when `wv` holds no copy on its plane, and when it is no longer loaded or has no scene, so a per-tick caller needs no guard. The reverse is `WorldPoint.fromLocalMainWorld`. fromWorldInstance: (WorldView, WorldPoint) -> {LocalPoint}, --- `(number, number) -> LocalPoint`: --- The centre of top-level scene tile `x`, `y` (deprecated). --- --- `(number, number, WorldView) -> LocalPoint`: --- The centre of scene tile `x`, `y` of world view `wv` (its `getId()`; nothing is read). --- --- `(number, number, Scene) -> LocalPoint`: --- The centre of scene tile `x`, `y` of `scene`'s world view (its `getWorldViewId()`; nothing is read). fromScene: ((number, number) -> LocalPoint) & ((number, number, WorldView) -> LocalPoint) & ((number, number, Scene) -> LocalPoint), } --- `LocalPoint`'s static functions and constants. declare LocalPoint: LocalPointClass --- A `width` by `height` rectangle of tiles on one plane, `(x, y)` its south-west corner. `==` is identity: two areas over the same tiles are different objects. export type WorldArea = { --- The western-most x. getX: (WorldArea) -> number, --- The southern-most y. getY: (WorldArea) -> number, --- Width in tiles. getWidth: (WorldArea) -> number, --- Height in tiles. getHeight: (WorldArea) -> number, --- The plane. getPlane: (WorldArea) -> number, --- Whether the tile is in the area, on its plane. contains: (WorldArea, WorldPoint) -> boolean, --- Whether the tile is in the area, whatever its plane. contains2D: (WorldArea, WorldPoint) -> boolean, --- `(WorldArea, WorldArea) -> number`: --- The shortest Chebyshev distance to `other`, or `2147483647` across planes. --- --- `(WorldArea, WorldPoint) -> number`: --- The shortest Chebyshev distance to the tile, or `2147483647` across planes. distanceTo: ((WorldArea, WorldArea) -> number) & ((WorldArea, WorldPoint) -> number), --- `(WorldArea, WorldArea) -> number`: --- The shortest Chebyshev distance to `other`, ignoring planes. --- --- `(WorldArea, WorldPoint) -> number`: --- The shortest Chebyshev distance to the tile, ignoring planes. distanceTo2D: ((WorldArea, WorldArea) -> number) & ((WorldArea, WorldPoint) -> number), --- `(WorldArea, WorldArea) -> boolean`: --- Whether `other` touches this area's edge from outside, cardinally (a diagonal neighbour is not in melee distance). --- --- `(WorldArea, WorldPoint) -> boolean`: --- Whether the tile touches this area's edge from outside, cardinally. isInMeleeDistance: ((WorldArea, WorldArea) -> boolean) & ((WorldArea, WorldPoint) -> boolean), --- Whether the areas share a tile, on the same plane. intersectsWith: (WorldArea, WorldArea) -> boolean, --- The south-west corner. toWorldPoint: (WorldArea) -> WorldPoint, --- Every tile, column by column (x outer, y inner), as a 1-based array. toWorldPointList: (WorldArea) -> {WorldPoint}, --- `(WorldArea, WorldView, WorldArea) -> boolean`: --- Whether some edge tile of this area sees some edge tile of `other` across `wv`'s line-of-sight collision flags. `false` across planes, off `wv`'s plane, or where an end tile is outside the scene or has no tile; an area never sees one it overlaps. Not necessarily symmetric. --- --- `(WorldArea, WorldView, WorldPoint) -> boolean`: --- `hasLineOfSightTo(wv, other:toWorldArea())`: whether this area sees the tile. hasLineOfSightTo: ((WorldArea, WorldView, WorldArea) -> boolean) & ((WorldArea, WorldView, WorldPoint) -> boolean), --- `(WorldArea, WorldView, number, number) -> boolean`: --- Whether the whole area can step one tile in the direction of `dx`, `dy` (each taken by its sign) under `wv`'s movement collision flags. Other actors are not obstacles. Raises `NullPointerException` when the area's corner is outside the scene, and `ArrayIndexOutOfBoundsException` when the step leaves the collision map. --- --- `(WorldArea, WorldView, number, number, (WorldPoint) -> boolean) -> boolean`: --- As `canTravelInDirection(wv, dx, dy)`, also refusing the tiles `extraCondition(tile)` answers `false` for (an NPC's actor collision, say). It is asked tile by tile as the walk goes (the x edge, the y edge, then the diagonal), stopping at the first refusal, and must return a boolean; an error it raises ends the walk and is raised from this call unchanged. canTravelInDirection: ((WorldArea, WorldView, number, number) -> boolean) & ((WorldArea, WorldView, number, number, (WorldPoint) -> boolean) -> boolean), } export type WorldAreaClass = { --- `(number, number, number, number, number) -> WorldArea`: --- The area `width` by `height` from the south-west corner `x`, `y`. --- --- `(WorldPoint, number, number) -> WorldArea`: --- The area `width` by `height` from the south-west corner `location`, on its plane. new: ((number, number, number, number, number) -> WorldArea) & ((WorldPoint, number, number) -> WorldArea), } --- `WorldArea`'s static functions and constants. declare WorldArea: WorldAreaClass --- A canvas coordinate: what `Perspective` and the entity canvas methods return, and also a mouse position or a layout offset, with `x`/`y` fields and `Point2D` distances. `equals` compares the values and `==` is identity: the same object. Immutable. export type Point = { --- The x coordinate. getX: (Point) -> number, --- The y coordinate. getY: (Point) -> number, --- The Euclidean distance to `other`, truncated to an int; the differences wrap as 32-bit integers. distanceTo: (Point, Point) -> number, --- `(Point, Point) -> number`: --- The Euclidean distance to `pt`, as a double (not truncated, unlike `distanceTo`). --- --- `(Point, number, number) -> number`: --- The Euclidean distance to `(px, py)`, as a double. distance: ((Point, Point) -> number) & ((Point, number, number) -> number), --- Whether `obj` is a `Point` with the same `x` and `y`; anything else is `false`. `==` is identity: the same object. equals: (Point, any) -> boolean, --- The x coordinate. x: number, --- The y coordinate. y: number, } export type PointClass = { --- `(number, number) -> Point`: --- The point `x`, `y`. --- --- `(Point) -> Point`: --- A copy of `p`. --- --- `() -> Point`: --- The origin, `(0, 0)`. new: ((number, number) -> Point) & ((Point) -> Point) & (() -> Point), } --- `Point`'s static functions and constants. declare Point: PointClass --- Static distance functions. There is no `Point2D` instance: a point is a `Point`, which answers `distance` itself. export type Point2D = { } export type Point2DClass = { --- The Euclidean distance from `(x1, y1)` to `(x2, y2)`, as AWT computes it. distance: (number, number, number, number) -> number, --- The squared distance from `(x1, y1)` to `(x2, y2)`. distanceSq: (number, number, number, number) -> number, --- `Point2D.Double`: `Point2D` itself, for its statics; it has no `new` (no `Point2D` object is made). Double: Point2DClass, --- `Point2D.Float`: `Point2D` itself, for its statics; it has no `new` (no `Point2D` object is made). Float: Point2DClass, } --- `Point2D`'s static functions and constants. declare Point2D: Point2DClass --- A width and a height. --- --- `__newindex`: `d.width = w` and `d.height = h` write the field in place; any other field raises. export type Dimension = { --- The width. getWidth: (Dimension) -> number, --- The height. getHeight: (Dimension) -> number, --- The width, a public field: writable (`d.width = 5`), and seen by every holder of this object. width: number, --- The height, a public field: writable (`d.height = 5`), and seen by every holder of this object. height: number, --- Whether `other` is a `Dimension` of the same width and height; `false` for anything else. `==` is identity: the same object. equals: (Dimension, any) -> boolean, } export type DimensionClass = { --- `(number, number) -> Dimension`: --- A `width` by `height` size. --- --- `() -> Dimension`: --- A zero size. new: ((number, number) -> Dimension) & (() -> Dimension), } --- `Dimension`'s static functions and constants. declare Dimension: DimensionClass --- A colour as a packed ARGB number, `0xAARRGGBB`: no allocation, `==` and table keys by value. A number has no methods, so `Color`'s instance methods are statics taking the colour first (`Color.getRed(c)`, `Color.darker(c)`). Every member taking a colour also takes the signed 32-bit integer `Color.getRGB(c)` returns. export type Color = number export type ColorClass = { --- `(number, number, number) -> Color`: --- An opaque colour; each component 0-255, else an error naming the bad ones. --- --- `(number, number, number, number) -> Color`: --- A colour with alpha; each component 0-255. --- --- `(number) -> Color`: --- The opaque colour of the low 24 bits of `rgb`. --- --- `(number, boolean) -> Color`: --- All 32 bits when `hasalpha`, else the low 24 opaque. new: ((number, number, number) -> Color) & ((number, number, number, number) -> Color) & ((number) -> Color) & ((number, boolean) -> Color), --- `nm` as an integer (`#rrggbb`, `0x...`, decimal, octal), opaque. decode: (string) -> Color, --- The opaque colour of hue, saturation and brightness, computed in 32-bit floats. getHSBColor: (number, number, number) -> Color, --- The opaque RGB of hue, saturation and brightness, as a signed 32-bit integer. HSBtoRGB: (number, number, number) -> number, --- `{hue, saturation, brightness}`; filled into `hsbvals` and returned when it is a table. RGBtoHSB: (number, number, number, {number}?) -> {number}, --- `Color.equals(c, obj)`: whether `obj` is the same colour. `==` answers the same, since a colour is a number. equals: (Color, any) -> boolean, --- `Color.getRed(c)`: the red component, 0-255. getRed: (Color) -> number, --- `Color.getGreen(c)`: the green component, 0-255. getGreen: (Color) -> number, --- `Color.getBlue(c)`: the blue component, 0-255. getBlue: (Color) -> number, --- `Color.getAlpha(c)`: the alpha component, 0-255. getAlpha: (Color) -> number, --- `Color.getRGB(c)`: the 32 bits as a signed integer (`Color.RED` is -65536). getRGB: (Color) -> number, --- `Color.brighter(c)`: each channel divided by 0.7, at most 255, keeping alpha; a non-zero channel under 3 counts as 3, and black gives `(3, 3, 3)`. brighter: (Color) -> Color, --- `Color.darker(c)`: each channel times 0.7, truncated, keeping alpha. darker: (Color) -> Color, --- `Color.WHITE`, packed ARGB. WHITE: Color, --- `Color.white`, packed ARGB. white: Color, --- `Color.LIGHT_GRAY`, packed ARGB. LIGHT_GRAY: Color, --- `Color.lightGray`, packed ARGB. lightGray: Color, --- `Color.GRAY`, packed ARGB. GRAY: Color, --- `Color.gray`, packed ARGB. gray: Color, --- `Color.DARK_GRAY`, packed ARGB. DARK_GRAY: Color, --- `Color.darkGray`, packed ARGB. darkGray: Color, --- `Color.BLACK`, packed ARGB. BLACK: Color, --- `Color.black`, packed ARGB. black: Color, --- `Color.RED`, packed ARGB. RED: Color, --- `Color.red`, packed ARGB. red: Color, --- `Color.PINK`, packed ARGB. PINK: Color, --- `Color.pink`, packed ARGB. pink: Color, --- `Color.ORANGE`, packed ARGB. ORANGE: Color, --- `Color.orange`, packed ARGB. orange: Color, --- `Color.YELLOW`, packed ARGB. YELLOW: Color, --- `Color.yellow`, packed ARGB. yellow: Color, --- `Color.GREEN`, packed ARGB. GREEN: Color, --- `Color.green`, packed ARGB. green: Color, --- `Color.MAGENTA`, packed ARGB. MAGENTA: Color, --- `Color.magenta`, packed ARGB. magenta: Color, --- `Color.CYAN`, packed ARGB. CYAN: Color, --- `Color.cyan`, packed ARGB. cyan: Color, --- `Color.BLUE`, packed ARGB. BLUE: Color, --- `Color.blue`, packed ARGB. blue: Color, } --- `Color`'s static functions and constants. declare Color: ColorClass --- Text helpers. A list result is a 1-based array of strings, a collection argument an array. export type Text = { } export type TextClass = { --- The string without its `<...>` tags; ``/`` become `<`/`>`. removeTags: (string) -> string, --- The comma-separated values, each trimmed, empty ones dropped. fromCSV: (string) -> {string}, --- The strings joined by `,`. toCSV: ({string}) -> string, --- A player name as Jagex spells it: printable characters, non-breaking spaces as spaces. toJagexName: (string) -> string, --- A player name without tags and with non-breaking spaces as spaces. sanitize: (string) -> string, --- An enum constant's name as `This Format`, unless its `toString` is its own. Takes any enum constant. titleCase: (any) -> string, --- `<` as ``, `>` as ``, a newline as `
`, carriage returns dropped. escapeJagex: (string) -> string, --- The inverse of `escapeJagex`. unescapeJagex: (string) -> string, --- Multiline widget text as one line: `
` as a space, tags removed. sanitizeMultilineText: (string) -> string, --- Tags removed, lower case, trimmed: for comparing names. standardize: (string) -> string, --- Only the formatting tags removed (``, `
`, ...); `` kept. removeFormattingTags: (string) -> string, --- Whether every term is in, or within a Jaro-Winkler similarity of 0.9 of, some keyword. matchesSearchTerms: ({string}, {string}) -> boolean, --- The characters the game's fonts draw (U+0020-U+007E, U+0080, U+00A0-U+00FF), as a `CharMatcher`: `Text.JAGEX_PRINTABLE_CHAR_MATCHER:retainFrom(s)` keeps only those, as the chat filter does to every message. One instance, the same every read. JAGEX_PRINTABLE_CHAR_MATCHER: CharMatcher, } --- `Text`'s static functions and constants. declare Text: TextClass --- Quantity formatting. export type QuantityFormatter = { } export type QuantityFormatterClass = { --- A short K/M/B stack size of at most six characters, e.g. `9,450`, `2.14B`, `100K`. quantityToStackSize: (number) -> string, --- `(number) -> string`: --- The stack size as the game prints it, truncated to one decimal. --- --- `(number, boolean) -> string`: --- As the one-argument form, with three decimals for millions and up when `precise`. quantityToRSDecimalStack: ((number) -> string) & ((number, boolean) -> string), --- `"1.5m"` as 1500000; an error for text that is not a quantity. parseQuantity: (string) -> number, --- Comma-grouped, with at most three decimals rounded half-even, e.g. `10,123,351`, `5.612`. formatNumber: (number) -> string, } --- `QuantityFormatter`'s static functions and constants. declare QuantityFormatter: QuantityFormatterClass --- Packed component id helpers. export type WidgetUtil = { } export type WidgetUtilClass = { --- The interface of a packed component id: `component >>> 16`. componentToInterface: (number) -> number, --- The child of a packed component id: `component & 0xFFFF`. componentToId: (number) -> number, --- `interfaceId << 16 | childId`. packComponentId: (number, number) -> number, } --- `WidgetUtil`'s static functions and constants. declare WidgetUtil: WidgetUtilClass --- An orientation in the game's units: 0-2047, 0 facing south, increasing anticlockwise. export type Angle = { --- The angle. getAngle: (Angle) -> number, --- The cardinal `Direction` nearest this angle. getNearestDirection: (Angle) -> Direction, } export type AngleClass = { --- The angle `angle`. new: (number) -> Angle, } --- `Angle`'s static functions and constants. declare Angle: AngleClass --- A key event's constants: the `VK_` key codes, `KEY_PRESSED`/`KEY_RELEASED`/`KEY_TYPED`, `CHAR_UNDEFINED` and the `KEY_LOCATION_` values, plus those it inherits from `InputEvent`, `ComponentEvent` and `AWTEvent`, read as `KeyEvent.X`. export type KeyEvent = { } export type KeyEventClass = { --- `KeyEvent.KEY_FIRST`: 400. KEY_FIRST: number, --- `KeyEvent.KEY_LAST`: 402. KEY_LAST: number, --- `KeyEvent.KEY_TYPED`: 400. KEY_TYPED: number, --- `KeyEvent.KEY_PRESSED`: 401. KEY_PRESSED: number, --- `KeyEvent.KEY_RELEASED`: 402. KEY_RELEASED: number, --- `KeyEvent.VK_ENTER`: 10. VK_ENTER: number, --- `KeyEvent.VK_BACK_SPACE`: 8. VK_BACK_SPACE: number, --- `KeyEvent.VK_TAB`: 9. VK_TAB: number, --- `KeyEvent.VK_CANCEL`: 3. VK_CANCEL: number, --- `KeyEvent.VK_CLEAR`: 12. VK_CLEAR: number, --- `KeyEvent.VK_SHIFT`: 16. VK_SHIFT: number, --- `KeyEvent.VK_CONTROL`: 17. VK_CONTROL: number, --- `KeyEvent.VK_ALT`: 18. VK_ALT: number, --- `KeyEvent.VK_PAUSE`: 19. VK_PAUSE: number, --- `KeyEvent.VK_CAPS_LOCK`: 20. VK_CAPS_LOCK: number, --- `KeyEvent.VK_ESCAPE`: 27. VK_ESCAPE: number, --- `KeyEvent.VK_SPACE`: 32. VK_SPACE: number, --- `KeyEvent.VK_PAGE_UP`: 33. VK_PAGE_UP: number, --- `KeyEvent.VK_PAGE_DOWN`: 34. VK_PAGE_DOWN: number, --- `KeyEvent.VK_END`: 35. VK_END: number, --- `KeyEvent.VK_HOME`: 36. VK_HOME: number, --- `KeyEvent.VK_LEFT`: 37. VK_LEFT: number, --- `KeyEvent.VK_UP`: 38. VK_UP: number, --- `KeyEvent.VK_RIGHT`: 39. VK_RIGHT: number, --- `KeyEvent.VK_DOWN`: 40. VK_DOWN: number, --- `KeyEvent.VK_COMMA`: 44. VK_COMMA: number, --- `KeyEvent.VK_MINUS`: 45. VK_MINUS: number, --- `KeyEvent.VK_PERIOD`: 46. VK_PERIOD: number, --- `KeyEvent.VK_SLASH`: 47. VK_SLASH: number, --- `KeyEvent.VK_0`: 48. VK_0: number, --- `KeyEvent.VK_1`: 49. VK_1: number, --- `KeyEvent.VK_2`: 50. VK_2: number, --- `KeyEvent.VK_3`: 51. VK_3: number, --- `KeyEvent.VK_4`: 52. VK_4: number, --- `KeyEvent.VK_5`: 53. VK_5: number, --- `KeyEvent.VK_6`: 54. VK_6: number, --- `KeyEvent.VK_7`: 55. VK_7: number, --- `KeyEvent.VK_8`: 56. VK_8: number, --- `KeyEvent.VK_9`: 57. VK_9: number, --- `KeyEvent.VK_SEMICOLON`: 59. VK_SEMICOLON: number, --- `KeyEvent.VK_EQUALS`: 61. VK_EQUALS: number, --- `KeyEvent.VK_A`: 65. VK_A: number, --- `KeyEvent.VK_B`: 66. VK_B: number, --- `KeyEvent.VK_C`: 67. VK_C: number, --- `KeyEvent.VK_D`: 68. VK_D: number, --- `KeyEvent.VK_E`: 69. VK_E: number, --- `KeyEvent.VK_F`: 70. VK_F: number, --- `KeyEvent.VK_G`: 71. VK_G: number, --- `KeyEvent.VK_H`: 72. VK_H: number, --- `KeyEvent.VK_I`: 73. VK_I: number, --- `KeyEvent.VK_J`: 74. VK_J: number, --- `KeyEvent.VK_K`: 75. VK_K: number, --- `KeyEvent.VK_L`: 76. VK_L: number, --- `KeyEvent.VK_M`: 77. VK_M: number, --- `KeyEvent.VK_N`: 78. VK_N: number, --- `KeyEvent.VK_O`: 79. VK_O: number, --- `KeyEvent.VK_P`: 80. VK_P: number, --- `KeyEvent.VK_Q`: 81. VK_Q: number, --- `KeyEvent.VK_R`: 82. VK_R: number, --- `KeyEvent.VK_S`: 83. VK_S: number, --- `KeyEvent.VK_T`: 84. VK_T: number, --- `KeyEvent.VK_U`: 85. VK_U: number, --- `KeyEvent.VK_V`: 86. VK_V: number, --- `KeyEvent.VK_W`: 87. VK_W: number, --- `KeyEvent.VK_X`: 88. VK_X: number, --- `KeyEvent.VK_Y`: 89. VK_Y: number, --- `KeyEvent.VK_Z`: 90. VK_Z: number, --- `KeyEvent.VK_OPEN_BRACKET`: 91. VK_OPEN_BRACKET: number, --- `KeyEvent.VK_BACK_SLASH`: 92. VK_BACK_SLASH: number, --- `KeyEvent.VK_CLOSE_BRACKET`: 93. VK_CLOSE_BRACKET: number, --- `KeyEvent.VK_NUMPAD0`: 96. VK_NUMPAD0: number, --- `KeyEvent.VK_NUMPAD1`: 97. VK_NUMPAD1: number, --- `KeyEvent.VK_NUMPAD2`: 98. VK_NUMPAD2: number, --- `KeyEvent.VK_NUMPAD3`: 99. VK_NUMPAD3: number, --- `KeyEvent.VK_NUMPAD4`: 100. VK_NUMPAD4: number, --- `KeyEvent.VK_NUMPAD5`: 101. VK_NUMPAD5: number, --- `KeyEvent.VK_NUMPAD6`: 102. VK_NUMPAD6: number, --- `KeyEvent.VK_NUMPAD7`: 103. VK_NUMPAD7: number, --- `KeyEvent.VK_NUMPAD8`: 104. VK_NUMPAD8: number, --- `KeyEvent.VK_NUMPAD9`: 105. VK_NUMPAD9: number, --- `KeyEvent.VK_MULTIPLY`: 106. VK_MULTIPLY: number, --- `KeyEvent.VK_ADD`: 107. VK_ADD: number, --- `KeyEvent.VK_SEPARATER`: 108. VK_SEPARATER: number, --- `KeyEvent.VK_SEPARATOR`: 108. VK_SEPARATOR: number, --- `KeyEvent.VK_SUBTRACT`: 109. VK_SUBTRACT: number, --- `KeyEvent.VK_DECIMAL`: 110. VK_DECIMAL: number, --- `KeyEvent.VK_DIVIDE`: 111. VK_DIVIDE: number, --- `KeyEvent.VK_DELETE`: 127. VK_DELETE: number, --- `KeyEvent.VK_NUM_LOCK`: 144. VK_NUM_LOCK: number, --- `KeyEvent.VK_SCROLL_LOCK`: 145. VK_SCROLL_LOCK: number, --- `KeyEvent.VK_F1`: 112. VK_F1: number, --- `KeyEvent.VK_F2`: 113. VK_F2: number, --- `KeyEvent.VK_F3`: 114. VK_F3: number, --- `KeyEvent.VK_F4`: 115. VK_F4: number, --- `KeyEvent.VK_F5`: 116. VK_F5: number, --- `KeyEvent.VK_F6`: 117. VK_F6: number, --- `KeyEvent.VK_F7`: 118. VK_F7: number, --- `KeyEvent.VK_F8`: 119. VK_F8: number, --- `KeyEvent.VK_F9`: 120. VK_F9: number, --- `KeyEvent.VK_F10`: 121. VK_F10: number, --- `KeyEvent.VK_F11`: 122. VK_F11: number, --- `KeyEvent.VK_F12`: 123. VK_F12: number, --- `KeyEvent.VK_F13`: 61440. VK_F13: number, --- `KeyEvent.VK_F14`: 61441. VK_F14: number, --- `KeyEvent.VK_F15`: 61442. VK_F15: number, --- `KeyEvent.VK_F16`: 61443. VK_F16: number, --- `KeyEvent.VK_F17`: 61444. VK_F17: number, --- `KeyEvent.VK_F18`: 61445. VK_F18: number, --- `KeyEvent.VK_F19`: 61446. VK_F19: number, --- `KeyEvent.VK_F20`: 61447. VK_F20: number, --- `KeyEvent.VK_F21`: 61448. VK_F21: number, --- `KeyEvent.VK_F22`: 61449. VK_F22: number, --- `KeyEvent.VK_F23`: 61450. VK_F23: number, --- `KeyEvent.VK_F24`: 61451. VK_F24: number, --- `KeyEvent.VK_PRINTSCREEN`: 154. VK_PRINTSCREEN: number, --- `KeyEvent.VK_INSERT`: 155. VK_INSERT: number, --- `KeyEvent.VK_HELP`: 156. VK_HELP: number, --- `KeyEvent.VK_META`: 157. VK_META: number, --- `KeyEvent.VK_BACK_QUOTE`: 192. VK_BACK_QUOTE: number, --- `KeyEvent.VK_QUOTE`: 222. VK_QUOTE: number, --- `KeyEvent.VK_KP_UP`: 224. VK_KP_UP: number, --- `KeyEvent.VK_KP_DOWN`: 225. VK_KP_DOWN: number, --- `KeyEvent.VK_KP_LEFT`: 226. VK_KP_LEFT: number, --- `KeyEvent.VK_KP_RIGHT`: 227. VK_KP_RIGHT: number, --- `KeyEvent.VK_DEAD_GRAVE`: 128. VK_DEAD_GRAVE: number, --- `KeyEvent.VK_DEAD_ACUTE`: 129. VK_DEAD_ACUTE: number, --- `KeyEvent.VK_DEAD_CIRCUMFLEX`: 130. VK_DEAD_CIRCUMFLEX: number, --- `KeyEvent.VK_DEAD_TILDE`: 131. VK_DEAD_TILDE: number, --- `KeyEvent.VK_DEAD_MACRON`: 132. VK_DEAD_MACRON: number, --- `KeyEvent.VK_DEAD_BREVE`: 133. VK_DEAD_BREVE: number, --- `KeyEvent.VK_DEAD_ABOVEDOT`: 134. VK_DEAD_ABOVEDOT: number, --- `KeyEvent.VK_DEAD_DIAERESIS`: 135. VK_DEAD_DIAERESIS: number, --- `KeyEvent.VK_DEAD_ABOVERING`: 136. VK_DEAD_ABOVERING: number, --- `KeyEvent.VK_DEAD_DOUBLEACUTE`: 137. VK_DEAD_DOUBLEACUTE: number, --- `KeyEvent.VK_DEAD_CARON`: 138. VK_DEAD_CARON: number, --- `KeyEvent.VK_DEAD_CEDILLA`: 139. VK_DEAD_CEDILLA: number, --- `KeyEvent.VK_DEAD_OGONEK`: 140. VK_DEAD_OGONEK: number, --- `KeyEvent.VK_DEAD_IOTA`: 141. VK_DEAD_IOTA: number, --- `KeyEvent.VK_DEAD_VOICED_SOUND`: 142. VK_DEAD_VOICED_SOUND: number, --- `KeyEvent.VK_DEAD_SEMIVOICED_SOUND`: 143. VK_DEAD_SEMIVOICED_SOUND: number, --- `KeyEvent.VK_AMPERSAND`: 150. VK_AMPERSAND: number, --- `KeyEvent.VK_ASTERISK`: 151. VK_ASTERISK: number, --- `KeyEvent.VK_QUOTEDBL`: 152. VK_QUOTEDBL: number, --- `KeyEvent.VK_LESS`: 153. VK_LESS: number, --- `KeyEvent.VK_GREATER`: 160. VK_GREATER: number, --- `KeyEvent.VK_BRACELEFT`: 161. VK_BRACELEFT: number, --- `KeyEvent.VK_BRACERIGHT`: 162. VK_BRACERIGHT: number, --- `KeyEvent.VK_AT`: 512. VK_AT: number, --- `KeyEvent.VK_COLON`: 513. VK_COLON: number, --- `KeyEvent.VK_CIRCUMFLEX`: 514. VK_CIRCUMFLEX: number, --- `KeyEvent.VK_DOLLAR`: 515. VK_DOLLAR: number, --- `KeyEvent.VK_EURO_SIGN`: 516. VK_EURO_SIGN: number, --- `KeyEvent.VK_EXCLAMATION_MARK`: 517. VK_EXCLAMATION_MARK: number, --- `KeyEvent.VK_INVERTED_EXCLAMATION_MARK`: 518. VK_INVERTED_EXCLAMATION_MARK: number, --- `KeyEvent.VK_LEFT_PARENTHESIS`: 519. VK_LEFT_PARENTHESIS: number, --- `KeyEvent.VK_NUMBER_SIGN`: 520. VK_NUMBER_SIGN: number, --- `KeyEvent.VK_PLUS`: 521. VK_PLUS: number, --- `KeyEvent.VK_RIGHT_PARENTHESIS`: 522. VK_RIGHT_PARENTHESIS: number, --- `KeyEvent.VK_UNDERSCORE`: 523. VK_UNDERSCORE: number, --- `KeyEvent.VK_WINDOWS`: 524. VK_WINDOWS: number, --- `KeyEvent.VK_CONTEXT_MENU`: 525. VK_CONTEXT_MENU: number, --- `KeyEvent.VK_FINAL`: 24. VK_FINAL: number, --- `KeyEvent.VK_CONVERT`: 28. VK_CONVERT: number, --- `KeyEvent.VK_NONCONVERT`: 29. VK_NONCONVERT: number, --- `KeyEvent.VK_ACCEPT`: 30. VK_ACCEPT: number, --- `KeyEvent.VK_MODECHANGE`: 31. VK_MODECHANGE: number, --- `KeyEvent.VK_KANA`: 21. VK_KANA: number, --- `KeyEvent.VK_KANJI`: 25. VK_KANJI: number, --- `KeyEvent.VK_ALPHANUMERIC`: 240. VK_ALPHANUMERIC: number, --- `KeyEvent.VK_KATAKANA`: 241. VK_KATAKANA: number, --- `KeyEvent.VK_HIRAGANA`: 242. VK_HIRAGANA: number, --- `KeyEvent.VK_FULL_WIDTH`: 243. VK_FULL_WIDTH: number, --- `KeyEvent.VK_HALF_WIDTH`: 244. VK_HALF_WIDTH: number, --- `KeyEvent.VK_ROMAN_CHARACTERS`: 245. VK_ROMAN_CHARACTERS: number, --- `KeyEvent.VK_ALL_CANDIDATES`: 256. VK_ALL_CANDIDATES: number, --- `KeyEvent.VK_PREVIOUS_CANDIDATE`: 257. VK_PREVIOUS_CANDIDATE: number, --- `KeyEvent.VK_CODE_INPUT`: 258. VK_CODE_INPUT: number, --- `KeyEvent.VK_JAPANESE_KATAKANA`: 259. VK_JAPANESE_KATAKANA: number, --- `KeyEvent.VK_JAPANESE_HIRAGANA`: 260. VK_JAPANESE_HIRAGANA: number, --- `KeyEvent.VK_JAPANESE_ROMAN`: 261. VK_JAPANESE_ROMAN: number, --- `KeyEvent.VK_KANA_LOCK`: 262. VK_KANA_LOCK: number, --- `KeyEvent.VK_INPUT_METHOD_ON_OFF`: 263. VK_INPUT_METHOD_ON_OFF: number, --- `KeyEvent.VK_CUT`: 65489. VK_CUT: number, --- `KeyEvent.VK_COPY`: 65485. VK_COPY: number, --- `KeyEvent.VK_PASTE`: 65487. VK_PASTE: number, --- `KeyEvent.VK_UNDO`: 65483. VK_UNDO: number, --- `KeyEvent.VK_AGAIN`: 65481. VK_AGAIN: number, --- `KeyEvent.VK_FIND`: 65488. VK_FIND: number, --- `KeyEvent.VK_PROPS`: 65482. VK_PROPS: number, --- `KeyEvent.VK_STOP`: 65480. VK_STOP: number, --- `KeyEvent.VK_COMPOSE`: 65312. VK_COMPOSE: number, --- `KeyEvent.VK_ALT_GRAPH`: 65406. VK_ALT_GRAPH: number, --- `KeyEvent.VK_BEGIN`: 65368. VK_BEGIN: number, --- `KeyEvent.VK_UNDEFINED`: 0. VK_UNDEFINED: number, --- `KeyEvent.CHAR_UNDEFINED`: the one-character string U+FFFF. CHAR_UNDEFINED: string, --- `KeyEvent.KEY_LOCATION_UNKNOWN`: 0. KEY_LOCATION_UNKNOWN: number, --- `KeyEvent.KEY_LOCATION_STANDARD`: 1. KEY_LOCATION_STANDARD: number, --- `KeyEvent.KEY_LOCATION_LEFT`: 2. KEY_LOCATION_LEFT: number, --- `KeyEvent.KEY_LOCATION_RIGHT`: 3. KEY_LOCATION_RIGHT: number, --- `KeyEvent.KEY_LOCATION_NUMPAD`: 4. KEY_LOCATION_NUMPAD: number, --- `InputEvent.SHIFT_MASK`: 1. SHIFT_MASK: number, --- `InputEvent.CTRL_MASK`: 2. CTRL_MASK: number, --- `InputEvent.META_MASK`: 4. META_MASK: number, --- `InputEvent.ALT_MASK`: 8. ALT_MASK: number, --- `InputEvent.ALT_GRAPH_MASK`: 32. ALT_GRAPH_MASK: number, --- `InputEvent.BUTTON1_MASK`: 16. BUTTON1_MASK: number, --- `InputEvent.BUTTON2_MASK`: 8. BUTTON2_MASK: number, --- `InputEvent.BUTTON3_MASK`: 4. BUTTON3_MASK: number, --- `InputEvent.SHIFT_DOWN_MASK`: 64. SHIFT_DOWN_MASK: number, --- `InputEvent.CTRL_DOWN_MASK`: 128. CTRL_DOWN_MASK: number, --- `InputEvent.META_DOWN_MASK`: 256. META_DOWN_MASK: number, --- `InputEvent.ALT_DOWN_MASK`: 512. ALT_DOWN_MASK: number, --- `InputEvent.BUTTON1_DOWN_MASK`: 1024. BUTTON1_DOWN_MASK: number, --- `InputEvent.BUTTON2_DOWN_MASK`: 2048. BUTTON2_DOWN_MASK: number, --- `InputEvent.BUTTON3_DOWN_MASK`: 4096. BUTTON3_DOWN_MASK: number, --- `InputEvent.ALT_GRAPH_DOWN_MASK`: 8192. ALT_GRAPH_DOWN_MASK: number, --- `ComponentEvent.COMPONENT_FIRST`: 100. COMPONENT_FIRST: number, --- `ComponentEvent.COMPONENT_LAST`: 103. COMPONENT_LAST: number, --- `ComponentEvent.COMPONENT_MOVED`: 100. COMPONENT_MOVED: number, --- `ComponentEvent.COMPONENT_RESIZED`: 101. COMPONENT_RESIZED: number, --- `ComponentEvent.COMPONENT_SHOWN`: 102. COMPONENT_SHOWN: number, --- `ComponentEvent.COMPONENT_HIDDEN`: 103. COMPONENT_HIDDEN: number, --- `AWTEvent.COMPONENT_EVENT_MASK`: 1. COMPONENT_EVENT_MASK: number, --- `AWTEvent.CONTAINER_EVENT_MASK`: 2. CONTAINER_EVENT_MASK: number, --- `AWTEvent.FOCUS_EVENT_MASK`: 4. FOCUS_EVENT_MASK: number, --- `AWTEvent.KEY_EVENT_MASK`: 8. KEY_EVENT_MASK: number, --- `AWTEvent.MOUSE_EVENT_MASK`: 16. MOUSE_EVENT_MASK: number, --- `AWTEvent.MOUSE_MOTION_EVENT_MASK`: 32. MOUSE_MOTION_EVENT_MASK: number, --- `AWTEvent.WINDOW_EVENT_MASK`: 64. WINDOW_EVENT_MASK: number, --- `AWTEvent.ACTION_EVENT_MASK`: 128. ACTION_EVENT_MASK: number, --- `AWTEvent.ADJUSTMENT_EVENT_MASK`: 256. ADJUSTMENT_EVENT_MASK: number, --- `AWTEvent.ITEM_EVENT_MASK`: 512. ITEM_EVENT_MASK: number, --- `AWTEvent.TEXT_EVENT_MASK`: 1024. TEXT_EVENT_MASK: number, --- `AWTEvent.INPUT_METHOD_EVENT_MASK`: 2048. INPUT_METHOD_EVENT_MASK: number, --- `AWTEvent.PAINT_EVENT_MASK`: 8192. PAINT_EVENT_MASK: number, --- `AWTEvent.INVOCATION_EVENT_MASK`: 16384. INVOCATION_EVENT_MASK: number, --- `AWTEvent.HIERARCHY_EVENT_MASK`: 32768. HIERARCHY_EVENT_MASK: number, --- `AWTEvent.HIERARCHY_BOUNDS_EVENT_MASK`: 65536. HIERARCHY_BOUNDS_EVENT_MASK: number, --- `AWTEvent.MOUSE_WHEEL_EVENT_MASK`: 131072. MOUSE_WHEEL_EVENT_MASK: number, --- `AWTEvent.WINDOW_STATE_EVENT_MASK`: 262144. WINDOW_STATE_EVENT_MASK: number, --- `AWTEvent.WINDOW_FOCUS_EVENT_MASK`: 524288. WINDOW_FOCUS_EVENT_MASK: number, --- `AWTEvent.RESERVED_ID_MAX`: 1999. RESERVED_ID_MAX: number, } --- `KeyEvent`'s static functions and constants. declare KeyEvent: KeyEventClass --- The modifier masks (`SHIFT_DOWN_MASK`, `BUTTON1_DOWN_MASK`, ... and the older `SHIFT_MASK` family), plus the constants it inherits from `ComponentEvent` and `AWTEvent`. export type InputEvent = { } export type InputEventClass = { --- `InputEvent.SHIFT_MASK`: 1. SHIFT_MASK: number, --- `InputEvent.CTRL_MASK`: 2. CTRL_MASK: number, --- `InputEvent.META_MASK`: 4. META_MASK: number, --- `InputEvent.ALT_MASK`: 8. ALT_MASK: number, --- `InputEvent.ALT_GRAPH_MASK`: 32. ALT_GRAPH_MASK: number, --- `InputEvent.BUTTON1_MASK`: 16. BUTTON1_MASK: number, --- `InputEvent.BUTTON2_MASK`: 8. BUTTON2_MASK: number, --- `InputEvent.BUTTON3_MASK`: 4. BUTTON3_MASK: number, --- `InputEvent.SHIFT_DOWN_MASK`: 64. SHIFT_DOWN_MASK: number, --- `InputEvent.CTRL_DOWN_MASK`: 128. CTRL_DOWN_MASK: number, --- `InputEvent.META_DOWN_MASK`: 256. META_DOWN_MASK: number, --- `InputEvent.ALT_DOWN_MASK`: 512. ALT_DOWN_MASK: number, --- `InputEvent.BUTTON1_DOWN_MASK`: 1024. BUTTON1_DOWN_MASK: number, --- `InputEvent.BUTTON2_DOWN_MASK`: 2048. BUTTON2_DOWN_MASK: number, --- `InputEvent.BUTTON3_DOWN_MASK`: 4096. BUTTON3_DOWN_MASK: number, --- `InputEvent.ALT_GRAPH_DOWN_MASK`: 8192. ALT_GRAPH_DOWN_MASK: number, --- `ComponentEvent.COMPONENT_FIRST`: 100. COMPONENT_FIRST: number, --- `ComponentEvent.COMPONENT_LAST`: 103. COMPONENT_LAST: number, --- `ComponentEvent.COMPONENT_MOVED`: 100. COMPONENT_MOVED: number, --- `ComponentEvent.COMPONENT_RESIZED`: 101. COMPONENT_RESIZED: number, --- `ComponentEvent.COMPONENT_SHOWN`: 102. COMPONENT_SHOWN: number, --- `ComponentEvent.COMPONENT_HIDDEN`: 103. COMPONENT_HIDDEN: number, --- `AWTEvent.COMPONENT_EVENT_MASK`: 1. COMPONENT_EVENT_MASK: number, --- `AWTEvent.CONTAINER_EVENT_MASK`: 2. CONTAINER_EVENT_MASK: number, --- `AWTEvent.FOCUS_EVENT_MASK`: 4. FOCUS_EVENT_MASK: number, --- `AWTEvent.KEY_EVENT_MASK`: 8. KEY_EVENT_MASK: number, --- `AWTEvent.MOUSE_EVENT_MASK`: 16. MOUSE_EVENT_MASK: number, --- `AWTEvent.MOUSE_MOTION_EVENT_MASK`: 32. MOUSE_MOTION_EVENT_MASK: number, --- `AWTEvent.WINDOW_EVENT_MASK`: 64. WINDOW_EVENT_MASK: number, --- `AWTEvent.ACTION_EVENT_MASK`: 128. ACTION_EVENT_MASK: number, --- `AWTEvent.ADJUSTMENT_EVENT_MASK`: 256. ADJUSTMENT_EVENT_MASK: number, --- `AWTEvent.ITEM_EVENT_MASK`: 512. ITEM_EVENT_MASK: number, --- `AWTEvent.TEXT_EVENT_MASK`: 1024. TEXT_EVENT_MASK: number, --- `AWTEvent.INPUT_METHOD_EVENT_MASK`: 2048. INPUT_METHOD_EVENT_MASK: number, --- `AWTEvent.PAINT_EVENT_MASK`: 8192. PAINT_EVENT_MASK: number, --- `AWTEvent.INVOCATION_EVENT_MASK`: 16384. INVOCATION_EVENT_MASK: number, --- `AWTEvent.HIERARCHY_EVENT_MASK`: 32768. HIERARCHY_EVENT_MASK: number, --- `AWTEvent.HIERARCHY_BOUNDS_EVENT_MASK`: 65536. HIERARCHY_BOUNDS_EVENT_MASK: number, --- `AWTEvent.MOUSE_WHEEL_EVENT_MASK`: 131072. MOUSE_WHEEL_EVENT_MASK: number, --- `AWTEvent.WINDOW_STATE_EVENT_MASK`: 262144. WINDOW_STATE_EVENT_MASK: number, --- `AWTEvent.WINDOW_FOCUS_EVENT_MASK`: 524288. WINDOW_FOCUS_EVENT_MASK: number, --- `AWTEvent.RESERVED_ID_MAX`: 1999. RESERVED_ID_MAX: number, } --- `InputEvent`'s static functions and constants. declare InputEvent: InputEventClass --- A mouse event's constants: the `MOUSE_` event ids, `BUTTON1`-`BUTTON3` and `NOBUTTON`, plus those it inherits from `InputEvent`, `ComponentEvent` and `AWTEvent`. export type MouseEvent = { } export type MouseEventClass = { --- `MouseEvent.MOUSE_FIRST`: 500. MOUSE_FIRST: number, --- `MouseEvent.MOUSE_LAST`: 507. MOUSE_LAST: number, --- `MouseEvent.MOUSE_CLICKED`: 500. MOUSE_CLICKED: number, --- `MouseEvent.MOUSE_PRESSED`: 501. MOUSE_PRESSED: number, --- `MouseEvent.MOUSE_RELEASED`: 502. MOUSE_RELEASED: number, --- `MouseEvent.MOUSE_MOVED`: 503. MOUSE_MOVED: number, --- `MouseEvent.MOUSE_ENTERED`: 504. MOUSE_ENTERED: number, --- `MouseEvent.MOUSE_EXITED`: 505. MOUSE_EXITED: number, --- `MouseEvent.MOUSE_DRAGGED`: 506. MOUSE_DRAGGED: number, --- `MouseEvent.MOUSE_WHEEL`: 507. MOUSE_WHEEL: number, --- `MouseEvent.NOBUTTON`: 0. NOBUTTON: number, --- `MouseEvent.BUTTON1`: 1. BUTTON1: number, --- `MouseEvent.BUTTON2`: 2. BUTTON2: number, --- `MouseEvent.BUTTON3`: 3. BUTTON3: number, --- `InputEvent.SHIFT_MASK`: 1. SHIFT_MASK: number, --- `InputEvent.CTRL_MASK`: 2. CTRL_MASK: number, --- `InputEvent.META_MASK`: 4. META_MASK: number, --- `InputEvent.ALT_MASK`: 8. ALT_MASK: number, --- `InputEvent.ALT_GRAPH_MASK`: 32. ALT_GRAPH_MASK: number, --- `InputEvent.BUTTON1_MASK`: 16. BUTTON1_MASK: number, --- `InputEvent.BUTTON2_MASK`: 8. BUTTON2_MASK: number, --- `InputEvent.BUTTON3_MASK`: 4. BUTTON3_MASK: number, --- `InputEvent.SHIFT_DOWN_MASK`: 64. SHIFT_DOWN_MASK: number, --- `InputEvent.CTRL_DOWN_MASK`: 128. CTRL_DOWN_MASK: number, --- `InputEvent.META_DOWN_MASK`: 256. META_DOWN_MASK: number, --- `InputEvent.ALT_DOWN_MASK`: 512. ALT_DOWN_MASK: number, --- `InputEvent.BUTTON1_DOWN_MASK`: 1024. BUTTON1_DOWN_MASK: number, --- `InputEvent.BUTTON2_DOWN_MASK`: 2048. BUTTON2_DOWN_MASK: number, --- `InputEvent.BUTTON3_DOWN_MASK`: 4096. BUTTON3_DOWN_MASK: number, --- `InputEvent.ALT_GRAPH_DOWN_MASK`: 8192. ALT_GRAPH_DOWN_MASK: number, --- `ComponentEvent.COMPONENT_FIRST`: 100. COMPONENT_FIRST: number, --- `ComponentEvent.COMPONENT_LAST`: 103. COMPONENT_LAST: number, --- `ComponentEvent.COMPONENT_MOVED`: 100. COMPONENT_MOVED: number, --- `ComponentEvent.COMPONENT_RESIZED`: 101. COMPONENT_RESIZED: number, --- `ComponentEvent.COMPONENT_SHOWN`: 102. COMPONENT_SHOWN: number, --- `ComponentEvent.COMPONENT_HIDDEN`: 103. COMPONENT_HIDDEN: number, --- `AWTEvent.COMPONENT_EVENT_MASK`: 1. COMPONENT_EVENT_MASK: number, --- `AWTEvent.CONTAINER_EVENT_MASK`: 2. CONTAINER_EVENT_MASK: number, --- `AWTEvent.FOCUS_EVENT_MASK`: 4. FOCUS_EVENT_MASK: number, --- `AWTEvent.KEY_EVENT_MASK`: 8. KEY_EVENT_MASK: number, --- `AWTEvent.MOUSE_EVENT_MASK`: 16. MOUSE_EVENT_MASK: number, --- `AWTEvent.MOUSE_MOTION_EVENT_MASK`: 32. MOUSE_MOTION_EVENT_MASK: number, --- `AWTEvent.WINDOW_EVENT_MASK`: 64. WINDOW_EVENT_MASK: number, --- `AWTEvent.ACTION_EVENT_MASK`: 128. ACTION_EVENT_MASK: number, --- `AWTEvent.ADJUSTMENT_EVENT_MASK`: 256. ADJUSTMENT_EVENT_MASK: number, --- `AWTEvent.ITEM_EVENT_MASK`: 512. ITEM_EVENT_MASK: number, --- `AWTEvent.TEXT_EVENT_MASK`: 1024. TEXT_EVENT_MASK: number, --- `AWTEvent.INPUT_METHOD_EVENT_MASK`: 2048. INPUT_METHOD_EVENT_MASK: number, --- `AWTEvent.PAINT_EVENT_MASK`: 8192. PAINT_EVENT_MASK: number, --- `AWTEvent.INVOCATION_EVENT_MASK`: 16384. INVOCATION_EVENT_MASK: number, --- `AWTEvent.HIERARCHY_EVENT_MASK`: 32768. HIERARCHY_EVENT_MASK: number, --- `AWTEvent.HIERARCHY_BOUNDS_EVENT_MASK`: 65536. HIERARCHY_BOUNDS_EVENT_MASK: number, --- `AWTEvent.MOUSE_WHEEL_EVENT_MASK`: 131072. MOUSE_WHEEL_EVENT_MASK: number, --- `AWTEvent.WINDOW_STATE_EVENT_MASK`: 262144. WINDOW_STATE_EVENT_MASK: number, --- `AWTEvent.WINDOW_FOCUS_EVENT_MASK`: 524288. WINDOW_FOCUS_EVENT_MASK: number, --- `AWTEvent.RESERVED_ID_MAX`: 1999. RESERVED_ID_MAX: number, } --- `MouseEvent`'s static functions and constants. declare MouseEvent: MouseEventClass --- What every shape answers. A draw call takes any shape. export type Shape = { --- `(Shape, number, number) -> boolean`: --- Whether the point is inside, by the shape's winding rule (a `Rectangle` with whole coordinates tests as its `contains(int, int)`). --- --- `(Shape, Point) -> boolean`: --- Whether `p` is inside. --- --- `(Shape, Rectangle) -> boolean`: --- Whether `r` is entirely inside. contains: ((Shape, number, number) -> boolean) & ((Shape, Point) -> boolean) & ((Shape, Rectangle) -> boolean), --- `(Shape, number, number, number, number) -> boolean`: --- Whether the shape's interior meets the rectangle's. --- --- `(Shape, Rectangle) -> boolean`: --- Whether the shape meets `r`. --- --- `(Shape, Rectangle2D) -> boolean`: --- Whether the shape meets `r`. intersects: ((Shape, number, number, number, number) -> boolean) & ((Shape, Rectangle2D) -> boolean), --- The integer bounding rectangle: the exact bounds with their edges rounded outward to whole pixels. getBounds: (Shape) -> Rectangle, --- The exact bounding rectangle. getBounds2D: (Shape) -> Rectangle2D, } --- A shape inscribed in a rectangular frame. export type RectangularShape = Shape & { --- The frame's x. getX: (RectangularShape) -> number, --- The frame's y. getY: (RectangularShape) -> number, --- The frame's width. getWidth: (RectangularShape) -> number, --- The frame's height. getHeight: (RectangularShape) -> number, --- The frame's smallest x. getMinX: (RectangularShape) -> number, --- The frame's smallest y. getMinY: (RectangularShape) -> number, --- The frame's largest x: `x + width`. getMaxX: (RectangularShape) -> number, --- The frame's largest y: `y + height`. getMaxY: (RectangularShape) -> number, --- The frame's centre x. getCenterX: (RectangularShape) -> number, --- The frame's centre y. getCenterY: (RectangularShape) -> number, --- Whether the frame encloses no area. isEmpty: (RectangularShape) -> boolean, --- Set the frame from two opposite corners. setFrameFromDiagonal: (RectangularShape, number, number, number, number) -> (), } --- A rectangle of `double`s. `==` compares frames (a `Rectangle` equals a `Rectangle2D` with the same frame). export type Rectangle2D = RectangularShape & { --- Whether `other` has the same frame, a `Rectangle` and a `Rectangle2D` alike (`false` for anything else); `==` answers the same. equals: (Rectangle2D, any) -> boolean, --- The x, `Rectangle2D.Double`'s public field. x: number, --- The y, `Rectangle2D.Double`'s public field. y: number, --- The width, `Rectangle2D.Double`'s public field. width: number, --- The height, `Rectangle2D.Double`'s public field. height: number, } export type Rectangle2DClass = { --- `(number, number, number, number) -> Rectangle2D`: --- The rectangle at `x`, `y`, `w` wide and `h` high (`Rectangle2D.Double.new(...)` reaches it too). --- --- `() -> Rectangle2D`: --- The empty rectangle at the origin (`Rectangle2D.Double.new()` reaches it too). new: ((number, number, number, number) -> Rectangle2D) & (() -> Rectangle2D), --- `Rectangle2D.Double`: `Rectangle2D` itself, so `Rectangle2D.Double.new(...)` is `Rectangle2D.new(...)`. Double: Rectangle2DClass, --- `Rectangle2D.Float`: `Rectangle2D` itself, so `Rectangle2D.Float.new(...)` is `Rectangle2D.new(...)`. Float: Rectangle2DClass, } --- `Rectangle2D`'s static functions and constants. declare Rectangle2D: Rectangle2DClass --- A rectangle of `int`s, with public `x`, `y`, `width` and `height` fields (read-only: write through `setLocation`/`setSize`/`setBounds`). Mutable; `==` compares frames. export type Rectangle = Rectangle2D & { --- The x, AWT's field. x: number, --- The y, AWT's field. y: number, --- The width, AWT's field. width: number, --- The height, AWT's field. height: number, --- The size, as a new `Dimension`. getSize: (Rectangle) -> Dimension, --- The corner, as a new `Point`. getLocation: (Rectangle) -> Point, --- `(Rectangle, number, number) -> ()`: --- Move the corner to `x`, `y`. --- --- `(Rectangle, Point) -> ()`: --- Move the corner to `p`. setLocation: ((Rectangle, number, number) -> ()) & ((Rectangle, Point) -> ()), --- `(Rectangle, number, number) -> ()`: --- Resize. --- --- `(Rectangle, Dimension) -> ()`: --- Resize to `d`. setSize: ((Rectangle, number, number) -> ()) & ((Rectangle, Dimension) -> ()), --- Set every field. setBounds: (Rectangle, number, number, number, number) -> (), --- `(Rectangle, number, number) -> ()`: --- Grow to include the point, as AWT's `add`. --- --- `(Rectangle, Point) -> ()`: --- Grow to include `p`. --- --- `(Rectangle, Rectangle) -> ()`: --- Grow to include `r`. add: ((Rectangle, number, number) -> ()) & ((Rectangle, Point) -> ()) & ((Rectangle, Rectangle) -> ()), --- Move by `dx`, `dy`, clamped as AWT clamps. translate: (Rectangle, number, number) -> (), --- Grow by `h` on the left and right and `v` top and bottom. grow: (Rectangle, number, number) -> (), --- The overlap, as a new rectangle (empty, with AWT's negative size, when there is none). intersection: (Rectangle, Rectangle) -> Rectangle, --- The smallest rectangle holding both. union: (Rectangle, Rectangle) -> Rectangle, } export type RectangleClass = { --- `(number, number, number, number) -> Rectangle`: --- The rectangle at `x`, `y`, `width` by `height`. --- --- `(number, number) -> Rectangle`: --- A `width` by `height` rectangle at the origin. --- --- `(Point) -> Rectangle`: --- An empty rectangle at `p`. --- --- `(Dimension) -> Rectangle`: --- A rectangle of size `d` at the origin. --- --- `(Rectangle) -> Rectangle`: --- A copy of `r`. --- --- `() -> Rectangle`: --- The empty rectangle at the origin. new: ((number, number, number, number) -> Rectangle) & ((number, number) -> Rectangle) & ((Point) -> Rectangle) & ((Dimension) -> Rectangle) & ((Rectangle) -> Rectangle) & (() -> Rectangle), } --- `Rectangle`'s static functions and constants. declare Rectangle: RectangleClass --- A closed polygon of integer points, even-odd filled. Mutable. `copyXPoints()`/`copyYPoints()` give copies of its point coordinates. export type Polygon = Shape & { --- Append a point. addPoint: (Polygon, number, number) -> (), --- Move every point. translate: (Polygon, number, number) -> (), --- Remove every point. reset: (Polygon) -> (), --- How many points, AWT's field. npoints: number, --- The x of each point (`xpoints`) as a new 1-based array, so a write to it changes nothing. `addPoint`/`translate` change the polygon. copyXPoints: (Polygon) -> {number}, --- The y of each point (`ypoints`) as a new 1-based array. copyYPoints: (Polygon) -> {number}, } export type PolygonClass = { --- `() -> Polygon`: --- An empty polygon. --- --- `({number}, {number}, number) -> Polygon`: --- The polygon of the first `npoints` points. new: (() -> Polygon) & (({number}, {number}, number) -> Polygon), } --- `Polygon`'s static functions and constants. declare Polygon: PolygonClass --- The ellipse inscribed in a frame. export type Ellipse2D = RectangularShape & { --- The frame's x, `Ellipse2D.Double`'s public field. x: number, --- The frame's y, `Ellipse2D.Double`'s public field. y: number, --- The frame's width, `Ellipse2D.Double`'s public field. width: number, --- The frame's height, `Ellipse2D.Double`'s public field. height: number, } export type Ellipse2DClass = { --- The ellipse in the frame at `x`, `y`, `w` wide and `h` high (`Ellipse2D.Double.new(...)` reaches it too). new: (number, number, number, number) -> Ellipse2D, --- `Ellipse2D.Double`: `Ellipse2D` itself, so `Ellipse2D.Double.new(...)` is `Ellipse2D.new(...)`. Double: Ellipse2DClass, --- `Ellipse2D.Float`: `Ellipse2D` itself, so `Ellipse2D.Float.new(...)` is `Ellipse2D.new(...)`. Float: Ellipse2DClass, } --- `Ellipse2D`'s static functions and constants. declare Ellipse2D: Ellipse2DClass --- A segment. It encloses no area, so `contains` is always false. export type Line2D = Shape & { --- The start point's x. getX1: (Line2D) -> number, --- The start point's y. getY1: (Line2D) -> number, --- The end point's x. getX2: (Line2D) -> number, --- The end point's y. getY2: (Line2D) -> number, --- The start point's x, `Line2D.Double`'s public field. x1: number, --- The start point's y, `Line2D.Double`'s public field. y1: number, --- The end point's x, `Line2D.Double`'s public field. x2: number, --- The end point's y, `Line2D.Double`'s public field. y2: number, } export type Line2DClass = { --- `(number, number, number, number) -> Line2D`: --- The segment from `(x1, y1)` to `(x2, y2)` (`Line2D.Double.new(...)` reaches it too). --- --- `(Point, Point) -> Line2D`: --- The segment between two points (`Line2D.Double.new(p1, p2)` reaches it too). new: ((number, number, number, number) -> Line2D) & ((Point, Point) -> Line2D), --- `Line2D.Double`: `Line2D` itself, so `Line2D.Double.new(...)` is `Line2D.new(...)`. Double: Line2DClass, --- `Line2D.Float`: `Line2D` itself, so `Line2D.Float.new(...)` is `Line2D.new(...)`. Float: Line2DClass, } --- `Line2D`'s static functions and constants. declare Line2D: Line2DClass --- An arc of the ellipse inscribed in a frame, angles in degrees counter-clockwise from 3 o'clock. export type Arc2D = RectangularShape & { --- The frame's x, `Arc2D.Double`'s public field. x: number, --- The frame's y, `Arc2D.Double`'s public field. y: number, --- The frame's width, `Arc2D.Double`'s public field. width: number, --- The frame's height, `Arc2D.Double`'s public field. height: number, --- The start angle in degrees, `Arc2D.Double`'s public field. start: number, --- The angular extent in degrees, `Arc2D.Double`'s public field. extent: number, } export type Arc2DClass = { --- The arc of the frame at `x`, `y`, `w` wide and `h` high, from `start` through `extent` degrees; `type` is `Arc2D.OPEN`, `CHORD` or `PIE` (`Arc2D.Double.new(...)` reaches it too). new: (number, number, number, number, number, number, number) -> Arc2D, --- `Arc2D.OPEN`: the arc alone. OPEN: number, --- `Arc2D.CHORD`: closed by the chord. CHORD: number, --- `Arc2D.PIE`: closed through the centre. PIE: number, --- `Arc2D.Double`: `Arc2D` itself, so `Arc2D.Double.new(...)` is `Arc2D.new(...)`. Double: Arc2DClass, --- `Arc2D.Float`: `Arc2D` itself, so `Arc2D.Float.new(...)` is `Arc2D.new(...)`. Float: Arc2DClass, } --- `Arc2D`'s static functions and constants. declare Arc2D: Arc2DClass --- A path of lines and curves, in `double`s (`Path2D.Float`'s `float`s are widened; the path is the same to the pixel at game coordinates). export type Path2D = Shape & { --- Start a subpath at `x`, `y`. moveTo: (Path2D, number, number) -> (), --- A line to `x`, `y`; an error with no `moveTo` first. lineTo: (Path2D, number, number) -> (), --- A quadratic curve through control point 1 to point 2. quadTo: (Path2D, number, number, number, number) -> (), --- A cubic curve through two control points to point 3. curveTo: (Path2D, number, number, number, number, number, number) -> (), --- Close the subpath. closePath: (Path2D) -> (), --- Empty the path. reset: (Path2D) -> (), } export type Path2DClass = { --- An empty non-zero path (`Path2D.Double.new()` reaches it too). new: () -> Path2D, --- `Path2D.Double`: `Path2D` itself, so `Path2D.Double.new(...)` is `Path2D.new(...)`. Double: Path2DClass, --- `Path2D.Float`: `Path2D` itself, so `Path2D.Float.new(...)` is `Path2D.new(...)`. Float: Path2DClass, } --- `Path2D`'s static functions and constants. declare Path2D: Path2DClass --- A `Path2D`, under another name. export type GeneralPath = Path2D export type GeneralPathClass = { --- `() -> GeneralPath`: --- An empty non-zero path. --- --- `(Shape) -> GeneralPath`: --- The outline of `s`, under its winding rule. new: (() -> GeneralPath) & ((Shape) -> GeneralPath), } --- `GeneralPath`'s static functions and constants. declare GeneralPath: GeneralPathClass --- A region, combined by union, difference, intersection and exclusive or. export type Area = Shape & { --- Union with `rhs`. add: (Area, Area) -> (), --- Remove `rhs`. subtract: (Area, Area) -> (), --- Keep only the overlap with `rhs`. intersect: (Area, Area) -> (), --- Keep what exactly one of the two covers. exclusiveOr: (Area, Area) -> (), --- Whether the region is empty. isEmpty: (Area) -> boolean, } export type AreaClass = { --- `() -> Area`: --- The empty region. --- --- `(Shape) -> Area`: --- The region `s` encloses, under its winding rule. new: (() -> Area) & ((Shape) -> Area), } --- `Area`'s static functions and constants. declare Area: AreaClass --- A line width, end caps, joins and dashes. A negative width, dash phase or dash length, all-zero dashes, an unknown cap or join, or a miter limit under 1 on a miter join raises. `==` compares by value. export type BasicStroke = { --- The width. getLineWidth: (BasicStroke) -> number, --- The `CAP_*` constant. getEndCap: (BasicStroke) -> number, --- The `JOIN_*` constant. getLineJoin: (BasicStroke) -> number, --- The miter limit. getMiterLimit: (BasicStroke) -> number, --- Whether `other` is the same stroke (`==` answers the same; `false` for anything else). equals: (BasicStroke, any) -> boolean, } export type BasicStrokeClass = { --- `(number) -> BasicStroke`: --- A `width` stroke: square caps, miter joins. --- --- `(number, number, number) -> BasicStroke`: --- A `width` stroke with `cap` (`CAP_BUTT`/`ROUND`/`SQUARE`) and `join` (`JOIN_MITER`/`ROUND`/`BEVEL`). --- --- `(number, number, number, number) -> BasicStroke`: --- As above, with a miter limit. --- --- `(number, number, number, number, {number}?, number) -> BasicStroke`: --- A dashed stroke: `dash` is the on/off lengths, or nil for solid. --- --- `() -> BasicStroke`: --- A 1 pixel stroke: square caps, miter joins. new: ((number) -> BasicStroke) & ((number, number, number) -> BasicStroke) & ((number, number, number, number) -> BasicStroke) & ((number, number, number, number, {number}?, number) -> BasicStroke) & (() -> BasicStroke), --- `BasicStroke.CAP_BUTT`: 0. CAP_BUTT: number, --- `BasicStroke.CAP_ROUND`: 1. CAP_ROUND: number, --- `BasicStroke.CAP_SQUARE`: 2. CAP_SQUARE: number, --- `BasicStroke.JOIN_MITER`: 0. JOIN_MITER: number, --- `BasicStroke.JOIN_ROUND`: 1. JOIN_ROUND: number, --- `BasicStroke.JOIN_BEVEL`: 2. JOIN_BEVEL: number, } --- `BasicStroke`'s static functions and constants. declare BasicStroke: BasicStrokeClass --- A font. Its name resolves to: the RuneScape families `FontManager` registers ("RuneScape", whose bold style is `runescape_bold.ttf`, and "RuneScape Small"); the logical fonts (`Dialog`, `DialogInput`, `SansSerif`, `Serif`, `Monospaced`, and any name that is not a known font, which is `Dialog`); and the system's own faces by family or face name (`"Arial"`, `"Arial Bold"`, any installed family). Metrics come from measured tables, so `stringWidth`-centred layouts land to the pixel. Glyphs are the face's own, hinted by FreeType (at the device size under a scale or rotation), with synthetic bold and italic where the family lacks the style. A character the face lacks comes from another face: the RuneScape, logical and `FontManager.getFallbackFont` fonts take it from `Dialog`'s components (Segoe UI Symbol, then the CJK and other script faces). **Complex scripts:** text is laid out one glyph per character, left to right, with no shaping of Arabic, Hebrew, Indic, Thai or Myanmar runs and no placing of combining marks, so right-to-left and shaped scripts in plugin text do not join up (OSRS text is cp1252 and unaffected). **Custom fonts:** the `.ttf` and `.otf` files in `~/.bentobox/fonts` resolve by family name. **Substitution:** where this host has no file for a known face (Wine, a stripped install), its text is drawn with the nearest installed face (a metric-compatible one first: Liberation Sans or Arimo for Arial, Liberation Serif or Tinos for Times New Roman, Liberation Mono or Cousine for Courier New; then look-alikes such as Segoe UI or Tahoma), else the RuneScape face, still laid out with the known face's metrics, and the log names the stand-in once. `==` compares by value (the name it was made with included). export type Font = { --- `(Font, number) -> Font`: --- This font at `size`. --- --- `(Font, number, number) -> Font`: --- This font in `style` at `size`. deriveFont: ((Font, number) -> Font) & ((Font, number, number) -> Font), --- This font in `style`. Luau has one number type, so a one-number `deriveFont` is always the size overload, and the style one is this. deriveFontStyle: (Font, number) -> Font, --- The size, rounded half up. getSize: (Font) -> number, --- The size. getSize2D: (Font) -> number, --- The style bits. getStyle: (Font) -> number, --- Whether the style is bold. isBold: (Font) -> boolean, --- Whether the style is italic. isItalic: (Font) -> boolean, --- Whether the style is plain. isPlain: (Font) -> boolean, --- The family the name resolved to: `RuneScape`, `Dialog`, `Arial`... getFamily: (Font) -> string, --- The face's name, e.g. `RuneScape Bold`, `Arial Bold`, `Dialog.bold`. getFontName: (Font) -> string, --- The name it was made with (`"Sans-serif"` stays `"Sans-serif"`; its family is `Dialog`); a name longer than 256 bytes is not kept and answers its family's name. getName: (Font) -> string, --- Whether `other` is the same font (`==` answers the same, the name it was made with included; `false` for anything else). equals: (Font, any) -> boolean, } export type FontClass = { --- The font for `name`: a RuneScape family, a logical font (`Font.DIALOG`...), or a system family or face name; any other name is `Dialog`. `style` is `PLAIN`, `BOLD`, `ITALIC`, or'ed; a face the family lacks is synthesized. Never raises. new: (string, number, number) -> Font, --- `Font.PLAIN`: 0. PLAIN: number, --- `Font.BOLD`: 1. BOLD: number, --- `Font.ITALIC`: 2. ITALIC: number, --- `Font.DIALOG`: the logical font Swing draws with (Arial, then the fallback faces). DIALOG: string, --- `Font.DIALOG_INPUT`: the logical font of text input (Courier New). DIALOG_INPUT: string, --- `Font.SANS_SERIF`: the logical sans-serif font (Arial). SANS_SERIF: string, --- `Font.SERIF`: the logical serif font (Times New Roman). SERIF: string, --- `Font.MONOSPACED`: the logical monospaced font (Courier New). MONOSPACED: string, } --- `Font`'s static functions and constants. declare Font: FontClass --- A font's metrics, from measured tables: the RuneScape fonts, the logical fonts and the system faces, rounding included, so text lays out to the pixel. export type FontMetrics = { --- The advance of `str`, in pixels. stringWidth: (FontMetrics, string) -> number, --- Ascent plus descent plus leading. getHeight: (FontMetrics) -> number, --- The ascent. getAscent: (FontMetrics) -> number, --- The descent. getDescent: (FontMetrics) -> number, --- The leading. getLeading: (FontMetrics) -> number, --- The largest ascent. getMaxAscent: (FontMetrics) -> number, --- The largest descent. getMaxDescent: (FontMetrics) -> number, --- The largest advance. getMaxAdvance: (FontMetrics) -> number, --- The font measured. getFont: (FontMetrics) -> Font, --- The logical bounds of `str` from its baseline origin. Pass the `Graphics2D`; the metrics already carry its context. getStringBounds: (FontMetrics, string, any) -> Rectangle2D, } --- The three RuneScape fonts at 16, Swing's `Dialog` defaults, and `getFallbackFont`. export type FontManager = { } export type FontManagerClass = { --- `RuneScape`, plain, 16. getRunescapeFont: () -> Font, --- `RuneScape Small`, plain, 16. getRunescapeSmallFont: () -> Font, --- `RuneScape`, bold, 16. getRunescapeBoldFont: () -> Font, --- Swing's `Dialog`, plain, 16 (`Font.new(Font.DIALOG, Font.PLAIN, 16)`). getDefaultFont: () -> Font, --- Swing's `Dialog`, bold, 16. getDefaultBoldFont: () -> Font, --- The family's font with `Dialog`'s faces behind it for the characters it lacks (what `FontType.getFont()` answers); an unknown family is `Dialog`. getFallbackFont: (string, number, number) -> Font, } --- `FontManager`'s static functions and constants. declare FontManager: FontManagerClass --- A font as a config value: a family, size and style, and `getFont()`. Immutable: `with*` returns a new one, or the receiver when nothing changes. `==` is identity. `FontType.REGULAR`, `BOLD` and `SMALL` are the three built in; any family name is taken and resolved as `FontManager.getFallbackFont` resolves it. export type FontType = { --- The family name. getFamily: (FontType) -> string, --- The size. getSize: (FontType) -> number, --- Whether it is bold. isBold: (FontType) -> boolean, --- Whether it is italic. isItalic: (FontType) -> boolean, --- The font it describes. getFont: (FontType) -> Font, --- A copy, bold or not. withBold: (FontType, boolean) -> FontType, --- A copy, italic or not. withItalic: (FontType, boolean) -> FontType, --- A copy at `size`. withSize: (FontType, number) -> FontType, --- A copy in `family` (any family name; `getFamily` answers it as given). withFamily: (FontType, string) -> FontType, } export type FontTypeClass = { --- `FontType.REGULAR`: RuneScape, 16. REGULAR: FontType, --- `FontType.BOLD`: RuneScape bold, 16. BOLD: FontType, --- `FontType.SMALL`: RuneScape Small, 16. SMALL: FontType, } --- `FontType`'s static functions and constants. declare FontType: FontTypeClass --- Enum `ChatMessageType`: 45 constants, each one userdata per VM, so `==` is identity and a constant is a table key. `ChatMessageType.values()`, `ChatMessageType.valueOf(name)`; every constant answers `name()`, `ordinal()` (0-based), `toString()`, `compareTo()` and `equals()`, plus `getType()`. export type ChatMessageType = { --- The constant's name as declared. name: (ChatMessageType) -> string, --- The constant's 0-based position in `values()`. ordinal: (ChatMessageType) -> number, --- `name()`; `tostring(c)` answers the same. toString: (ChatMessageType) -> string, --- This ordinal less `other`'s. compareTo: (ChatMessageType, ChatMessageType) -> number, --- Whether `other` is this constant. `==` answers the same. equals: (ChatMessageType, any) -> boolean, --- This constant's `getType()` value, listed on each constant. getType: (ChatMessageType) -> number, } export type ChatMessageTypeClass = { --- Every constant in ordinal order, as a 1-based array: the same frozen array every `values()` call, so `table.clone` it before changing it. values: () -> {ChatMessageType}, --- `valueOf(name)`: the constant named `name`; any other name is an error. valueOf: (string) -> ChatMessageType, --- The constant whose `getType()` is `type`, or `UNKNOWN`. of: (number) -> ChatMessageType, --- `GAMEMESSAGE`: ordinal 0; `getType()` 0. GAMEMESSAGE: ChatMessageType, --- `MODCHAT`: ordinal 1; `getType()` 1. MODCHAT: ChatMessageType, --- `PUBLICCHAT`: ordinal 2; `getType()` 2. PUBLICCHAT: ChatMessageType, --- `PRIVATECHAT`: ordinal 3; `getType()` 3. PRIVATECHAT: ChatMessageType, --- `ENGINE`: ordinal 4; `getType()` 4. ENGINE: ChatMessageType, --- `LOGINLOGOUTNOTIFICATION`: ordinal 5; `getType()` 5. LOGINLOGOUTNOTIFICATION: ChatMessageType, --- `PRIVATECHATOUT`: ordinal 6; `getType()` 6. PRIVATECHATOUT: ChatMessageType, --- `MODPRIVATECHAT`: ordinal 7; `getType()` 7. MODPRIVATECHAT: ChatMessageType, --- `FRIENDSCHAT`: ordinal 8; `getType()` 9. FRIENDSCHAT: ChatMessageType, --- `FRIENDSCHATNOTIFICATION`: ordinal 9; `getType()` 11. FRIENDSCHATNOTIFICATION: ChatMessageType, --- `TRADE_SENT`: ordinal 10; `getType()` 12. TRADE_SENT: ChatMessageType, --- `BROADCAST`: ordinal 11; `getType()` 14. BROADCAST: ChatMessageType, --- `SNAPSHOTFEEDBACK`: ordinal 12; `getType()` 26. SNAPSHOTFEEDBACK: ChatMessageType, --- `ITEM_EXAMINE`: ordinal 13; `getType()` 27. ITEM_EXAMINE: ChatMessageType, --- `NPC_EXAMINE`: ordinal 14; `getType()` 28. NPC_EXAMINE: ChatMessageType, --- `OBJECT_EXAMINE`: ordinal 15; `getType()` 29. OBJECT_EXAMINE: ChatMessageType, --- `FRIENDNOTIFICATION`: ordinal 16; `getType()` 30. FRIENDNOTIFICATION: ChatMessageType, --- `IGNORENOTIFICATION`: ordinal 17; `getType()` 31. IGNORENOTIFICATION: ChatMessageType, --- `CLAN_CHAT`: ordinal 18; `getType()` 41. CLAN_CHAT: ChatMessageType, --- `CLAN_MESSAGE`: ordinal 19; `getType()` 43. CLAN_MESSAGE: ChatMessageType, --- `CLAN_GUEST_CHAT`: ordinal 20; `getType()` 44. CLAN_GUEST_CHAT: ChatMessageType, --- `CLAN_GUEST_MESSAGE`: ordinal 21; `getType()` 46. CLAN_GUEST_MESSAGE: ChatMessageType, --- `AUTOTYPER`: ordinal 22; `getType()` 90. AUTOTYPER: ChatMessageType, --- `MODAUTOTYPER`: ordinal 23; `getType()` 91. MODAUTOTYPER: ChatMessageType, --- `CONSOLE`: ordinal 24; `getType()` 99. CONSOLE: ChatMessageType, --- `TRADEREQ`: ordinal 25; `getType()` 101. TRADEREQ: ChatMessageType, --- `TRADE`: ordinal 26; `getType()` 102. TRADE: ChatMessageType, --- `CHALREQ_TRADE`: ordinal 27; `getType()` 103. CHALREQ_TRADE: ChatMessageType, --- `CHALREQ_FRIENDSCHAT`: ordinal 28; `getType()` 104. CHALREQ_FRIENDSCHAT: ChatMessageType, --- `SPAM`: ordinal 29; `getType()` 105. SPAM: ChatMessageType, --- `PLAYERRELATED`: ordinal 30; `getType()` 106. PLAYERRELATED: ChatMessageType, --- `TENSECTIMEOUT`: ordinal 31; `getType()` 107. TENSECTIMEOUT: ChatMessageType, --- `WELCOME`: ordinal 32; `getType()` 108. WELCOME: ChatMessageType, --- `CLAN_CREATION_INVITATION`: ordinal 33; `getType()` 109. CLAN_CREATION_INVITATION: ChatMessageType, --- `CHALREQ_CLANCHAT`: ordinal 34; `getType()` 110. CHALREQ_CLANCHAT: ChatMessageType, --- `CLAN_GIM_FORM_GROUP`: ordinal 35; `getType()` 111. CLAN_GIM_FORM_GROUP: ChatMessageType, --- `CLAN_GIM_GROUP_WITH`: ordinal 36; `getType()` 112. CLAN_GIM_GROUP_WITH: ChatMessageType, --- `CLAN_GIM_CHAT`: ordinal 37; `getType()` -1. CLAN_GIM_CHAT: ChatMessageType, --- `CLAN_GIM_MESSAGE`: ordinal 38; `getType()` -1. CLAN_GIM_MESSAGE: ChatMessageType, --- `DIALOG`: ordinal 39; `getType()` 114. DIALOG: ChatMessageType, --- `MESBOX`: ordinal 40; `getType()` 115. MESBOX: ChatMessageType, --- `NPC_SAY`: ordinal 41; `getType()` 116. NPC_SAY: ChatMessageType, --- `DIDYOUKNOW`: ordinal 42; `getType()` 117. DIDYOUKNOW: ChatMessageType, --- `LEVELUPMESSAGE`: ordinal 43; `getType()` 118. LEVELUPMESSAGE: ChatMessageType, --- `UNKNOWN`: ordinal 44; `getType()` -1. UNKNOWN: ChatMessageType, } --- `ChatMessageType`'s static functions and constants. declare ChatMessageType: ChatMessageTypeClass --- Enum `EquipmentInventorySlot`: 14 constants, each one userdata per VM, so `==` is identity and a constant is a table key. `EquipmentInventorySlot.values()`, `EquipmentInventorySlot.valueOf(name)`; every constant answers `name()`, `ordinal()` (0-based), `toString()`, `compareTo()` and `equals()`, plus `getSlotIdx()`. export type EquipmentInventorySlot = { --- The constant's name as declared. name: (EquipmentInventorySlot) -> string, --- The constant's 0-based position in `values()`. ordinal: (EquipmentInventorySlot) -> number, --- `name()`; `tostring(c)` answers the same. toString: (EquipmentInventorySlot) -> string, --- This ordinal less `other`'s. compareTo: (EquipmentInventorySlot, EquipmentInventorySlot) -> number, --- Whether `other` is this constant. `==` answers the same. equals: (EquipmentInventorySlot, any) -> boolean, --- This constant's `getSlotIdx()` value, listed on each constant. getSlotIdx: (EquipmentInventorySlot) -> number, } export type EquipmentInventorySlotClass = { --- Every constant in ordinal order, as a 1-based array: the same frozen array every `values()` call, so `table.clone` it before changing it. values: () -> {EquipmentInventorySlot}, --- `valueOf(name)`: the constant named `name`; any other name is an error. valueOf: (string) -> EquipmentInventorySlot, --- `HEAD`: ordinal 0; `getSlotIdx()` 0. HEAD: EquipmentInventorySlot, --- `CAPE`: ordinal 1; `getSlotIdx()` 1. CAPE: EquipmentInventorySlot, --- `AMULET`: ordinal 2; `getSlotIdx()` 2. AMULET: EquipmentInventorySlot, --- `WEAPON`: ordinal 3; `getSlotIdx()` 3. WEAPON: EquipmentInventorySlot, --- `BODY`: ordinal 4; `getSlotIdx()` 4. BODY: EquipmentInventorySlot, --- `SHIELD`: ordinal 5; `getSlotIdx()` 5. SHIELD: EquipmentInventorySlot, --- `ARMS`: ordinal 6; `getSlotIdx()` 6. ARMS: EquipmentInventorySlot, --- `LEGS`: ordinal 7; `getSlotIdx()` 7. LEGS: EquipmentInventorySlot, --- `HAIR`: ordinal 8; `getSlotIdx()` 8. HAIR: EquipmentInventorySlot, --- `GLOVES`: ordinal 9; `getSlotIdx()` 9. GLOVES: EquipmentInventorySlot, --- `BOOTS`: ordinal 10; `getSlotIdx()` 10. BOOTS: EquipmentInventorySlot, --- `JAW`: ordinal 11; `getSlotIdx()` 11. JAW: EquipmentInventorySlot, --- `RING`: ordinal 12; `getSlotIdx()` 12. RING: EquipmentInventorySlot, --- `AMMO`: ordinal 13; `getSlotIdx()` 13. AMMO: EquipmentInventorySlot, } --- `EquipmentInventorySlot`'s static functions and constants. declare EquipmentInventorySlot: EquipmentInventorySlotClass --- Enum `FriendsChatRank`: 10 constants, each one userdata per VM, so `==` is identity and a constant is a table key. `FriendsChatRank.values()`, `FriendsChatRank.valueOf(name)`; every constant answers `name()`, `ordinal()` (0-based), `toString()`, `compareTo()` and `equals()`, plus `getValue()`. export type FriendsChatRank = { --- The constant's name as declared. name: (FriendsChatRank) -> string, --- The constant's 0-based position in `values()`. ordinal: (FriendsChatRank) -> number, --- `name()`; `tostring(c)` answers the same. toString: (FriendsChatRank) -> string, --- This ordinal less `other`'s. compareTo: (FriendsChatRank, FriendsChatRank) -> number, --- Whether `other` is this constant. `==` answers the same. equals: (FriendsChatRank, any) -> boolean, --- This constant's `getValue()` value, listed on each constant. getValue: (FriendsChatRank) -> number, } export type FriendsChatRankClass = { --- Every constant in ordinal order, as a 1-based array: the same frozen array every `values()` call, so `table.clone` it before changing it. values: () -> {FriendsChatRank}, --- `valueOf(name)`: the constant named `name`; any other name is an error. valueOf: (string) -> FriendsChatRank, --- `UNRANKED`: ordinal 0; `getValue()` -1. UNRANKED: FriendsChatRank, --- `FRIEND`: ordinal 1; `getValue()` 0. FRIEND: FriendsChatRank, --- `RECRUIT`: ordinal 2; `getValue()` 1. RECRUIT: FriendsChatRank, --- `CORPORAL`: ordinal 3; `getValue()` 2. CORPORAL: FriendsChatRank, --- `SERGEANT`: ordinal 4; `getValue()` 3. SERGEANT: FriendsChatRank, --- `LIEUTENANT`: ordinal 5; `getValue()` 4. LIEUTENANT: FriendsChatRank, --- `CAPTAIN`: ordinal 6; `getValue()` 5. CAPTAIN: FriendsChatRank, --- `GENERAL`: ordinal 7; `getValue()` 6. GENERAL: FriendsChatRank, --- `OWNER`: ordinal 8; `getValue()` 7. OWNER: FriendsChatRank, --- `JMOD`: ordinal 9; `getValue()` 127. JMOD: FriendsChatRank, } --- `FriendsChatRank`'s static functions and constants. declare FriendsChatRank: FriendsChatRankClass --- Enum `GameState`: 9 constants, each one userdata per VM, so `==` is identity and a constant is a table key. `GameState.values()`, `GameState.valueOf(name)`; every constant answers `name()`, `ordinal()` (0-based), `toString()`, `compareTo()` and `equals()`, plus `getState()`. export type GameState = { --- The constant's name as declared. name: (GameState) -> string, --- The constant's 0-based position in `values()`. ordinal: (GameState) -> number, --- `name()`; `tostring(c)` answers the same. toString: (GameState) -> string, --- This ordinal less `other`'s. compareTo: (GameState, GameState) -> number, --- Whether `other` is this constant. `==` answers the same. equals: (GameState, any) -> boolean, --- This constant's `getState()` value, listed on each constant. getState: (GameState) -> number, } export type GameStateClass = { --- Every constant in ordinal order, as a 1-based array: the same frozen array every `values()` call, so `table.clone` it before changing it. values: () -> {GameState}, --- `valueOf(name)`: the constant named `name`; any other name is an error. valueOf: (string) -> GameState, --- The constant whose `getState()` is `state`, or `UNKNOWN`. of: (number) -> GameState, --- `UNKNOWN`: ordinal 0; `getState()` -1. UNKNOWN: GameState, --- `STARTING`: ordinal 1; `getState()` 0. STARTING: GameState, --- `LOGIN_SCREEN`: ordinal 2; `getState()` 10. LOGIN_SCREEN: GameState, --- `LOGIN_SCREEN_AUTHENTICATOR`: ordinal 3; `getState()` 11. LOGIN_SCREEN_AUTHENTICATOR: GameState, --- `LOGGING_IN`: ordinal 4; `getState()` 20. LOGGING_IN: GameState, --- `LOADING`: ordinal 5; `getState()` 25. LOADING: GameState, --- `LOGGED_IN`: ordinal 6; `getState()` 30. LOGGED_IN: GameState, --- `CONNECTION_LOST`: ordinal 7; `getState()` 40. CONNECTION_LOST: GameState, --- `HOPPING`: ordinal 8; `getState()` 45. HOPPING: GameState, } --- `GameState`'s static functions and constants. declare GameState: GameStateClass --- Enum `GrandExchangeOfferState`: 7 constants, each one userdata per VM, so `==` is identity and a constant is a table key. `GrandExchangeOfferState.values()`, `GrandExchangeOfferState.valueOf(name)`; every constant answers `name()`, `ordinal()` (0-based), `toString()`, `compareTo()` and `equals()`. export type GrandExchangeOfferState = { --- The constant's name as declared. name: (GrandExchangeOfferState) -> string, --- The constant's 0-based position in `values()`. ordinal: (GrandExchangeOfferState) -> number, --- `name()`; `tostring(c)` answers the same. toString: (GrandExchangeOfferState) -> string, --- This ordinal less `other`'s. compareTo: (GrandExchangeOfferState, GrandExchangeOfferState) -> number, --- Whether `other` is this constant. `==` answers the same. equals: (GrandExchangeOfferState, any) -> boolean, } export type GrandExchangeOfferStateClass = { --- Every constant in ordinal order, as a 1-based array: the same frozen array every `values()` call, so `table.clone` it before changing it. values: () -> {GrandExchangeOfferState}, --- `valueOf(name)`: the constant named `name`; any other name is an error. valueOf: (string) -> GrandExchangeOfferState, --- `EMPTY`: ordinal 0. EMPTY: GrandExchangeOfferState, --- `CANCELLED_BUY`: ordinal 1. CANCELLED_BUY: GrandExchangeOfferState, --- `CANCELLED_SELL`: ordinal 2. CANCELLED_SELL: GrandExchangeOfferState, --- `BUYING`: ordinal 3. BUYING: GrandExchangeOfferState, --- `BOUGHT`: ordinal 4. BOUGHT: GrandExchangeOfferState, --- `SELLING`: ordinal 5. SELLING: GrandExchangeOfferState, --- `SOLD`: ordinal 6. SOLD: GrandExchangeOfferState, } --- `GrandExchangeOfferState`'s static functions and constants. declare GrandExchangeOfferState: GrandExchangeOfferStateClass --- Enum `HeadIcon`: 15 constants, each one userdata per VM, so `==` is identity and a constant is a table key. `HeadIcon.values()`, `HeadIcon.valueOf(name)`; every constant answers `name()`, `ordinal()` (0-based), `toString()`, `compareTo()` and `equals()`. export type HeadIcon = { --- The constant's name as declared. name: (HeadIcon) -> string, --- The constant's 0-based position in `values()`. ordinal: (HeadIcon) -> number, --- `name()`; `tostring(c)` answers the same. toString: (HeadIcon) -> string, --- This ordinal less `other`'s. compareTo: (HeadIcon, HeadIcon) -> number, --- Whether `other` is this constant. `==` answers the same. equals: (HeadIcon, any) -> boolean, } export type HeadIconClass = { --- Every constant in ordinal order, as a 1-based array: the same frozen array every `values()` call, so `table.clone` it before changing it. values: () -> {HeadIcon}, --- `valueOf(name)`: the constant named `name`; any other name is an error. valueOf: (string) -> HeadIcon, --- `MELEE`: ordinal 0. MELEE: HeadIcon, --- `RANGED`: ordinal 1. RANGED: HeadIcon, --- `MAGIC`: ordinal 2. MAGIC: HeadIcon, --- `RETRIBUTION`: ordinal 3. RETRIBUTION: HeadIcon, --- `SMITE`: ordinal 4. SMITE: HeadIcon, --- `REDEMPTION`: ordinal 5. REDEMPTION: HeadIcon, --- `RANGE_MAGE`: ordinal 6. RANGE_MAGE: HeadIcon, --- `RANGE_MELEE`: ordinal 7. RANGE_MELEE: HeadIcon, --- `MAGE_MELEE`: ordinal 8. MAGE_MELEE: HeadIcon, --- `RANGE_MAGE_MELEE`: ordinal 9. RANGE_MAGE_MELEE: HeadIcon, --- `WRATH`: ordinal 10. WRATH: HeadIcon, --- `SOUL_SPLIT`: ordinal 11. SOUL_SPLIT: HeadIcon, --- `DEFLECT_MELEE`: ordinal 12. DEFLECT_MELEE: HeadIcon, --- `DEFLECT_RANGE`: ordinal 13. DEFLECT_RANGE: HeadIcon, --- `DEFLECT_MAGE`: ordinal 14. DEFLECT_MAGE: HeadIcon, } --- `HeadIcon`'s static functions and constants. declare HeadIcon: HeadIconClass --- Enum `IconID`: 18 constants, each one userdata per VM, so `==` is identity and a constant is a table key. `IconID.values()`, `IconID.valueOf(name)`; every constant answers `name()`, `ordinal()` (0-based), `toString()`, `compareTo()` and `equals()`, plus `getIndex()`. export type IconID = { --- The constant's name as declared. name: (IconID) -> string, --- The constant's 0-based position in `values()`. ordinal: (IconID) -> number, --- This enum's own text for the constant, which can differ from `name()`; `tostring(c)` answers the same. toString: (IconID) -> string, --- This ordinal less `other`'s. compareTo: (IconID, IconID) -> number, --- Whether `other` is this constant. `==` answers the same. equals: (IconID, any) -> boolean, --- This constant's `getIndex()` value, listed on each constant. getIndex: (IconID) -> number, } export type IconIDClass = { --- Every constant in ordinal order, as a 1-based array: the same frozen array every `values()` call, so `table.clone` it before changing it. values: () -> {IconID}, --- `valueOf(name)`: the constant named `name`; any other name is an error. valueOf: (string) -> IconID, --- `PLAYER_MODERATOR`: ordinal 0; `getIndex()` 0. PLAYER_MODERATOR: IconID, --- `JAGEX_MODERATOR`: ordinal 1; `getIndex()` 1. JAGEX_MODERATOR: IconID, --- `IRONMAN`: ordinal 2; `getIndex()` 2. IRONMAN: IconID, --- `ULTIMATE_IRONMAN`: ordinal 3; `getIndex()` 3. ULTIMATE_IRONMAN: IconID, --- `DMM_SKULL_5_KEYS`: ordinal 4; `getIndex()` 4. DMM_SKULL_5_KEYS: IconID, --- `DMM_SKULL_4_KEYS`: ordinal 5; `getIndex()` 5. DMM_SKULL_4_KEYS: IconID, --- `DMM_SKULL_3_KEYS`: ordinal 6; `getIndex()` 6. DMM_SKULL_3_KEYS: IconID, --- `DMM_SKULL_2_KEYS`: ordinal 7; `getIndex()` 7. DMM_SKULL_2_KEYS: IconID, --- `DMM_SKULL_1_KEYS`: ordinal 8; `getIndex()` 8. DMM_SKULL_1_KEYS: IconID, --- `SKULL`: ordinal 9; `getIndex()` 9. SKULL: IconID, --- `HARDCORE_IRONMAN`: ordinal 10; `getIndex()` 10. HARDCORE_IRONMAN: IconID, --- `NO_ENTRY`: ordinal 11; `getIndex()` 11. NO_ENTRY: IconID, --- `CHAIN_LINK`: ordinal 12; `getIndex()` 12. CHAIN_LINK: IconID, --- `BOUNTY_HUNTER_EMBLEM`: ordinal 13; `getIndex()` 20. BOUNTY_HUNTER_EMBLEM: IconID, --- `LEAGUE`: ordinal 14; `getIndex()` 22. LEAGUE: IconID, --- `GROUP_IRONMAN`: ordinal 15; `getIndex()` 41. GROUP_IRONMAN: IconID, --- `HARDCORE_GROUP_IRONMAN`: ordinal 16; `getIndex()` 42. HARDCORE_GROUP_IRONMAN: IconID, --- `UNRANKED_GROUP_IRONMAN`: ordinal 17; `getIndex()` 43. UNRANKED_GROUP_IRONMAN: IconID, } --- `IconID`'s static functions and constants. declare IconID: IconIDClass --- Enum `InstanceTemplates`: 19 constants, each one userdata per VM, so `==` is identity and a constant is a table key. `InstanceTemplates.values()`, `InstanceTemplates.valueOf(name)`; every constant answers `name()`, `ordinal()` (0-based), `toString()`, `compareTo()` and `equals()`, plus `getBaseX()`, `getBaseY()`, `getHeight()`, `getPlane()`, `getWidth()`. export type InstanceTemplates = { --- The constant's name as declared. name: (InstanceTemplates) -> string, --- The constant's 0-based position in `values()`. ordinal: (InstanceTemplates) -> number, --- `name()`; `tostring(c)` answers the same. toString: (InstanceTemplates) -> string, --- This ordinal less `other`'s. compareTo: (InstanceTemplates, InstanceTemplates) -> number, --- Whether `other` is this constant. `==` answers the same. equals: (InstanceTemplates, any) -> boolean, --- This constant's `getBaseX()` value, listed on each constant. getBaseX: (InstanceTemplates) -> number, --- This constant's `getBaseY()` value, listed on each constant. getBaseY: (InstanceTemplates) -> number, --- This constant's `getHeight()` value, listed on each constant. getHeight: (InstanceTemplates) -> number, --- This constant's `getPlane()` value, listed on each constant. getPlane: (InstanceTemplates) -> number, --- This constant's `getWidth()` value, listed on each constant. getWidth: (InstanceTemplates) -> number, } export type InstanceTemplatesClass = { --- Every constant in ordinal order, as a 1-based array: the same frozen array every `values()` call, so `table.clone` it before changing it. values: () -> {InstanceTemplates}, --- `valueOf(name)`: the constant named `name`; any other name is an error. valueOf: (string) -> InstanceTemplates, --- The first template, in declaration order, whose area holds the template chunk an instance chunk entry points at, or `nil`. findMatch: (number) -> InstanceTemplates?, --- `RAIDS_LOBBY`: ordinal 0; `getBaseX()` 3264, `getBaseY()` 5184, `getHeight()` 32, `getPlane()` 0, `getWidth()` 96. RAIDS_LOBBY: InstanceTemplates, --- `RAIDS_START`: ordinal 1; `getBaseX()` 3264, `getBaseY()` 5696, `getHeight()` 32, `getPlane()` 0, `getWidth()` 96. RAIDS_START: InstanceTemplates, --- `RAIDS_END`: ordinal 2; `getBaseX()` 3264, `getBaseY()` 5152, `getHeight()` 32, `getPlane()` 0, `getWidth()` 64. RAIDS_END: InstanceTemplates, --- `RAIDS_SCAVENGERS`: ordinal 3; `getBaseX()` 3264, `getBaseY()` 5216, `getHeight()` 32, `getPlane()` 0, `getWidth()` 96. RAIDS_SCAVENGERS: InstanceTemplates, --- `RAIDS_SHAMANS`: ordinal 4; `getBaseX()` 3264, `getBaseY()` 5248, `getHeight()` 32, `getPlane()` 0, `getWidth()` 96. RAIDS_SHAMANS: InstanceTemplates, --- `RAIDS_VASA`: ordinal 5; `getBaseX()` 3264, `getBaseY()` 5280, `getHeight()` 32, `getPlane()` 0, `getWidth()` 96. RAIDS_VASA: InstanceTemplates, --- `RAIDS_VANGUARDS`: ordinal 6; `getBaseX()` 3264, `getBaseY()` 5312, `getHeight()` 32, `getPlane()` 0, `getWidth()` 96. RAIDS_VANGUARDS: InstanceTemplates, --- `RAIDS_ICE_DEMON`: ordinal 7; `getBaseX()` 3264, `getBaseY()` 5344, `getHeight()` 32, `getPlane()` 0, `getWidth()` 96. RAIDS_ICE_DEMON: InstanceTemplates, --- `RAIDS_THIEVING`: ordinal 8; `getBaseX()` 3264, `getBaseY()` 5376, `getHeight()` 32, `getPlane()` 0, `getWidth()` 96. RAIDS_THIEVING: InstanceTemplates, --- `RAIDS_FARMING`: ordinal 9; `getBaseX()` 3264, `getBaseY()` 5440, `getHeight()` 32, `getPlane()` 0, `getWidth()` 96. RAIDS_FARMING: InstanceTemplates, --- `RAIDS_SCAVENGERS2`: ordinal 10; `getBaseX()` 3264, `getBaseY()` 5216, `getHeight()` 32, `getPlane()` 1, `getWidth()` 96. RAIDS_SCAVENGERS2: InstanceTemplates, --- `RAIDS_MUTTADILES`: ordinal 11; `getBaseX()` 3264, `getBaseY()` 5312, `getHeight()` 32, `getPlane()` 1, `getWidth()` 96. RAIDS_MUTTADILES: InstanceTemplates, --- `RAIDS_MYSTICS`: ordinal 12; `getBaseX()` 3264, `getBaseY()` 5248, `getHeight()` 32, `getPlane()` 1, `getWidth()` 96. RAIDS_MYSTICS: InstanceTemplates, --- `RAIDS_TEKTON`: ordinal 13; `getBaseX()` 3264, `getBaseY()` 5280, `getHeight()` 32, `getPlane()` 1, `getWidth()` 96. RAIDS_TEKTON: InstanceTemplates, --- `RAIDS_TIGHTROPE`: ordinal 14; `getBaseX()` 3264, `getBaseY()` 5344, `getHeight()` 32, `getPlane()` 1, `getWidth()` 96. RAIDS_TIGHTROPE: InstanceTemplates, --- `RAIDS_FARMING2`: ordinal 15; `getBaseX()` 3264, `getBaseY()` 5440, `getHeight()` 32, `getPlane()` 1, `getWidth()` 96. RAIDS_FARMING2: InstanceTemplates, --- `RAIDS_GUARDIANS`: ordinal 16; `getBaseX()` 3264, `getBaseY()` 5248, `getHeight()` 32, `getPlane()` 2, `getWidth()` 96. RAIDS_GUARDIANS: InstanceTemplates, --- `RAIDS_VESPULA`: ordinal 17; `getBaseX()` 3264, `getBaseY()` 5280, `getHeight()` 32, `getPlane()` 2, `getWidth()` 96. RAIDS_VESPULA: InstanceTemplates, --- `RAIDS_CRABS`: ordinal 18; `getBaseX()` 3264, `getBaseY()` 5344, `getHeight()` 32, `getPlane()` 2, `getWidth()` 96. RAIDS_CRABS: InstanceTemplates, } --- `InstanceTemplates`'s static functions and constants. declare InstanceTemplates: InstanceTemplatesClass --- Enum `LegacyInventoryID`, separate from the global `InventoryID`, which is a different class: 20 constants, each one userdata per VM, so `==` is identity and a constant is a table key. `LegacyInventoryID.values()`, `LegacyInventoryID.valueOf(name)`; every constant answers `name()`, `ordinal()` (0-based), `toString()`, `compareTo()` and `equals()`, plus `getId()`. export type LegacyInventoryID = { --- The constant's name as declared. name: (LegacyInventoryID) -> string, --- The constant's 0-based position in `values()`. ordinal: (LegacyInventoryID) -> number, --- `name()`; `tostring(c)` answers the same. toString: (LegacyInventoryID) -> string, --- This ordinal less `other`'s. compareTo: (LegacyInventoryID, LegacyInventoryID) -> number, --- Whether `other` is this constant. `==` answers the same. equals: (LegacyInventoryID, any) -> boolean, --- This constant's `getId()` value, listed on each constant. getId: (LegacyInventoryID) -> number, } export type LegacyInventoryIDClass = { --- Every constant in ordinal order, as a 1-based array: the same frozen array every `values()` call, so `table.clone` it before changing it. values: () -> {LegacyInventoryID}, --- `valueOf(name)`: the constant named `name`; any other name is an error. valueOf: (string) -> LegacyInventoryID, --- `FISHING_TRAWLER_REWARD`: ordinal 0; `getId()` 0. FISHING_TRAWLER_REWARD: LegacyInventoryID, --- `TRADE`: ordinal 1; `getId()` 90. TRADE: LegacyInventoryID, --- `TRADEOTHER`: ordinal 2; `getId()` 32858. TRADEOTHER: LegacyInventoryID, --- `INVENTORY`: ordinal 3; `getId()` 93. INVENTORY: LegacyInventoryID, --- `EQUIPMENT`: ordinal 4; `getId()` 94. EQUIPMENT: LegacyInventoryID, --- `BANK`: ordinal 5; `getId()` 95. BANK: LegacyInventoryID, --- `PUZZLE_BOX`: ordinal 6; `getId()` 140. PUZZLE_BOX: LegacyInventoryID, --- `BARROWS_REWARD`: ordinal 7; `getId()` 141. BARROWS_REWARD: LegacyInventoryID, --- `MONKEY_MADNESS_PUZZLE_BOX`: ordinal 8; `getId()` 221. MONKEY_MADNESS_PUZZLE_BOX: LegacyInventoryID, --- `DRIFT_NET_FISHING_REWARD`: ordinal 9; `getId()` 307. DRIFT_NET_FISHING_REWARD: LegacyInventoryID, --- `KINGDOM_OF_MISCELLANIA`: ordinal 10; `getId()` 390. KINGDOM_OF_MISCELLANIA: LegacyInventoryID, --- `CHAMBERS_OF_XERIC_CHEST`: ordinal 11; `getId()` 581. CHAMBERS_OF_XERIC_CHEST: LegacyInventoryID, --- `THEATRE_OF_BLOOD_CHEST`: ordinal 12; `getId()` 612. THEATRE_OF_BLOOD_CHEST: LegacyInventoryID, --- `SEED_VAULT`: ordinal 13; `getId()` 626. SEED_VAULT: LegacyInventoryID, --- `GROUP_STORAGE`: ordinal 14; `getId()` 659. GROUP_STORAGE: LegacyInventoryID, --- `GROUP_STORAGE_INV`: ordinal 15; `getId()` 660. GROUP_STORAGE_INV: LegacyInventoryID, --- `WILDERNESS_LOOT_CHEST`: ordinal 16; `getId()` 797. WILDERNESS_LOOT_CHEST: LegacyInventoryID, --- `TOA_REWARD_CHEST`: ordinal 17; `getId()` 811. TOA_REWARD_CHEST: LegacyInventoryID, --- `LUNAR_CHEST`: ordinal 18; `getId()` 847. LUNAR_CHEST: LegacyInventoryID, --- `FORTIS_COLOSSEUM_REWARD_CHEST`: ordinal 19; `getId()` 843. FORTIS_COLOSSEUM_REWARD_CHEST: LegacyInventoryID, } --- `LegacyInventoryID`'s static functions and constants. declare LegacyInventoryID: LegacyInventoryIDClass --- Enum `MenuAction`: 75 constants, each one userdata per VM, so `==` is identity and a constant is a table key. `MenuAction.values()`, `MenuAction.valueOf(name)`; every constant answers `name()`, `ordinal()` (0-based), `toString()`, `compareTo()` and `equals()`, plus `getId()`. export type MenuAction = { --- The constant's name as declared. name: (MenuAction) -> string, --- The constant's 0-based position in `values()`. ordinal: (MenuAction) -> number, --- `name()`; `tostring(c)` answers the same. toString: (MenuAction) -> string, --- This ordinal less `other`'s. compareTo: (MenuAction, MenuAction) -> number, --- Whether `other` is this constant. `==` answers the same. equals: (MenuAction, any) -> boolean, --- This constant's `getId()` value, listed on each constant. getId: (MenuAction) -> number, } export type MenuActionClass = { --- Every constant in ordinal order, as a 1-based array: the same frozen array every `values()` call, so `table.clone` it before changing it. values: () -> {MenuAction}, --- `valueOf(name)`: the constant named `name`; any other name is an error. valueOf: (string) -> MenuAction, --- The constant whose `getId()` is `id` (the last declared, where several share it), or `UNKNOWN`. of: (number) -> MenuAction, --- `ITEM_USE_ON_GAME_OBJECT`: ordinal 0; `getId()` 1. ITEM_USE_ON_GAME_OBJECT: MenuAction, --- `WIDGET_TARGET_ON_GAME_OBJECT`: ordinal 1; `getId()` 2. WIDGET_TARGET_ON_GAME_OBJECT: MenuAction, --- `GAME_OBJECT_FIRST_OPTION`: ordinal 2; `getId()` 3. GAME_OBJECT_FIRST_OPTION: MenuAction, --- `GAME_OBJECT_SECOND_OPTION`: ordinal 3; `getId()` 4. GAME_OBJECT_SECOND_OPTION: MenuAction, --- `GAME_OBJECT_THIRD_OPTION`: ordinal 4; `getId()` 5. GAME_OBJECT_THIRD_OPTION: MenuAction, --- `GAME_OBJECT_FOURTH_OPTION`: ordinal 5; `getId()` 6. GAME_OBJECT_FOURTH_OPTION: MenuAction, --- `GAME_OBJECT_FIFTH_OPTION`: ordinal 6; `getId()` 1001. GAME_OBJECT_FIFTH_OPTION: MenuAction, --- `ITEM_USE_ON_NPC`: ordinal 7; `getId()` 7. ITEM_USE_ON_NPC: MenuAction, --- `WIDGET_TARGET_ON_NPC`: ordinal 8; `getId()` 8. WIDGET_TARGET_ON_NPC: MenuAction, --- `NPC_FIRST_OPTION`: ordinal 9; `getId()` 9. NPC_FIRST_OPTION: MenuAction, --- `NPC_SECOND_OPTION`: ordinal 10; `getId()` 10. NPC_SECOND_OPTION: MenuAction, --- `NPC_THIRD_OPTION`: ordinal 11; `getId()` 11. NPC_THIRD_OPTION: MenuAction, --- `NPC_FOURTH_OPTION`: ordinal 12; `getId()` 12. NPC_FOURTH_OPTION: MenuAction, --- `NPC_FIFTH_OPTION`: ordinal 13; `getId()` 13. NPC_FIFTH_OPTION: MenuAction, --- `ITEM_USE_ON_PLAYER`: ordinal 14; `getId()` 14. ITEM_USE_ON_PLAYER: MenuAction, --- `WIDGET_TARGET_ON_PLAYER`: ordinal 15; `getId()` 15. WIDGET_TARGET_ON_PLAYER: MenuAction, --- `ITEM_USE_ON_GROUND_ITEM`: ordinal 16; `getId()` 16. ITEM_USE_ON_GROUND_ITEM: MenuAction, --- `WIDGET_TARGET_ON_GROUND_ITEM`: ordinal 17; `getId()` 17. WIDGET_TARGET_ON_GROUND_ITEM: MenuAction, --- `GROUND_ITEM_FIRST_OPTION`: ordinal 18; `getId()` 18. GROUND_ITEM_FIRST_OPTION: MenuAction, --- `GROUND_ITEM_SECOND_OPTION`: ordinal 19; `getId()` 19. GROUND_ITEM_SECOND_OPTION: MenuAction, --- `GROUND_ITEM_THIRD_OPTION`: ordinal 20; `getId()` 20. GROUND_ITEM_THIRD_OPTION: MenuAction, --- `GROUND_ITEM_FOURTH_OPTION`: ordinal 21; `getId()` 21. GROUND_ITEM_FOURTH_OPTION: MenuAction, --- `GROUND_ITEM_FIFTH_OPTION`: ordinal 22; `getId()` 22. GROUND_ITEM_FIFTH_OPTION: MenuAction, --- `WALK`: ordinal 23; `getId()` 23. WALK: MenuAction, --- `WIDGET_TYPE_1`: ordinal 24; `getId()` 24. WIDGET_TYPE_1: MenuAction, --- `WIDGET_TARGET`: ordinal 25; `getId()` 25. WIDGET_TARGET: MenuAction, --- `WIDGET_CLOSE`: ordinal 26; `getId()` 26. WIDGET_CLOSE: MenuAction, --- `WIDGET_TYPE_4`: ordinal 27; `getId()` 28. WIDGET_TYPE_4: MenuAction, --- `WIDGET_TYPE_5`: ordinal 28; `getId()` 29. WIDGET_TYPE_5: MenuAction, --- `WIDGET_CONTINUE`: ordinal 29; `getId()` 30. WIDGET_CONTINUE: MenuAction, --- `ITEM_USE_ON_ITEM`: ordinal 30; `getId()` 31. ITEM_USE_ON_ITEM: MenuAction, --- `WIDGET_USE_ON_ITEM`: ordinal 31; `getId()` 32. WIDGET_USE_ON_ITEM: MenuAction, --- `ITEM_FIRST_OPTION`: ordinal 32; `getId()` 33. ITEM_FIRST_OPTION: MenuAction, --- `ITEM_SECOND_OPTION`: ordinal 33; `getId()` 34. ITEM_SECOND_OPTION: MenuAction, --- `ITEM_THIRD_OPTION`: ordinal 34; `getId()` 35. ITEM_THIRD_OPTION: MenuAction, --- `ITEM_FOURTH_OPTION`: ordinal 35; `getId()` 36. ITEM_FOURTH_OPTION: MenuAction, --- `ITEM_FIFTH_OPTION`: ordinal 36; `getId()` 37. ITEM_FIFTH_OPTION: MenuAction, --- `ITEM_USE`: ordinal 37; `getId()` 38. ITEM_USE: MenuAction, --- `WIDGET_FIRST_OPTION`: ordinal 38; `getId()` 39. WIDGET_FIRST_OPTION: MenuAction, --- `WIDGET_SECOND_OPTION`: ordinal 39; `getId()` 40. WIDGET_SECOND_OPTION: MenuAction, --- `WIDGET_THIRD_OPTION`: ordinal 40; `getId()` 41. WIDGET_THIRD_OPTION: MenuAction, --- `WIDGET_FOURTH_OPTION`: ordinal 41; `getId()` 42. WIDGET_FOURTH_OPTION: MenuAction, --- `WIDGET_FIFTH_OPTION`: ordinal 42; `getId()` 43. WIDGET_FIFTH_OPTION: MenuAction, --- `PLAYER_FIRST_OPTION`: ordinal 43; `getId()` 44. PLAYER_FIRST_OPTION: MenuAction, --- `PLAYER_SECOND_OPTION`: ordinal 44; `getId()` 45. PLAYER_SECOND_OPTION: MenuAction, --- `PLAYER_THIRD_OPTION`: ordinal 45; `getId()` 46. PLAYER_THIRD_OPTION: MenuAction, --- `PLAYER_FOURTH_OPTION`: ordinal 46; `getId()` 47. PLAYER_FOURTH_OPTION: MenuAction, --- `PLAYER_FIFTH_OPTION`: ordinal 47; `getId()` 48. PLAYER_FIFTH_OPTION: MenuAction, --- `PLAYER_SIXTH_OPTION`: ordinal 48; `getId()` 49. PLAYER_SIXTH_OPTION: MenuAction, --- `PLAYER_SEVENTH_OPTION`: ordinal 49; `getId()` 50. PLAYER_SEVENTH_OPTION: MenuAction, --- `PLAYER_EIGHTH_OPTION`: ordinal 50; `getId()` 51. PLAYER_EIGHTH_OPTION: MenuAction, --- `CC_OP`: ordinal 51; `getId()` 57. CC_OP: MenuAction, --- `WIDGET_TARGET_ON_WIDGET`: ordinal 52; `getId()` 58. WIDGET_TARGET_ON_WIDGET: MenuAction, --- `SET_HEADING`: ordinal 53; `getId()` 60. SET_HEADING: MenuAction, --- `WORLD_ENTITY_FIRST_OPTION`: ordinal 54; `getId()` 63. WORLD_ENTITY_FIRST_OPTION: MenuAction, --- `WORLD_ENTITY_SECOND_OPTION`: ordinal 55; `getId()` 64. WORLD_ENTITY_SECOND_OPTION: MenuAction, --- `WORLD_ENTITY_THIRD_OPTION`: ordinal 56; `getId()` 65. WORLD_ENTITY_THIRD_OPTION: MenuAction, --- `WORLD_ENTITY_FOURTH_OPTION`: ordinal 57; `getId()` 66. WORLD_ENTITY_FOURTH_OPTION: MenuAction, --- `WORLD_ENTITY_FIFTH_OPTION`: ordinal 58; `getId()` 67. WORLD_ENTITY_FIFTH_OPTION: MenuAction, --- `CLIENT_WIDGET`: ordinal 59; `getId()` 998. Its `name()` and `toString()` are `"CLIENT_WIDGET"`, and `valueOf` takes that name only. CLIENT_WIDGET: MenuAction, --- `CLIENT_HIGH_PRIORITY`: ordinal 60; `getId()` 999. Its `name()` and `toString()` are `"CLIENT_HIGH_PRIORITY"`, and `valueOf` takes that name only. CLIENT_HIGH_PRIORITY: MenuAction, --- `EXAMINE_OBJECT`: ordinal 61; `getId()` 1002. EXAMINE_OBJECT: MenuAction, --- `EXAMINE_NPC`: ordinal 62; `getId()` 1003. EXAMINE_NPC: MenuAction, --- `EXAMINE_ITEM_GROUND`: ordinal 63; `getId()` 1004. EXAMINE_ITEM_GROUND: MenuAction, --- `EXAMINE_ITEM`: ordinal 64; `getId()` 1005. EXAMINE_ITEM: MenuAction, --- `CANCEL`: ordinal 65; `getId()` 1006. CANCEL: MenuAction, --- `CC_OP_LOW_PRIORITY`: ordinal 66; `getId()` 1007. CC_OP_LOW_PRIORITY: MenuAction, --- `EXAMINE_WORLD_ENTITY`: ordinal 67; `getId()` 1013. EXAMINE_WORLD_ENTITY: MenuAction, --- `CLIENT`: ordinal 68; `getId()` 1500. Its `name()` and `toString()` are `"CLIENT"`, and `valueOf` takes that name only. CLIENT: MenuAction, --- `CLIENT_OVERLAY`: ordinal 69; `getId()` 1501. Its `name()` and `toString()` are `"CLIENT_OVERLAY"`, and `valueOf` takes that name only. CLIENT_OVERLAY: MenuAction, --- `CLIENT_OVERLAY_CONFIG`: ordinal 70; `getId()` 1502. Its `name()` and `toString()` are `"CLIENT_OVERLAY_CONFIG"`, and `valueOf` takes that name only. CLIENT_OVERLAY_CONFIG: MenuAction, --- `CLIENT_PLAYER`: ordinal 71; `getId()` 1503. Its `name()` and `toString()` are `"CLIENT_PLAYER"`, and `valueOf` takes that name only. CLIENT_PLAYER: MenuAction, --- `CLIENT_INFOBOX`: ordinal 72; `getId()` 1504. Its `name()` and `toString()` are `"CLIENT_INFOBOX"`, and `valueOf` takes that name only. CLIENT_INFOBOX: MenuAction, --- `CLIENT_LOW_PRIORITY`: ordinal 73; `getId()` 1506. Its `name()` and `toString()` are `"CLIENT_LOW_PRIORITY"`, and `valueOf` takes that name only. CLIENT_LOW_PRIORITY: MenuAction, --- `UNKNOWN`: ordinal 74; `getId()` -1. UNKNOWN: MenuAction, --- `MenuAction.MENU_ACTION_DEPRIORITIZE_OFFSET`: 2000. MENU_ACTION_DEPRIORITIZE_OFFSET: number, --- `MenuAction.PLAYER_EIGTH_OPTION`: MenuAction.PLAYER_EIGHTH_OPTION. PLAYER_EIGTH_OPTION: MenuAction, } --- `MenuAction`'s static functions and constants. declare MenuAction: MenuActionClass --- Enum `Prayer`: 56 constants, each one userdata per VM, so `==` is identity and a constant is a table key. `Prayer.values()`, `Prayer.valueOf(name)`; every constant answers `name()`, `ordinal()` (0-based), `toString()`, `compareTo()` and `equals()`, plus `getVarbit()`. export type Prayer = { --- The constant's name as declared. name: (Prayer) -> string, --- The constant's 0-based position in `values()`. ordinal: (Prayer) -> number, --- `name()`; `tostring(c)` answers the same. toString: (Prayer) -> string, --- This ordinal less `other`'s. compareTo: (Prayer, Prayer) -> number, --- Whether `other` is this constant. `==` answers the same. equals: (Prayer, any) -> boolean, --- This constant's `getVarbit()` value, listed on each constant. getVarbit: (Prayer) -> number, } export type PrayerClass = { --- Every constant in ordinal order, as a 1-based array: the same frozen array every `values()` call, so `table.clone` it before changing it. values: () -> {Prayer}, --- `valueOf(name)`: the constant named `name`; any other name is an error. valueOf: (string) -> Prayer, --- `THICK_SKIN`: ordinal 0; `getVarbit()` 4104. THICK_SKIN: Prayer, --- `BURST_OF_STRENGTH`: ordinal 1; `getVarbit()` 4105. BURST_OF_STRENGTH: Prayer, --- `CLARITY_OF_THOUGHT`: ordinal 2; `getVarbit()` 4106. CLARITY_OF_THOUGHT: Prayer, --- `SHARP_EYE`: ordinal 3; `getVarbit()` 4122. SHARP_EYE: Prayer, --- `MYSTIC_WILL`: ordinal 4; `getVarbit()` 4123. MYSTIC_WILL: Prayer, --- `ROCK_SKIN`: ordinal 5; `getVarbit()` 4107. ROCK_SKIN: Prayer, --- `SUPERHUMAN_STRENGTH`: ordinal 6; `getVarbit()` 4108. SUPERHUMAN_STRENGTH: Prayer, --- `IMPROVED_REFLEXES`: ordinal 7; `getVarbit()` 4109. IMPROVED_REFLEXES: Prayer, --- `RAPID_RESTORE`: ordinal 8; `getVarbit()` 4110. RAPID_RESTORE: Prayer, --- `RAPID_HEAL`: ordinal 9; `getVarbit()` 4111. RAPID_HEAL: Prayer, --- `PROTECT_ITEM`: ordinal 10; `getVarbit()` 4112. PROTECT_ITEM: Prayer, --- `HAWK_EYE`: ordinal 11; `getVarbit()` 4124. HAWK_EYE: Prayer, --- `MYSTIC_LORE`: ordinal 12; `getVarbit()` 4125. MYSTIC_LORE: Prayer, --- `STEEL_SKIN`: ordinal 13; `getVarbit()` 4113. STEEL_SKIN: Prayer, --- `ULTIMATE_STRENGTH`: ordinal 14; `getVarbit()` 4114. ULTIMATE_STRENGTH: Prayer, --- `INCREDIBLE_REFLEXES`: ordinal 15; `getVarbit()` 4115. INCREDIBLE_REFLEXES: Prayer, --- `PROTECT_FROM_MAGIC`: ordinal 16; `getVarbit()` 4116. PROTECT_FROM_MAGIC: Prayer, --- `PROTECT_FROM_MISSILES`: ordinal 17; `getVarbit()` 4117. PROTECT_FROM_MISSILES: Prayer, --- `PROTECT_FROM_MELEE`: ordinal 18; `getVarbit()` 4118. PROTECT_FROM_MELEE: Prayer, --- `EAGLE_EYE`: ordinal 19; `getVarbit()` 4126. EAGLE_EYE: Prayer, --- `MYSTIC_MIGHT`: ordinal 20; `getVarbit()` 4127. MYSTIC_MIGHT: Prayer, --- `RETRIBUTION`: ordinal 21; `getVarbit()` 4119. RETRIBUTION: Prayer, --- `REDEMPTION`: ordinal 22; `getVarbit()` 4120. REDEMPTION: Prayer, --- `SMITE`: ordinal 23; `getVarbit()` 4121. SMITE: Prayer, --- `CHIVALRY`: ordinal 24; `getVarbit()` 4128. CHIVALRY: Prayer, --- `DEADEYE`: ordinal 25; `getVarbit()` 16090. DEADEYE: Prayer, --- `MYSTIC_VIGOUR`: ordinal 26; `getVarbit()` 16091. MYSTIC_VIGOUR: Prayer, --- `PIETY`: ordinal 27; `getVarbit()` 4129. PIETY: Prayer, --- `PRESERVE`: ordinal 28; `getVarbit()` 5466. PRESERVE: Prayer, --- `RIGOUR`: ordinal 29; `getVarbit()` 5464. RIGOUR: Prayer, --- `AUGURY`: ordinal 30; `getVarbit()` 5465. AUGURY: Prayer, --- `ZEAL`: ordinal 31; `getVarbit()` 16577. ZEAL: Prayer, --- `RP_REJUVENATION`: ordinal 32; `getVarbit()` 14840. RP_REJUVENATION: Prayer, --- `RP_ANCIENT_STRENGTH`: ordinal 33; `getVarbit()` 14829. RP_ANCIENT_STRENGTH: Prayer, --- `RP_ANCIENT_SIGHT`: ordinal 34; `getVarbit()` 14830. RP_ANCIENT_SIGHT: Prayer, --- `RP_ANCIENT_WILL`: ordinal 35; `getVarbit()` 14831. RP_ANCIENT_WILL: Prayer, --- `RP_PROTECT_ITEM`: ordinal 36; `getVarbit()` 14966. RP_PROTECT_ITEM: Prayer, --- `RP_RUINOUS_GRACE`: ordinal 37; `getVarbit()` 14841. RP_RUINOUS_GRACE: Prayer, --- `RP_DAMPEN_MAGIC`: ordinal 38; `getVarbit()` 14964. RP_DAMPEN_MAGIC: Prayer, --- `RP_DAMPEN_RANGED`: ordinal 39; `getVarbit()` 14963. RP_DAMPEN_RANGED: Prayer, --- `RP_DAMPEN_MELEE`: ordinal 40; `getVarbit()` 14962. RP_DAMPEN_MELEE: Prayer, --- `RP_TRINITAS`: ordinal 41; `getVarbit()` 14832. RP_TRINITAS: Prayer, --- `RP_BERSERKER`: ordinal 42; `getVarbit()` 14844. RP_BERSERKER: Prayer, --- `RP_PURGE`: ordinal 43; `getVarbit()` 14839. RP_PURGE: Prayer, --- `RP_METABOLISE`: ordinal 44; `getVarbit()` 14843. RP_METABOLISE: Prayer, --- `RP_REBUKE`: ordinal 45; `getVarbit()` 14850. RP_REBUKE: Prayer, --- `RP_VINDICATION`: ordinal 46; `getVarbit()` 14851. RP_VINDICATION: Prayer, --- `RP_DECIMATE`: ordinal 47; `getVarbit()` 14833. RP_DECIMATE: Prayer, --- `RP_ANNIHILATE`: ordinal 48; `getVarbit()` 14834. RP_ANNIHILATE: Prayer, --- `RP_VAPORISE`: ordinal 49; `getVarbit()` 14835. RP_VAPORISE: Prayer, --- `RP_FUMUS_VOW`: ordinal 50; `getVarbit()` 14845. RP_FUMUS_VOW: Prayer, --- `RP_UMBRA_VOW`: ordinal 51; `getVarbit()` 14847. RP_UMBRA_VOW: Prayer, --- `RP_CRUORS_VOW`: ordinal 52; `getVarbit()` 14846. RP_CRUORS_VOW: Prayer, --- `RP_GLACIES_VOW`: ordinal 53; `getVarbit()` 14848. RP_GLACIES_VOW: Prayer, --- `RP_WRATH`: ordinal 54; `getVarbit()` 14842. RP_WRATH: Prayer, --- `RP_INTENSIFY`: ordinal 55; `getVarbit()` 14965. RP_INTENSIFY: Prayer, } --- `Prayer`'s static functions and constants. declare Prayer: PrayerClass --- Enum `Quest`: 218 constants, each one userdata per VM, so `==` is identity and a constant is a table key. `Quest.values()`, `Quest.valueOf(name)`; every constant answers `name()`, `ordinal()` (0-based), `toString()`, `compareTo()` and `equals()`, plus `getId()`, `getName()`. The last 2 are the quests the game added most recently: each is named from the game's own name for the quest and keeps that name in later versions, where its ordinal can change. export type Quest = { --- The constant's name as declared. name: (Quest) -> string, --- The constant's 0-based position in `values()`. ordinal: (Quest) -> number, --- `name()`; `tostring(c)` answers the same. toString: (Quest) -> string, --- This ordinal less `other`'s. compareTo: (Quest, Quest) -> number, --- Whether `other` is this constant. `==` answers the same. equals: (Quest, any) -> boolean, --- This constant's `getId()` value, listed on each constant. getId: (Quest) -> number, --- This constant's `getName()` value, listed on each constant. getName: (Quest) -> string, --- The quest's state as the game's quest list shows it (script 4029's thresholds over the quest's varp or varbit). Pass the `client` global; it reads the running callback's client. A progress var the client cannot read answers `NOT_STARTED`, as the script reads a missing value as -1, so this never raises. getState: (Quest, Client) -> QuestState, } export type QuestClass = { --- Every constant in ordinal order, as a 1-based array: the same frozen array every `values()` call, so `table.clone` it before changing it. values: () -> {Quest}, --- `valueOf(name)`: the constant named `name`; any other name is an error. valueOf: (string) -> Quest, --- `ANIMAL_MAGNETISM`: ordinal 0; `getId()` 0, `getName()` "Animal Magnetism". ANIMAL_MAGNETISM: Quest, --- `ANOTHER_SLICE_OF_HAM`: ordinal 1; `getId()` 1, `getName()` "Another Slice of H.A.M.". ANOTHER_SLICE_OF_HAM: Quest, --- `THE_ASCENT_OF_ARCEUUS`: ordinal 2; `getId()` 3, `getName()` "The Ascent of Arceuus". THE_ASCENT_OF_ARCEUUS: Quest, --- `ALFRED_GRIMHANDS_BARCRAWL`: ordinal 3; `getId()` 4, `getName()` "Alfred Grimhand's Barcrawl". ALFRED_GRIMHANDS_BARCRAWL: Quest, --- `BEAR_YOUR_SOUL`: ordinal 4; `getId()` 5, `getName()` "Bear Your Soul". BEAR_YOUR_SOUL: Quest, --- `BELOW_ICE_MOUNTAIN`: ordinal 5; `getId()` 6, `getName()` "Below Ice Mountain". BELOW_ICE_MOUNTAIN: Quest, --- `BETWEEN_A_ROCK`: ordinal 6; `getId()` 7, `getName()` "Between a Rock...". BETWEEN_A_ROCK: Quest, --- `BIG_CHOMPY_BIRD_HUNTING`: ordinal 7; `getId()` 8, `getName()` "Big Chompy Bird Hunting". BIG_CHOMPY_BIRD_HUNTING: Quest, --- `BIOHAZARD`: ordinal 8; `getId()` 9, `getName()` "Biohazard". BIOHAZARD: Quest, --- `BLACK_KNIGHTS_FORTRESS`: ordinal 9; `getId()` 10, `getName()` "Black Knights' Fortress". BLACK_KNIGHTS_FORTRESS: Quest, --- `BONE_VOYAGE`: ordinal 10; `getId()` 11, `getName()` "Bone Voyage". BONE_VOYAGE: Quest, --- `CABIN_FEVER`: ordinal 11; `getId()` 12, `getName()` "Cabin Fever". CABIN_FEVER: Quest, --- `CLIENT_OF_KOUREND`: ordinal 12; `getId()` 13, `getName()` "Client of Kourend". CLIENT_OF_KOUREND: Quest, --- `CLOCK_TOWER`: ordinal 13; `getId()` 14, `getName()` "Clock Tower". CLOCK_TOWER: Quest, --- `COLD_WAR`: ordinal 14; `getId()` 15, `getName()` "Cold War". COLD_WAR: Quest, --- `CONTACT`: ordinal 15; `getId()` 16, `getName()` "Contact!". CONTACT: Quest, --- `COOKS_ASSISTANT`: ordinal 16; `getId()` 17, `getName()` "Cook's Assistant". COOKS_ASSISTANT: Quest, --- `THE_CORSAIR_CURSE`: ordinal 17; `getId()` 18, `getName()` "The Corsair Curse". THE_CORSAIR_CURSE: Quest, --- `CREATURE_OF_FENKENSTRAIN`: ordinal 18; `getId()` 19, `getName()` "Creature of Fenkenstrain". CREATURE_OF_FENKENSTRAIN: Quest, --- `CURSE_OF_THE_EMPTY_LORD`: ordinal 19; `getId()` 20, `getName()` "Curse of the Empty Lord". CURSE_OF_THE_EMPTY_LORD: Quest, --- `DARKNESS_OF_HALLOWVALE`: ordinal 20; `getId()` 22, `getName()` "Darkness of Hallowvale". DARKNESS_OF_HALLOWVALE: Quest, --- `DEATH_PLATEAU`: ordinal 21; `getId()` 23, `getName()` "Death Plateau". DEATH_PLATEAU: Quest, --- `DEATH_TO_THE_DORGESHUUN`: ordinal 22; `getId()` 24, `getName()` "Death to the Dorgeshuun". DEATH_TO_THE_DORGESHUUN: Quest, --- `DEMON_SLAYER`: ordinal 23; `getId()` 25, `getName()` "Demon Slayer". DEMON_SLAYER: Quest, --- `THE_DEPTHS_OF_DESPAIR`: ordinal 24; `getId()` 26, `getName()` "The Depths of Despair". THE_DEPTHS_OF_DESPAIR: Quest, --- `DESERT_TREASURE_I`: ordinal 25; `getId()` 27, `getName()` "Desert Treasure I". DESERT_TREASURE_I: Quest, --- `DEVIOUS_MINDS`: ordinal 26; `getId()` 28, `getName()` "Devious Minds". DEVIOUS_MINDS: Quest, --- `THE_DIG_SITE`: ordinal 27; `getId()` 29, `getName()` "The Dig Site". THE_DIG_SITE: Quest, --- `DORICS_QUEST`: ordinal 28; `getId()` 30, `getName()` "Doric's Quest". DORICS_QUEST: Quest, --- `DRAGON_SLAYER_I`: ordinal 29; `getId()` 31, `getName()` "Dragon Slayer I". DRAGON_SLAYER_I: Quest, --- `DRAGON_SLAYER_II`: ordinal 30; `getId()` 32, `getName()` "Dragon Slayer II". DRAGON_SLAYER_II: Quest, --- `DREAM_MENTOR`: ordinal 31; `getId()` 33, `getName()` "Dream Mentor". DREAM_MENTOR: Quest, --- `DRUIDIC_RITUAL`: ordinal 32; `getId()` 34, `getName()` "Druidic Ritual". DRUIDIC_RITUAL: Quest, --- `DWARF_CANNON`: ordinal 33; `getId()` 35, `getName()` "Dwarf Cannon". DWARF_CANNON: Quest, --- `EADGARS_RUSE`: ordinal 34; `getId()` 36, `getName()` "Eadgar's Ruse". EADGARS_RUSE: Quest, --- `EAGLES_PEAK`: ordinal 35; `getId()` 37, `getName()` "Eagles' Peak". EAGLES_PEAK: Quest, --- `ELEMENTAL_WORKSHOP_I`: ordinal 36; `getId()` 38, `getName()` "Elemental Workshop I". ELEMENTAL_WORKSHOP_I: Quest, --- `ELEMENTAL_WORKSHOP_II`: ordinal 37; `getId()` 39, `getName()` "Elemental Workshop II". ELEMENTAL_WORKSHOP_II: Quest, --- `ENAKHRAS_LAMENT`: ordinal 38; `getId()` 40, `getName()` "Enakhra's Lament". ENAKHRAS_LAMENT: Quest, --- `THE_ENCHANTED_KEY`: ordinal 39; `getId()` 41, `getName()` "The Enchanted Key". THE_ENCHANTED_KEY: Quest, --- `ENLIGHTENED_JOURNEY`: ordinal 40; `getId()` 42, `getName()` "Enlightened Journey". ENLIGHTENED_JOURNEY: Quest, --- `ENTER_THE_ABYSS`: ordinal 41; `getId()` 43, `getName()` "Enter the Abyss". ENTER_THE_ABYSS: Quest, --- `ERNEST_THE_CHICKEN`: ordinal 42; `getId()` 44, `getName()` "Ernest the Chicken". ERNEST_THE_CHICKEN: Quest, --- `THE_EYES_OF_GLOUPHRIE`: ordinal 43; `getId()` 45, `getName()` "The Eyes of Glouphrie". THE_EYES_OF_GLOUPHRIE: Quest, --- `FAIRYTALE_I__GROWING_PAINS`: ordinal 44; `getId()` 46, `getName()` "Fairytale I - Growing Pains". FAIRYTALE_I__GROWING_PAINS: Quest, --- `FAIRYTALE_II__CURE_A_QUEEN`: ordinal 45; `getId()` 47, `getName()` "Fairytale II - Cure a Queen". FAIRYTALE_II__CURE_A_QUEEN: Quest, --- `FAMILY_CREST`: ordinal 46; `getId()` 48, `getName()` "Family Crest". FAMILY_CREST: Quest, --- `FAMILY_PEST`: ordinal 47; `getId()` 49, `getName()` "Family Pest". FAMILY_PEST: Quest, --- `THE_FEUD`: ordinal 48; `getId()` 50, `getName()` "The Feud". THE_FEUD: Quest, --- `FIGHT_ARENA`: ordinal 49; `getId()` 51, `getName()` "Fight Arena". FIGHT_ARENA: Quest, --- `FISHING_CONTEST`: ordinal 50; `getId()` 52, `getName()` "Fishing Contest". FISHING_CONTEST: Quest, --- `FORGETTABLE_TALE`: ordinal 51; `getId()` 53, `getName()` "Forgettable Tale...". FORGETTABLE_TALE: Quest, --- `THE_FORSAKEN_TOWER`: ordinal 52; `getId()` 54, `getName()` "The Forsaken Tower". THE_FORSAKEN_TOWER: Quest, --- `THE_FREMENNIK_EXILES`: ordinal 53; `getId()` 55, `getName()` "The Fremennik Exiles". THE_FREMENNIK_EXILES: Quest, --- `THE_FREMENNIK_ISLES`: ordinal 54; `getId()` 56, `getName()` "The Fremennik Isles". THE_FREMENNIK_ISLES: Quest, --- `THE_FREMENNIK_TRIALS`: ordinal 55; `getId()` 57, `getName()` "The Fremennik Trials". THE_FREMENNIK_TRIALS: Quest, --- `GARDEN_OF_TRANQUILLITY`: ordinal 56; `getId()` 58, `getName()` "Garden of Tranquillity". GARDEN_OF_TRANQUILLITY: Quest, --- `THE_GENERALS_SHADOW`: ordinal 57; `getId()` 59, `getName()` "The General's Shadow". THE_GENERALS_SHADOW: Quest, --- `GERTRUDES_CAT`: ordinal 58; `getId()` 60, `getName()` "Gertrude's Cat". GERTRUDES_CAT: Quest, --- `GETTING_AHEAD`: ordinal 59; `getId()` 61, `getName()` "Getting Ahead". GETTING_AHEAD: Quest, --- `GHOSTS_AHOY`: ordinal 60; `getId()` 62, `getName()` "Ghosts Ahoy". GHOSTS_AHOY: Quest, --- `THE_GIANT_DWARF`: ordinal 61; `getId()` 63, `getName()` "The Giant Dwarf". THE_GIANT_DWARF: Quest, --- `GOBLIN_DIPLOMACY`: ordinal 62; `getId()` 64, `getName()` "Goblin Diplomacy". GOBLIN_DIPLOMACY: Quest, --- `THE_GOLEM`: ordinal 63; `getId()` 65, `getName()` "The Golem". THE_GOLEM: Quest, --- `THE_GRAND_TREE`: ordinal 64; `getId()` 66, `getName()` "The Grand Tree". THE_GRAND_TREE: Quest, --- `THE_GREAT_BRAIN_ROBBERY`: ordinal 65; `getId()` 67, `getName()` "The Great Brain Robbery". THE_GREAT_BRAIN_ROBBERY: Quest, --- `GRIM_TALES`: ordinal 66; `getId()` 68, `getName()` "Grim Tales". GRIM_TALES: Quest, --- `THE_HAND_IN_THE_SAND`: ordinal 67; `getId()` 69, `getName()` "The Hand in the Sand". THE_HAND_IN_THE_SAND: Quest, --- `HAUNTED_MINE`: ordinal 68; `getId()` 70, `getName()` "Haunted Mine". HAUNTED_MINE: Quest, --- `HAZEEL_CULT`: ordinal 69; `getId()` 71, `getName()` "Hazeel Cult". HAZEEL_CULT: Quest, --- `HEROES_QUEST`: ordinal 70; `getId()` 72, `getName()` "Heroes' Quest". HEROES_QUEST: Quest, --- `HOLY_GRAIL`: ordinal 71; `getId()` 73, `getName()` "Holy Grail". HOLY_GRAIL: Quest, --- `HORROR_FROM_THE_DEEP`: ordinal 72; `getId()` 74, `getName()` "Horror from the Deep". HORROR_FROM_THE_DEEP: Quest, --- `ICTHLARINS_LITTLE_HELPER`: ordinal 73; `getId()` 75, `getName()` "Icthlarin's Little Helper". ICTHLARINS_LITTLE_HELPER: Quest, --- `IMP_CATCHER`: ordinal 74; `getId()` 76, `getName()` "Imp Catcher". IMP_CATCHER: Quest, --- `IN_AID_OF_THE_MYREQUE`: ordinal 75; `getId()` 77, `getName()` "In Aid of the Myreque". IN_AID_OF_THE_MYREQUE: Quest, --- `IN_SEARCH_OF_KNOWLEDGE`: ordinal 76; `getId()` 78, `getName()` "In Search of Knowledge". IN_SEARCH_OF_KNOWLEDGE: Quest, --- `IN_SEARCH_OF_THE_MYREQUE`: ordinal 77; `getId()` 79, `getName()` "In Search of the Myreque". IN_SEARCH_OF_THE_MYREQUE: Quest, --- `JUNGLE_POTION`: ordinal 78; `getId()` 80, `getName()` "Jungle Potion". JUNGLE_POTION: Quest, --- `A_KINGDOM_DIVIDED`: ordinal 79; `getId()` 81, `getName()` "A Kingdom Divided". A_KINGDOM_DIVIDED: Quest, --- `KINGS_RANSOM`: ordinal 80; `getId()` 82, `getName()` "King's Ransom". KINGS_RANSOM: Quest, --- `THE_KNIGHTS_SWORD`: ordinal 81; `getId()` 83, `getName()` "The Knight's Sword". THE_KNIGHTS_SWORD: Quest, --- `LAIR_OF_TARN_RAZORLOR`: ordinal 82; `getId()` 84, `getName()` "Lair of Tarn Razorlor". LAIR_OF_TARN_RAZORLOR: Quest, --- `LEGENDS_QUEST`: ordinal 83; `getId()` 85, `getName()` "Legends' Quest". LEGENDS_QUEST: Quest, --- `LOST_CITY`: ordinal 84; `getId()` 86, `getName()` "Lost City". LOST_CITY: Quest, --- `THE_LOST_TRIBE`: ordinal 85; `getId()` 87, `getName()` "The Lost Tribe". THE_LOST_TRIBE: Quest, --- `LUNAR_DIPLOMACY`: ordinal 86; `getId()` 88, `getName()` "Lunar Diplomacy". LUNAR_DIPLOMACY: Quest, --- `MAGE_ARENA_I`: ordinal 87; `getId()` 89, `getName()` "Mage Arena I". MAGE_ARENA_I: Quest, --- `MAGE_ARENA_II`: ordinal 88; `getId()` 90, `getName()` "Mage Arena II". MAGE_ARENA_II: Quest, --- `MAKING_FRIENDS_WITH_MY_ARM`: ordinal 89; `getId()` 91, `getName()` "Making Friends with My Arm". MAKING_FRIENDS_WITH_MY_ARM: Quest, --- `MAKING_HISTORY`: ordinal 90; `getId()` 92, `getName()` "Making History". MAKING_HISTORY: Quest, --- `MERLINS_CRYSTAL`: ordinal 91; `getId()` 93, `getName()` "Merlin's Crystal". MERLINS_CRYSTAL: Quest, --- `MISTHALIN_MYSTERY`: ordinal 92; `getId()` 94, `getName()` "Misthalin Mystery". MISTHALIN_MYSTERY: Quest, --- `MONKEY_MADNESS_I`: ordinal 93; `getId()` 95, `getName()` "Monkey Madness I". MONKEY_MADNESS_I: Quest, --- `MONKEY_MADNESS_II`: ordinal 94; `getId()` 96, `getName()` "Monkey Madness II". MONKEY_MADNESS_II: Quest, --- `MONKS_FRIEND`: ordinal 95; `getId()` 97, `getName()` "Monk's Friend". MONKS_FRIEND: Quest, --- `MOUNTAIN_DAUGHTER`: ordinal 96; `getId()` 98, `getName()` "Mountain Daughter". MOUNTAIN_DAUGHTER: Quest, --- `MOURNINGS_END_PART_I`: ordinal 97; `getId()` 99, `getName()` "Mourning's End Part I". MOURNINGS_END_PART_I: Quest, --- `MOURNINGS_END_PART_II`: ordinal 98; `getId()` 100, `getName()` "Mourning's End Part II". MOURNINGS_END_PART_II: Quest, --- `MURDER_MYSTERY`: ordinal 99; `getId()` 101, `getName()` "Murder Mystery". MURDER_MYSTERY: Quest, --- `MY_ARMS_BIG_ADVENTURE`: ordinal 100; `getId()` 102, `getName()` "My Arm's Big Adventure". MY_ARMS_BIG_ADVENTURE: Quest, --- `NATURE_SPIRIT`: ordinal 101; `getId()` 103, `getName()` "Nature Spirit". NATURE_SPIRIT: Quest, --- `A_NIGHT_AT_THE_THEATRE`: ordinal 102; `getId()` 104, `getName()` "A Night at the Theatre". A_NIGHT_AT_THE_THEATRE: Quest, --- `OBSERVATORY_QUEST`: ordinal 103; `getId()` 105, `getName()` "Observatory Quest". OBSERVATORY_QUEST: Quest, --- `OLAFS_QUEST`: ordinal 104; `getId()` 106, `getName()` "Olaf's Quest". OLAFS_QUEST: Quest, --- `ONE_SMALL_FAVOUR`: ordinal 105; `getId()` 107, `getName()` "One Small Favour". ONE_SMALL_FAVOUR: Quest, --- `PIRATES_TREASURE`: ordinal 106; `getId()` 108, `getName()` "Pirate's Treasure". PIRATES_TREASURE: Quest, --- `PLAGUE_CITY`: ordinal 107; `getId()` 109, `getName()` "Plague City". PLAGUE_CITY: Quest, --- `A_PORCINE_OF_INTEREST`: ordinal 108; `getId()` 110, `getName()` "A Porcine of Interest". A_PORCINE_OF_INTEREST: Quest, --- `PRIEST_IN_PERIL`: ordinal 109; `getId()` 111, `getName()` "Priest in Peril". PRIEST_IN_PERIL: Quest, --- `PRINCE_ALI_RESCUE`: ordinal 110; `getId()` 112, `getName()` "Prince Ali Rescue". PRINCE_ALI_RESCUE: Quest, --- `THE_QUEEN_OF_THIEVES`: ordinal 111; `getId()` 113, `getName()` "The Queen of Thieves". THE_QUEEN_OF_THIEVES: Quest, --- `RAG_AND_BONE_MAN_I`: ordinal 112; `getId()` 114, `getName()` "Rag and Bone Man I". RAG_AND_BONE_MAN_I: Quest, --- `RAG_AND_BONE_MAN_II`: ordinal 113; `getId()` 115, `getName()` "Rag and Bone Man II". RAG_AND_BONE_MAN_II: Quest, --- `RATCATCHERS`: ordinal 114; `getId()` 116, `getName()` "Ratcatchers". RATCATCHERS: Quest, --- `RECIPE_FOR_DISASTER`: ordinal 115; `getId()` 117, `getName()` "Recipe for Disaster". RECIPE_FOR_DISASTER: Quest, --- `RECRUITMENT_DRIVE`: ordinal 116; `getId()` 118, `getName()` "Recruitment Drive". RECRUITMENT_DRIVE: Quest, --- `REGICIDE`: ordinal 117; `getId()` 119, `getName()` "Regicide". REGICIDE: Quest, --- `THE_RESTLESS_GHOST`: ordinal 118; `getId()` 120, `getName()` "The Restless Ghost". THE_RESTLESS_GHOST: Quest, --- `ROMEO__JULIET`: ordinal 119; `getId()` 121, `getName()` "Romeo & Juliet". ROMEO__JULIET: Quest, --- `ROVING_ELVES`: ordinal 120; `getId()` 122, `getName()` "Roving Elves". ROVING_ELVES: Quest, --- `ROYAL_TROUBLE`: ordinal 121; `getId()` 123, `getName()` "Royal Trouble". ROYAL_TROUBLE: Quest, --- `RUM_DEAL`: ordinal 122; `getId()` 124, `getName()` "Rum Deal". RUM_DEAL: Quest, --- `RUNE_MYSTERIES`: ordinal 123; `getId()` 125, `getName()` "Rune Mysteries". RUNE_MYSTERIES: Quest, --- `SCORPION_CATCHER`: ordinal 124; `getId()` 126, `getName()` "Scorpion Catcher". SCORPION_CATCHER: Quest, --- `SEA_SLUG`: ordinal 125; `getId()` 127, `getName()` "Sea Slug". SEA_SLUG: Quest, --- `SHADES_OF_MORTTON`: ordinal 126; `getId()` 128, `getName()` "Shades of Mort'ton". SHADES_OF_MORTTON: Quest, --- `SHADOW_OF_THE_STORM`: ordinal 127; `getId()` 129, `getName()` "Shadow of the Storm". SHADOW_OF_THE_STORM: Quest, --- `SHEEP_HERDER`: ordinal 128; `getId()` 130, `getName()` "Sheep Herder". SHEEP_HERDER: Quest, --- `SHEEP_SHEARER`: ordinal 129; `getId()` 131, `getName()` "Sheep Shearer". SHEEP_SHEARER: Quest, --- `SHIELD_OF_ARRAV`: ordinal 130; `getId()` 132, `getName()` "Shield of Arrav". SHIELD_OF_ARRAV: Quest, --- `SHILO_VILLAGE`: ordinal 131; `getId()` 133, `getName()` "Shilo Village". SHILO_VILLAGE: Quest, --- `SINS_OF_THE_FATHER`: ordinal 132; `getId()` 134, `getName()` "Sins of the Father". SINS_OF_THE_FATHER: Quest, --- `SKIPPY_AND_THE_MOGRES`: ordinal 133; `getId()` 135, `getName()` "Skippy and the Mogres". SKIPPY_AND_THE_MOGRES: Quest, --- `THE_SLUG_MENACE`: ordinal 134; `getId()` 136, `getName()` "The Slug Menace". THE_SLUG_MENACE: Quest, --- `SONG_OF_THE_ELVES`: ordinal 135; `getId()` 137, `getName()` "Song of the Elves". SONG_OF_THE_ELVES: Quest, --- `A_SOULS_BANE`: ordinal 136; `getId()` 138, `getName()` "A Soul's Bane". A_SOULS_BANE: Quest, --- `SPIRITS_OF_THE_ELID`: ordinal 137; `getId()` 139, `getName()` "Spirits of the Elid". SPIRITS_OF_THE_ELID: Quest, --- `SWAN_SONG`: ordinal 138; `getId()` 140, `getName()` "Swan Song". SWAN_SONG: Quest, --- `TAI_BWO_WANNAI_TRIO`: ordinal 139; `getId()` 141, `getName()` "Tai Bwo Wannai Trio". TAI_BWO_WANNAI_TRIO: Quest, --- `A_TAIL_OF_TWO_CATS`: ordinal 140; `getId()` 142, `getName()` "A Tail of Two Cats". A_TAIL_OF_TWO_CATS: Quest, --- `TALE_OF_THE_RIGHTEOUS`: ordinal 141; `getId()` 143, `getName()` "Tale of the Righteous". TALE_OF_THE_RIGHTEOUS: Quest, --- `A_TASTE_OF_HOPE`: ordinal 142; `getId()` 144, `getName()` "A Taste of Hope". A_TASTE_OF_HOPE: Quest, --- `TEARS_OF_GUTHIX`: ordinal 143; `getId()` 145, `getName()` "Tears of Guthix". TEARS_OF_GUTHIX: Quest, --- `TEMPLE_OF_IKOV`: ordinal 144; `getId()` 146, `getName()` "Temple of Ikov". TEMPLE_OF_IKOV: Quest, --- `THRONE_OF_MISCELLANIA`: ordinal 145; `getId()` 147, `getName()` "Throne of Miscellania". THRONE_OF_MISCELLANIA: Quest, --- `THE_TOURIST_TRAP`: ordinal 146; `getId()` 148, `getName()` "The Tourist Trap". THE_TOURIST_TRAP: Quest, --- `TOWER_OF_LIFE`: ordinal 147; `getId()` 149, `getName()` "Tower of Life". TOWER_OF_LIFE: Quest, --- `TREE_GNOME_VILLAGE`: ordinal 148; `getId()` 150, `getName()` "Tree Gnome Village". TREE_GNOME_VILLAGE: Quest, --- `TRIBAL_TOTEM`: ordinal 149; `getId()` 151, `getName()` "Tribal Totem". TRIBAL_TOTEM: Quest, --- `TROLL_ROMANCE`: ordinal 150; `getId()` 152, `getName()` "Troll Romance". TROLL_ROMANCE: Quest, --- `TROLL_STRONGHOLD`: ordinal 151; `getId()` 153, `getName()` "Troll Stronghold". TROLL_STRONGHOLD: Quest, --- `UNDERGROUND_PASS`: ordinal 152; `getId()` 154, `getName()` "Underground Pass". UNDERGROUND_PASS: Quest, --- `VAMPYRE_SLAYER`: ordinal 153; `getId()` 155, `getName()` "Vampyre Slayer". VAMPYRE_SLAYER: Quest, --- `WANTED`: ordinal 154; `getId()` 156, `getName()` "Wanted!". WANTED: Quest, --- `WATCHTOWER`: ordinal 155; `getId()` 157, `getName()` "Watchtower". WATCHTOWER: Quest, --- `WATERFALL_QUEST`: ordinal 156; `getId()` 158, `getName()` "Waterfall Quest". WATERFALL_QUEST: Quest, --- `WHAT_LIES_BELOW`: ordinal 157; `getId()` 159, `getName()` "What Lies Below". WHAT_LIES_BELOW: Quest, --- `WITCHS_HOUSE`: ordinal 158; `getId()` 160, `getName()` "Witch's House". WITCHS_HOUSE: Quest, --- `WITCHS_POTION`: ordinal 159; `getId()` 161, `getName()` "Witch's Potion". WITCHS_POTION: Quest, --- `X_MARKS_THE_SPOT`: ordinal 160; `getId()` 162, `getName()` "X Marks the Spot". X_MARKS_THE_SPOT: Quest, --- `ZOGRE_FLESH_EATERS`: ordinal 161; `getId()` 163, `getName()` "Zogre Flesh Eaters". ZOGRE_FLESH_EATERS: Quest, --- `THE_FROZEN_DOOR`: ordinal 162; `getId()` 164, `getName()` "The Frozen Door". THE_FROZEN_DOOR: Quest, --- `LAND_OF_THE_GOBLINS`: ordinal 163; `getId()` 165, `getName()` "Land of the Goblins". LAND_OF_THE_GOBLINS: Quest, --- `HOPESPEARS_WILL`: ordinal 164; `getId()` 166, `getName()` "Hopespear's Will". HOPESPEARS_WILL: Quest, --- `TEMPLE_OF_THE_EYE`: ordinal 165; `getId()` 167, `getName()` "Temple of the Eye". TEMPLE_OF_THE_EYE: Quest, --- `BENEATH_CURSED_SANDS`: ordinal 166; `getId()` 168, `getName()` "Beneath Cursed Sands". BENEATH_CURSED_SANDS: Quest, --- `SLEEPING_GIANTS`: ordinal 167; `getId()` 169, `getName()` "Sleeping Giants". SLEEPING_GIANTS: Quest, --- `THE_GARDEN_OF_DEATH`: ordinal 168; `getId()` 180, `getName()` "The Garden of Death". THE_GARDEN_OF_DEATH: Quest, --- `INTO_THE_TOMBS`: ordinal 169; `getId()` 2306, `getName()` "Into the Tombs". INTO_THE_TOMBS: Quest, --- `RECIPE_FOR_DISASTER__ANOTHER_COOKS_QUEST`: ordinal 170; `getId()` 2307, `getName()` "Recipe for Disaster - Another Cook's Quest". RECIPE_FOR_DISASTER__ANOTHER_COOKS_QUEST: Quest, --- `RECIPE_FOR_DISASTER__MOUNTAIN_DWARF`: ordinal 171; `getId()` 2308, `getName()` "Recipe for Disaster - Mountain Dwarf". RECIPE_FOR_DISASTER__MOUNTAIN_DWARF: Quest, --- `RECIPE_FOR_DISASTER__WARTFACE__BENTNOZE`: ordinal 172; `getId()` 2309, `getName()` "Recipe for Disaster - Wartface & Bentnoze". RECIPE_FOR_DISASTER__WARTFACE__BENTNOZE: Quest, --- `RECIPE_FOR_DISASTER__PIRATE_PETE`: ordinal 173; `getId()` 2310, `getName()` "Recipe for Disaster - Pirate Pete". RECIPE_FOR_DISASTER__PIRATE_PETE: Quest, --- `RECIPE_FOR_DISASTER__LUMBRIDGE_GUIDE`: ordinal 174; `getId()` 2311, `getName()` "Recipe for Disaster - Lumbridge Guide". RECIPE_FOR_DISASTER__LUMBRIDGE_GUIDE: Quest, --- `RECIPE_FOR_DISASTER__EVIL_DAVE`: ordinal 175; `getId()` 2312, `getName()` "Recipe for Disaster - Evil Dave". RECIPE_FOR_DISASTER__EVIL_DAVE: Quest, --- `RECIPE_FOR_DISASTER__SKRACH_UGLOGWEE`: ordinal 176; `getId()` 2313, `getName()` "Recipe for Disaster - Skrach Uglogwee". RECIPE_FOR_DISASTER__SKRACH_UGLOGWEE: Quest, --- `RECIPE_FOR_DISASTER__SIR_AMIK_VARZE`: ordinal 177; `getId()` 2314, `getName()` "Recipe for Disaster - Sir Amik Varze". RECIPE_FOR_DISASTER__SIR_AMIK_VARZE: Quest, --- `RECIPE_FOR_DISASTER__KING_AWOWOGEI`: ordinal 178; `getId()` 2315, `getName()` "Recipe for Disaster - King Awowogei". RECIPE_FOR_DISASTER__KING_AWOWOGEI: Quest, --- `RECIPE_FOR_DISASTER__CULINAROMANCER`: ordinal 179; `getId()` 2316, `getName()` "Recipe for Disaster - Culinaromancer". RECIPE_FOR_DISASTER__CULINAROMANCER: Quest, --- `SECRETS_OF_THE_NORTH`: ordinal 180; `getId()` 2338, `getName()` "Secrets of the North". SECRETS_OF_THE_NORTH: Quest, --- `DESERT_TREASURE_II__THE_FALLEN_EMPIRE`: ordinal 181; `getId()` 2343, `getName()` "Desert Treasure II - The Fallen Empire". DESERT_TREASURE_II__THE_FALLEN_EMPIRE: Quest, --- `HIS_FAITHFUL_SERVANTS`: ordinal 182; `getId()` 3250, `getName()` "His Faithful Servants". HIS_FAITHFUL_SERVANTS: Quest, --- `THE_PATH_OF_GLOUPHRIE`: ordinal 183; `getId()` 3425, `getName()` "The Path of Glouphrie". THE_PATH_OF_GLOUPHRIE: Quest, --- `CHILDREN_OF_THE_SUN`: ordinal 184; `getId()` 3450, `getName()` "Children of the Sun". CHILDREN_OF_THE_SUN: Quest, --- `BARBARIAN_TRAINING`: ordinal 185; `getId()` 3451, `getName()` "Barbarian Training". BARBARIAN_TRAINING: Quest, --- `DEFENDER_OF_VARROCK`: ordinal 186; `getId()` 3466, `getName()` "Defender of Varrock". DEFENDER_OF_VARROCK: Quest, --- `WHILE_GUTHIX_SLEEPS`: ordinal 187; `getId()` 3467, `getName()` "While Guthix Sleeps". WHILE_GUTHIX_SLEEPS: Quest, --- `TWILIGHTS_PROMISE`: ordinal 188; `getId()` 3512, `getName()` "Twilight's Promise". TWILIGHTS_PROMISE: Quest, --- `AT_FIRST_LIGHT`: ordinal 189; `getId()` 3513, `getName()` "At First Light". AT_FIRST_LIGHT: Quest, --- `PERILOUS_MOONS`: ordinal 190; `getId()` 3514, `getName()` "Perilous Moons". PERILOUS_MOONS: Quest, --- `THE_RIBBITING_TALE_OF_A_LILY_PAD_LABOUR_DISPUTE`: ordinal 191; `getId()` 3515, `getName()` "The Ribbiting Tale of a Lily Pad Labour Dispute". THE_RIBBITING_TALE_OF_A_LILY_PAD_LABOUR_DISPUTE: Quest, --- `THE_HEART_OF_DARKNESS`: ordinal 192; `getId()` 3710, `getName()` "The Heart of Darkness". THE_HEART_OF_DARKNESS: Quest, --- `DEATH_ON_THE_ISLE`: ordinal 193; `getId()` 3711, `getName()` "Death on the Isle". DEATH_ON_THE_ISLE: Quest, --- `MEAT_AND_GREET`: ordinal 194; `getId()` 3712, `getName()` "Meat and Greet". MEAT_AND_GREET: Quest, --- `ETHICALLY_ACQUIRED_ANTIQUITIES`: ordinal 195; `getId()` 3713, `getName()` "Ethically Acquired Antiquities". ETHICALLY_ACQUIRED_ANTIQUITIES: Quest, --- `THE_CURSE_OF_ARRAV`: ordinal 196; `getId()` 3937, `getName()` "The Curse of Arrav". THE_CURSE_OF_ARRAV: Quest, --- `THE_FINAL_DAWN`: ordinal 197; `getId()` 5189, `getName()` "The Final Dawn". THE_FINAL_DAWN: Quest, --- `SHADOWS_OF_CUSTODIA`: ordinal 198; `getId()` 5190, `getName()` "Shadows of Custodia". SHADOWS_OF_CUSTODIA: Quest, --- `SCRAMBLED`: ordinal 199; `getId()` 5191, `getName()` "Scrambled!". SCRAMBLED: Quest, --- `VALE_TOTEMS`: ordinal 200; `getId()` 5194, `getName()` "Vale Totems". VALE_TOTEMS: Quest, --- `PANDEMONIUM`: ordinal 201; `getId()` 7103, `getName()` "Pandemonium". PANDEMONIUM: Quest, --- `PRYING_TIMES`: ordinal 202; `getId()` 7104, `getName()` "Prying Times". PRYING_TIMES: Quest, --- `CURRENT_AFFAIRS`: ordinal 203; `getId()` 7105, `getName()` "Current Affairs". CURRENT_AFFAIRS: Quest, --- `TROUBLED_TORTUGANS`: ordinal 204; `getId()` 7106, `getName()` "Troubled Tortugans". TROUBLED_TORTUGANS: Quest, --- `THE_RED_REEF`: ordinal 205; `getId()` 7107, `getName()` "The Red Reef". THE_RED_REEF: Quest, --- `FALLEN_FROM_GRACE`: ordinal 206; `getId()` 7133, `getName()` "Fallen From Grace". FALLEN_FROM_GRACE: Quest, --- `LEARNING_THE_ROPES`: ordinal 207; `getId()` 9643, `getName()` "Learning the Ropes". LEARNING_THE_ROPES: Quest, --- `THE_IDES_OF_MILK`: ordinal 208; `getId()` 9645, `getName()` "The Ides of Milk". THE_IDES_OF_MILK: Quest, --- `THE_BLOOD_MOON_RISES`: ordinal 209; `getId()` 16414, `getName()` "The Blood Moon Rises". THE_BLOOD_MOON_RISES: Quest, --- `A_RUFF_SITUATION`: ordinal 210; `getId()` 16971, `getName()` "A Ruff Situation". A_RUFF_SITUATION: Quest, --- `CRAB_QUEST`: ordinal 211; `getId()` 16972, `getName()` "Crab Quest". CRAB_QUEST: Quest, --- `THE_FRACTURED_ARCHIVE`: ordinal 212; `getId()` 17027, `getName()` "The Fractured Archive". THE_FRACTURED_ARCHIVE: Quest, --- `DADDYS_HOME`: ordinal 213; `getId()` 17229, `getName()` "Daddy's Home". DADDYS_HOME: Quest, --- `MUDFOOTS_BIG_ADVENTURE`: ordinal 214; `getId()` 17230, `getName()` "Mudfoot's Big Adventure". MUDFOOTS_BIG_ADVENTURE: Quest, --- `THE_WRITINGS_ON_THE_WALL`: ordinal 215; `getId()` 17231, `getName()` "The Writing's on the Wall". THE_WRITINGS_ON_THE_WALL: Quest, --- `A_SHELL_OF_A_FRIEND`: ordinal 216; `getId()` 17315, `getName()` "A Shell of a Friend". One of the quests the game added most recently, named from the game's own name for it. A_SHELL_OF_A_FRIEND: Quest, --- `THE_BIRDS_AND_THE_WASPS`: ordinal 217; `getId()` 17316, `getName()` "The Birds and the Wasps". One of the quests the game added most recently, named from the game's own name for it. THE_BIRDS_AND_THE_WASPS: Quest, } --- `Quest`'s static functions and constants. declare Quest: QuestClass --- Enum `QuestState`: 3 constants, each one userdata per VM, so `==` is identity and a constant is a table key. `QuestState.values()`, `QuestState.valueOf(name)`; every constant answers `name()`, `ordinal()` (0-based), `toString()`, `compareTo()` and `equals()`. export type QuestState = { --- The constant's name as declared. name: (QuestState) -> string, --- The constant's 0-based position in `values()`. ordinal: (QuestState) -> number, --- `name()`; `tostring(c)` answers the same. toString: (QuestState) -> string, --- This ordinal less `other`'s. compareTo: (QuestState, QuestState) -> number, --- Whether `other` is this constant. `==` answers the same. equals: (QuestState, any) -> boolean, } export type QuestStateClass = { --- Every constant in ordinal order, as a 1-based array: the same frozen array every `values()` call, so `table.clone` it before changing it. values: () -> {QuestState}, --- `valueOf(name)`: the constant named `name`; any other name is an error. valueOf: (string) -> QuestState, --- `IN_PROGRESS`: ordinal 0. IN_PROGRESS: QuestState, --- `NOT_STARTED`: ordinal 1. NOT_STARTED: QuestState, --- `FINISHED`: ordinal 2. FINISHED: QuestState, } --- `QuestState`'s static functions and constants. declare QuestState: QuestStateClass --- Enum `Skill`: 24 constants, each one userdata per VM, so `==` is identity and a constant is a table key. `Skill.values()`, `Skill.valueOf(name)`; every constant answers `name()`, `ordinal()` (0-based), `toString()`, `compareTo()` and `equals()`, plus `getName()`, `isMembers()`. export type Skill = { --- The constant's name as declared. name: (Skill) -> string, --- The constant's 0-based position in `values()`. ordinal: (Skill) -> number, --- `name()`; `tostring(c)` answers the same. toString: (Skill) -> string, --- This ordinal less `other`'s. compareTo: (Skill, Skill) -> number, --- Whether `other` is this constant. `==` answers the same. equals: (Skill, any) -> boolean, --- This constant's `getName()` value, listed on each constant. getName: (Skill) -> string, --- This constant's `isMembers()` value, listed on each constant. isMembers: (Skill) -> boolean, } export type SkillClass = { --- Every constant in ordinal order, as a 1-based array: the same frozen array every `values()` call, so `table.clone` it before changing it. values: () -> {Skill}, --- `valueOf(name)`: the constant named `name`; any other name is an error. valueOf: (string) -> Skill, --- `ATTACK`: ordinal 0; `getName()` "Attack", `isMembers()` false. ATTACK: Skill, --- `DEFENCE`: ordinal 1; `getName()` "Defence", `isMembers()` false. DEFENCE: Skill, --- `STRENGTH`: ordinal 2; `getName()` "Strength", `isMembers()` false. STRENGTH: Skill, --- `HITPOINTS`: ordinal 3; `getName()` "Hitpoints", `isMembers()` false. HITPOINTS: Skill, --- `RANGED`: ordinal 4; `getName()` "Ranged", `isMembers()` false. RANGED: Skill, --- `PRAYER`: ordinal 5; `getName()` "Prayer", `isMembers()` false. PRAYER: Skill, --- `MAGIC`: ordinal 6; `getName()` "Magic", `isMembers()` false. MAGIC: Skill, --- `COOKING`: ordinal 7; `getName()` "Cooking", `isMembers()` false. COOKING: Skill, --- `WOODCUTTING`: ordinal 8; `getName()` "Woodcutting", `isMembers()` false. WOODCUTTING: Skill, --- `FLETCHING`: ordinal 9; `getName()` "Fletching", `isMembers()` true. FLETCHING: Skill, --- `FISHING`: ordinal 10; `getName()` "Fishing", `isMembers()` false. FISHING: Skill, --- `FIREMAKING`: ordinal 11; `getName()` "Firemaking", `isMembers()` false. FIREMAKING: Skill, --- `CRAFTING`: ordinal 12; `getName()` "Crafting", `isMembers()` false. CRAFTING: Skill, --- `SMITHING`: ordinal 13; `getName()` "Smithing", `isMembers()` false. SMITHING: Skill, --- `MINING`: ordinal 14; `getName()` "Mining", `isMembers()` false. MINING: Skill, --- `HERBLORE`: ordinal 15; `getName()` "Herblore", `isMembers()` true. HERBLORE: Skill, --- `AGILITY`: ordinal 16; `getName()` "Agility", `isMembers()` true. AGILITY: Skill, --- `THIEVING`: ordinal 17; `getName()` "Thieving", `isMembers()` true. THIEVING: Skill, --- `SLAYER`: ordinal 18; `getName()` "Slayer", `isMembers()` true. SLAYER: Skill, --- `FARMING`: ordinal 19; `getName()` "Farming", `isMembers()` true. FARMING: Skill, --- `RUNECRAFT`: ordinal 20; `getName()` "Runecraft", `isMembers()` false. RUNECRAFT: Skill, --- `HUNTER`: ordinal 21; `getName()` "Hunter", `isMembers()` true. HUNTER: Skill, --- `CONSTRUCTION`: ordinal 22; `getName()` "Construction", `isMembers()` true. CONSTRUCTION: Skill, --- `SAILING`: ordinal 23; `getName()` "Sailing", `isMembers()` true. SAILING: Skill, } --- `Skill`'s static functions and constants. declare Skill: SkillClass --- Enum `WorldType`: 17 constants, each one userdata per VM, so `==` is identity and a constant is a table key. `WorldType.values()`, `WorldType.valueOf(name)`; every constant answers `name()`, `ordinal()` (0-based), `toString()`, `compareTo()` and `equals()`. export type WorldType = { --- The constant's name as declared. name: (WorldType) -> string, --- The constant's 0-based position in `values()`. ordinal: (WorldType) -> number, --- `name()`; `tostring(c)` answers the same. toString: (WorldType) -> string, --- This ordinal less `other`'s. compareTo: (WorldType, WorldType) -> number, --- Whether `other` is this constant. `==` answers the same. equals: (WorldType, any) -> boolean, } export type WorldTypeClass = { --- Every constant in ordinal order, as a 1-based array: the same frozen array every `values()` call, so `table.clone` it before changing it. values: () -> {WorldType}, --- `valueOf(name)`: the constant named `name`; any other name is an error. valueOf: (string) -> WorldType, --- Every type whose flag bit `mask` sets, as a set: `{[WorldType.PVP] = true}`. fromMask: (number) -> {[WorldType]: boolean}, --- The flag bits of every type in `types`, a set (`{[WorldType.PVP] = true}`) or an array. toMask: ({[WorldType]: boolean}) -> number, --- Whether any of `worldTypes` (a set or an array) is `PVP` or `DEADMAN`. isPvpWorld: ({[WorldType]: boolean}) -> boolean, --- `MEMBERS`: ordinal 0. MEMBERS: WorldType, --- `PVP`: ordinal 1. PVP: WorldType, --- `BOUNTY`: ordinal 2. BOUNTY: WorldType, --- `PVP_ARENA`: ordinal 3. PVP_ARENA: WorldType, --- `SKILL_TOTAL`: ordinal 4. SKILL_TOTAL: WorldType, --- `QUEST_SPEEDRUNNING`: ordinal 5. QUEST_SPEEDRUNNING: WorldType, --- `HIGH_RISK`: ordinal 6. HIGH_RISK: WorldType, --- `HARDCORE_MAIN`: ordinal 7. HARDCORE_MAIN: WorldType, --- `LAST_MAN_STANDING`: ordinal 8. LAST_MAN_STANDING: WorldType, --- `BETA_WORLD`: ordinal 9. BETA_WORLD: WorldType, --- `LEGACY_ONLY`: ordinal 10. LEGACY_ONLY: WorldType, --- `EOC_ONLY`: ordinal 11. EOC_ONLY: WorldType, --- `NOSAVE_MODE`: ordinal 12. NOSAVE_MODE: WorldType, --- `TOURNAMENT_WORLD`: ordinal 13. TOURNAMENT_WORLD: WorldType, --- `FRESH_START_WORLD`: ordinal 14. FRESH_START_WORLD: WorldType, --- `DEADMAN`: ordinal 15. DEADMAN: WorldType, --- `SEASONAL`: ordinal 16. SEASONAL: WorldType, } --- `WorldType`'s static functions and constants. declare WorldType: WorldTypeClass --- Enum `Direction`: 4 constants, each one userdata per VM, so `==` is identity and a constant is a table key. `Direction.values()`, `Direction.valueOf(name)`; every constant answers `name()`, `ordinal()` (0-based), `toString()`, `compareTo()` and `equals()`. export type Direction = { --- The constant's name as declared. name: (Direction) -> string, --- The constant's 0-based position in `values()`. ordinal: (Direction) -> number, --- `name()`; `tostring(c)` answers the same. toString: (Direction) -> string, --- This ordinal less `other`'s. compareTo: (Direction, Direction) -> number, --- Whether `other` is this constant. `==` answers the same. equals: (Direction, any) -> boolean, } export type DirectionClass = { --- Every constant in ordinal order, as a 1-based array: the same frozen array every `values()` call, so `table.clone` it before changing it. values: () -> {Direction}, --- `valueOf(name)`: the constant named `name`; any other name is an error. valueOf: (string) -> Direction, --- `NORTH`: ordinal 0. NORTH: Direction, --- `SOUTH`: ordinal 1. SOUTH: Direction, --- `EAST`: ordinal 2. EAST: Direction, --- `WEST`: ordinal 3. WEST: Direction, } --- `Direction`'s static functions and constants. declare Direction: DirectionClass --- Enum `KitType`: 12 constants, each one userdata per VM, so `==` is identity and a constant is a table key. `KitType.values()`, `KitType.valueOf(name)`; every constant answers `name()`, `ordinal()` (0-based), `toString()`, `compareTo()` and `equals()`, plus `getIndex()`. export type KitType = { --- The constant's name as declared. name: (KitType) -> string, --- The constant's 0-based position in `values()`. ordinal: (KitType) -> number, --- `name()`; `tostring(c)` answers the same. toString: (KitType) -> string, --- This ordinal less `other`'s. compareTo: (KitType, KitType) -> number, --- Whether `other` is this constant. `==` answers the same. equals: (KitType, any) -> boolean, --- This constant's `getIndex()` value, listed on each constant. getIndex: (KitType) -> number, } export type KitTypeClass = { --- Every constant in ordinal order, as a 1-based array: the same frozen array every `values()` call, so `table.clone` it before changing it. values: () -> {KitType}, --- `valueOf(name)`: the constant named `name`; any other name is an error. valueOf: (string) -> KitType, --- `HEAD`: ordinal 0; `getIndex()` 0. HEAD: KitType, --- `CAPE`: ordinal 1; `getIndex()` 1. CAPE: KitType, --- `AMULET`: ordinal 2; `getIndex()` 2. AMULET: KitType, --- `WEAPON`: ordinal 3; `getIndex()` 3. WEAPON: KitType, --- `TORSO`: ordinal 4; `getIndex()` 4. TORSO: KitType, --- `SHIELD`: ordinal 5; `getIndex()` 5. SHIELD: KitType, --- `ARMS`: ordinal 6; `getIndex()` 6. ARMS: KitType, --- `LEGS`: ordinal 7; `getIndex()` 7. LEGS: KitType, --- `HAIR`: ordinal 8; `getIndex()` 8. HAIR: KitType, --- `HANDS`: ordinal 9; `getIndex()` 9. HANDS: KitType, --- `BOOTS`: ordinal 10; `getIndex()` 10. BOOTS: KitType, --- `JAW`: ordinal 11; `getIndex()` 11. JAW: KitType, } --- `KitType`'s static functions and constants. declare KitType: KitTypeClass --- Enum `InputType`: 5 constants, each one userdata per VM, so `==` is identity and a constant is a table key. `InputType.values()`, `InputType.valueOf(name)`; every constant answers `name()`, `ordinal()` (0-based), `toString()`, `compareTo()` and `equals()`, plus `getType()`. export type InputType = { --- The constant's name as declared. name: (InputType) -> string, --- The constant's 0-based position in `values()`. ordinal: (InputType) -> number, --- `name()`; `tostring(c)` answers the same. toString: (InputType) -> string, --- This ordinal less `other`'s. compareTo: (InputType, InputType) -> number, --- Whether `other` is this constant. `==` answers the same. equals: (InputType, any) -> boolean, --- This constant's `getType()` value, listed on each constant. getType: (InputType) -> number, } export type InputTypeClass = { --- Every constant in ordinal order, as a 1-based array: the same frozen array every `values()` call, so `table.clone` it before changing it. values: () -> {InputType}, --- `valueOf(name)`: the constant named `name`; any other name is an error. valueOf: (string) -> InputType, --- `CLIENT_CHATBOX_PANEL`: ordinal 0; `getType()` -3. Its `name()` and `toString()` are `"CLIENT_CHATBOX_PANEL"`, and `valueOf` takes that name only. CLIENT_CHATBOX_PANEL: InputType, --- `CLIENT`: ordinal 1; `getType()` -2. Its `name()` and `toString()` are `"CLIENT"`, and `valueOf` takes that name only. CLIENT: InputType, --- `NONE`: ordinal 2; `getType()` 0. NONE: InputType, --- `PRIVATE_MESSAGE`: ordinal 3; `getType()` 6. PRIVATE_MESSAGE: InputType, --- `SEARCH`: ordinal 4; `getType()` 11. SEARCH: InputType, } --- `InputType`'s static functions and constants. declare InputType: InputTypeClass --- Enum `ChatColorType`: 2 constants, each one userdata per VM, so `==` is identity and a constant is a table key. `ChatColorType.values()`, `ChatColorType.valueOf(name)`; every constant answers `name()`, `ordinal()` (0-based), `toString()`, `compareTo()` and `equals()`. export type ChatColorType = { --- The constant's name as declared. name: (ChatColorType) -> string, --- The constant's 0-based position in `values()`. ordinal: (ChatColorType) -> number, --- `name()`; `tostring(c)` answers the same. toString: (ChatColorType) -> string, --- This ordinal less `other`'s. compareTo: (ChatColorType, ChatColorType) -> number, --- Whether `other` is this constant. `==` answers the same. equals: (ChatColorType, any) -> boolean, } export type ChatColorTypeClass = { --- Every constant in ordinal order, as a 1-based array: the same frozen array every `values()` call, so `table.clone` it before changing it. values: () -> {ChatColorType}, --- `valueOf(name)`: the constant named `name`; any other name is an error. valueOf: (string) -> ChatColorType, --- `NORMAL`: ordinal 0. NORMAL: ChatColorType, --- `HIGHLIGHT`: ordinal 1. HIGHLIGHT: ChatColorType, } --- `ChatColorType`'s static functions and constants. declare ChatColorType: ChatColorTypeClass --- Enum `FlashNotification`: 5 constants, each one userdata per VM, so `==` is identity and a constant is a table key. `FlashNotification.values()`, `FlashNotification.valueOf(name)`; every constant answers `name()`, `ordinal()` (0-based), `toString()`, `compareTo()` and `equals()`, plus `getType()`. export type FlashNotification = { --- The constant's name as declared. name: (FlashNotification) -> string, --- The constant's 0-based position in `values()`. ordinal: (FlashNotification) -> number, --- This enum's own text for the constant, which can differ from `name()`; `tostring(c)` answers the same. toString: (FlashNotification) -> string, --- This ordinal less `other`'s. compareTo: (FlashNotification, FlashNotification) -> number, --- Whether `other` is this constant. `==` answers the same. equals: (FlashNotification, any) -> boolean, --- This constant's `getType()` value, listed on each constant. getType: (FlashNotification) -> string, } export type FlashNotificationClass = { --- Every constant in ordinal order, as a 1-based array: the same frozen array every `values()` call, so `table.clone` it before changing it. values: () -> {FlashNotification}, --- `valueOf(name)`: the constant named `name`; any other name is an error. valueOf: (string) -> FlashNotification, --- `DISABLED`: ordinal 0; `getType()` "Off". DISABLED: FlashNotification, --- `FLASH_TWO_SECONDS`: ordinal 1; `getType()` "Flash for 2 seconds". FLASH_TWO_SECONDS: FlashNotification, --- `SOLID_TWO_SECONDS`: ordinal 2; `getType()` "Solid for 2 seconds". SOLID_TWO_SECONDS: FlashNotification, --- `FLASH_UNTIL_CANCELLED`: ordinal 3; `getType()` "Flash until cancelled". FLASH_UNTIL_CANCELLED: FlashNotification, --- `SOLID_UNTIL_CANCELLED`: ordinal 4; `getType()` "Solid until cancelled". SOLID_UNTIL_CANCELLED: FlashNotification, } --- `FlashNotification`'s static functions and constants. declare FlashNotification: FlashNotificationClass --- Enum `NotificationSound`: 3 constants, each one userdata per VM, so `==` is identity and a constant is a table key. `NotificationSound.values()`, `NotificationSound.valueOf(name)`; every constant answers `name()`, `ordinal()` (0-based), `toString()`, `compareTo()` and `equals()`, plus `getName()`. export type NotificationSound = { --- The constant's name as declared. name: (NotificationSound) -> string, --- The constant's 0-based position in `values()`. ordinal: (NotificationSound) -> number, --- This enum's own text for the constant, which can differ from `name()`; `tostring(c)` answers the same. toString: (NotificationSound) -> string, --- This ordinal less `other`'s. compareTo: (NotificationSound, NotificationSound) -> number, --- Whether `other` is this constant. `==` answers the same. equals: (NotificationSound, any) -> boolean, --- This constant's `getName()` value, listed on each constant. getName: (NotificationSound) -> string, } export type NotificationSoundClass = { --- Every constant in ordinal order, as a 1-based array: the same frozen array every `values()` call, so `table.clone` it before changing it. values: () -> {NotificationSound}, --- `valueOf(name)`: the constant named `name`; any other name is an error. valueOf: (string) -> NotificationSound, --- `NATIVE`: ordinal 0; `getName()` "Native". NATIVE: NotificationSound, --- `CUSTOM`: ordinal 1; `getName()` "Custom". CUSTOM: NotificationSound, --- `OFF`: ordinal 2; `getName()` "Off". OFF: NotificationSound, } --- `NotificationSound`'s static functions and constants. declare NotificationSound: NotificationSoundClass --- Enum `RequestFocusType`: 4 constants, each one userdata per VM, so `==` is identity and a constant is a table key. `RequestFocusType.values()`, `RequestFocusType.valueOf(name)`; every constant answers `name()`, `ordinal()` (0-based), `toString()`, `compareTo()` and `equals()`. export type RequestFocusType = { --- The constant's name as declared. name: (RequestFocusType) -> string, --- The constant's 0-based position in `values()`. ordinal: (RequestFocusType) -> number, --- `name()`; `tostring(c)` answers the same. toString: (RequestFocusType) -> string, --- This ordinal less `other`'s. compareTo: (RequestFocusType, RequestFocusType) -> number, --- Whether `other` is this constant. `==` answers the same. equals: (RequestFocusType, any) -> boolean, } export type RequestFocusTypeClass = { --- Every constant in ordinal order, as a 1-based array: the same frozen array every `values()` call, so `table.clone` it before changing it. values: () -> {RequestFocusType}, --- `valueOf(name)`: the constant named `name`; any other name is an error. valueOf: (string) -> RequestFocusType, --- `OFF`: ordinal 0. OFF: RequestFocusType, --- `REQUEST`: ordinal 1. REQUEST: RequestFocusType, --- `TASKBAR`: ordinal 2. TASKBAR: RequestFocusType, --- `FORCE`: ordinal 3. FORCE: RequestFocusType, } --- `RequestFocusType`'s static functions and constants. declare RequestFocusType: RequestFocusTypeClass --- Enum `RuneScapeProfileType`: 12 constants, each one userdata per VM, so `==` is identity and a constant is a table key. `RuneScapeProfileType.values()`, `RuneScapeProfileType.valueOf(name)`; every constant answers `name()`, `ordinal()` (0-based), `toString()`, `compareTo()` and `equals()`. export type RuneScapeProfileType = { --- The constant's name as declared. name: (RuneScapeProfileType) -> string, --- The constant's 0-based position in `values()`. ordinal: (RuneScapeProfileType) -> number, --- `name()`; `tostring(c)` answers the same. toString: (RuneScapeProfileType) -> string, --- This ordinal less `other`'s. compareTo: (RuneScapeProfileType, RuneScapeProfileType) -> number, --- Whether `other` is this constant. `==` answers the same. equals: (RuneScapeProfileType, any) -> boolean, } export type RuneScapeProfileTypeClass = { --- Every constant in ordinal order, as a 1-based array: the same frozen array every `values()` call, so `table.clone` it before changing it. values: () -> {RuneScapeProfileType}, --- `valueOf(name)`: the constant named `name`; any other name is an error. valueOf: (string) -> RuneScapeProfileType, --- The profile type of the world the client is on: the last constant whose test the world's types pass (`BETA` on a beta or no-save world, `QUEST_SPEEDRUNNING`, `DEADMAN`, `PVP_ARENA` on their world types, `DEMONIC_PACTS_LEAGUE` on a seasonal one; the retired leagues never), else `STANDARD`. Pass the `client` global; it reads the running callback's client. getCurrent: (Client) -> RuneScapeProfileType, --- `STANDARD`: ordinal 0. STANDARD: RuneScapeProfileType, --- `BETA`: ordinal 1. BETA: RuneScapeProfileType, --- `QUEST_SPEEDRUNNING`: ordinal 2. QUEST_SPEEDRUNNING: RuneScapeProfileType, --- `DEADMAN`: ordinal 3. DEADMAN: RuneScapeProfileType, --- `PVP_ARENA`: ordinal 4. PVP_ARENA: RuneScapeProfileType, --- `TRAILBLAZER_LEAGUE`: ordinal 5. TRAILBLAZER_LEAGUE: RuneScapeProfileType, --- `DEADMAN_REBORN`: ordinal 6. DEADMAN_REBORN: RuneScapeProfileType, --- `SHATTERED_RELICS_LEAGUE`: ordinal 7. SHATTERED_RELICS_LEAGUE: RuneScapeProfileType, --- `TRAILBLAZER_RELOADED_LEAGUE`: ordinal 8. TRAILBLAZER_RELOADED_LEAGUE: RuneScapeProfileType, --- `RAGING_ECHOES_LEAGUE`: ordinal 9. RAGING_ECHOES_LEAGUE: RuneScapeProfileType, --- `GRID_MASTER`: ordinal 10. GRID_MASTER: RuneScapeProfileType, --- `DEMONIC_PACTS_LEAGUE`: ordinal 11. DEMONIC_PACTS_LEAGUE: RuneScapeProfileType, } --- `RuneScapeProfileType`'s static functions and constants. declare RuneScapeProfileType: RuneScapeProfileTypeClass --- Enum `AgilityShortcut`: 251 constants, each one userdata per VM, so `==` is identity and a constant is a table key. `AgilityShortcut.values()`, `AgilityShortcut.valueOf(name)`; every constant answers `name()`, `ordinal()` (0-based), `toString()`, `compareTo()` and `equals()`, plus `getDescription()`, `getLevel()`, `getObstacleIds()`, `getTooltip()`, `getWorldLocation()`, `getWorldMapLocation()`. export type AgilityShortcut = { --- The constant's name as declared. name: (AgilityShortcut) -> string, --- The constant's 0-based position in `values()`. ordinal: (AgilityShortcut) -> number, --- `name()`; `tostring(c)` answers the same. toString: (AgilityShortcut) -> string, --- This ordinal less `other`'s. compareTo: (AgilityShortcut, AgilityShortcut) -> number, --- Whether `other` is this constant. `==` answers the same. equals: (AgilityShortcut, any) -> boolean, --- This constant's `getDescription()` value, listed on each constant. getDescription: (AgilityShortcut) -> string, --- This constant's `getLevel()` value, listed on each constant. getLevel: (AgilityShortcut) -> number, --- This constant's `getObstacleIds()` value, listed on each constant. getObstacleIds: (AgilityShortcut) -> {number}, --- This constant's `getTooltip()` value, listed on each constant. getTooltip: (AgilityShortcut) -> string, --- This constant's `getWorldLocation()` value, listed on each constant. getWorldLocation: (AgilityShortcut) -> WorldPoint?, --- This constant's `getWorldMapLocation()` value, listed on each constant. getWorldMapLocation: (AgilityShortcut) -> WorldPoint?, --- Whether this shortcut's obstacle is usable as the game stands: `true` by default (the id match is the caller's, through `getObstacleIds()`); seven constants check a varbit, a quest's state, a multiloc's current form or the window's tile. Pass the `client` global. matches: (AgilityShortcut, Client, TileObject) -> boolean, } export type AgilityShortcutClass = { --- Every constant in ordinal order, as a 1-based array: the same frozen array every `values()` call, so `table.clone` it before changing it. values: () -> {AgilityShortcut}, --- `valueOf(name)`: the constant named `name`; any other name is an error. valueOf: (string) -> AgilityShortcut, --- `GENERIC_SHORTCUT`: ordinal 0; `getDescription()` "Shortcut", `getLevel()` 1, `getObstacleIds()` {3790, 3791, 29993, 30938, 30939, 30940, 30941, 30606, 30198, 12982, 2830, 2831, 5948, 5949, 6673, 16115, 2618, 51, 30959, 30966, 30766, 30767, 30964, 30962, 30960, 30961, 2186, 993, 8729, 31485, 19846, 19847, 18416, 3522, 2959, 2960, 2961, 2962, 2963, 2964, 54720, 54721, 54722}, `getTooltip()` "Shortcut - Level 1", `getWorldLocation()` nil, `getWorldMapLocation()` nil. GENERIC_SHORTCUT: AgilityShortcut, --- `WEISS_BROKEN_FENCE`: ordinal 1; `getDescription()` "Shortcut", `getLevel()` 1, `getObstacleIds()` {46815}, `getTooltip()` "Shortcut - Level 1", `getWorldLocation()` nil, `getWorldMapLocation()` nil. WEISS_BROKEN_FENCE: AgilityShortcut, --- `BRIMHAVEN_DUNGEON_MEDIUM_PIPE_RETURN`: ordinal 2; `getDescription()` "Pipe Squeeze", `getLevel()` 1, `getObstacleIds()` {21727}, `getTooltip()` "Pipe Squeeze - Level 1", `getWorldLocation()` WorldPoint.new(2698, 9491, 0), `getWorldMapLocation()` nil. BRIMHAVEN_DUNGEON_MEDIUM_PIPE_RETURN: AgilityShortcut, --- `BRIMHAVEN_DUNGEON_PIPE_RETURN`: ordinal 3; `getDescription()` "Pipe Squeeze", `getLevel()` 1, `getObstacleIds()` {21728}, `getTooltip()` "Pipe Squeeze - Level 1", `getWorldLocation()` WorldPoint.new(2655, 9573, 0), `getWorldMapLocation()` nil. BRIMHAVEN_DUNGEON_PIPE_RETURN: AgilityShortcut, --- `BRIMHAVEN_DUNGEON_STEPPING_STONES_RETURN`: ordinal 4; `getDescription()` "Pipe Squeeze", `getLevel()` 1, `getObstacleIds()` {21739}, `getTooltip()` "Pipe Squeeze - Level 1", `getWorldLocation()` nil, `getWorldMapLocation()` nil. BRIMHAVEN_DUNGEON_STEPPING_STONES_RETURN: AgilityShortcut, --- `BRIMHAVEN_DUNGEON_LOG_BALANCE_RETURN`: ordinal 5; `getDescription()` "Log Balance", `getLevel()` 1, `getObstacleIds()` {20884}, `getTooltip()` "Log Balance - Level 1", `getWorldLocation()` nil, `getWorldMapLocation()` nil. BRIMHAVEN_DUNGEON_LOG_BALANCE_RETURN: AgilityShortcut, --- `AGILITY_PYRAMID_ROCKS_WEST`: ordinal 6; `getDescription()` "Rocks", `getLevel()` 1, `getObstacleIds()` {11948}, `getTooltip()` "Rocks - Level 1", `getWorldLocation()` nil, `getWorldMapLocation()` nil. AGILITY_PYRAMID_ROCKS_WEST: AgilityShortcut, --- `CAIRN_ISLE_CLIMBING_ROCKS`: ordinal 7; `getDescription()` "Rocks", `getLevel()` 1, `getObstacleIds()` {2236}, `getTooltip()` "Rocks - Level 1", `getWorldLocation()` nil, `getWorldMapLocation()` nil. CAIRN_ISLE_CLIMBING_ROCKS: AgilityShortcut, --- `KARAMJA_GLIDER_LOG`: ordinal 8; `getDescription()` "Log Balance", `getLevel()` 1, `getObstacleIds()` {23644}, `getTooltip()` "Log Balance - Level 1", `getWorldLocation()` WorldPoint.new(2906, 3050, 0), `getWorldMapLocation()` WorldPoint.new(2906, 3050, 0). KARAMJA_GLIDER_LOG: AgilityShortcut, --- `FALADOR_CRUMBLING_WALL`: ordinal 9; `getDescription()` "Crumbling Wall", `getLevel()` 5, `getObstacleIds()` {24222}, `getTooltip()` "Crumbling Wall - Level 5", `getWorldLocation()` WorldPoint.new(2936, 3357, 0), `getWorldMapLocation()` WorldPoint.new(2936, 3357, 0). FALADOR_CRUMBLING_WALL: AgilityShortcut, --- `YANILLE_CLIMBING_ROCKS`: ordinal 10; `getDescription()` "Climbing rocks", `getLevel()` 5, `getObstacleIds()` {23543}, `getTooltip()` "Climbing rocks - Level 5", `getWorldLocation()` nil, `getWorldMapLocation()` nil. YANILLE_CLIMBING_ROCKS: AgilityShortcut, --- `RIVER_LUM_GRAPPLE_WEST`: ordinal 11; `getDescription()` "Grapple Broken Raft", `getLevel()` 8, `getObstacleIds()` {17068}, `getTooltip()` "Grapple Broken Raft - Level 8", `getWorldLocation()` WorldPoint.new(3245, 3179, 0), `getWorldMapLocation()` WorldPoint.new(3245, 3179, 0). RIVER_LUM_GRAPPLE_WEST: AgilityShortcut, --- `RIVER_LUM_GRAPPLE_EAST`: ordinal 12; `getDescription()` "Grapple Broken Raft", `getLevel()` 8, `getObstacleIds()` {17068}, `getTooltip()` "Grapple Broken Raft - Level 8", `getWorldLocation()` WorldPoint.new(3258, 3179, 0), `getWorldMapLocation()` WorldPoint.new(3258, 3179, 0). RIVER_LUM_GRAPPLE_EAST: AgilityShortcut, --- `CORSAIR_COVE_ROCKS`: ordinal 13; `getDescription()` "Rocks", `getLevel()` 10, `getObstacleIds()` {31757}, `getTooltip()` "Rocks - Level 10", `getWorldLocation()` WorldPoint.new(2545, 2871, 0), `getWorldMapLocation()` WorldPoint.new(2545, 2871, 0). CORSAIR_COVE_ROCKS: AgilityShortcut, --- `KARAMJA_MOSS_GIANT_SWING`: ordinal 14; `getDescription()` "Rope", `getLevel()` 10, `getObstacleIds()` {23568, 23569}, `getTooltip()` "Rope - Level 10", `getWorldLocation()` nil, `getWorldMapLocation()` nil. KARAMJA_MOSS_GIANT_SWING: AgilityShortcut, --- `FALADOR_GRAPPLE_WALL`: ordinal 15; `getDescription()` "Grapple Wall", `getLevel()` 11, `getObstacleIds()` {17049, 17050, 17051, 17052}, `getTooltip()` "Grapple Wall - Level 11", `getWorldLocation()` WorldPoint.new(3031, 3391, 0), `getWorldMapLocation()` WorldPoint.new(3031, 3391, 0). FALADOR_GRAPPLE_WALL: AgilityShortcut, --- `BRIMHAVEN_DUNGEON_STEPPING_STONES`: ordinal 16; `getDescription()` "Stepping Stones", `getLevel()` 12, `getObstacleIds()` {21738}, `getTooltip()` "Stepping Stones - Level 12", `getWorldLocation()` nil, `getWorldMapLocation()` nil. BRIMHAVEN_DUNGEON_STEPPING_STONES: AgilityShortcut, --- `VARROCK_SOUTH_FENCE`: ordinal 17; `getDescription()` "Fence", `getLevel()` 13, `getObstacleIds()` {16518}, `getTooltip()` "Fence - Level 13", `getWorldLocation()` WorldPoint.new(3239, 3334, 0), `getWorldMapLocation()` WorldPoint.new(3239, 3334, 0). VARROCK_SOUTH_FENCE: AgilityShortcut, --- `GOBLIN_VILLAGE_WALL`: ordinal 18; `getDescription()` "Wall", `getLevel()` 14, `getObstacleIds()` {16468}, `getTooltip()` "Wall - Level 14", `getWorldLocation()` WorldPoint.new(2925, 3523, 0), `getWorldMapLocation()` WorldPoint.new(2925, 3523, 0). GOBLIN_VILLAGE_WALL: AgilityShortcut, --- `CORSAIR_COVE_DUNGEON_PILLAR`: ordinal 19; `getDescription()` "Pillar Jump", `getLevel()` 15, `getObstacleIds()` {31809}, `getTooltip()` "Pillar Jump - Level 15", `getWorldLocation()` WorldPoint.new(1980, 8996, 0), `getWorldMapLocation()` WorldPoint.new(1980, 8996, 0). CORSAIR_COVE_DUNGEON_PILLAR: AgilityShortcut, --- `EDGEVILLE_DUNGEON_MONKEYBARS`: ordinal 20; `getDescription()` "Monkey Bars", `getLevel()` 15, `getObstacleIds()` {23566}, `getTooltip()` "Monkey Bars - Level 15", `getWorldLocation()` nil, `getWorldMapLocation()` nil. EDGEVILLE_DUNGEON_MONKEYBARS: AgilityShortcut, --- `TROLLHEIM_ROCKS`: ordinal 21; `getDescription()` "Rocks", `getLevel()` 15, `getObstacleIds()` {3748}, `getTooltip()` "Rocks - Level 15", `getWorldLocation()` nil, `getWorldMapLocation()` nil. TROLLHEIM_ROCKS: AgilityShortcut, --- `TROLLHEIM_CLIFF_SCRAMBLE_NORTHWEST_SOUTH`: ordinal 22; `getDescription()` "Rocks", `getLevel()` 15, `getObstacleIds()` {3803, 3804}, `getTooltip()` "Rocks - Level 15", `getWorldLocation()` WorldPoint.new(2886, 3684, 0), `getWorldMapLocation()` WorldPoint.new(2886, 3684, 0). TROLLHEIM_CLIFF_SCRAMBLE_NORTHWEST_SOUTH: AgilityShortcut, --- `YANILLE_UNDERWALL_TUNNEL`: ordinal 23; `getDescription()` "Underwall Tunnel", `getLevel()` 16, `getObstacleIds()` {16520, 16519}, `getTooltip()` "Underwall Tunnel - Level 16", `getWorldLocation()` WorldPoint.new(2574, 3109, 0), `getWorldMapLocation()` WorldPoint.new(2574, 3109, 0). YANILLE_UNDERWALL_TUNNEL: AgilityShortcut, --- `KOUREND_CATACOMBS_SOUTH_WEST_CRACK_NORTH`: ordinal 24; `getDescription()` "Crack", `getLevel()` 17, `getObstacleIds()` {28892}, `getTooltip()` "Crack - Level 17", `getWorldLocation()` WorldPoint.new(1647, 10008, 0), `getWorldMapLocation()` WorldPoint.new(1647, 10008, 0). KOUREND_CATACOMBS_SOUTH_WEST_CRACK_NORTH: AgilityShortcut, --- `KOUREND_CATACOMBS_SOUTH_WEST_CRACK_SOUTH`: ordinal 25; `getDescription()` "Crack", `getLevel()` 17, `getObstacleIds()` {28892}, `getTooltip()` "Crack - Level 17", `getWorldLocation()` WorldPoint.new(1645, 10001, 0), `getWorldMapLocation()` WorldPoint.new(1645, 10001, 0). KOUREND_CATACOMBS_SOUTH_WEST_CRACK_SOUTH: AgilityShortcut, --- `CRABCLAW_CAVES_CREVICE`: ordinal 26; `getDescription()` "Crevice", `getLevel()` 18, `getObstacleIds()` {31695, 31696}, `getTooltip()` "Crevice - Level 18", `getWorldLocation()` WorldPoint.new(1710, 9822, 0), `getWorldMapLocation()` WorldPoint.new(1710, 9822, 0). CRABCLAW_CAVES_CREVICE: AgilityShortcut, --- `CRABCLAW_CAVES_ROCKS`: ordinal 27; `getDescription()` "Rocks", `getLevel()` 18, `getObstacleIds()` {31697}, `getTooltip()` "Rocks - Level 18", `getWorldLocation()` WorldPoint.new(1687, 9802, 0), `getWorldMapLocation()` WorldPoint.new(1687, 9802, 0). CRABCLAW_CAVES_ROCKS: AgilityShortcut, --- `CRABCLAW_CAVES_STEPPING_STONES`: ordinal 28; `getDescription()` "Stepping Stones", `getLevel()` 18, `getObstacleIds()` {31699}, `getTooltip()` "Stepping Stones - Level 18", `getWorldLocation()` WorldPoint.new(1704, 9800, 0), `getWorldMapLocation()` WorldPoint.new(1704, 9800, 0). CRABCLAW_CAVES_STEPPING_STONES: AgilityShortcut, --- `SLAYER_TOWER_GROUND_WINDOW`: ordinal 29; `getDescription()` "Window", `getLevel()` 18, `getObstacleIds()` {57679}, `getTooltip()` "Window - Level 18", `getWorldLocation()` WorldPoint.new(3442, 3532, 0), `getWorldMapLocation()` WorldPoint.new(3442, 3532, 0). SLAYER_TOWER_GROUND_WINDOW: AgilityShortcut, --- `YANILLE_WATCHTOWER_TRELLIS`: ordinal 30; `getDescription()` "Trellis", `getLevel()` 18, `getObstacleIds()` {20056}, `getTooltip()` "Trellis - Level 18", `getWorldLocation()` nil, `getWorldMapLocation()` nil. YANILLE_WATCHTOWER_TRELLIS: AgilityShortcut, --- `COAL_TRUCKS_LOG_BALANCE`: ordinal 31; `getDescription()` "Log Balance", `getLevel()` 20, `getObstacleIds()` {23274}, `getTooltip()` "Log Balance - Level 20", `getWorldLocation()` WorldPoint.new(2598, 3475, 0), `getWorldMapLocation()` WorldPoint.new(2598, 3475, 0). COAL_TRUCKS_LOG_BALANCE: AgilityShortcut, --- `GRAND_EXCHANGE_UNDERWALL_TUNNEL`: ordinal 32; `getDescription()` "Underwall Tunnel", `getLevel()` 21, `getObstacleIds()` {16529, 16530}, `getTooltip()` "Underwall Tunnel - Level 21", `getWorldLocation()` WorldPoint.new(3139, 3515, 0), `getWorldMapLocation()` WorldPoint.new(3139, 3515, 0). GRAND_EXCHANGE_UNDERWALL_TUNNEL: AgilityShortcut, --- `BRIMHAVEN_DUNGEON_PIPE`: ordinal 33; `getDescription()` "Pipe Squeeze", `getLevel()` 22, `getObstacleIds()` {21728}, `getTooltip()` "Pipe Squeeze - Level 22", `getWorldLocation()` WorldPoint.new(2654, 9569, 0), `getWorldMapLocation()` WorldPoint.new(2654, 9569, 0). BRIMHAVEN_DUNGEON_PIPE: AgilityShortcut, --- `OBSERVATORY_SCALE_CLIFF`: ordinal 34; `getDescription()` "Grapple Rocks", `getLevel()` 23, `getObstacleIds()` {31849, 31852}, `getTooltip()` "Grapple Rocks - Level 23", `getWorldLocation()` WorldPoint.new(2447, 3155, 0), `getWorldMapLocation()` WorldPoint.new(2447, 3155, 0). OBSERVATORY_SCALE_CLIFF: AgilityShortcut, --- `NEMUS_RETREAT_WALL_SOUTH_EAST`: ordinal 35; `getDescription()` "Broken Wall", `getLevel()` 24, `getObstacleIds()` {56996}, `getTooltip()` "Broken Wall - Level 24", `getWorldLocation()` WorldPoint.new(1386, 3302, 0), `getWorldMapLocation()` WorldPoint.new(1386, 3302, 0). NEMUS_RETREAT_WALL_SOUTH_EAST: AgilityShortcut, --- `NEMUS_RETREAT_WALL_SOUTH_WEST`: ordinal 36; `getDescription()` "Broken Wall", `getLevel()` 24, `getObstacleIds()` {56996}, `getTooltip()` "Broken Wall - Level 24", `getWorldLocation()` WorldPoint.new(1368, 3295, 0), `getWorldMapLocation()` WorldPoint.new(1368, 3295, 0). NEMUS_RETREAT_WALL_SOUTH_WEST: AgilityShortcut, --- `NEMUS_RETREAT_WALL_EAST`: ordinal 37; `getDescription()` "Broken Wall", `getLevel()` 24, `getObstacleIds()` {56997}, `getTooltip()` "Broken Wall - Level 24", `getWorldLocation()` WorldPoint.new(1389, 3309, 0), `getWorldMapLocation()` WorldPoint.new(1389, 3309, 0). NEMUS_RETREAT_WALL_EAST: AgilityShortcut, --- `EAGLES_PEAK_ROCK_CLIMB`: ordinal 38; `getDescription()` "Rock Climb", `getLevel()` 25, `getObstacleIds()` {19849}, `getTooltip()` "Rock Climb - Level 25", `getWorldLocation()` WorldPoint.new(2320, 3499, 0), `getWorldMapLocation()` WorldPoint.new(2320, 3499, 0). EAGLES_PEAK_ROCK_CLIMB: AgilityShortcut, --- `BURGH_AGILITY_SHORTCUT_FENCE`: ordinal 39; `getDescription()` "Broken Fence", `getLevel()` 25, `getObstacleIds()` {12776}, `getTooltip()` "Broken Fence - Level 25", `getWorldLocation()` WorldPoint.new(3470, 3219, 0), `getWorldMapLocation()` WorldPoint.new(3470, 3219, 0). BURGH_AGILITY_SHORTCUT_FENCE: AgilityShortcut, --- `FALADOR_UNDERWALL_TUNNEL`: ordinal 40; `getDescription()` "Underwall Tunnel", `getLevel()` 26, `getObstacleIds()` {16527, 16528}, `getTooltip()` "Underwall Tunnel - Level 26", `getWorldLocation()` WorldPoint.new(2947, 3313, 0), `getWorldMapLocation()` WorldPoint.new(2947, 3313, 0). FALADOR_UNDERWALL_TUNNEL: AgilityShortcut, --- `KOUREND_CATACOMBS_STONES_NORTH`: ordinal 41; `getDescription()` "Stones", `getLevel()` 28, `getObstacleIds()` {28893}, `getTooltip()` "Stones - Level 28", `getWorldLocation()` WorldPoint.new(1613, 10071, 0), `getWorldMapLocation()` WorldPoint.new(1613, 10071, 0). KOUREND_CATACOMBS_STONES_NORTH: AgilityShortcut, --- `KOUREND_CATACOMBS_STONES_SOUTH`: ordinal 42; `getDescription()` "Stones", `getLevel()` 28, `getObstacleIds()` {28893}, `getTooltip()` "Stones - Level 28", `getWorldLocation()` WorldPoint.new(1609, 10060, 0), `getWorldMapLocation()` WorldPoint.new(1609, 10060, 0). KOUREND_CATACOMBS_STONES_SOUTH: AgilityShortcut, --- `MOUNT_KARUULM_LOWER`: ordinal 43; `getDescription()` "Rocks", `getLevel()` 29, `getObstacleIds()` {34397}, `getTooltip()` "Rocks - Level 29", `getWorldLocation()` WorldPoint.new(1324, 3782, 0), `getWorldMapLocation()` WorldPoint.new(1324, 3782, 0). MOUNT_KARUULM_LOWER: AgilityShortcut, --- `CORSAIR_COVE_RESOURCE_ROCKS`: ordinal 44; `getDescription()` "Rocks", `getLevel()` 30, `getObstacleIds()` {31758, 31759}, `getTooltip()` "Rocks - Level 30", `getWorldLocation()` WorldPoint.new(2486, 2898, 0), `getWorldMapLocation()` WorldPoint.new(2486, 2898, 0). CORSAIR_COVE_RESOURCE_ROCKS: AgilityShortcut, --- `SOUTHEAST_KARAMJA_STEPPING_STONES`: ordinal 45; `getDescription()` "Stepping Stones", `getLevel()` 30, `getObstacleIds()` {23645, 23646, 23647}, `getTooltip()` "Stepping Stones - Level 30", `getWorldLocation()` WorldPoint.new(2924, 2946, 0), `getWorldMapLocation()` WorldPoint.new(2924, 2946, 0). SOUTHEAST_KARAMJA_STEPPING_STONES: AgilityShortcut, --- `BRIMHAVEN_DUNGEON_LOG_BALANCE`: ordinal 46; `getDescription()` "Log Balance", `getLevel()` 30, `getObstacleIds()` {20882}, `getTooltip()` "Log Balance - Level 30", `getWorldLocation()` nil, `getWorldMapLocation()` nil. BRIMHAVEN_DUNGEON_LOG_BALANCE: AgilityShortcut, --- `AGILITY_PYRAMID_ROCKS_EAST`: ordinal 47; `getDescription()` "Rocks", `getLevel()` 30, `getObstacleIds()` {11949}, `getTooltip()` "Rocks - Level 30", `getWorldLocation()` nil, `getWorldMapLocation()` nil. AGILITY_PYRAMID_ROCKS_EAST: AgilityShortcut, --- `DRAYNOR_MANOR_STEPPING_STONES`: ordinal 48; `getDescription()` "Stepping Stones", `getLevel()` 31, `getObstacleIds()` {16533}, `getTooltip()` "Stepping Stones - Level 31", `getWorldLocation()` WorldPoint.new(3150, 3362, 0), `getWorldMapLocation()` WorldPoint.new(3150, 3362, 0). DRAYNOR_MANOR_STEPPING_STONES: AgilityShortcut, --- `CATHERBY_CLIFFSIDE_GRAPPLE`: ordinal 49; `getDescription()` "Grapple Rock", `getLevel()` 32, `getObstacleIds()` {17042}, `getTooltip()` "Grapple Rock - Level 32", `getWorldLocation()` WorldPoint.new(2868, 3429, 0), `getWorldMapLocation()` WorldPoint.new(2868, 3429, 0). CATHERBY_CLIFFSIDE_GRAPPLE: AgilityShortcut, --- `CAIRN_ISLE_ROCKS`: ordinal 50; `getDescription()` "Rocks", `getLevel()` 32, `getObstacleIds()` {2231}, `getTooltip()` "Rocks - Level 32", `getWorldLocation()` nil, `getWorldMapLocation()` nil. CAIRN_ISLE_ROCKS: AgilityShortcut, --- `SHILO_VILLAGE_STEPPING_STONES`: ordinal 51; `getDescription()` "Stepping Stones", `getLevel()` 32, `getObstacleIds()` {16466}, `getTooltip()` "Stepping Stones - Level 32", `getWorldLocation()` WorldPoint.new(2863, 2974, 0), `getWorldMapLocation()` WorldPoint.new(2863, 2974, 0). SHILO_VILLAGE_STEPPING_STONES: AgilityShortcut, --- `ARDOUGNE_LOG_BALANCE`: ordinal 52; `getDescription()` "Log Balance", `getLevel()` 33, `getObstacleIds()` {16546, 16547, 16548}, `getTooltip()` "Log Balance - Level 33", `getWorldLocation()` WorldPoint.new(2602, 3336, 0), `getWorldMapLocation()` WorldPoint.new(2602, 3336, 0). ARDOUGNE_LOG_BALANCE: AgilityShortcut, --- `NEMUS_RETREAT_TUNNEL`: ordinal 53; `getDescription()` "Tunnel", `getLevel()` 33, `getObstacleIds()` {56989}, `getTooltip()` "Tunnel - Level 33", `getWorldLocation()` WorldPoint.new(1367, 3325, 0), `getWorldMapLocation()` WorldPoint.new(1367, 3325, 0). NEMUS_RETREAT_TUNNEL: AgilityShortcut, --- `BRIMHAVEN_DUNGEON_MEDIUM_PIPE`: ordinal 54; `getDescription()` "Pipe Squeeze", `getLevel()` 34, `getObstacleIds()` {21727}, `getTooltip()` "Pipe Squeeze - Level 34", `getWorldLocation()` WorldPoint.new(2698, 9501, 0), `getWorldMapLocation()` nil. BRIMHAVEN_DUNGEON_MEDIUM_PIPE: AgilityShortcut, --- `KOUREND_CATACOMBS_NORTH_EAST_CRACK_NORTH`: ordinal 55; `getDescription()` "Crack", `getLevel()` 34, `getObstacleIds()` {28892}, `getTooltip()` "Crack - Level 34", `getWorldLocation()` WorldPoint.new(1715, 10057, 0), `getWorldMapLocation()` WorldPoint.new(1715, 10057, 0). KOUREND_CATACOMBS_NORTH_EAST_CRACK_NORTH: AgilityShortcut, --- `KOUREND_CATACOMBS_NORTH_EAST_CRACK_SOUTH`: ordinal 56; `getDescription()` "Crack", `getLevel()` 34, `getObstacleIds()` {28892}, `getTooltip()` "Crack - Level 34", `getWorldLocation()` WorldPoint.new(1705, 10077, 0), `getWorldMapLocation()` WorldPoint.new(1705, 10077, 0). KOUREND_CATACOMBS_NORTH_EAST_CRACK_SOUTH: AgilityShortcut, --- `VARROCK_CASTLE_GARDEN_TRELLIS`: ordinal 57; `getDescription()` "Trellis", `getLevel()` 35, `getObstacleIds()` {2149}, `getTooltip()` "Trellis - Level 35", `getWorldLocation()` WorldPoint.new(3227, 3471, 0), `getWorldMapLocation()` WorldPoint.new(3227, 3471, 0). VARROCK_CASTLE_GARDEN_TRELLIS: AgilityShortcut, --- `CATHERBY_OBELISK_GRAPPLE`: ordinal 58; `getDescription()` "Grapple Rock", `getLevel()` 36, `getObstacleIds()` {17062}, `getTooltip()` "Grapple Rock - Level 36", `getWorldLocation()` WorldPoint.new(2840, 3435, 0), `getWorldMapLocation()` WorldPoint.new(2840, 3435, 0). CATHERBY_OBELISK_GRAPPLE: AgilityShortcut, --- `NEMUS_RETREAT_STEPPING_STONES`: ordinal 59; `getDescription()` "Stepping Stones", `getLevel()` 36, `getObstacleIds()` {56988}, `getTooltip()` "Stepping Stones - Level 36", `getWorldLocation()` WorldPoint.new(1395, 3309, 0), `getWorldMapLocation()` WorldPoint.new(1395, 3309, 0). NEMUS_RETREAT_STEPPING_STONES: AgilityShortcut, --- `GNOME_STRONGHOLD_ROCKS`: ordinal 60; `getDescription()` "Rocks", `getLevel()` 37, `getObstacleIds()` {16534, 16535}, `getTooltip()` "Rocks - Level 37", `getWorldLocation()` WorldPoint.new(2485, 3515, 0), `getWorldMapLocation()` WorldPoint.new(2485, 3515, 0). GNOME_STRONGHOLD_ROCKS: AgilityShortcut, --- `AL_KHARID_MINING_PITCLIFF_SCRAMBLE`: ordinal 61; `getDescription()` "Rocks", `getLevel()` 38, `getObstacleIds()` {16549, 16550}, `getTooltip()` "Rocks - Level 38", `getWorldLocation()` WorldPoint.new(3305, 3315, 0), `getWorldMapLocation()` WorldPoint.new(3305, 3315, 0). AL_KHARID_MINING_PITCLIFF_SCRAMBLE: AgilityShortcut, --- `YANILLE_WALL_GRAPPLE`: ordinal 62; `getDescription()` "Grapple Wall", `getLevel()` 39, `getObstacleIds()` {17047, 17048}, `getTooltip()` "Grapple Wall - Level 39", `getWorldLocation()` WorldPoint.new(2552, 3072, 0), `getWorldMapLocation()` WorldPoint.new(2552, 3072, 0). YANILLE_WALL_GRAPPLE: AgilityShortcut, --- `NEITIZNOT_BRIDGE_REPAIR`: ordinal 63; `getDescription()` "Bridge Repair - Quest", `getLevel()` 0, `getObstacleIds()` {21306, 21307}, `getTooltip()` "Bridge Repair - Quest - Level 0", `getWorldLocation()` WorldPoint.new(2315, 3828, 0), `getWorldMapLocation()` WorldPoint.new(2315, 3828, 0). NEITIZNOT_BRIDGE_REPAIR: AgilityShortcut, --- `NEITIZNOT_BRIDGE_SOUTHEAST`: ordinal 64; `getDescription()` "Rope Bridge", `getLevel()` 0, `getObstacleIds()` {21308, 21309}, `getTooltip()` "Rope Bridge - Level 0", `getWorldLocation()` nil, `getWorldMapLocation()` nil. NEITIZNOT_BRIDGE_SOUTHEAST: AgilityShortcut, --- `NEITIZNOT_BRIDGE_NORTHWEST`: ordinal 65; `getDescription()` "Rope Bridge", `getLevel()` 0, `getObstacleIds()` {21310, 21311}, `getTooltip()` "Rope Bridge - Level 0", `getWorldLocation()` nil, `getWorldMapLocation()` nil. NEITIZNOT_BRIDGE_NORTHWEST: AgilityShortcut, --- `NEITIZNOT_BRIDGE_NORTH`: ordinal 66; `getDescription()` "Rope Bridge", `getLevel()` 0, `getObstacleIds()` {21312, 21313}, `getTooltip()` "Rope Bridge - Level 0", `getWorldLocation()` nil, `getWorldMapLocation()` nil. NEITIZNOT_BRIDGE_NORTH: AgilityShortcut, --- `NEITIZNOT_BRIDGE_NORTHEAST`: ordinal 67; `getDescription()` "Broken Rope bridge", `getLevel()` 40, `getObstacleIds()` {21314, 21315}, `getTooltip()` "Broken Rope bridge - Level 40", `getWorldLocation()` nil, `getWorldMapLocation()` nil. NEITIZNOT_BRIDGE_NORTHEAST: AgilityShortcut, --- `KOUREND_LAKE_JUMP_EAST`: ordinal 68; `getDescription()` "Stepping Stones", `getLevel()` 40, `getObstacleIds()` {29729, 29730}, `getTooltip()` "Stepping Stones - Level 40", `getWorldLocation()` WorldPoint.new(1612, 3570, 0), `getWorldMapLocation()` WorldPoint.new(1612, 3570, 0). KOUREND_LAKE_JUMP_EAST: AgilityShortcut, --- `KOUREND_LAKE_JUMP_WEST`: ordinal 69; `getDescription()` "Stepping Stones", `getLevel()` 40, `getObstacleIds()` {29729, 29730}, `getTooltip()` "Stepping Stones - Level 40", `getWorldLocation()` WorldPoint.new(1604, 3572, 0), `getWorldMapLocation()` WorldPoint.new(1604, 3572, 0). KOUREND_LAKE_JUMP_WEST: AgilityShortcut, --- `TLATI_RAINFORST_BALANCE`: ordinal 70; `getDescription()` "Log Balance", `getLevel()` 40, `getObstacleIds()` {57593}, `getTooltip()` "Log Balance - Level 40", `getWorldLocation()` WorldPoint.new(1283, 3144, 0), `getWorldMapLocation()` WorldPoint.new(1283, 3144, 0). TLATI_RAINFORST_BALANCE: AgilityShortcut, --- `YANILLE_DUNGEON_BALANCE`: ordinal 71; `getDescription()` "Balancing Ledge", `getLevel()` 40, `getObstacleIds()` {23548}, `getTooltip()` "Balancing Ledge - Level 40", `getWorldLocation()` nil, `getWorldMapLocation()` nil. YANILLE_DUNGEON_BALANCE: AgilityShortcut, --- `AUBURNVALE_ROCK_SCRAMBLE`: ordinal 72; `getDescription()` "Rocks", `getLevel()` 41, `getObstacleIds()` {56994}, `getTooltip()` "Rocks - Level 41", `getWorldLocation()` WorldPoint.new(1393, 3322, 0), `getWorldMapLocation()` WorldPoint.new(1393, 3322, 0). AUBURNVALE_ROCK_SCRAMBLE: AgilityShortcut, --- `TROLLHEIM_EASY_CLIFF_SCRAMBLE`: ordinal 73; `getDescription()` "Rocks", `getLevel()` 41, `getObstacleIds()` {16521}, `getTooltip()` "Rocks - Level 41", `getWorldLocation()` WorldPoint.new(2869, 3670, 0), `getWorldMapLocation()` WorldPoint.new(2869, 3670, 0). TROLLHEIM_EASY_CLIFF_SCRAMBLE: AgilityShortcut, --- `DWARVEN_MINE_NARROW_CREVICE`: ordinal 74; `getDescription()` "Narrow Crevice", `getLevel()` 42, `getObstacleIds()` {16543}, `getTooltip()` "Narrow Crevice - Level 42", `getWorldLocation()` WorldPoint.new(3034, 9806, 0), `getWorldMapLocation()` WorldPoint.new(3034, 9806, 0). DWARVEN_MINE_NARROW_CREVICE: AgilityShortcut, --- `DRAYNOR_UNDERWALL_TUNNEL`: ordinal 75; `getDescription()` "Underwall Tunnel", `getLevel()` 42, `getObstacleIds()` {19032, 19036}, `getTooltip()` "Underwall Tunnel - Level 42", `getWorldLocation()` WorldPoint.new(3068, 3261, 0), `getWorldMapLocation()` WorldPoint.new(3068, 3261, 0). DRAYNOR_UNDERWALL_TUNNEL: AgilityShortcut, --- `TROLLHEIM_MEDIUM_CLIFF_SCRAMBLE_SOUTHWEST`: ordinal 76; `getDescription()` "Rocks", `getLevel()` 43, `getObstacleIds()` {16522}, `getTooltip()` "Rocks - Level 43", `getWorldLocation()` WorldPoint.new(2876, 3666, 0), `getWorldMapLocation()` WorldPoint.new(2876, 3666, 0). TROLLHEIM_MEDIUM_CLIFF_SCRAMBLE_SOUTHWEST: AgilityShortcut, --- `TLATI_RAINFORST_CLIFF_SCRAMBLE`: ordinal 77; `getDescription()` "Rocks", `getLevel()` 43, `getObstacleIds()` {57605, 57604}, `getTooltip()` "Rocks - Level 43", `getWorldLocation()` WorldPoint.new(1271, 3001, 0), `getWorldMapLocation()` WorldPoint.new(1271, 3001, 0). TLATI_RAINFORST_CLIFF_SCRAMBLE: AgilityShortcut, --- `SLAYER_DUNGEON_CHASM_JUMP`: ordinal 78; `getDescription()` "Spiked Blades", `getLevel()` 43, `getObstacleIds()` {16544}, `getTooltip()` "Spiked Blades - Level 43", `getWorldLocation()` WorldPoint.new(2770, 10003, 0), `getWorldMapLocation()` WorldPoint.new(2770, 10003, 0). SLAYER_DUNGEON_CHASM_JUMP: AgilityShortcut, --- `TROLLHEIM_ADVANCED_CLIFF_SCRAMBLE`: ordinal 79; `getDescription()` "Rocks", `getLevel()` 44, `getObstacleIds()` {16523}, `getTooltip()` "Rocks - Level 44", `getWorldLocation()` WorldPoint.new(2907, 3686, 0), `getWorldMapLocation()` WorldPoint.new(2907, 3686, 0). TROLLHEIM_ADVANCED_CLIFF_SCRAMBLE: AgilityShortcut, --- `AUBURN_VALLEY_LOG_BALANCE_SOUTH`: ordinal 80; `getDescription()` "Log Balance", `getLevel()` 45, `getObstacleIds()` {56990}, `getTooltip()` "Log Balance - Level 45", `getWorldLocation()` WorldPoint.new(1401, 3287, 0), `getWorldMapLocation()` WorldPoint.new(1401, 3287, 0). AUBURN_VALLEY_LOG_BALANCE_SOUTH: AgilityShortcut, --- `AUBURN_VALLEY_LOG_BALANCE_NORTH`: ordinal 81; `getDescription()` "Log Balance", `getLevel()` 45, `getObstacleIds()` {56991}, `getTooltip()` "Log Balance - Level 45", `getWorldLocation()` WorldPoint.new(1453, 3332, 0), `getWorldMapLocation()` WorldPoint.new(1453, 3332, 0). AUBURN_VALLEY_LOG_BALANCE_NORTH: AgilityShortcut, --- `PROUDSPIRE_LOWER_ROCKS`: ordinal 82; `getDescription()` "Rocks", `getLevel()` 45, `getObstacleIds()` {56983}, `getTooltip()` "Rocks - Level 45", `getWorldLocation()` WorldPoint.new(1588, 3260, 0), `getWorldMapLocation()` WorldPoint.new(1588, 3260, 0). PROUDSPIRE_LOWER_ROCKS: AgilityShortcut, --- `KOUREND_RIVER_STEPPING_STONES`: ordinal 83; `getDescription()` "Stepping Stones", `getLevel()` 45, `getObstacleIds()` {29728}, `getTooltip()` "Stepping Stones - Level 45", `getWorldLocation()` WorldPoint.new(1720, 3551, 0), `getWorldMapLocation()` WorldPoint.new(1720, 3551, 0). KOUREND_RIVER_STEPPING_STONES: AgilityShortcut, --- `TIRANNWN_LOG_BALANCE`: ordinal 84; `getDescription()` "Log Balance", `getLevel()` 45, `getObstacleIds()` {3933, 3931, 3930, 3929, 3932}, `getTooltip()` "Log Balance - Level 45", `getWorldLocation()` nil, `getWorldMapLocation()` nil. TIRANNWN_LOG_BALANCE: AgilityShortcut, --- `COSMIC_ALTAR_MEDIUM_WALKWAY`: ordinal 85; `getDescription()` "Narrow Walkway", `getLevel()` 46, `getObstacleIds()` {17002}, `getTooltip()` "Narrow Walkway - Level 46", `getWorldLocation()` WorldPoint.new(2399, 4403, 0), `getWorldMapLocation()` WorldPoint.new(2399, 4403, 0). COSMIC_ALTAR_MEDIUM_WALKWAY: AgilityShortcut, --- `DEEP_WILDERNESS_DUNGEON_CREVICE_NORTH`: ordinal 86; `getDescription()` "Narrow Crevice", `getLevel()` 46, `getObstacleIds()` {19043}, `getTooltip()` "Narrow Crevice - Level 46", `getWorldLocation()` WorldPoint.new(3047, 10335, 0), `getWorldMapLocation()` WorldPoint.new(3047, 10335, 0). DEEP_WILDERNESS_DUNGEON_CREVICE_NORTH: AgilityShortcut, --- `DEEP_WILDERNESS_DUNGEON_CREVICE_SOUTH`: ordinal 87; `getDescription()` "Narrow Crevice", `getLevel()` 46, `getObstacleIds()` {19043}, `getTooltip()` "Narrow Crevice - Level 46", `getWorldLocation()` WorldPoint.new(3045, 10327, 0), `getWorldMapLocation()` WorldPoint.new(3045, 10327, 0). DEEP_WILDERNESS_DUNGEON_CREVICE_SOUTH: AgilityShortcut, --- `TONALI_CAVERN_STEPPING_STONE`: ordinal 88; `getDescription()` "Stepping Stones", `getLevel()` 46, `getObstacleIds()` {56717}, `getTooltip()` "Stepping Stones - Level 46", `getWorldLocation()` nil, `getWorldMapLocation()` nil. TONALI_CAVERN_STEPPING_STONE: AgilityShortcut, --- `TONALI_CAVERN_LOG_BALANCE`: ordinal 89; `getDescription()` "Log Balance", `getLevel()` 46, `getObstacleIds()` {56718}, `getTooltip()` "Log Balance - Level 46", `getWorldLocation()` nil, `getWorldMapLocation()` nil. TONALI_CAVERN_LOG_BALANCE: AgilityShortcut, --- `TROLLHEIM_HARD_CLIFF_SCRAMBLE`: ordinal 90; `getDescription()` "Rocks", `getLevel()` 47, `getObstacleIds()` {16524}, `getTooltip()` "Rocks - Level 47", `getWorldLocation()` WorldPoint.new(2902, 3680, 0), `getWorldMapLocation()` WorldPoint.new(2902, 3680, 0). TROLLHEIM_HARD_CLIFF_SCRAMBLE: AgilityShortcut, --- `RALOS_RISE_ROCK_CLIMB`: ordinal 91; `getDescription()` "Rocks", `getLevel()` 47, `getObstacleIds()` {51931}, `getTooltip()` "Rocks - Level 47", `getWorldLocation()` WorldPoint.new(1458, 3129, 0), `getWorldMapLocation()` WorldPoint.new(1458, 3129, 0). RALOS_RISE_ROCK_CLIMB: AgilityShortcut, --- `FREMENNIK_LOG_BALANCE`: ordinal 92; `getDescription()` "Log Balance", `getLevel()` 48, `getObstacleIds()` {16540, 16541, 16542}, `getTooltip()` "Log Balance - Level 48", `getWorldLocation()` WorldPoint.new(2721, 3591, 0), `getWorldMapLocation()` WorldPoint.new(2721, 3591, 0). FREMENNIK_LOG_BALANCE: AgilityShortcut, --- `RIVER_LUM_BROKEN_RAFT`: ordinal 93; `getDescription()` "Broken Raft", `getLevel()` 48, `getObstacleIds()` {17070, 17069}, `getTooltip()` "Broken Raft - Level 48", `getWorldLocation()` nil, `getWorldMapLocation()` nil. RIVER_LUM_BROKEN_RAFT: AgilityShortcut, --- `YANILLE_DUNGEON_PIPE_SQUEEZE`: ordinal 94; `getDescription()` "Pipe Squeeze", `getLevel()` 49, `getObstacleIds()` {23140}, `getTooltip()` "Pipe Squeeze - Level 49", `getWorldLocation()` nil, `getWorldMapLocation()` nil. YANILLE_DUNGEON_PIPE_SQUEEZE: AgilityShortcut, --- `ARCEUUS_ESSENCE_MINE_BOULDER`: ordinal 95; `getDescription()` "Boulder", `getLevel()` 49, `getObstacleIds()` {27990}, `getTooltip()` "Boulder - Level 49", `getWorldLocation()` WorldPoint.new(1774, 3888, 0), `getWorldMapLocation()` WorldPoint.new(1774, 3888, 0). ARCEUUS_ESSENCE_MINE_BOULDER: AgilityShortcut, --- `DRAYNOR_MANOR_BROKEN_FENCE`: ordinal 96; `getDescription()` "Broken Fence", `getLevel()` 49, `getObstacleIds()` {62422}, `getTooltip()` "Broken Fence - Level 49", `getWorldLocation()` WorldPoint.new(3085, 3352, 0), `getWorldMapLocation()` WorldPoint.new(3085, 3352, 0). DRAYNOR_MANOR_BROKEN_FENCE: AgilityShortcut, --- `MORYTANIA_STEPPING_STONE`: ordinal 97; `getDescription()` "Stepping Stone", `getLevel()` 50, `getObstacleIds()` {13504}, `getTooltip()` "Stepping Stone - Level 50", `getWorldLocation()` WorldPoint.new(3418, 3326, 0), `getWorldMapLocation()` WorldPoint.new(3418, 3326, 0). MORYTANIA_STEPPING_STONE: AgilityShortcut, --- `SHAMAN_CAVES_JAGGED_WALL`: ordinal 98; `getDescription()` "Jagged wall", `getLevel()` 50, `getObstacleIds()` {2926}, `getTooltip()` "Jagged wall - Level 50", `getWorldLocation()` nil, `getWorldMapLocation()` nil. SHAMAN_CAVES_JAGGED_WALL: AgilityShortcut, --- `GREAT_CONCH_CLIFF_SHORTCUT_TOWN`: ordinal 99; `getDescription()` "Rock Climb", `getLevel()` 50, `getObstacleIds()` {57928, 57927}, `getTooltip()` "Rock Climb - Level 50", `getWorldLocation()` WorldPoint.new(3180, 2433, 0), `getWorldMapLocation()` WorldPoint.new(3180, 2433, 0). GREAT_CONCH_CLIFF_SHORTCUT_TOWN: AgilityShortcut, --- `VARROCK_SEWERS_PIPE_SQUEEZE`: ordinal 100; `getDescription()` "Pipe Squeeze", `getLevel()` 51, `getObstacleIds()` {16511}, `getTooltip()` "Pipe Squeeze - Level 51", `getWorldLocation()` WorldPoint.new(3152, 9905, 0), `getWorldMapLocation()` WorldPoint.new(3152, 9905, 0). VARROCK_SEWERS_PIPE_SQUEEZE: AgilityShortcut, --- `ARCEUUS_ESSENCE_MINE_EAST_SCRAMBLE`: ordinal 101; `getDescription()` "Rock Climb", `getLevel()` 52, `getObstacleIds()` {27987, 27988}, `getTooltip()` "Rock Climb - Level 52", `getWorldLocation()` WorldPoint.new(1770, 3851, 0), `getWorldMapLocation()` WorldPoint.new(1770, 3851, 0). ARCEUUS_ESSENCE_MINE_EAST_SCRAMBLE: AgilityShortcut, --- `ANGLERS_RETREAT_SHORTCUT`: ordinal 102; `getDescription()` "Rocks", `getLevel()` 52, `getObstacleIds()` {60126}, `getTooltip()` "Rocks - Level 52", `getWorldLocation()` WorldPoint.new(2475, 2729, 0), `getWorldMapLocation()` WorldPoint.new(2475, 2729, 0). ANGLERS_RETREAT_SHORTCUT: AgilityShortcut, --- `GREAT_CONCH_CLIFF_SHORTCUT_EAST_1`: ordinal 103; `getDescription()` "Rock Climb", `getLevel()` 52, `getObstacleIds()` {57932, 57931}, `getTooltip()` "Rock Climb - Level 52", `getWorldLocation()` WorldPoint.new(3235, 2388, 0), `getWorldMapLocation()` WorldPoint.new(3235, 2388, 0). GREAT_CONCH_CLIFF_SHORTCUT_EAST_1: AgilityShortcut, --- `CHAMPIONS_GUILD_STEPPING_STONE`: ordinal 104; `getDescription()` "Stepping Stone", `getLevel()` 52, `getObstacleIds()` {62412}, `getTooltip()` "Stepping Stone - Level 52", `getWorldLocation()` WorldPoint.new(3191, 3342, 0), `getWorldMapLocation()` WorldPoint.new(3191, 3342, 0). CHAMPIONS_GUILD_STEPPING_STONE: AgilityShortcut, --- `KARAMJA_VOLCANO_GRAPPLE_NORTH`: ordinal 105; `getDescription()` "Grapple Rock", `getLevel()` 53, `getObstacleIds()` {17074}, `getTooltip()` "Grapple Rock - Level 53", `getWorldLocation()` WorldPoint.new(2873, 3143, 0), `getWorldMapLocation()` WorldPoint.new(2873, 3143, 0). KARAMJA_VOLCANO_GRAPPLE_NORTH: AgilityShortcut, --- `KARAMJA_VOLCANO_GRAPPLE_SOUTH`: ordinal 106; `getDescription()` "Grapple Rock", `getLevel()` 53, `getObstacleIds()` {17074}, `getTooltip()` "Grapple Rock - Level 53", `getWorldLocation()` WorldPoint.new(2874, 3128, 0), `getWorldMapLocation()` WorldPoint.new(2874, 3128, 0). KARAMJA_VOLCANO_GRAPPLE_SOUTH: AgilityShortcut, --- `ALDARIN_ROCKS`: ordinal 107; `getDescription()` "Rocks", `getLevel()` 54, `getObstacleIds()` {54775, 54776}, `getTooltip()` "Rocks - Level 54", `getWorldLocation()` WorldPoint.new(1340, 2916, 0), `getWorldMapLocation()` WorldPoint.new(1340, 2916, 0). ALDARIN_ROCKS: AgilityShortcut, --- `MOTHERLODE_MINE_WALL_EAST`: ordinal 108; `getDescription()` "Wall", `getLevel()` 54, `getObstacleIds()` {10047}, `getTooltip()` "Wall - Level 54", `getWorldLocation()` WorldPoint.new(3124, 9703, 0), `getWorldMapLocation()` WorldPoint.new(3124, 9703, 0). MOTHERLODE_MINE_WALL_EAST: AgilityShortcut, --- `MOTHERLODE_MINE_WALL_WEST`: ordinal 109; `getDescription()` "Wall", `getLevel()` 54, `getObstacleIds()` {10047}, `getTooltip()` "Wall - Level 54", `getWorldLocation()` WorldPoint.new(3118, 9702, 0), `getWorldMapLocation()` WorldPoint.new(3118, 9702, 0). MOTHERLODE_MINE_WALL_WEST: AgilityShortcut, --- `GIANTS_PLATEAU_ROCKS`: ordinal 110; `getDescription()` "Rocks", `getLevel()` 54, `getObstacleIds()` {62403, 62404}, `getTooltip()` "Rocks - Level 54", `getWorldLocation()` WorldPoint.new(3392, 3156, 0), `getWorldMapLocation()` WorldPoint.new(3392, 3156, 0). GIANTS_PLATEAU_ROCKS: AgilityShortcut, --- `WYRMSCRAIG_CLIFFSIDE_ROCKS`: ordinal 111; `getDescription()` "Rocks", `getLevel()` 54, `getObstacleIds()` {62267, 62265}, `getTooltip()` "Rocks - Level 54", `getWorldLocation()` WorldPoint.new(2551, 2208, 0), `getWorldMapLocation()` WorldPoint.new(2551, 2208, 0). WYRMSCRAIG_CLIFFSIDE_ROCKS: AgilityShortcut, --- `MISCELLANIA_DOCK_STEPPING_STONE`: ordinal 112; `getDescription()` "Stepping Stone", `getLevel()` 55, `getObstacleIds()` {11768}, `getTooltip()` "Stepping Stone - Level 55", `getWorldLocation()` WorldPoint.new(2572, 3862, 0), `getWorldMapLocation()` WorldPoint.new(2572, 3862, 0). MISCELLANIA_DOCK_STEPPING_STONE: AgilityShortcut, --- `GREAT_CONCH_CLIFF_SHORTCUT_SOUTHEAST_BOTTOM`: ordinal 113; `getDescription()` "Rock Climb", `getLevel()` 55, `getObstacleIds()` {57930, 57929}, `getTooltip()` "Rock Climb - Level 55", `getWorldLocation()` WorldPoint.new(3272, 2330, 0), `getWorldMapLocation()` WorldPoint.new(3272, 2330, 0). GREAT_CONCH_CLIFF_SHORTCUT_SOUTHEAST_BOTTOM: AgilityShortcut, --- `TEMPLE_OF_EYE_RUBBLE`: ordinal 114; `getDescription()` "Rubble", `getLevel()` 56, `getObstacleIds()` {43724, 43726}, `getTooltip()` "Rubble - Level 56", `getWorldLocation()` nil, `getWorldMapLocation()` nil. TEMPLE_OF_EYE_RUBBLE: AgilityShortcut, --- `BRIMHAVEN_DUNGEON_EAST_STEPPING_STONES_NORTH`: ordinal 115; `getDescription()` "Stepping Stones", `getLevel()` 56, `getObstacleIds()` {19040}, `getTooltip()` "Stepping Stones - Level 56", `getWorldLocation()` WorldPoint.new(2685, 9547, 0), `getWorldMapLocation()` WorldPoint.new(2685, 9547, 0). BRIMHAVEN_DUNGEON_EAST_STEPPING_STONES_NORTH: AgilityShortcut, --- `BRIMHAVEN_DUNGEON_EAST_STEPPING_STONES_SOUTH`: ordinal 116; `getDescription()` "Stepping Stones", `getLevel()` 56, `getObstacleIds()` {19040}, `getTooltip()` "Stepping Stones - Level 56", `getWorldLocation()` WorldPoint.new(2693, 9529, 0), `getWorldMapLocation()` WorldPoint.new(2693, 9529, 0). BRIMHAVEN_DUNGEON_EAST_STEPPING_STONES_SOUTH: AgilityShortcut, --- `ISAFDAR_FOREST_OBSTACLES`: ordinal 117; `getDescription()` "Trap", `getLevel()` 56, `getObstacleIds()` {3938, 3939, 3998, 3999, 3937, 3923, 3924, 3925, 3922, 3920, 3921}, `getTooltip()` "Trap - Level 56", `getWorldLocation()` nil, `getWorldMapLocation()` nil. ISAFDAR_FOREST_OBSTACLES: AgilityShortcut, --- `RELEKKA_EAST_FENCE`: ordinal 118; `getDescription()` "Fence", `getLevel()` 57, `getObstacleIds()` {544}, `getTooltip()` "Fence - Level 57", `getWorldLocation()` WorldPoint.new(2688, 3697, 0), `getWorldMapLocation()` WorldPoint.new(2688, 3697, 0). RELEKKA_EAST_FENCE: AgilityShortcut, --- `YANILLE_DUNGEON_MONKEY_BARS`: ordinal 119; `getDescription()` "Monkey Bars", `getLevel()` 57, `getObstacleIds()` {23567}, `getTooltip()` "Monkey Bars - Level 57", `getWorldLocation()` nil, `getWorldMapLocation()` nil. YANILLE_DUNGEON_MONKEY_BARS: AgilityShortcut, --- `GREAT_CONCH_CLIFF_SHORTCUT_EAST_2`: ordinal 120; `getDescription()` "Rock Climb", `getLevel()` 57, `getObstacleIds()` {57934, 57933}, `getTooltip()` "Rock Climb - Level 57", `getWorldLocation()` WorldPoint.new(3256, 2397, 0), `getWorldMapLocation()` WorldPoint.new(3256, 2397, 0). GREAT_CONCH_CLIFF_SHORTCUT_EAST_2: AgilityShortcut, --- `PHASMATYS_ECTOPOOL_SHORTCUT`: ordinal 121; `getDescription()` "Weathered Wall", `getLevel()` 58, `getObstacleIds()` {16525, 16526}, `getTooltip()` "Weathered Wall - Level 58", `getWorldLocation()` nil, `getWorldMapLocation()` nil. PHASMATYS_ECTOPOOL_SHORTCUT: AgilityShortcut, --- `WYRMSCRAIG_STEPPING_STONES_NORTH`: ordinal 122; `getDescription()` "Stepping Stones", `getLevel()` 58, `getObstacleIds()` {62260}, `getTooltip()` "Stepping Stones - Level 58", `getWorldLocation()` WorldPoint.new(2583, 2283, 0), `getWorldMapLocation()` WorldPoint.new(2583, 2283, 0). WYRMSCRAIG_STEPPING_STONES_NORTH: AgilityShortcut, --- `ELVEN_OVERPASS_CLIFF_SCRAMBLE`: ordinal 123; `getDescription()` "Rocks", `getLevel()` 59, `getObstacleIds()` {16514, 16515}, `getTooltip()` "Rocks - Level 59", `getWorldLocation()` WorldPoint.new(2345, 3300, 0), `getWorldMapLocation()` WorldPoint.new(2345, 3300, 0). ELVEN_OVERPASS_CLIFF_SCRAMBLE: AgilityShortcut, --- `ELVEN_OVERPASS_CLIFF_SCRAMBLE_PRIFDDINAS`: ordinal 124; `getDescription()` "Rocks", `getLevel()` 59, `getObstacleIds()` {16514, 16515}, `getTooltip()` "Rocks - Level 59", `getWorldLocation()` WorldPoint.new(3369, 6052, 0), `getWorldMapLocation()` WorldPoint.new(3369, 6052, 0). ELVEN_OVERPASS_CLIFF_SCRAMBLE_PRIFDDINAS: AgilityShortcut, --- `ASGARNIA_ICE_DUNGEON_TUNNEL_EAST`: ordinal 125; `getDescription()` "Tunnel", `getLevel()` 60, `getObstacleIds()` {55988}, `getTooltip()` "Tunnel - Level 60", `getWorldLocation()` WorldPoint.new(2989, 9547, 0), `getWorldMapLocation()` WorldPoint.new(2989, 9547, 0). ASGARNIA_ICE_DUNGEON_TUNNEL_EAST: AgilityShortcut, --- `ASGARNIA_ICE_DUNGEON_TUNNEL_WEST`: ordinal 126; `getDescription()` "Tunnel", `getLevel()` 60, `getObstacleIds()` {55989}, `getTooltip()` "Tunnel - Level 60", `getWorldLocation()` WorldPoint.new(2968, 9549, 0), `getWorldMapLocation()` WorldPoint.new(2968, 9549, 0). ASGARNIA_ICE_DUNGEON_TUNNEL_WEST: AgilityShortcut, --- `WILDERNESS_GWD_CLIMB_EAST`: ordinal 127; `getDescription()` "Rocks", `getLevel()` 60, `getObstacleIds()` {26400, 26401, 26402, 26404, 26405, 26406}, `getTooltip()` "Rocks - Level 60", `getWorldLocation()` WorldPoint.new(2943, 3770, 0), `getWorldMapLocation()` WorldPoint.new(2943, 3770, 0). WILDERNESS_GWD_CLIMB_EAST: AgilityShortcut, --- `WILDERNESS_GWD_CLIMB_WEST`: ordinal 128; `getDescription()` "Rocks", `getLevel()` 60, `getObstacleIds()` {26400, 26401, 26402, 26404, 26405, 26406}, `getTooltip()` "Rocks - Level 60", `getWorldLocation()` WorldPoint.new(2928, 3760, 0), `getWorldMapLocation()` WorldPoint.new(2928, 3760, 0). WILDERNESS_GWD_CLIMB_WEST: AgilityShortcut, --- `MOS_LEHARMLESS_STEPPING_STONE`: ordinal 129; `getDescription()` "Stepping Stone", `getLevel()` 60, `getObstacleIds()` {19042}, `getTooltip()` "Stepping Stone - Level 60", `getWorldLocation()` WorldPoint.new(3710, 2970, 0), `getWorldMapLocation()` WorldPoint.new(3710, 2970, 0). MOS_LEHARMLESS_STEPPING_STONE: AgilityShortcut, --- `WINTERTODT_GAP`: ordinal 130; `getDescription()` "Gap", `getLevel()` 60, `getObstacleIds()` {29326}, `getTooltip()` "Gap - Level 60", `getWorldLocation()` WorldPoint.new(1629, 4023, 0), `getWorldMapLocation()` WorldPoint.new(1629, 4023, 0). WINTERTODT_GAP: AgilityShortcut, --- `UNGAEL_ICE`: ordinal 131; `getDescription()` "Ice Chunks", `getLevel()` 60, `getObstacleIds()` {25337, 29868, 29869, 29870, 31822, 31823, 31990, 47324, 47325}, `getTooltip()` "Ice Chunks - Level 60", `getWorldLocation()` WorldPoint.new(2262, 4044, 0), `getWorldMapLocation()` WorldPoint.new(2262, 4044, 0). UNGAEL_ICE: AgilityShortcut, --- `GWD_LITTLE_CRACK`: ordinal 132; `getDescription()` "Little Crack", `getLevel()` 60, `getObstacleIds()` {26382}, `getTooltip()` "Little Crack - Level 60", `getWorldLocation()` WorldPoint.new(2900, 3712, 0), `getWorldMapLocation()` WorldPoint.new(2900, 3712, 0). GWD_LITTLE_CRACK: AgilityShortcut, --- `EDGEVILLE_DUNGEON_PIPE_SQUEEZE`: ordinal 133; `getDescription()` "Pipe Squeeze", `getLevel()` 60, `getObstacleIds()` {62409}, `getTooltip()` "Pipe Squeeze - Level 60", `getWorldLocation()` WorldPoint.new(3121, 9882, 0), `getWorldMapLocation()` WorldPoint.new(3121, 9882, 0). EDGEVILLE_DUNGEON_PIPE_SQUEEZE: AgilityShortcut, --- `SLAYER_TOWER_MEDIUM_CHAIN_FIRST`: ordinal 134; `getDescription()` "Spikey Chain (Floor 1)", `getLevel()` 61, `getObstacleIds()` {16537}, `getTooltip()` "Spikey Chain (Floor 1) - Level 61", `getWorldLocation()` WorldPoint.new(3421, 3550, 0), `getWorldMapLocation()` WorldPoint.new(3421, 3550, 0). SLAYER_TOWER_MEDIUM_CHAIN_FIRST: AgilityShortcut, --- `SLAYER_TOWER_MEDIUM_CHAIN_SECOND`: ordinal 135; `getDescription()` "Spikey Chain (Floor 2)", `getLevel()` 61, `getObstacleIds()` {16538}, `getTooltip()` "Spikey Chain (Floor 2) - Level 61", `getWorldLocation()` WorldPoint.new(3420, 3551, 0), `getWorldMapLocation()` WorldPoint.new(3420, 3551, 0). SLAYER_TOWER_MEDIUM_CHAIN_SECOND: AgilityShortcut, --- `SLAYER_DUNGEON_CREVICE`: ordinal 136; `getDescription()` "Narrow Crevice", `getLevel()` 61, `getObstacleIds()` {16539}, `getTooltip()` "Narrow Crevice - Level 61", `getWorldLocation()` WorldPoint.new(2729, 10008, 0), `getWorldMapLocation()` WorldPoint.new(2729, 10008, 0). SLAYER_DUNGEON_CREVICE: AgilityShortcut, --- `GREAT_CONCH_STEPPING_STONE`: ordinal 137; `getDescription()` "Stepping Stone", `getLevel()` 61, `getObstacleIds()` {57936}, `getTooltip()` "Stepping Stone - Level 61", `getWorldLocation()` WorldPoint.new(3208, 2394, 0), `getWorldMapLocation()` WorldPoint.new(3208, 2394, 0). GREAT_CONCH_STEPPING_STONE: AgilityShortcut, --- `LAGUNA_AURORAE_SHORTCUT_1`: ordinal 138; `getDescription()` "Rocks", `getLevel()` 61, `getObstacleIds()` {60127}, `getTooltip()` "Rocks - Level 61", `getWorldLocation()` WorldPoint.new(1152, 2804, 0), `getWorldMapLocation()` WorldPoint.new(1152, 2804, 0). LAGUNA_AURORAE_SHORTCUT_1: AgilityShortcut, --- `LAGUNA_AURORAE_SHORTCUT_2`: ordinal 139; `getDescription()` "Rocks", `getLevel()` 61, `getObstacleIds()` {60128}, `getTooltip()` "Rocks - Level 61", `getWorldLocation()` WorldPoint.new(1142, 2803, 0), `getWorldMapLocation()` WorldPoint.new(1142, 2803, 0). LAGUNA_AURORAE_SHORTCUT_2: AgilityShortcut, --- `CASTLE_DRAKAN_ROCKS_UP`: ordinal 140; `getDescription()` "Rocks", `getLevel()` 61, `getObstacleIds()` {60921}, `getTooltip()` "Rocks - Level 61", `getWorldLocation()` WorldPoint.new(2555, 7821, 0), `getWorldMapLocation()` WorldPoint.new(2555, 7821, 0). CASTLE_DRAKAN_ROCKS_UP: AgilityShortcut, --- `APSUL_HUNTING_GROUND_ROCKS_UP`: ordinal 141; `getDescription()` "Rocks", `getLevel()` 61, `getObstacleIds()` {60925}, `getTooltip()` "Rocks - Level 61", `getWorldLocation()` WorldPoint.new(2576, 7768, 0), `getWorldMapLocation()` WorldPoint.new(2576, 7768, 0). APSUL_HUNTING_GROUND_ROCKS_UP: AgilityShortcut, --- `MOUNT_KARUULM_UPPER`: ordinal 142; `getDescription()` "Rocks", `getLevel()` 62, `getObstacleIds()` {34396}, `getTooltip()` "Rocks - Level 62", `getWorldLocation()` WorldPoint.new(1322, 3791, 0), `getWorldMapLocation()` WorldPoint.new(1322, 3791, 0). MOUNT_KARUULM_UPPER: AgilityShortcut, --- `NECROPOLIS_STEPPING_STONE_NORTH`: ordinal 143; `getDescription()` "Stepping Stone", `getLevel()` 62, `getObstacleIds()` {43990}, `getTooltip()` "Stepping Stone - Level 62", `getWorldLocation()` WorldPoint.new(3293, 2706, 0), `getWorldMapLocation()` WorldPoint.new(3293, 2706, 0). NECROPOLIS_STEPPING_STONE_NORTH: AgilityShortcut, --- `NECROPOLIS_STEPPING_STONES_SOUTH`: ordinal 144; `getDescription()` "Stepping Stones", `getLevel()` 62, `getObstacleIds()` {43989}, `getTooltip()` "Stepping Stones - Level 62", `getWorldLocation()` WorldPoint.new(3291, 2700, 0), `getWorldMapLocation()` WorldPoint.new(3291, 2700, 0). NECROPOLIS_STEPPING_STONES_SOUTH: AgilityShortcut, --- `WYRMSCRAIG_STEPPING_STONES_SOUTH`: ordinal 145; `getDescription()` "Stepping Stones", `getLevel()` 62, `getObstacleIds()` {62262}, `getTooltip()` "Stepping Stones - Level 62", `getWorldLocation()` WorldPoint.new(2564, 2220, 0), `getWorldMapLocation()` WorldPoint.new(2564, 2220, 0). WYRMSCRAIG_STEPPING_STONES_SOUTH: AgilityShortcut, --- `TAVERLEY_DUNGEON_RAILING`: ordinal 146; `getDescription()` "Loose Railing", `getLevel()` 63, `getObstacleIds()` {28849}, `getTooltip()` "Loose Railing - Level 63", `getWorldLocation()` WorldPoint.new(2935, 9811, 0), `getWorldMapLocation()` WorldPoint.new(2935, 9811, 0). TAVERLEY_DUNGEON_RAILING: AgilityShortcut, --- `FORTHOS_DUNGEON_SPIKED_BLADES`: ordinal 147; `getDescription()` "Spiked Blades", `getLevel()` 63, `getObstacleIds()` {34834}, `getTooltip()` "Spiked Blades - Level 63", `getWorldLocation()` WorldPoint.new(1819, 9946, 0), `getWorldMapLocation()` WorldPoint.new(1819, 9946, 0). FORTHOS_DUNGEON_SPIKED_BLADES: AgilityShortcut, --- `DARKMEYER_WALL`: ordinal 148; `getDescription()` "Wall (Long rope)", `getLevel()` 63, `getObstacleIds()` {39541, 39542}, `getTooltip()` "Wall (Long rope) - Level 63", `getWorldLocation()` WorldPoint.new(3669, 3375, 0), `getWorldMapLocation()` WorldPoint.new(3669, 3375, 0). DARKMEYER_WALL: AgilityShortcut, --- `TROLLHEIM_WILDERNESS_ROCKS_EAST`: ordinal 149; `getDescription()` "Rocks", `getLevel()` 64, `getObstacleIds()` {16545}, `getTooltip()` "Rocks - Level 64", `getWorldLocation()` WorldPoint.new(2945, 3678, 0), `getWorldMapLocation()` WorldPoint.new(2945, 3678, 0). TROLLHEIM_WILDERNESS_ROCKS_EAST: AgilityShortcut, --- `TROLLHEIM_WILDERNESS_ROCKS_WEST`: ordinal 150; `getDescription()` "Rocks", `getLevel()` 64, `getObstacleIds()` {16545}, `getTooltip()` "Rocks - Level 64", `getWorldLocation()` WorldPoint.new(2917, 3672, 0), `getWorldMapLocation()` WorldPoint.new(2917, 3672, 0). TROLLHEIM_WILDERNESS_ROCKS_WEST: AgilityShortcut, --- `STALKER_DEN_STEEPING_STONE`: ordinal 151; `getDescription()` "Stepping Stone", `getLevel()` 64, `getObstacleIds()` {57277}, `getTooltip()` "Stepping Stone - Level 64", `getWorldLocation()` WorldPoint.new(1372, 9720, 0), `getWorldMapLocation()` WorldPoint.new(1372, 9720, 0). STALKER_DEN_STEEPING_STONE: AgilityShortcut, --- `FOSSIL_ISLAND_VOLCANO`: ordinal 152; `getDescription()` "Rope", `getLevel()` 64, `getObstacleIds()` {30916, 30917}, `getTooltip()` "Rope - Level 64", `getWorldLocation()` WorldPoint.new(3780, 3822, 0), `getWorldMapLocation()` WorldPoint.new(3780, 3822, 0). FOSSIL_ISLAND_VOLCANO: AgilityShortcut, --- `SANGVESTI_BUSH_WEST`: ordinal 153; `getDescription()` "Bush", `getLevel()` 64, `getObstacleIds()` {40787}, `getTooltip()` "Bush - Level 64", `getWorldLocation()` WorldPoint.new(2656, 7816, 0), `getWorldMapLocation()` WorldPoint.new(2656, 7816, 0). SANGVESTI_BUSH_WEST: AgilityShortcut, --- `SANGVESTI_BUSH_EAST`: ordinal 154; `getDescription()` "Bush", `getLevel()` 64, `getObstacleIds()` {40787}, `getTooltip()` "Bush - Level 64", `getWorldLocation()` WorldPoint.new(2666, 7837, 0), `getWorldMapLocation()` WorldPoint.new(2666, 7837, 0). SANGVESTI_BUSH_EAST: AgilityShortcut, --- `MORYTANIA_TEMPLE`: ordinal 155; `getDescription()` "Loose Railing", `getLevel()` 65, `getObstacleIds()` {16998, 16999, 16552, 17000}, `getTooltip()` "Loose Railing - Level 65", `getWorldLocation()` WorldPoint.new(3422, 3476, 0), `getWorldMapLocation()` WorldPoint.new(3422, 3476, 0). MORYTANIA_TEMPLE: AgilityShortcut, --- `REVENANT_CAVES_GREEN_DRAGONS`: ordinal 156; `getDescription()` "Jump", `getLevel()` 65, `getObstacleIds()` {31561}, `getTooltip()` "Jump - Level 65", `getWorldLocation()` WorldPoint.new(3220, 10086, 0), `getWorldMapLocation()` WorldPoint.new(3220, 10086, 0). REVENANT_CAVES_GREEN_DRAGONS: AgilityShortcut, --- `COSMIC_ALTAR_ADVANCED_WALKWAY`: ordinal 157; `getDescription()` "Narrow Walkway", `getLevel()` 66, `getObstacleIds()` {17002}, `getTooltip()` "Narrow Walkway - Level 66", `getWorldLocation()` WorldPoint.new(2408, 4401, 0), `getWorldMapLocation()` WorldPoint.new(2408, 4401, 0). COSMIC_ALTAR_ADVANCED_WALKWAY: AgilityShortcut, --- `LUMBRIDGE_DESERT_STEPPING_STONE`: ordinal 158; `getDescription()` "Stepping Stone", `getLevel()` 66, `getObstacleIds()` {16513}, `getTooltip()` "Stepping Stone - Level 66", `getWorldLocation()` WorldPoint.new(3210, 3135, 0), `getWorldMapLocation()` WorldPoint.new(3210, 3135, 0). LUMBRIDGE_DESERT_STEPPING_STONE: AgilityShortcut, --- `TAVERLEY_WALL_CLIMBING_ROCKS`: ordinal 159; `getDescription()` "Climbing rocks", `getLevel()` 66, `getObstacleIds()` {53255}, `getTooltip()` "Climbing rocks - Level 66", `getWorldLocation()` WorldPoint.new(2945, 3439, 0), `getWorldMapLocation()` WorldPoint.new(2945, 3439, 0). TAVERLEY_WALL_CLIMBING_ROCKS: AgilityShortcut, --- `HEROES_GUILD_TUNNEL_EAST`: ordinal 160; `getDescription()` "Crevice", `getLevel()` 67, `getObstacleIds()` {9739, 9740}, `getTooltip()` "Crevice - Level 67", `getWorldLocation()` WorldPoint.new(2898, 9901, 0), `getWorldMapLocation()` WorldPoint.new(2898, 9901, 0). HEROES_GUILD_TUNNEL_EAST: AgilityShortcut, --- `HEROES_GUILD_TUNNEL_WEST`: ordinal 161; `getDescription()` "Crevice", `getLevel()` 67, `getObstacleIds()` {9739, 9740}, `getTooltip()` "Crevice - Level 67", `getWorldLocation()` WorldPoint.new(2913, 9895, 0), `getWorldMapLocation()` WorldPoint.new(2913, 9895, 0). HEROES_GUILD_TUNNEL_WEST: AgilityShortcut, --- `YANILLE_DUNGEON_RUBBLE_CLIMB`: ordinal 162; `getDescription()` "Pile of Rubble", `getLevel()` 67, `getObstacleIds()` {23563, 23564}, `getTooltip()` "Pile of Rubble - Level 67", `getWorldLocation()` nil, `getWorldMapLocation()` nil. YANILLE_DUNGEON_RUBBLE_CLIMB: AgilityShortcut, --- `ELVEN_OVERPASS_MEDIUM_CLIFF`: ordinal 163; `getDescription()` "Rocks", `getLevel()` 68, `getObstacleIds()` {16514, 16515}, `getTooltip()` "Rocks - Level 68", `getWorldLocation()` WorldPoint.new(2337, 3288, 0), `getWorldMapLocation()` WorldPoint.new(2337, 3288, 0). ELVEN_OVERPASS_MEDIUM_CLIFF: AgilityShortcut, --- `ICE_MOUNTAIN_WESTERN_SCRAMBLE`: ordinal 164; `getDescription()` "Rocks", `getLevel()` 68, `getObstacleIds()` {47570, 47571}, `getTooltip()` "Rocks - Level 68", `getWorldLocation()` WorldPoint.new(2998, 3484, 0), `getWorldMapLocation()` WorldPoint.new(2998, 3484, 0). ICE_MOUNTAIN_WESTERN_SCRAMBLE: AgilityShortcut, --- `ELVEN_OVERPASS_MEDIUM_CLIFF_PRIFDDINAS`: ordinal 165; `getDescription()` "Rocks", `getLevel()` 68, `getObstacleIds()` {16514, 16515}, `getTooltip()` "Rocks - Level 68", `getWorldLocation()` WorldPoint.new(3361, 6040, 0), `getWorldMapLocation()` WorldPoint.new(3361, 6040, 0). ELVEN_OVERPASS_MEDIUM_CLIFF_PRIFDDINAS: AgilityShortcut, --- `WEISS_OBSTACLES`: ordinal 166; `getDescription()` "Shortcut", `getLevel()` 68, `getObstacleIds()` {33184, 33185, 33327, 33328, 33190, 33191, 33192}, `getTooltip()` "Shortcut - Level 68", `getWorldLocation()` nil, `getWorldMapLocation()` nil. WEISS_OBSTACLES: AgilityShortcut, --- `CATHERBY_CLIFFSIDE_ROCKS`: ordinal 167; `getDescription()` "Rocks", `getLevel()` 68, `getObstacleIds()` {62423, 62424}, `getTooltip()` "Rocks - Level 68", `getWorldLocation()` nil, `getWorldMapLocation()` nil. CATHERBY_CLIFFSIDE_ROCKS: AgilityShortcut, --- `WEISS_FARMING_PATCH_BOULDER`: ordinal 168; `getDescription()` "Shortcut", `getLevel()` 0, `getObstacleIds()` {33312}, `getTooltip()` "Shortcut - Level 0", `getWorldLocation()` nil, `getWorldMapLocation()` nil. WEISS_FARMING_PATCH_BOULDER: AgilityShortcut, --- `ARCEUUS_ESSENSE_NORTH`: ordinal 169; `getDescription()` "Rock Climb", `getLevel()` 69, `getObstacleIds()` {34741}, `getTooltip()` "Rock Climb - Level 69", `getWorldLocation()` WorldPoint.new(1759, 3873, 0), `getWorldMapLocation()` WorldPoint.new(1759, 3873, 0). ARCEUUS_ESSENSE_NORTH: AgilityShortcut, --- `FENKENSTRAIN_MAUSOLEUM_BRIDGE`: ordinal 170; `getDescription()` "Bridge Jump", `getLevel()` 69, `getObstacleIds()` {57715, 57716, 57717, 57718}, `getTooltip()` "Bridge Jump - Level 69", `getWorldLocation()` WorldPoint.new(3504, 3560, 0), `getWorldMapLocation()` WorldPoint.new(3504, 3560, 0). FENKENSTRAIN_MAUSOLEUM_BRIDGE: AgilityShortcut, --- `TAVERLEY_DUNGEON_PIPE_BLUE_DRAGON`: ordinal 171; `getDescription()` "Pipe Squeeze", `getLevel()` 70, `getObstacleIds()` {16509}, `getTooltip()` "Pipe Squeeze - Level 70", `getWorldLocation()` WorldPoint.new(2886, 9798, 0), `getWorldMapLocation()` WorldPoint.new(2886, 9798, 0). TAVERLEY_DUNGEON_PIPE_BLUE_DRAGON: AgilityShortcut, --- `TAVERLEY_DUNGEON_ROCKS_NORTH`: ordinal 172; `getDescription()` "Rocks", `getLevel()` 70, `getObstacleIds()` {154, 14106}, `getTooltip()` "Rocks - Level 70", `getWorldLocation()` WorldPoint.new(2887, 9823, 0), `getWorldMapLocation()` WorldPoint.new(2887, 9823, 0). TAVERLEY_DUNGEON_ROCKS_NORTH: AgilityShortcut, --- `TAVERLEY_DUNGEON_ROCKS_SOUTH`: ordinal 173; `getDescription()` "Rocks", `getLevel()` 70, `getObstacleIds()` {154, 14106}, `getTooltip()` "Rocks - Level 70", `getWorldLocation()` WorldPoint.new(2887, 9631, 0), `getWorldMapLocation()` WorldPoint.new(2887, 9631, 0). TAVERLEY_DUNGEON_ROCKS_SOUTH: AgilityShortcut, --- `FOSSIL_ISLAND_HARDWOOD_NORTH`: ordinal 174; `getDescription()` "Hole", `getLevel()` 70, `getObstacleIds()` {31481, 31482}, `getTooltip()` "Hole - Level 70", `getWorldLocation()` WorldPoint.new(3712, 3828, 0), `getWorldMapLocation()` WorldPoint.new(3712, 3828, 0). FOSSIL_ISLAND_HARDWOOD_NORTH: AgilityShortcut, --- `FOSSIL_ISLAND_HARDWOOD_SOUTH`: ordinal 175; `getDescription()` "Hole", `getLevel()` 70, `getObstacleIds()` {31481, 31482}, `getTooltip()` "Hole - Level 70", `getWorldLocation()` WorldPoint.new(3714, 3816, 0), `getWorldMapLocation()` WorldPoint.new(3714, 3816, 0). FOSSIL_ISLAND_HARDWOOD_SOUTH: AgilityShortcut, --- `AL_KHARID_WINDOW`: ordinal 176; `getDescription()` "Window", `getLevel()` 70, `getObstacleIds()` {33344, 33348}, `getTooltip()` "Window - Level 70", `getWorldLocation()` WorldPoint.new(3293, 3158, 0), `getWorldMapLocation()` WorldPoint.new(3293, 3158, 0). AL_KHARID_WINDOW: AgilityShortcut, --- `GWD_SARADOMIN_ROPE_NORTH`: ordinal 177; `getDescription()` "Rope Descent", `getLevel()` 70, `getObstacleIds()` {26371, 26561}, `getTooltip()` "Rope Descent - Level 70", `getWorldLocation()` WorldPoint.new(2912, 5300, 0), `getWorldMapLocation()` WorldPoint.new(2912, 5300, 0). GWD_SARADOMIN_ROPE_NORTH: AgilityShortcut, --- `GWD_SARADOMIN_ROPE_SOUTH`: ordinal 178; `getDescription()` "Rope Descent", `getLevel()` 70, `getObstacleIds()` {26375, 26562}, `getTooltip()` "Rope Descent - Level 70", `getWorldLocation()` WorldPoint.new(2951, 5267, 0), `getWorldMapLocation()` WorldPoint.new(2951, 5267, 0). GWD_SARADOMIN_ROPE_SOUTH: AgilityShortcut, --- `GU_TANOTH_CRUMBLING_WALL`: ordinal 179; `getDescription()` "Rocks", `getLevel()` 71, `getObstacleIds()` {40355, 40356}, `getTooltip()` "Rocks - Level 71", `getWorldLocation()` WorldPoint.new(2545, 3032, 0), `getWorldMapLocation()` WorldPoint.new(2545, 3032, 0). GU_TANOTH_CRUMBLING_WALL: AgilityShortcut, --- `POLLNIVNEACH_STEPPING_STONE`: ordinal 180; `getDescription()` "Stepping stone", `getLevel()` 71, `getObstacleIds()` {53241}, `getTooltip()` "Stepping stone - Level 71", `getWorldLocation()` WorldPoint.new(3371, 2958, 0), `getWorldMapLocation()` WorldPoint.new(3371, 2958, 0). POLLNIVNEACH_STEPPING_STONE: AgilityShortcut, --- `SLAYER_TOWER_ADVANCED_CHAIN_FIRST`: ordinal 181; `getDescription()` "Spikey Chain (Floor 2)", `getLevel()` 71, `getObstacleIds()` {16537}, `getTooltip()` "Spikey Chain (Floor 2) - Level 71", `getWorldLocation()` WorldPoint.new(3447, 3578, 0), `getWorldMapLocation()` WorldPoint.new(3447, 3578, 0). SLAYER_TOWER_ADVANCED_CHAIN_FIRST: AgilityShortcut, --- `SLAYER_TOWER_ADVANCED_CHAIN_SECOND`: ordinal 182; `getDescription()` "Spikey Chain (Floor 3)", `getLevel()` 71, `getObstacleIds()` {16538}, `getTooltip()` "Spikey Chain (Floor 3) - Level 71", `getWorldLocation()` WorldPoint.new(3446, 3576, 0), `getWorldMapLocation()` WorldPoint.new(3446, 3576, 0). SLAYER_TOWER_ADVANCED_CHAIN_SECOND: AgilityShortcut, --- `PROUDSPIRE_UPPER_ROCKS`: ordinal 183; `getDescription()` "Rocks", `getLevel()` 71, `getObstacleIds()` {56978, 56980}, `getTooltip()` "Rocks - Level 71", `getWorldLocation()` WorldPoint.new(1576, 3251, 0), `getWorldMapLocation()` WorldPoint.new(1576, 3251, 0). PROUDSPIRE_UPPER_ROCKS: AgilityShortcut, --- `STRONGHOLD_SLAYER_CAVE_TUNNEL`: ordinal 184; `getDescription()` "Tunnel", `getLevel()` 72, `getObstacleIds()` {30174, 30175}, `getTooltip()` "Tunnel - Level 72", `getWorldLocation()` WorldPoint.new(2431, 9806, 0), `getWorldMapLocation()` WorldPoint.new(2431, 9806, 0). STRONGHOLD_SLAYER_CAVE_TUNNEL: AgilityShortcut, --- `ASGARNIA_ICE_DUNGEON_BASIC_NORTH`: ordinal 185; `getDescription()` "Tunnel", `getLevel()` 72, `getObstacleIds()` {42506}, `getTooltip()` "Tunnel - Level 72", `getWorldLocation()` WorldPoint.new(3025, 9570, 0), `getWorldMapLocation()` WorldPoint.new(3025, 9570, 0). ASGARNIA_ICE_DUNGEON_BASIC_NORTH: AgilityShortcut, --- `ASGARNIA_ICE_DUNGEON_BASIC_SOUTH`: ordinal 186; `getDescription()` "Tunnel", `getLevel()` 72, `getObstacleIds()` {42507}, `getTooltip()` "Tunnel - Level 72", `getWorldLocation()` WorldPoint.new(3033, 9559, 0), `getWorldMapLocation()` WorldPoint.new(3033, 9559, 0). ASGARNIA_ICE_DUNGEON_BASIC_SOUTH: AgilityShortcut, --- `CHAOS_TEMPLE_STEPPING_STONE`: ordinal 187; `getDescription()` "Stepping stone", `getLevel()` 72, `getObstacleIds()` {53237}, `getTooltip()` "Stepping stone - Level 72", `getWorldLocation()` WorldPoint.new(3267, 3628, 0), `getWorldMapLocation()` WorldPoint.new(3267, 3628, 0). CHAOS_TEMPLE_STEPPING_STONE: AgilityShortcut, --- `WYRMSCRAIG_STEPPING_STONES_EAST`: ordinal 188; `getDescription()` "Stepping Stones", `getLevel()` 72, `getObstacleIds()` {62261}, `getTooltip()` "Stepping Stones - Level 72", `getWorldLocation()` WorldPoint.new(2612, 2249, 0), `getWorldMapLocation()` WorldPoint.new(2612, 2249, 0). WYRMSCRAIG_STEPPING_STONES_EAST: AgilityShortcut, --- `BARROWS_WALL_JUMP`: ordinal 189; `getDescription()` "Dry stone wall", `getLevel()` 72, `getObstacleIds()` {53256}, `getTooltip()` "Dry stone wall - Level 72", `getWorldLocation()` WorldPoint.new(3544, 3282, 0), `getWorldMapLocation()` WorldPoint.new(3544, 3282, 0). BARROWS_WALL_JUMP: AgilityShortcut, --- `CATHERBY_OBELISK_SWIM`: ordinal 190; `getDescription()` "Shore", `getLevel()` 72, `getObstacleIds()` {62421}, `getTooltip()` "Shore - Level 72", `getWorldLocation()` nil, `getWorldMapLocation()` nil. CATHERBY_OBELISK_SWIM: AgilityShortcut, --- `TROLL_STRONGHOLD_WALL_CLIMB`: ordinal 191; `getDescription()` "Rocks", `getLevel()` 73, `getObstacleIds()` {16464}, `getTooltip()` "Rocks - Level 73", `getWorldLocation()` WorldPoint.new(2841, 3694, 0), `getWorldMapLocation()` WorldPoint.new(2841, 3694, 0). TROLL_STRONGHOLD_WALL_CLIMB: AgilityShortcut, --- `COF_PLATFORM_TOP`: ordinal 192; `getDescription()` "Platform Edge", `getLevel()` 73, `getObstacleIds()` {56371}, `getTooltip()` "Platform Edge - Level 73", `getWorldLocation()` WorldPoint.new(1438, 10098, 2), `getWorldMapLocation()` WorldPoint.new(1309, 10099, 0). COF_PLATFORM_TOP: AgilityShortcut, --- `COF_PLATFORM_MID`: ordinal 193; `getDescription()` "Jump", `getLevel()` 73, `getObstacleIds()` {56372}, `getTooltip()` "Jump - Level 73", `getWorldLocation()` WorldPoint.new(1443, 10097, 1), `getWorldMapLocation()` WorldPoint.new(1314, 10002, 0). COF_PLATFORM_MID: AgilityShortcut, --- `ARCEUUS_ESSENSE_MINE_WEST`: ordinal 194; `getDescription()` "Rock Climb", `getLevel()` 73, `getObstacleIds()` {27984, 27985}, `getTooltip()` "Rock Climb - Level 73", `getWorldLocation()` WorldPoint.new(1742, 3853, 0), `getWorldMapLocation()` WorldPoint.new(1742, 3853, 0). ARCEUUS_ESSENSE_MINE_WEST: AgilityShortcut, --- `VAMPYRIUM_PILLAR`: ordinal 195; `getDescription()` "Pillar Jump", `getLevel()` 73, `getObstacleIds()` {61116}, `getTooltip()` "Pillar Jump - Level 73", `getWorldLocation()` WorldPoint.new(2571, 7797, 0), `getWorldMapLocation()` WorldPoint.new(2571, 7797, 0). VAMPYRIUM_PILLAR: AgilityShortcut, --- `LAVA_DRAGON_ISLE_JUMP`: ordinal 196; `getDescription()` "Stepping Stone", `getLevel()` 74, `getObstacleIds()` {14918}, `getTooltip()` "Stepping Stone - Level 74", `getWorldLocation()` WorldPoint.new(3200, 3807, 0), `getWorldMapLocation()` WorldPoint.new(3200, 3807, 0). LAVA_DRAGON_ISLE_JUMP: AgilityShortcut, --- `MEIYERDITCH_LAB_TUNNELS_NORTH`: ordinal 197; `getDescription()` "Cave", `getLevel()` 74, `getObstacleIds()` {43755, 43756}, `getTooltip()` "Cave - Level 74", `getWorldLocation()` WorldPoint.new(3623, 9747, 0), `getWorldMapLocation()` WorldPoint.new(3623, 9747, 0). MEIYERDITCH_LAB_TUNNELS_NORTH: AgilityShortcut, --- `MEIYERDITCH_LAB_TUNNELS_SOUTH`: ordinal 198; `getDescription()` "Cave", `getLevel()` 74, `getObstacleIds()` {43757, 43758}, `getTooltip()` "Cave - Level 74", `getWorldLocation()` WorldPoint.new(3618, 9722, 0), `getWorldMapLocation()` WorldPoint.new(3618, 9722, 0). MEIYERDITCH_LAB_TUNNELS_SOUTH: AgilityShortcut, --- `FOSSIL_ISLAND_ZIPLINE`: ordinal 199; `getDescription()` "Zipline", `getLevel()` 74, `getObstacleIds()` {57667}, `getTooltip()` "Zipline - Level 74", `getWorldLocation()` WorldPoint.new(3764, 3883, 0), `getWorldMapLocation()` WorldPoint.new(3764, 3883, 0). FOSSIL_ISLAND_ZIPLINE: AgilityShortcut, --- `MOKHAIOTL_PIT_JUMP`: ordinal 200; `getDescription()` "Jump", `getLevel()` 75, `getObstacleIds()` {56610}, `getTooltip()` "Jump - Level 75", `getWorldLocation()` nil, `getWorldMapLocation()` nil. MOKHAIOTL_PIT_JUMP: AgilityShortcut, --- `REVENANT_CAVES_DEMONS_JUMP`: ordinal 201; `getDescription()` "Jump", `getLevel()` 75, `getObstacleIds()` {31561}, `getTooltip()` "Jump - Level 75", `getWorldLocation()` WorldPoint.new(3199, 10135, 0), `getWorldMapLocation()` WorldPoint.new(3199, 10135, 0). REVENANT_CAVES_DEMONS_JUMP: AgilityShortcut, --- `REVENANT_CAVES_ANKOU_EAST`: ordinal 202; `getDescription()` "Jump", `getLevel()` 75, `getObstacleIds()` {31561}, `getTooltip()` "Jump - Level 75", `getWorldLocation()` WorldPoint.new(3201, 10195, 0), `getWorldMapLocation()` WorldPoint.new(3201, 10195, 0). REVENANT_CAVES_ANKOU_EAST: AgilityShortcut, --- `REVENANT_CAVES_ANKOU_NORTH`: ordinal 203; `getDescription()` "Jump", `getLevel()` 75, `getObstacleIds()` {31561}, `getTooltip()` "Jump - Level 75", `getWorldLocation()` WorldPoint.new(3180, 10209, 0), `getWorldMapLocation()` WorldPoint.new(3180, 10209, 0). REVENANT_CAVES_ANKOU_NORTH: AgilityShortcut, --- `DARKFROST_CLIFF_SCRAMBLE`: ordinal 204; `getDescription()` "Rocks", `getLevel()` 76, `getObstacleIds()` {56986, 56985}, `getTooltip()` "Rocks - Level 76", `getWorldLocation()` WorldPoint.new(1477, 3307, 0), `getWorldMapLocation()` WorldPoint.new(1477, 3307, 0). DARKFROST_CLIFF_SCRAMBLE: AgilityShortcut, --- `ZUL_ANDRA_ISLAND_CROSSING`: ordinal 205; `getDescription()` "Stepping Stone", `getLevel()` 76, `getObstacleIds()` {10663}, `getTooltip()` "Stepping Stone - Level 76", `getWorldLocation()` WorldPoint.new(2156, 3073, 0), `getWorldMapLocation()` WorldPoint.new(2156, 3073, 0). ZUL_ANDRA_ISLAND_CROSSING: AgilityShortcut, --- `WILDERNESS_SLAYER_CAVE_CREVICE_NORTH_EAST`: ordinal 206; `getDescription()` "Crevice", `getLevel()` 77, `getObstacleIds()` {53259}, `getTooltip()` "Crevice - Level 77", `getWorldLocation()` WorldPoint.new(3433, 10093, 0), `getWorldMapLocation()` WorldPoint.new(3433, 10093, 0). WILDERNESS_SLAYER_CAVE_CREVICE_NORTH_EAST: AgilityShortcut, --- `WILDERNESS_SLAYER_CAVE_CREVICE_SOUTH_EAST`: ordinal 207; `getDescription()` "Crevice", `getLevel()` 77, `getObstacleIds()` {53259}, `getTooltip()` "Crevice - Level 77", `getWorldLocation()` WorldPoint.new(3434, 10115, 0), `getWorldMapLocation()` WorldPoint.new(3434, 10115, 0). WILDERNESS_SLAYER_CAVE_CREVICE_SOUTH_EAST: AgilityShortcut, --- `WILDERNESS_SLAYER_CAVE_CREVICE_NORTH_WEST`: ordinal 208; `getDescription()` "Crevice", `getLevel()` 77, `getObstacleIds()` {53259}, `getTooltip()` "Crevice - Level 77", `getWorldLocation()` WorldPoint.new(3341, 10149, 0), `getWorldMapLocation()` WorldPoint.new(3341, 10149, 0). WILDERNESS_SLAYER_CAVE_CREVICE_NORTH_WEST: AgilityShortcut, --- `WILDERNESS_SLAYER_CAVE_CREVICE_SOUTH_WEST`: ordinal 209; `getDescription()` "Crevice", `getLevel()` 77, `getObstacleIds()` {53259}, `getTooltip()` "Crevice - Level 77", `getWorldLocation()` WorldPoint.new(3333, 10119, 0), `getWorldMapLocation()` WorldPoint.new(3333, 10119, 0). WILDERNESS_SLAYER_CAVE_CREVICE_SOUTH_WEST: AgilityShortcut, --- `IORWERTHS_DUNGEON_NORTHERN_SHORTCUT_EAST`: ordinal 210; `getDescription()` "Tight Gap", `getLevel()` 78, `getObstacleIds()` {36692}, `getTooltip()` "Tight Gap - Level 78", `getWorldLocation()` WorldPoint.new(3221, 12441, 0), `getWorldMapLocation()` WorldPoint.new(3221, 12441, 0). IORWERTHS_DUNGEON_NORTHERN_SHORTCUT_EAST: AgilityShortcut, --- `IORWERTHS_DUNGEON_NORTHERN_SHORTCUT_WEST`: ordinal 211; `getDescription()` "Tight Gap", `getLevel()` 78, `getObstacleIds()` {36693}, `getTooltip()` "Tight Gap - Level 78", `getWorldLocation()` WorldPoint.new(3215, 12441, 0), `getWorldMapLocation()` WorldPoint.new(3215, 12441, 0). IORWERTHS_DUNGEON_NORTHERN_SHORTCUT_WEST: AgilityShortcut, --- `CASTLE_DRAKAN_ROCKS_DOWN`: ordinal 212; `getDescription()` "Rocks", `getLevel()` 78, `getObstacleIds()` {60920}, `getTooltip()` "Rocks - Level 78", `getWorldLocation()` WorldPoint.new(2555, 7821, 0), `getWorldMapLocation()` WorldPoint.new(2555, 7821, 0). CASTLE_DRAKAN_ROCKS_DOWN: AgilityShortcut, --- `APSUL_HUNTING_GROUND_ROCKS_DOWN`: ordinal 213; `getDescription()` "Rocks", `getLevel()` 78, `getObstacleIds()` {60924}, `getTooltip()` "Rocks - Level 78", `getWorldLocation()` WorldPoint.new(2576, 7768, 0), `getWorldMapLocation()` WorldPoint.new(2576, 7768, 0). APSUL_HUNTING_GROUND_ROCKS_DOWN: AgilityShortcut, --- `KARAMJA_VOLCANO_SWIM`: ordinal 214; `getDescription()` "Shore", `getLevel()` 78, `getObstacleIds()` {62420}, `getTooltip()` "Shore - Level 78", `getWorldLocation()` nil, `getWorldMapLocation()` nil. KARAMJA_VOLCANO_SWIM: AgilityShortcut, --- `SHILO_VILLAGE_ROCKS`: ordinal 215; `getDescription()` "Rocks", `getLevel()` 79, `getObstacleIds()` {53240, 53238}, `getTooltip()` "Rocks - Level 79", `getWorldLocation()` WorldPoint.new(2870, 3003, 0), `getWorldMapLocation()` WorldPoint.new(2870, 3003, 0). SHILO_VILLAGE_ROCKS: AgilityShortcut, --- `KHARAZI_JUNGLE_VINE_CLIMB`: ordinal 216; `getDescription()` "Vine", `getLevel()` 79, `getObstacleIds()` {26884, 26886}, `getTooltip()` "Vine - Level 79", `getWorldLocation()` WorldPoint.new(2897, 2939, 0), `getWorldMapLocation()` WorldPoint.new(2897, 2939, 0). KHARAZI_JUNGLE_VINE_CLIMB: AgilityShortcut, --- `SOPHANEM_STEPPING_STONE`: ordinal 217; `getDescription()` "Stepping Stone", `getLevel()` 79, `getObstacleIds()` {62401}, `getTooltip()` "Stepping Stone - Level 79", `getWorldLocation()` WorldPoint.new(3266, 2818, 0), `getWorldMapLocation()` WorldPoint.new(3266, 2818, 0). SOPHANEM_STEPPING_STONE: AgilityShortcut, --- `TAVERLEY_DUNGEON_SPIKED_BLADES`: ordinal 218; `getDescription()` "Strange Floor", `getLevel()` 80, `getObstacleIds()` {16510}, `getTooltip()` "Strange Floor - Level 80", `getWorldLocation()` WorldPoint.new(2877, 9813, 0), `getWorldMapLocation()` WorldPoint.new(2877, 9813, 0). TAVERLEY_DUNGEON_SPIKED_BLADES: AgilityShortcut, --- `SLAYER_TOWER_IVY`: ordinal 219; `getDescription()` "Ivy", `getLevel()` 81, `getObstacleIds()` {57677}, `getTooltip()` "Ivy - Level 81", `getWorldLocation()` WorldPoint.new(3417, 3533, 0), `getWorldMapLocation()` WorldPoint.new(3417, 3533, 0). SLAYER_TOWER_IVY: AgilityShortcut, --- `SLAYER_TOWER_TOP_WINDOW`: ordinal 220; `getDescription()` "Window", `getLevel()` 81, `getObstacleIds()` {57678}, `getTooltip()` "Window - Level 81", `getWorldLocation()` WorldPoint.new(3419, 3534, 0), `getWorldMapLocation()` WorldPoint.new(3419, 3534, 0). SLAYER_TOWER_TOP_WINDOW: AgilityShortcut, --- `WATERBIRTH_DUNGEON_CREVICE`: ordinal 221; `getDescription()` "Crevice", `getLevel()` 81, `getObstacleIds()` {53258}, `getTooltip()` "Crevice - Level 81", `getWorldLocation()` WorldPoint.new(2604, 10070, 0), `getWorldMapLocation()` WorldPoint.new(2604, 10070, 0). WATERBIRTH_DUNGEON_CREVICE: AgilityShortcut, --- `LAVA_MAZE_NORTH_JUMP`: ordinal 222; `getDescription()` "Stepping Stone", `getLevel()` 82, `getObstacleIds()` {14917}, `getTooltip()` "Stepping Stone - Level 82", `getWorldLocation()` WorldPoint.new(3092, 3880, 0), `getWorldMapLocation()` WorldPoint.new(3092, 3880, 0). LAVA_MAZE_NORTH_JUMP: AgilityShortcut, --- `ASGARNIA_ICE_DUNGEON_ADEPT_WEST`: ordinal 223; `getDescription()` "Tunnel", `getLevel()` 82, `getObstacleIds()` {53250}, `getTooltip()` "Tunnel - Level 82", `getWorldLocation()` WorldPoint.new(3012, 9549, 0), `getWorldMapLocation()` WorldPoint.new(3012, 9549, 0). ASGARNIA_ICE_DUNGEON_ADEPT_WEST: AgilityShortcut, --- `ASGARNIA_ICE_DUNGEON_ADEPT_EAST`: ordinal 224; `getDescription()` "Tunnel", `getLevel()` 82, `getObstacleIds()` {53251}, `getTooltip()` "Tunnel - Level 82", `getWorldLocation()` WorldPoint.new(3022, 9553, 0), `getWorldMapLocation()` WorldPoint.new(3022, 9553, 0). ASGARNIA_ICE_DUNGEON_ADEPT_EAST: AgilityShortcut, --- `MOS_LEHARMLESS_ISLAND_STEPPING_STONE_NORTH`: ordinal 225; `getDescription()` "Stepping Stone", `getLevel()` 82, `getObstacleIds()` {62411}, `getTooltip()` "Stepping Stone - Level 82", `getWorldLocation()` WorldPoint.new(3808, 3052, 0), `getWorldMapLocation()` WorldPoint.new(3808, 3052, 0). MOS_LEHARMLESS_ISLAND_STEPPING_STONE_NORTH: AgilityShortcut, --- `MOS_LEHARMLESS_ISLAND_STEPPING_STONE_SOUTH`: ordinal 226; `getDescription()` "Stepping Stone", `getLevel()` 82, `getObstacleIds()` {62410}, `getTooltip()` "Stepping Stone - Level 82", `getWorldLocation()` WorldPoint.new(3809, 3049, 0), `getWorldMapLocation()` WorldPoint.new(3809, 3049, 0). MOS_LEHARMLESS_ISLAND_STEPPING_STONE_SOUTH: AgilityShortcut, --- `COF_SHORTCUT_TOP`: ordinal 227; `getDescription()` "Chain", `getLevel()` 83, `getObstacleIds()` {56242}, `getTooltip()` "Chain - Level 83", `getWorldLocation()` WorldPoint.new(1436, 10075, 2), `getWorldMapLocation()` WorldPoint.new(1307, 10076, 0). COF_SHORTCUT_TOP: AgilityShortcut, --- `GRIMSTONE_SHORTCUT_SOUTH`: ordinal 228; `getDescription()` "Ledge", `getLevel()` 83, `getObstacleIds()` {60120}, `getTooltip()` "Ledge - Level 83", `getWorldLocation()` WorldPoint.new(2901, 10454, 0), `getWorldMapLocation()` WorldPoint.new(2901, 10454, 0). GRIMSTONE_SHORTCUT_SOUTH: AgilityShortcut, --- `POLLNIVNEACH_SLOPE_WEST`: ordinal 229; `getDescription()` "Slope", `getLevel()` 83, `getObstacleIds()` {62416}, `getTooltip()` "Slope - Level 83", `getWorldLocation()` WorldPoint.new(3328, 2983, 0), `getWorldMapLocation()` WorldPoint.new(3328, 2983, 0). POLLNIVNEACH_SLOPE_WEST: AgilityShortcut, --- `POLLNIVNEACH_SLOPE_EAST`: ordinal 230; `getDescription()` "Slope", `getLevel()` 83, `getObstacleIds()` {62414, 62415}, `getTooltip()` "Slope - Level 83", `getWorldLocation()` WorldPoint.new(3347, 2981, 0), `getWorldMapLocation()` WorldPoint.new(3347, 2981, 0). POLLNIVNEACH_SLOPE_EAST: AgilityShortcut, --- `IORWERTHS_DUNGEON_SOUTHERN_SHORTCUT_EAST`: ordinal 231; `getDescription()` "Tight Gap", `getLevel()` 84, `getObstacleIds()` {36694}, `getTooltip()` "Tight Gap - Level 84", `getWorldLocation()` WorldPoint.new(3241, 12420, 0), `getWorldMapLocation()` WorldPoint.new(3241, 12420, 0). IORWERTHS_DUNGEON_SOUTHERN_SHORTCUT_EAST: AgilityShortcut, --- `IORWERTHS_DUNGEON_SOUTHERN_SHORTCUT_WEST`: ordinal 232; `getDescription()` "Tight Gap", `getLevel()` 84, `getObstacleIds()` {36695}, `getTooltip()` "Tight Gap - Level 84", `getWorldLocation()` WorldPoint.new(3231, 12420, 0), `getWorldMapLocation()` WorldPoint.new(3231, 12420, 0). IORWERTHS_DUNGEON_SOUTHERN_SHORTCUT_WEST: AgilityShortcut, --- `CRANDOR_ROCK_CLIMB`: ordinal 233; `getDescription()` "Rocks", `getLevel()` 84, `getObstacleIds()` {53236, 53234}, `getTooltip()` "Rocks - Level 84", `getWorldLocation()` WorldPoint.new(2831, 3252, 0), `getWorldMapLocation()` WorldPoint.new(2831, 3252, 0). CRANDOR_ROCK_CLIMB: AgilityShortcut, --- `DEEPFIN_CAVE_SHORTCUT`: ordinal 234; `getDescription()` "Crevice", `getLevel()` 84, `getObstacleIds()` {60146}, `getTooltip()` "Crevice - Level 84", `getWorldLocation()` WorldPoint.new(2081, 9203, 0), `getWorldMapLocation()` WorldPoint.new(2081, 9203, 0). DEEPFIN_CAVE_SHORTCUT: AgilityShortcut, --- `DEEPFIN_CAVE_SHORTCUT_ICON`: ordinal 235; `getDescription()` "Crevice", `getLevel()` 84, `getObstacleIds()` {}, `getTooltip()` "Crevice - Level 84", `getWorldLocation()` WorldPoint.new(2075, 9203, 0), `getWorldMapLocation()` WorldPoint.new(2075, 9203, 0). DEEPFIN_CAVE_SHORTCUT_ICON: AgilityShortcut, --- `ELVEN_ADVANCED_CLIFF_SCRAMBLE`: ordinal 236; `getDescription()` "Rocks", `getLevel()` 85, `getObstacleIds()` {16514, 16515}, `getTooltip()` "Rocks - Level 85", `getWorldLocation()` WorldPoint.new(2337, 3253, 0), `getWorldMapLocation()` WorldPoint.new(2337, 3253, 0). ELVEN_ADVANCED_CLIFF_SCRAMBLE: AgilityShortcut, --- `ELVEN_ADVANCED_CLIFF_SCRAMBLE_PRIFDDINAS`: ordinal 237; `getDescription()` "Rocks", `getLevel()` 85, `getObstacleIds()` {16514, 16515}, `getTooltip()` "Rocks - Level 85", `getWorldLocation()` WorldPoint.new(3361, 6005, 0), `getWorldMapLocation()` WorldPoint.new(3361, 6005, 0). ELVEN_ADVANCED_CLIFF_SCRAMBLE_PRIFDDINAS: AgilityShortcut, --- `WATERBIRTH_ISLAND_ROCKS`: ordinal 238; `getDescription()` "Rocks", `getLevel()` 85, `getObstacleIds()` {53252, 53254}, `getTooltip()` "Rocks - Level 85", `getWorldLocation()` WorldPoint.new(2546, 3750, 0), `getWorldMapLocation()` WorldPoint.new(2546, 3750, 0). WATERBIRTH_ISLAND_ROCKS: AgilityShortcut, --- `DARKMEYER_WALL_ROCKS`: ordinal 239; `getDescription()` "Rocks", `getLevel()` 86, `getObstacleIds()` {29044, 57666}, `getTooltip()` "Rocks - Level 86", `getWorldLocation()` WorldPoint.new(3563, 3380, 0), `getWorldMapLocation()` WorldPoint.new(3563, 3380, 0). DARKMEYER_WALL_ROCKS: AgilityShortcut, --- `KALPHITE_WALL`: ordinal 240; `getDescription()` "Crevice", `getLevel()` 86, `getObstacleIds()` {16465}, `getTooltip()` "Crevice - Level 86", `getWorldLocation()` WorldPoint.new(3214, 9508, 0), `getWorldMapLocation()` WorldPoint.new(3214, 9508, 0). KALPHITE_WALL: AgilityShortcut, --- `BRIMHAVEN_DUNGEON_VINE_EAST`: ordinal 241; `getDescription()` "Vine", `getLevel()` 87, `getObstacleIds()` {26880, 26882}, `getTooltip()` "Vine - Level 87", `getWorldLocation()` WorldPoint.new(2672, 9582, 0), `getWorldMapLocation()` WorldPoint.new(2672, 9582, 0). BRIMHAVEN_DUNGEON_VINE_EAST: AgilityShortcut, --- `BRIMHAVEN_DUNGEON_VINE_WEST`: ordinal 242; `getDescription()` "Vine", `getLevel()` 87, `getObstacleIds()` {26880, 26882}, `getTooltip()` "Vine - Level 87", `getWorldLocation()` WorldPoint.new(2606, 9584, 0), `getWorldMapLocation()` WorldPoint.new(2606, 9584, 0). BRIMHAVEN_DUNGEON_VINE_WEST: AgilityShortcut, --- `MOUNT_KARUULM_PIPE_SOUTH`: ordinal 243; `getDescription()` "Pipe", `getLevel()` 88, `getObstacleIds()` {34655}, `getTooltip()` "Pipe - Level 88", `getWorldLocation()` WorldPoint.new(1316, 10214, 0), `getWorldMapLocation()` WorldPoint.new(1316, 10214, 0). MOUNT_KARUULM_PIPE_SOUTH: AgilityShortcut, --- `MOUNT_KARUULM_PIPE_NORTH`: ordinal 244; `getDescription()` "Pipe", `getLevel()` 88, `getObstacleIds()` {34655}, `getTooltip()` "Pipe - Level 88", `getWorldLocation()` WorldPoint.new(1345, 10230, 0), `getWorldMapLocation()` WorldPoint.new(1345, 10230, 0). MOUNT_KARUULM_PIPE_NORTH: AgilityShortcut, --- `REVENANT_CAVES_CHAMBER_JUMP`: ordinal 245; `getDescription()` "Jump", `getLevel()` 89, `getObstacleIds()` {31561}, `getTooltip()` "Jump - Level 89", `getWorldLocation()` WorldPoint.new(3240, 10144, 0), `getWorldMapLocation()` WorldPoint.new(3240, 10144, 0). REVENANT_CAVES_CHAMBER_JUMP: AgilityShortcut, --- `VIYELDI_ROCK_CLIMB`: ordinal 246; `getDescription()` "Rocks", `getLevel()` 91, `getObstacleIds()` {40960, 40962}, `getTooltip()` "Rocks - Level 91", `getWorldLocation()` nil, `getWorldMapLocation()` nil. VIYELDI_ROCK_CLIMB: AgilityShortcut, --- `MEIYERDITCH_LAB_ADVANCED_TUNNELS_WEST`: ordinal 247; `getDescription()` "Cave", `getLevel()` 93, `getObstacleIds()` {43759}, `getTooltip()` "Cave - Level 93", `getWorldLocation()` WorldPoint.new(3499, 9738, 0), `getWorldMapLocation()` WorldPoint.new(3499, 9738, 0). MEIYERDITCH_LAB_ADVANCED_TUNNELS_WEST: AgilityShortcut, --- `MEIYERDITCH_LAB_ADVANCED_TUNNELS_MIDDLE`: ordinal 248; `getDescription()` "Cave", `getLevel()` 93, `getObstacleIds()` {43840}, `getTooltip()` "Cave - Level 93", `getWorldLocation()` WorldPoint.new(3597, 9704, 0), `getWorldMapLocation()` WorldPoint.new(3597, 9704, 0). MEIYERDITCH_LAB_ADVANCED_TUNNELS_MIDDLE: AgilityShortcut, --- `MEIYERDITCH_LAB_ADVANCED_TUNNELS_EAST`: ordinal 249; `getDescription()` "Cave", `getLevel()` 93, `getObstacleIds()` {43762, 43763}, `getTooltip()` "Cave - Level 93", `getWorldLocation()` WorldPoint.new(3604, 9708, 0), `getWorldMapLocation()` WorldPoint.new(3604, 9708, 0). MEIYERDITCH_LAB_ADVANCED_TUNNELS_EAST: AgilityShortcut, --- `VIYELDI_CAVES_CREVICE`: ordinal 250; `getDescription()` "Crevice", `getLevel()` 96, `getObstacleIds()` {53242}, `getTooltip()` "Crevice - Level 96", `getWorldLocation()` nil, `getWorldMapLocation()` nil. VIYELDI_CAVES_CREVICE: AgilityShortcut, } --- `AgilityShortcut`'s static functions and constants. declare AgilityShortcut: AgilityShortcutClass --- Enum `FishingSpot`: 27 constants, each one userdata per VM, so `==` is identity and a constant is a table key. `FishingSpot.values()`, `FishingSpot.valueOf(name)`; every constant answers `name()`, `ordinal()` (0-based), `toString()`, `compareTo()` and `equals()`, plus `getFishSpriteId()`, `getIds()`, `getName()`, `getWorldMapTooltip()`. export type FishingSpot = { --- The constant's name as declared. name: (FishingSpot) -> string, --- The constant's 0-based position in `values()`. ordinal: (FishingSpot) -> number, --- `name()`; `tostring(c)` answers the same. toString: (FishingSpot) -> string, --- This ordinal less `other`'s. compareTo: (FishingSpot, FishingSpot) -> number, --- Whether `other` is this constant. `==` answers the same. equals: (FishingSpot, any) -> boolean, --- This constant's `getFishSpriteId()` value, listed on each constant. getFishSpriteId: (FishingSpot) -> number, --- This constant's `getIds()` value, listed on each constant. getIds: (FishingSpot) -> {number}, --- This constant's `getName()` value, listed on each constant. getName: (FishingSpot) -> string, --- This constant's `getWorldMapTooltip()` value, listed on each constant. getWorldMapTooltip: (FishingSpot) -> string, } export type FishingSpotClass = { --- Every constant in ordinal order, as a 1-based array: the same frozen array every `values()` call, so `table.clone` it before changing it. values: () -> {FishingSpot}, --- `valueOf(name)`: the constant named `name`; any other name is an error. valueOf: (string) -> FishingSpot, --- The spot whose `getIds()` holds NPC id `id`, or `nil`. findSpot: (number) -> FishingSpot?, --- `SHRIMP`: ordinal 0; `getFishSpriteId()` 317, `getIds()` {1514, 1517, 1518, 1521, 1523, 1524, 1525, 1528, 1530, 1544, 3913, 7155, 7459, 7462, 7467, 7469, 7947, 10513, 12778, 14038, 14040, 14041, 14524, 15066, 16338}, `getName()` "Shrimp, Anchovies, Sardine, Herring", `getWorldMapTooltip()` "Anchovies". SHRIMP: FishingSpot, --- `LOBSTER`: ordinal 1; `getFishSpriteId()` 377, `getIds()` {1510, 1519, 1522, 2146, 3914, 5820, 7199, 7460, 7465, 7470, 7946, 9173, 9174, 10515, 10635, 12777, 14039, 15070, 15071, 15075, 15076, 15079, 15084, 15086, 16340}, `getName()` "Lobster, Swordfish, Tuna", `getWorldMapTooltip()` "Lobster". LOBSTER: FishingSpot, --- `SHARK`: ordinal 2; `getFishSpriteId()` 383, `getIds()` {1511, 1520, 3419, 3915, 4476, 4477, 5233, 5234, 5821, 7200, 7461, 7466, 8525, 8526, 8527, 9171, 9172, 10514, 12775, 12776, 14037, 14523, 15067, 15068, 15069, 15077, 15080, 15082, 15083, 15087, 16339}, `getName()` "Shark, Bass", `getWorldMapTooltip()` "Shark". SHARK: FishingSpot, --- `MONKFISH`: ordinal 3; `getFishSpriteId()` 7944, `getIds()` {4316, 16343}, `getName()` "Monkfish", `getWorldMapTooltip()` "Monkfish". MONKFISH: FishingSpot, --- `SALMON`: ordinal 4; `getFishSpriteId()` 331, `getIds()` {394, 1506, 1507, 1508, 1509, 1513, 1515, 1516, 1526, 1527, 3417, 3418, 7463, 7464, 7468, 8524, 12774, 14036, 14525, 14526, 14527, 14528, 1512, 1529, 14521, 14522, 15072, 15073}, `getName()` "Salmon, Trout, Pike", `getWorldMapTooltip()` "Salmon". SALMON: FishingSpot, --- `LAVA_EEL`: ordinal 5; `getFishSpriteId()` 2149, `getIds()` {4928, 6784, 15384}, `getName()` "Lava eel", `getWorldMapTooltip()` "Lava eel". LAVA_EEL: FishingSpot, --- `BARB_FISH`: ordinal 6; `getFishSpriteId()` 11332, `getIds()` {1542, 7323}, `getName()` "Sturgeon, Salmon, Trout", `getWorldMapTooltip()` "Sturgeon, Salmon, Trout". BARB_FISH: FishingSpot, --- `ANGLERFISH`: ordinal 7; `getFishSpriteId()` 13439, `getIds()` {6825, 16342}, `getName()` "Anglerfish", `getWorldMapTooltip()` "Anglerfish". ANGLERFISH: FishingSpot, --- `MINNOW`: ordinal 8; `getFishSpriteId()` 21356, `getIds()` {7730, 7731, 7732, 7733}, `getName()` "Minnow", `getWorldMapTooltip()` "Minnow". MINNOW: FishingSpot, --- `HARPOONFISH`: ordinal 9; `getFishSpriteId()` 25564, `getIds()` {10565, 10568, 10569}, `getName()` "Harpoonfish", `getWorldMapTooltip()` "Harpoonfish". HARPOONFISH: FishingSpot, --- `INFERNAL_EEL`: ordinal 10; `getFishSpriteId()` 21293, `getIds()` {7676}, `getName()` "Infernal Eel", `getWorldMapTooltip()` "Infernal Eel". INFERNAL_EEL: FishingSpot, --- `KARAMBWAN`: ordinal 11; `getFishSpriteId()` 3142, `getIds()` {4712, 4713, 16341}, `getName()` "Karambwan", `getWorldMapTooltip()` "Karambwan". KARAMBWAN: FishingSpot, --- `KARAMBWANJI`: ordinal 12; `getFishSpriteId()` 3150, `getIds()` {4710}, `getName()` "Karambwanji, Shrimp", `getWorldMapTooltip()` "Karambwanji". KARAMBWANJI: FishingSpot, --- `SACRED_EEL`: ordinal 13; `getFishSpriteId()` 13339, `getIds()` {6488}, `getName()` "Sacred eel", `getWorldMapTooltip()` "Sacred eel". SACRED_EEL: FishingSpot, --- `CAVE_EEL`: ordinal 14; `getFishSpriteId()` 5001, `getIds()` {1497, 1498, 1499, 1500}, `getName()` "Frog spawn, Cave eel", `getWorldMapTooltip()` "Frog spawn, Cave eel". CAVE_EEL: FishingSpot, --- `SLIMY_EEL`: ordinal 15; `getFishSpriteId()` 3379, `getIds()` {2653, 2654, 2655}, `getName()` "Slimy eel", `getWorldMapTooltip()` "Slimy eel". SLIMY_EEL: FishingSpot, --- `DARK_CRAB`: ordinal 16; `getFishSpriteId()` 11934, `getIds()` {1535, 1536}, `getName()` "Dark Crab", `getWorldMapTooltip()` "Dark Crab". DARK_CRAB: FishingSpot, --- `COMMON_TENCH`: ordinal 17; `getFishSpriteId()` 22829, `getIds()` {8523}, `getName()` "Common tench, Bluegill, Greater siren, Mottled eel", `getWorldMapTooltip()` "Greater siren". COMMON_TENCH: FishingSpot, --- `CAMDOZAAL_TETRA`: ordinal 18; `getFishSpriteId()` 25666, `getIds()` {10686}, `getName()` "Guppy, Cavefish, Tetra, Catfish, Barronite shards, Barronite handle", `getWorldMapTooltip()` "Tetra". CAMDOZAAL_TETRA: FishingSpot, --- `CAMDOZAAL_CAVE_EEL`: ordinal 19; `getFishSpriteId()` 5003, `getIds()` {10653}, `getName()` "Slimy eel, Cave eel", `getWorldMapTooltip()` "Cave eel". CAMDOZAAL_CAVE_EEL: FishingSpot, --- `TUTORIAL_SHRIMP`: ordinal 20; `getFishSpriteId()` 317, `getIds()` {3317}, `getName()` "Shrimp", `getWorldMapTooltip()` "Shrimp". TUTORIAL_SHRIMP: FishingSpot, --- `ETCETERIA_LOBSTER`: ordinal 21; `getFishSpriteId()` 377, `getIds()` {3657}, `getName()` "Lobster", `getWorldMapTooltip()` "Lobster (Approval only)". ETCETERIA_LOBSTER: FishingSpot, --- `QUEST_RUM_DEAL`: ordinal 22; `getFishSpriteId()` 6715, `getIds()` {635}, `getName()` "Sluglings", `getWorldMapTooltip()` "Rum deal (Quest)". QUEST_RUM_DEAL: FishingSpot, --- `QUEST_TAI_BWO_WANNAI_TRIO`: ordinal 23; `getFishSpriteId()` 3142, `getIds()` {4714}, `getName()` "Karambwan", `getWorldMapTooltip()` "Tai Bwo Wannai Trio (Quest)". QUEST_TAI_BWO_WANNAI_TRIO: FishingSpot, --- `QUEST_FISHING_CONTEST`: ordinal 24; `getFishSpriteId()` 337, `getIds()` {4079, 4080, 4081, 4082}, `getName()` "Giant carp", `getWorldMapTooltip()` "Fishing Contest (Quest)". QUEST_FISHING_CONTEST: FishingSpot, --- `CIVITAS_ILLA_FORTIS_PARK`: ordinal 25; `getFishSpriteId()` 29325, `getIds()` {13329}, `getName()` "House Keys", `getWorldMapTooltip()` "House Keys". CIVITAS_ILLA_FORTIS_PARK: FishingSpot, --- `SQUID`: ordinal 26; `getFishSpriteId()` 31561, `getIds()` {15074, 15078, 15081, 15085}, `getName()` "Squid", `getWorldMapTooltip()` "Squid". SQUID: FishingSpot, } --- `FishingSpot`'s static functions and constants. declare FishingSpot: FishingSpotClass --- Enum `HiscoreEndpoint`: 11 constants, each one userdata per VM, so `==` is identity and a constant is a table key. `HiscoreEndpoint.values()`, `HiscoreEndpoint.valueOf(name)`; every constant answers `name()`, `ordinal()` (0-based), `toString()`, `compareTo()` and `equals()`, plus `getHiscoreURL()`, `getName()`. export type HiscoreEndpoint = { --- The constant's name as declared. name: (HiscoreEndpoint) -> string, --- The constant's 0-based position in `values()`. ordinal: (HiscoreEndpoint) -> number, --- `name()`; `tostring(c)` answers the same. toString: (HiscoreEndpoint) -> string, --- This ordinal less `other`'s. compareTo: (HiscoreEndpoint, HiscoreEndpoint) -> number, --- Whether `other` is this constant. `==` answers the same. equals: (HiscoreEndpoint, any) -> boolean, --- This constant's `getHiscoreURL()` value, listed on each constant. getHiscoreURL: (HiscoreEndpoint) -> string, --- This constant's `getName()` value, listed on each constant. getName: (HiscoreEndpoint) -> string, } export type HiscoreEndpointClass = { --- Every constant in ordinal order, as a 1-based array: the same frozen array every `values()` call, so `table.clone` it before changing it. values: () -> {HiscoreEndpoint}, --- `valueOf(name)`: the constant named `name`; any other name is an error. valueOf: (string) -> HiscoreEndpoint, --- The hiscores a world of `worldTypes` (a set or an array) ranks on: `SEASONAL`, `TOURNAMENT`, `DEADMAN`, `FRESH_START_WORLD`, `HARDCORE_MAIN` in that order of precedence, else `NORMAL`. fromWorldTypes: ({[WorldType]: boolean}) -> HiscoreEndpoint, --- `NORMAL`: ordinal 0; `getHiscoreURL()` "https://services.runescape.com/m=hiscore_oldschool/index_lite.json", `getName()` "Normal". NORMAL: HiscoreEndpoint, --- `IRONMAN`: ordinal 1; `getHiscoreURL()` "https://services.runescape.com/m=hiscore_oldschool_ironman/index_lite.json", `getName()` "Ironman". IRONMAN: HiscoreEndpoint, --- `HARDCORE_IRONMAN`: ordinal 2; `getHiscoreURL()` "https://services.runescape.com/m=hiscore_oldschool_hardcore_ironman/index_lite.json", `getName()` "Hardcore Ironman". HARDCORE_IRONMAN: HiscoreEndpoint, --- `ULTIMATE_IRONMAN`: ordinal 3; `getHiscoreURL()` "https://services.runescape.com/m=hiscore_oldschool_ultimate/index_lite.json", `getName()` "Ultimate Ironman". ULTIMATE_IRONMAN: HiscoreEndpoint, --- `DEADMAN`: ordinal 4; `getHiscoreURL()` "https://services.runescape.com/m=hiscore_oldschool_deadman/index_lite.json", `getName()` "Deadman". DEADMAN: HiscoreEndpoint, --- `SEASONAL`: ordinal 5; `getHiscoreURL()` "https://services.runescape.com/m=hiscore_oldschool_seasonal/index_lite.json", `getName()` "Leagues". SEASONAL: HiscoreEndpoint, --- `TOURNAMENT`: ordinal 6; `getHiscoreURL()` "https://services.runescape.com/m=hiscore_oldschool_tournament/index_lite.json", `getName()` "Tournament". TOURNAMENT: HiscoreEndpoint, --- `FRESH_START_WORLD`: ordinal 7; `getHiscoreURL()` "https://secure.runescape.com/m=hiscore_oldschool_fresh_start/index_lite.json", `getName()` "Fresh Start". FRESH_START_WORLD: HiscoreEndpoint, --- `PURE`: ordinal 8; `getHiscoreURL()` "https://secure.runescape.com/m=hiscore_oldschool_skiller_defence/index_lite.json", `getName()` "1 Defence Pure". PURE: HiscoreEndpoint, --- `LEVEL_3_SKILLER`: ordinal 9; `getHiscoreURL()` "https://secure.runescape.com/m=hiscore_oldschool_skiller/index_lite.json", `getName()` "Level 3 Skiller". LEVEL_3_SKILLER: HiscoreEndpoint, --- `HARDCORE_MAIN`: ordinal 10; `getHiscoreURL()` "https://secure.runescape.com/m=hiscore_oldschool_hardcore_mains/index_lite.json", `getName()` "Hardcore Main". HARDCORE_MAIN: HiscoreEndpoint, } --- `HiscoreEndpoint`'s static functions and constants. declare HiscoreEndpoint: HiscoreEndpointClass --- Enum `HiscoreSkill`: 113 constants, each one userdata per VM, so `==` is identity and a constant is a table key. `HiscoreSkill.values()`, `HiscoreSkill.valueOf(name)`; every constant answers `name()`, `ordinal()` (0-based), `toString()`, `compareTo()` and `equals()`, plus `getName()`, `getSpriteId()`, `getType()`. export type HiscoreSkill = { --- The constant's name as declared. name: (HiscoreSkill) -> string, --- The constant's 0-based position in `values()`. ordinal: (HiscoreSkill) -> number, --- `name()`; `tostring(c)` answers the same. toString: (HiscoreSkill) -> string, --- This ordinal less `other`'s. compareTo: (HiscoreSkill, HiscoreSkill) -> number, --- Whether `other` is this constant. `==` answers the same. equals: (HiscoreSkill, any) -> boolean, --- This constant's `getName()` value, listed on each constant. getName: (HiscoreSkill) -> string, --- This constant's `getSpriteId()` value, listed on each constant. getSpriteId: (HiscoreSkill) -> number, --- This constant's `getType()` value, listed on each constant. getType: (HiscoreSkill) -> HiscoreSkillType, } export type HiscoreSkillClass = { --- Every constant in ordinal order, as a 1-based array: the same frozen array every `values()` call, so `table.clone` it before changing it. values: () -> {HiscoreSkill}, --- `valueOf(name)`: the constant named `name`; any other name is an error. valueOf: (string) -> HiscoreSkill, --- `OVERALL`: ordinal 0; `getName()` "Overall", `getSpriteId()` 222, `getType()` HiscoreSkillType.OVERALL. OVERALL: HiscoreSkill, --- `ATTACK`: ordinal 1; `getName()` "Attack", `getSpriteId()` 197, `getType()` HiscoreSkillType.SKILL. ATTACK: HiscoreSkill, --- `DEFENCE`: ordinal 2; `getName()` "Defence", `getSpriteId()` 199, `getType()` HiscoreSkillType.SKILL. DEFENCE: HiscoreSkill, --- `STRENGTH`: ordinal 3; `getName()` "Strength", `getSpriteId()` 198, `getType()` HiscoreSkillType.SKILL. STRENGTH: HiscoreSkill, --- `HITPOINTS`: ordinal 4; `getName()` "Hitpoints", `getSpriteId()` 203, `getType()` HiscoreSkillType.SKILL. HITPOINTS: HiscoreSkill, --- `RANGED`: ordinal 5; `getName()` "Ranged", `getSpriteId()` 200, `getType()` HiscoreSkillType.SKILL. RANGED: HiscoreSkill, --- `PRAYER`: ordinal 6; `getName()` "Prayer", `getSpriteId()` 201, `getType()` HiscoreSkillType.SKILL. PRAYER: HiscoreSkill, --- `MAGIC`: ordinal 7; `getName()` "Magic", `getSpriteId()` 202, `getType()` HiscoreSkillType.SKILL. MAGIC: HiscoreSkill, --- `COOKING`: ordinal 8; `getName()` "Cooking", `getSpriteId()` 212, `getType()` HiscoreSkillType.SKILL. COOKING: HiscoreSkill, --- `WOODCUTTING`: ordinal 9; `getName()` "Woodcutting", `getSpriteId()` 214, `getType()` HiscoreSkillType.SKILL. WOODCUTTING: HiscoreSkill, --- `FLETCHING`: ordinal 10; `getName()` "Fletching", `getSpriteId()` 208, `getType()` HiscoreSkillType.SKILL. FLETCHING: HiscoreSkill, --- `FISHING`: ordinal 11; `getName()` "Fishing", `getSpriteId()` 211, `getType()` HiscoreSkillType.SKILL. FISHING: HiscoreSkill, --- `FIREMAKING`: ordinal 12; `getName()` "Firemaking", `getSpriteId()` 213, `getType()` HiscoreSkillType.SKILL. FIREMAKING: HiscoreSkill, --- `CRAFTING`: ordinal 13; `getName()` "Crafting", `getSpriteId()` 207, `getType()` HiscoreSkillType.SKILL. CRAFTING: HiscoreSkill, --- `SMITHING`: ordinal 14; `getName()` "Smithing", `getSpriteId()` 210, `getType()` HiscoreSkillType.SKILL. SMITHING: HiscoreSkill, --- `MINING`: ordinal 15; `getName()` "Mining", `getSpriteId()` 209, `getType()` HiscoreSkillType.SKILL. MINING: HiscoreSkill, --- `HERBLORE`: ordinal 16; `getName()` "Herblore", `getSpriteId()` 205, `getType()` HiscoreSkillType.SKILL. HERBLORE: HiscoreSkill, --- `AGILITY`: ordinal 17; `getName()` "Agility", `getSpriteId()` 204, `getType()` HiscoreSkillType.SKILL. AGILITY: HiscoreSkill, --- `THIEVING`: ordinal 18; `getName()` "Thieving", `getSpriteId()` 206, `getType()` HiscoreSkillType.SKILL. THIEVING: HiscoreSkill, --- `SLAYER`: ordinal 19; `getName()` "Slayer", `getSpriteId()` 216, `getType()` HiscoreSkillType.SKILL. SLAYER: HiscoreSkill, --- `FARMING`: ordinal 20; `getName()` "Farming", `getSpriteId()` 217, `getType()` HiscoreSkillType.SKILL. FARMING: HiscoreSkill, --- `RUNECRAFT`: ordinal 21; `getName()` "Runecraft", `getSpriteId()` 215, `getType()` HiscoreSkillType.SKILL. RUNECRAFT: HiscoreSkill, --- `HUNTER`: ordinal 22; `getName()` "Hunter", `getSpriteId()` 220, `getType()` HiscoreSkillType.SKILL. HUNTER: HiscoreSkill, --- `CONSTRUCTION`: ordinal 23; `getName()` "Construction", `getSpriteId()` 221, `getType()` HiscoreSkillType.SKILL. CONSTRUCTION: HiscoreSkill, --- `SAILING`: ordinal 24; `getName()` "Sailing", `getSpriteId()` 228, `getType()` HiscoreSkillType.SKILL. SAILING: HiscoreSkill, --- `LEAGUE_POINTS`: ordinal 25; `getName()` "League Points", `getSpriteId()` 5857, `getType()` HiscoreSkillType.ACTIVITY. LEAGUE_POINTS: HiscoreSkill, --- `BOUNTY_HUNTER_HUNTER`: ordinal 26; `getName()` "Bounty Hunter - Hunter", `getSpriteId()` 5854, `getType()` HiscoreSkillType.ACTIVITY. BOUNTY_HUNTER_HUNTER: HiscoreSkill, --- `BOUNTY_HUNTER_ROGUE`: ordinal 27; `getName()` "Bounty Hunter - Rogue", `getSpriteId()` 5855, `getType()` HiscoreSkillType.ACTIVITY. BOUNTY_HUNTER_ROGUE: HiscoreSkill, --- `CLUE_SCROLL_ALL`: ordinal 28; `getName()` "Clue Scrolls (all)", `getSpriteId()` 5853, `getType()` HiscoreSkillType.ACTIVITY. CLUE_SCROLL_ALL: HiscoreSkill, --- `CLUE_SCROLL_BEGINNER`: ordinal 29; `getName()` "Clue Scrolls (beginner)", `getSpriteId()` -1, `getType()` HiscoreSkillType.ACTIVITY. CLUE_SCROLL_BEGINNER: HiscoreSkill, --- `CLUE_SCROLL_EASY`: ordinal 30; `getName()` "Clue Scrolls (easy)", `getSpriteId()` -1, `getType()` HiscoreSkillType.ACTIVITY. CLUE_SCROLL_EASY: HiscoreSkill, --- `CLUE_SCROLL_MEDIUM`: ordinal 31; `getName()` "Clue Scrolls (medium)", `getSpriteId()` -1, `getType()` HiscoreSkillType.ACTIVITY. CLUE_SCROLL_MEDIUM: HiscoreSkill, --- `CLUE_SCROLL_HARD`: ordinal 32; `getName()` "Clue Scrolls (hard)", `getSpriteId()` -1, `getType()` HiscoreSkillType.ACTIVITY. CLUE_SCROLL_HARD: HiscoreSkill, --- `CLUE_SCROLL_ELITE`: ordinal 33; `getName()` "Clue Scrolls (elite)", `getSpriteId()` -1, `getType()` HiscoreSkillType.ACTIVITY. CLUE_SCROLL_ELITE: HiscoreSkill, --- `CLUE_SCROLL_MASTER`: ordinal 34; `getName()` "Clue Scrolls (master)", `getSpriteId()` -1, `getType()` HiscoreSkillType.ACTIVITY. CLUE_SCROLL_MASTER: HiscoreSkill, --- `LAST_MAN_STANDING`: ordinal 35; `getName()` "LMS - Rank", `getSpriteId()` 5856, `getType()` HiscoreSkillType.ACTIVITY. LAST_MAN_STANDING: HiscoreSkill, --- `PVP_ARENA_RANK`: ordinal 36; `getName()` "PvP Arena - Rank", `getSpriteId()` 5859, `getType()` HiscoreSkillType.ACTIVITY. PVP_ARENA_RANK: HiscoreSkill, --- `SOUL_WARS_ZEAL`: ordinal 37; `getName()` "Soul Wars Zeal", `getSpriteId()` 5858, `getType()` HiscoreSkillType.ACTIVITY. SOUL_WARS_ZEAL: HiscoreSkill, --- `RIFTS_CLOSED`: ordinal 38; `getName()` "Rifts closed", `getSpriteId()` 5860, `getType()` HiscoreSkillType.ACTIVITY. RIFTS_CLOSED: HiscoreSkill, --- `COLOSSEUM_GLORY`: ordinal 39; `getName()` "Colosseum Glory", `getSpriteId()` 5862, `getType()` HiscoreSkillType.ACTIVITY. COLOSSEUM_GLORY: HiscoreSkill, --- `COLLECTIONS_LOGGED`: ordinal 40; `getName()` "Collections Logged", `getSpriteId()` 6390, `getType()` HiscoreSkillType.ACTIVITY. COLLECTIONS_LOGGED: HiscoreSkill, --- `ABYSSAL_SIRE`: ordinal 41; `getName()` "Abyssal Sire", `getSpriteId()` 4276, `getType()` HiscoreSkillType.BOSS. ABYSSAL_SIRE: HiscoreSkill, --- `ALCHEMICAL_HYDRA`: ordinal 42; `getName()` "Alchemical Hydra", `getSpriteId()` 4289, `getType()` HiscoreSkillType.BOSS. ALCHEMICAL_HYDRA: HiscoreSkill, --- `AMOXLIATL`: ordinal 43; `getName()` "Amoxliatl", `getSpriteId()` 5639, `getType()` HiscoreSkillType.BOSS. AMOXLIATL: HiscoreSkill, --- `ARAXXOR`: ordinal 44; `getName()` "Araxxor", `getSpriteId()` 5638, `getType()` HiscoreSkillType.BOSS. ARAXXOR: HiscoreSkill, --- `ARTIO`: ordinal 45; `getName()` "Artio", `getSpriteId()` 5622, `getType()` HiscoreSkillType.BOSS. ARTIO: HiscoreSkill, --- `BARROWS_CHESTS`: ordinal 46; `getName()` "Barrows Chests", `getSpriteId()` 4267, `getType()` HiscoreSkillType.BOSS. BARROWS_CHESTS: HiscoreSkill, --- `BRUTUS`: ordinal 47; `getName()` "Brutus", `getSpriteId()` 6352, `getType()` HiscoreSkillType.BOSS. BRUTUS: HiscoreSkill, --- `BRYOPHYTA`: ordinal 48; `getName()` "Bryophyta", `getSpriteId()` 4262, `getType()` HiscoreSkillType.BOSS. BRYOPHYTA: HiscoreSkill, --- `CALLISTO`: ordinal 49; `getName()` "Callisto", `getSpriteId()` 5622, `getType()` HiscoreSkillType.BOSS. CALLISTO: HiscoreSkill, --- `CALVARION`: ordinal 50; `getName()` "Calvar'ion", `getSpriteId()` 5623, `getType()` HiscoreSkillType.BOSS. CALVARION: HiscoreSkill, --- `CERBERUS`: ordinal 51; `getName()` "Cerberus", `getSpriteId()` 4280, `getType()` HiscoreSkillType.BOSS. CERBERUS: HiscoreSkill, --- `CHAMBERS_OF_XERIC`: ordinal 52; `getName()` "Chambers of Xeric", `getSpriteId()` 4288, `getType()` HiscoreSkillType.BOSS. CHAMBERS_OF_XERIC: HiscoreSkill, --- `CHAMBERS_OF_XERIC_CHALLENGE_MODE`: ordinal 53; `getName()` "Chambers of Xeric: Challenge Mode", `getSpriteId()` 4296, `getType()` HiscoreSkillType.BOSS. CHAMBERS_OF_XERIC_CHALLENGE_MODE: HiscoreSkill, --- `CHAOS_ELEMENTAL`: ordinal 54; `getName()` "Chaos Elemental", `getSpriteId()` 5621, `getType()` HiscoreSkillType.BOSS. CHAOS_ELEMENTAL: HiscoreSkill, --- `CHAOS_FANATIC`: ordinal 55; `getName()` "Chaos Fanatic", `getSpriteId()` 5625, `getType()` HiscoreSkillType.BOSS. CHAOS_FANATIC: HiscoreSkill, --- `COMMANDER_ZILYANA`: ordinal 56; `getName()` "Commander Zilyana", `getSpriteId()` 4284, `getType()` HiscoreSkillType.BOSS. COMMANDER_ZILYANA: HiscoreSkill, --- `CORPOREAL_BEAST`: ordinal 57; `getName()` "Corporeal Beast", `getSpriteId()` 4287, `getType()` HiscoreSkillType.BOSS. CORPOREAL_BEAST: HiscoreSkill, --- `CRAZY_ARCHAEOLOGIST`: ordinal 58; `getName()` "Crazy Archaeologist", `getSpriteId()` 5626, `getType()` HiscoreSkillType.BOSS. CRAZY_ARCHAEOLOGIST: HiscoreSkill, --- `DAGANNOTH_PRIME`: ordinal 59; `getName()` "Dagannoth Prime", `getSpriteId()` 4294, `getType()` HiscoreSkillType.BOSS. DAGANNOTH_PRIME: HiscoreSkill, --- `DAGANNOTH_REX`: ordinal 60; `getName()` "Dagannoth Rex", `getSpriteId()` 4293, `getType()` HiscoreSkillType.BOSS. DAGANNOTH_REX: HiscoreSkill, --- `DAGANNOTH_SUPREME`: ordinal 61; `getName()` "Dagannoth Supreme", `getSpriteId()` 4292, `getType()` HiscoreSkillType.BOSS. DAGANNOTH_SUPREME: HiscoreSkill, --- `DERANGED_ARCHAEOLOGIST`: ordinal 62; `getName()` "Deranged Archaeologist", `getSpriteId()` 5627, `getType()` HiscoreSkillType.BOSS. DERANGED_ARCHAEOLOGIST: HiscoreSkill, --- `DOOM_OF_MOKHAIOTL`: ordinal 63; `getName()` "Doom of Mokhaiotl", `getSpriteId()` 6347, `getType()` HiscoreSkillType.BOSS. DOOM_OF_MOKHAIOTL: HiscoreSkill, --- `DUKE_SUCELLUS`: ordinal 64; `getName()` "Duke Sucellus", `getSpriteId()` 5632, `getType()` HiscoreSkillType.BOSS. DUKE_SUCELLUS: HiscoreSkill, --- `GENERAL_GRAARDOR`: ordinal 65; `getName()` "General Graardor", `getSpriteId()` 4282, `getType()` HiscoreSkillType.BOSS. GENERAL_GRAARDOR: HiscoreSkill, --- `GIANT_MOLE`: ordinal 66; `getName()` "Giant Mole", `getSpriteId()` 4263, `getType()` HiscoreSkillType.BOSS. GIANT_MOLE: HiscoreSkill, --- `GROTESQUE_GUARDIANS`: ordinal 67; `getName()` "Grotesque Guardians", `getSpriteId()` 4264, `getType()` HiscoreSkillType.BOSS. GROTESQUE_GUARDIANS: HiscoreSkill, --- `HESPORI`: ordinal 68; `getName()` "Hespori", `getSpriteId()` 4271, `getType()` HiscoreSkillType.BOSS. HESPORI: HiscoreSkill, --- `KALPHITE_QUEEN`: ordinal 69; `getName()` "Kalphite Queen", `getSpriteId()` 4270, `getType()` HiscoreSkillType.BOSS. KALPHITE_QUEEN: HiscoreSkill, --- `KING_BLACK_DRAGON`: ordinal 70; `getName()` "King Black Dragon", `getSpriteId()` 4274, `getType()` HiscoreSkillType.BOSS. KING_BLACK_DRAGON: HiscoreSkill, --- `KRAKEN`: ordinal 71; `getName()` "Kraken", `getSpriteId()` 4275, `getType()` HiscoreSkillType.BOSS. KRAKEN: HiscoreSkill, --- `KREEARRA`: ordinal 72; `getName()` "Kree'Arra", `getSpriteId()` 4285, `getType()` HiscoreSkillType.BOSS. KREEARRA: HiscoreSkill, --- `KRIL_TSUTSAROTH`: ordinal 73; `getName()` "K'ril Tsutsaroth", `getSpriteId()` 4283, `getType()` HiscoreSkillType.BOSS. KRIL_TSUTSAROTH: HiscoreSkill, --- `LUNAR_CHESTS`: ordinal 74; `getName()` "Lunar Chests", `getSpriteId()` 5637, `getType()` HiscoreSkillType.BOSS. LUNAR_CHESTS: HiscoreSkill, --- `MAD_ANGEL`: ordinal 75; `getName()` "Mad Angel", `getSpriteId()` 8359, `getType()` HiscoreSkillType.BOSS. MAD_ANGEL: HiscoreSkill, --- `MAGGOT_KING`: ordinal 76; `getName()` "Maggot King", `getSpriteId()` 8358, `getType()` HiscoreSkillType.BOSS. MAGGOT_KING: HiscoreSkill, --- `MIMIC`: ordinal 77; `getName()` "Mimic", `getSpriteId()` 4260, `getType()` HiscoreSkillType.BOSS. MIMIC: HiscoreSkill, --- `NEX`: ordinal 78; `getName()` "Nex", `getSpriteId()` 4291, `getType()` HiscoreSkillType.BOSS. NEX: HiscoreSkill, --- `NIGHTMARE`: ordinal 79; `getName()` "Nightmare", `getSpriteId()` 4286, `getType()` HiscoreSkillType.BOSS. NIGHTMARE: HiscoreSkill, --- `PHOSANIS_NIGHTMARE`: ordinal 80; `getName()` "Phosani's Nightmare", `getSpriteId()` 4286, `getType()` HiscoreSkillType.BOSS. PHOSANIS_NIGHTMARE: HiscoreSkill, --- `OBOR`: ordinal 81; `getName()` "Obor", `getSpriteId()` 4261, `getType()` HiscoreSkillType.BOSS. OBOR: HiscoreSkill, --- `PHANTOM_MUSPAH`: ordinal 82; `getName()` "Phantom Muspah", `getSpriteId()` 4299, `getType()` HiscoreSkillType.BOSS. PHANTOM_MUSPAH: HiscoreSkill, --- `SARACHNIS`: ordinal 83; `getName()` "Sarachnis", `getSpriteId()` 4269, `getType()` HiscoreSkillType.BOSS. SARACHNIS: HiscoreSkill, --- `SCORPIA`: ordinal 84; `getName()` "Scorpia", `getSpriteId()` 5628, `getType()` HiscoreSkillType.BOSS. SCORPIA: HiscoreSkill, --- `SCURRIUS`: ordinal 85; `getName()` "Scurrius", `getSpriteId()` 5635, `getType()` HiscoreSkillType.BOSS. SCURRIUS: HiscoreSkill, --- `SHELLBANE_GRYPHON`: ordinal 86; `getName()` "Shellbane Gryphon", `getSpriteId()` 6349, `getType()` HiscoreSkillType.BOSS. SHELLBANE_GRYPHON: HiscoreSkill, --- `SKOTIZO`: ordinal 87; `getName()` "Skotizo", `getSpriteId()` 4272, `getType()` HiscoreSkillType.BOSS. SKOTIZO: HiscoreSkill, --- `SOL_HEREDIT`: ordinal 88; `getName()` "Sol Heredit", `getSpriteId()` 5636, `getType()` HiscoreSkillType.BOSS. SOL_HEREDIT: HiscoreSkill, --- `SPINDEL`: ordinal 89; `getName()` "Spindel", `getSpriteId()` 5624, `getType()` HiscoreSkillType.BOSS. SPINDEL: HiscoreSkill, --- `TEMPOROSS`: ordinal 90; `getName()` "Tempoross", `getSpriteId()` 4265, `getType()` HiscoreSkillType.BOSS. TEMPOROSS: HiscoreSkill, --- `THE_GAUNTLET`: ordinal 91; `getName()` "The Gauntlet", `getSpriteId()` 4278, `getType()` HiscoreSkillType.BOSS. THE_GAUNTLET: HiscoreSkill, --- `THE_CORRUPTED_GAUNTLET`: ordinal 92; `getName()` "The Corrupted Gauntlet", `getSpriteId()` 4295, `getType()` HiscoreSkillType.BOSS. THE_CORRUPTED_GAUNTLET: HiscoreSkill, --- `THE_HUEYCOATL`: ordinal 93; `getName()` "The Hueycoatl", `getSpriteId()` 5640, `getType()` HiscoreSkillType.BOSS. THE_HUEYCOATL: HiscoreSkill, --- `THE_LEVIATHAN`: ordinal 94; `getName()` "The Leviathan", `getSpriteId()` 5633, `getType()` HiscoreSkillType.BOSS. THE_LEVIATHAN: HiscoreSkill, --- `THE_ROYAL_TITANS`: ordinal 95; `getName()` "The Royal Titans", `getSpriteId()` 6345, `getType()` HiscoreSkillType.BOSS. THE_ROYAL_TITANS: HiscoreSkill, --- `THE_WHISPERER`: ordinal 96; `getName()` "The Whisperer", `getSpriteId()` 5631, `getType()` HiscoreSkillType.BOSS. THE_WHISPERER: HiscoreSkill, --- `THEATRE_OF_BLOOD`: ordinal 97; `getName()` "Theatre of Blood", `getSpriteId()` 4290, `getType()` HiscoreSkillType.BOSS. THEATRE_OF_BLOOD: HiscoreSkill, --- `THEATRE_OF_BLOOD_HARD_MODE`: ordinal 98; `getName()` "Theatre of Blood: Hard Mode", `getSpriteId()` 4290, `getType()` HiscoreSkillType.BOSS. THEATRE_OF_BLOOD_HARD_MODE: HiscoreSkill, --- `THE_FRACTURED_ARCHIVE`: ordinal 99; `getName()` "The Fractured Archive", `getSpriteId()` 8360, `getType()` HiscoreSkillType.BOSS. THE_FRACTURED_ARCHIVE: HiscoreSkill, --- `THERMONUCLEAR_SMOKE_DEVIL`: ordinal 100; `getName()` "Thermonuclear Smoke Devil", `getSpriteId()` 4277, `getType()` HiscoreSkillType.BOSS. THERMONUCLEAR_SMOKE_DEVIL: HiscoreSkill, --- `TOMBS_OF_AMASCUT`: ordinal 101; `getName()` "Tombs of Amascut", `getSpriteId()` 4297, `getType()` HiscoreSkillType.BOSS. TOMBS_OF_AMASCUT: HiscoreSkill, --- `TOMBS_OF_AMASCUT_EXPERT`: ordinal 102; `getName()` "Tombs of Amascut: Expert Mode", `getSpriteId()` 4298, `getType()` HiscoreSkillType.BOSS. TOMBS_OF_AMASCUT_EXPERT: HiscoreSkill, --- `TZKAL_ZUK`: ordinal 103; `getName()` "TzKal-Zuk", `getSpriteId()` 5630, `getType()` HiscoreSkillType.BOSS. TZKAL_ZUK: HiscoreSkill, --- `TZTOK_JAD`: ordinal 104; `getName()` "TzTok-Jad", `getSpriteId()` 5629, `getType()` HiscoreSkillType.BOSS. TZTOK_JAD: HiscoreSkill, --- `VARDORVIS`: ordinal 105; `getName()` "Vardorvis", `getSpriteId()` 5634, `getType()` HiscoreSkillType.BOSS. VARDORVIS: HiscoreSkill, --- `VENENATIS`: ordinal 106; `getName()` "Venenatis", `getSpriteId()` 5624, `getType()` HiscoreSkillType.BOSS. VENENATIS: HiscoreSkill, --- `VETION`: ordinal 107; `getName()` "Vet'ion", `getSpriteId()` 5623, `getType()` HiscoreSkillType.BOSS. VETION: HiscoreSkill, --- `VORKATH`: ordinal 108; `getName()` "Vorkath", `getSpriteId()` 4281, `getType()` HiscoreSkillType.BOSS. VORKATH: HiscoreSkill, --- `WINTERTODT`: ordinal 109; `getName()` "Wintertodt", `getSpriteId()` 4266, `getType()` HiscoreSkillType.BOSS. WINTERTODT: HiscoreSkill, --- `YAMA`: ordinal 110; `getName()` "Yama", `getSpriteId()` 6346, `getType()` HiscoreSkillType.BOSS. YAMA: HiscoreSkill, --- `ZALCANO`: ordinal 111; `getName()` "Zalcano", `getSpriteId()` 4273, `getType()` HiscoreSkillType.BOSS. ZALCANO: HiscoreSkill, --- `ZULRAH`: ordinal 112; `getName()` "Zulrah", `getSpriteId()` 4279, `getType()` HiscoreSkillType.BOSS. ZULRAH: HiscoreSkill, } --- `HiscoreSkill`'s static functions and constants. declare HiscoreSkill: HiscoreSkillClass --- Enum `HiscoreSkillType`: 4 constants, each one userdata per VM, so `==` is identity and a constant is a table key. `HiscoreSkillType.values()`, `HiscoreSkillType.valueOf(name)`; every constant answers `name()`, `ordinal()` (0-based), `toString()`, `compareTo()` and `equals()`. export type HiscoreSkillType = { --- The constant's name as declared. name: (HiscoreSkillType) -> string, --- The constant's 0-based position in `values()`. ordinal: (HiscoreSkillType) -> number, --- `name()`; `tostring(c)` answers the same. toString: (HiscoreSkillType) -> string, --- This ordinal less `other`'s. compareTo: (HiscoreSkillType, HiscoreSkillType) -> number, --- Whether `other` is this constant. `==` answers the same. equals: (HiscoreSkillType, any) -> boolean, } export type HiscoreSkillTypeClass = { --- Every constant in ordinal order, as a 1-based array: the same frozen array every `values()` call, so `table.clone` it before changing it. values: () -> {HiscoreSkillType}, --- `valueOf(name)`: the constant named `name`; any other name is an error. valueOf: (string) -> HiscoreSkillType, --- `OVERALL`: ordinal 0. OVERALL: HiscoreSkillType, --- `SKILL`: ordinal 1. SKILL: HiscoreSkillType, --- `ACTIVITY`: ordinal 2. ACTIVITY: HiscoreSkillType, --- `BOSS`: ordinal 3. BOSS: HiscoreSkillType, } --- `HiscoreSkillType`'s static functions and constants. declare HiscoreSkillType: HiscoreSkillTypeClass --- Enum `SkillColor`: 24 constants, each one userdata per VM, so `==` is identity and a constant is a table key. `SkillColor.values()`, `SkillColor.valueOf(name)`; every constant answers `name()`, `ordinal()` (0-based), `toString()`, `compareTo()` and `equals()`, plus `getColor()`. export type SkillColor = { --- The constant's name as declared. name: (SkillColor) -> string, --- The constant's 0-based position in `values()`. ordinal: (SkillColor) -> number, --- `name()`; `tostring(c)` answers the same. toString: (SkillColor) -> string, --- This ordinal less `other`'s. compareTo: (SkillColor, SkillColor) -> number, --- Whether `other` is this constant. `==` answers the same. equals: (SkillColor, any) -> boolean, --- This constant's `getColor()` value, listed on each constant. getColor: (SkillColor) -> Color, } export type SkillColorClass = { --- Every constant in ordinal order, as a 1-based array: the same frozen array every `values()` call, so `table.clone` it before changing it. values: () -> {SkillColor}, --- `valueOf(name)`: the constant named `name`; any other name is an error. valueOf: (string) -> SkillColor, --- The colour declared in `skill`'s place. find: (Skill) -> SkillColor, --- `ATTACK`: ordinal 0; `getColor()` 0xFF9B2007. ATTACK: SkillColor, --- `DEFENCE`: ordinal 1; `getColor()` 0xFF6277BE. DEFENCE: SkillColor, --- `STRENGTH`: ordinal 2; `getColor()` 0xFF04955A. STRENGTH: SkillColor, --- `HITPOINTS`: ordinal 3; `getColor()` 0xFF837E7E. HITPOINTS: SkillColor, --- `RANGED`: ordinal 4; `getColor()` 0xFF6D9017. RANGED: SkillColor, --- `PRAYER`: ordinal 5; `getColor()` 0xFF9F9323. PRAYER: SkillColor, --- `MAGIC`: ordinal 6; `getColor()` 0xFF3250C1. MAGIC: SkillColor, --- `COOKING`: ordinal 7; `getColor()` 0xFF702386. COOKING: SkillColor, --- `WOODCUTTING`: ordinal 8; `getColor()` 0xFF348C25. WOODCUTTING: SkillColor, --- `FLETCHING`: ordinal 9; `getColor()` 0xFF038D7D. FLETCHING: SkillColor, --- `FISHING`: ordinal 10; `getColor()` 0xFF6A84A4. FISHING: SkillColor, --- `FIREMAKING`: ordinal 11; `getColor()` 0xFFBD7819. FIREMAKING: SkillColor, --- `CRAFTING`: ordinal 12; `getColor()` 0xFF976E4D. CRAFTING: SkillColor, --- `SMITHING`: ordinal 13; `getColor()` 0xFF6C6B52. SMITHING: SkillColor, --- `MINING`: ordinal 14; `getColor()` 0xFF5D8FA7. MINING: SkillColor, --- `HERBLORE`: ordinal 15; `getColor()` 0xFF078509. HERBLORE: SkillColor, --- `AGILITY`: ordinal 16; `getColor()` 0xFF3A3C89. AGILITY: SkillColor, --- `THIEVING`: ordinal 17; `getColor()` 0xFF6C3457. THIEVING: SkillColor, --- `SLAYER`: ordinal 18; `getColor()` 0xFF646464. SLAYER: SkillColor, --- `FARMING`: ordinal 19; `getColor()` 0xFF65983F. FARMING: SkillColor, --- `RUNECRAFT`: ordinal 20; `getColor()` 0xFFAA8D1A. RUNECRAFT: SkillColor, --- `HUNTER`: ordinal 21; `getColor()` 0xFF5C5941. HUNTER: SkillColor, --- `CONSTRUCTION`: ordinal 22; `getColor()` 0xFF82745F. CONSTRUCTION: SkillColor, --- `SAILING`: ordinal 23; `getColor()` 0xFF0BA59D. SAILING: SkillColor, } --- `SkillColor`'s static functions and constants. declare SkillColor: SkillColorClass --- Enum `OverlayLayer`: 5 constants, each one userdata per VM, so `==` is identity and a constant is a table key. `OverlayLayer.values()`, `OverlayLayer.valueOf(name)`; every constant answers `name()`, `ordinal()` (0-based), `toString()`, `compareTo()` and `equals()`. export type OverlayLayer = { --- The constant's name as declared. name: (OverlayLayer) -> string, --- The constant's 0-based position in `values()`. ordinal: (OverlayLayer) -> number, --- `name()`; `tostring(c)` answers the same. toString: (OverlayLayer) -> string, --- This ordinal less `other`'s. compareTo: (OverlayLayer, OverlayLayer) -> number, --- Whether `other` is this constant. `==` answers the same. equals: (OverlayLayer, any) -> boolean, } export type OverlayLayerClass = { --- Every constant in ordinal order, as a 1-based array: the same frozen array every `values()` call, so `table.clone` it before changing it. values: () -> {OverlayLayer}, --- `valueOf(name)`: the constant named `name`; any other name is an error. valueOf: (string) -> OverlayLayer, --- `MANUAL`: ordinal 0. MANUAL: OverlayLayer, --- `ABOVE_SCENE`: ordinal 1. ABOVE_SCENE: OverlayLayer, --- `UNDER_WIDGETS`: ordinal 2. UNDER_WIDGETS: OverlayLayer, --- `ABOVE_WIDGETS`: ordinal 3. ABOVE_WIDGETS: OverlayLayer, --- `ALWAYS_ON_TOP`: ordinal 4. ALWAYS_ON_TOP: OverlayLayer, } --- `OverlayLayer`'s static functions and constants. declare OverlayLayer: OverlayLayerClass --- Enum `OverlayPosition`: 10 constants, each one userdata per VM, so `==` is identity and a constant is a table key. `OverlayPosition.values()`, `OverlayPosition.valueOf(name)`; every constant answers `name()`, `ordinal()` (0-based), `toString()`, `compareTo()` and `equals()`. export type OverlayPosition = { --- The constant's name as declared. name: (OverlayPosition) -> string, --- The constant's 0-based position in `values()`. ordinal: (OverlayPosition) -> number, --- `name()`; `tostring(c)` answers the same. toString: (OverlayPosition) -> string, --- This ordinal less `other`'s. compareTo: (OverlayPosition, OverlayPosition) -> number, --- Whether `other` is this constant. `==` answers the same. equals: (OverlayPosition, any) -> boolean, } export type OverlayPositionClass = { --- Every constant in ordinal order, as a 1-based array: the same frozen array every `values()` call, so `table.clone` it before changing it. values: () -> {OverlayPosition}, --- `valueOf(name)`: the constant named `name`; any other name is an error. valueOf: (string) -> OverlayPosition, --- `DETACHED`: ordinal 0. DETACHED: OverlayPosition, --- `DYNAMIC`: ordinal 1. DYNAMIC: OverlayPosition, --- `TOP_LEFT`: ordinal 2. TOP_LEFT: OverlayPosition, --- `TOP_CENTER`: ordinal 3. TOP_CENTER: OverlayPosition, --- `TOP_RIGHT`: ordinal 4. TOP_RIGHT: OverlayPosition, --- `BOTTOM_LEFT`: ordinal 5. BOTTOM_LEFT: OverlayPosition, --- `BOTTOM_RIGHT`: ordinal 6. BOTTOM_RIGHT: OverlayPosition, --- `ABOVE_CHATBOX_RIGHT`: ordinal 7. ABOVE_CHATBOX_RIGHT: OverlayPosition, --- `CANVAS_TOP_RIGHT`: ordinal 8. CANVAS_TOP_RIGHT: OverlayPosition, --- `TOOLTIP`: ordinal 9. TOOLTIP: OverlayPosition, } --- `OverlayPosition`'s static functions and constants. declare OverlayPosition: OverlayPositionClass --- Enum `OverlayPriority`: 5 constants, each one userdata per VM, so `==` is identity and a constant is a table key. `OverlayPriority.values()`, `OverlayPriority.valueOf(name)`; every constant answers `name()`, `ordinal()` (0-based), `toString()`, `compareTo()` and `equals()`. export type OverlayPriority = { --- The constant's name as declared. name: (OverlayPriority) -> string, --- The constant's 0-based position in `values()`. ordinal: (OverlayPriority) -> number, --- `name()`; `tostring(c)` answers the same. toString: (OverlayPriority) -> string, --- This ordinal less `other`'s. compareTo: (OverlayPriority, OverlayPriority) -> number, --- Whether `other` is this constant. `==` answers the same. equals: (OverlayPriority, any) -> boolean, } export type OverlayPriorityClass = { --- Every constant in ordinal order, as a 1-based array: the same frozen array every `values()` call, so `table.clone` it before changing it. values: () -> {OverlayPriority}, --- `valueOf(name)`: the constant named `name`; any other name is an error. valueOf: (string) -> OverlayPriority, --- `LOW`: ordinal 0. LOW: OverlayPriority, --- `NONE`: ordinal 1. NONE: OverlayPriority, --- `MED`: ordinal 2. MED: OverlayPriority, --- `HIGH`: ordinal 3. HIGH: OverlayPriority, --- `HIGHEST`: ordinal 4. HIGHEST: OverlayPriority, } --- `OverlayPriority`'s static functions and constants. declare OverlayPriority: OverlayPriorityClass --- Enum `ComponentOrientation`: 2 constants, each one userdata per VM, so `==` is identity and a constant is a table key. `ComponentOrientation.values()`, `ComponentOrientation.valueOf(name)`; every constant answers `name()`, `ordinal()` (0-based), `toString()`, `compareTo()` and `equals()`. export type ComponentOrientation = { --- The constant's name as declared. name: (ComponentOrientation) -> string, --- The constant's 0-based position in `values()`. ordinal: (ComponentOrientation) -> number, --- `name()`; `tostring(c)` answers the same. toString: (ComponentOrientation) -> string, --- This ordinal less `other`'s. compareTo: (ComponentOrientation, ComponentOrientation) -> number, --- Whether `other` is this constant. `==` answers the same. equals: (ComponentOrientation, any) -> boolean, } export type ComponentOrientationClass = { --- Every constant in ordinal order, as a 1-based array: the same frozen array every `values()` call, so `table.clone` it before changing it. values: () -> {ComponentOrientation}, --- `valueOf(name)`: the constant named `name`; any other name is an error. valueOf: (string) -> ComponentOrientation, --- `HORIZONTAL`: ordinal 0. HORIZONTAL: ComponentOrientation, --- `VERTICAL`: ordinal 1. VERTICAL: ComponentOrientation, } --- `ComponentOrientation`'s static functions and constants. declare ComponentOrientation: ComponentOrientationClass --- Enum `InfoBoxPriority`: 4 constants, each one userdata per VM, so `==` is identity and a constant is a table key. `InfoBoxPriority.values()`, `InfoBoxPriority.valueOf(name)`; every constant answers `name()`, `ordinal()` (0-based), `toString()`, `compareTo()` and `equals()`. export type InfoBoxPriority = { --- The constant's name as declared. name: (InfoBoxPriority) -> string, --- The constant's 0-based position in `values()`. ordinal: (InfoBoxPriority) -> number, --- `name()`; `tostring(c)` answers the same. toString: (InfoBoxPriority) -> string, --- This ordinal less `other`'s. compareTo: (InfoBoxPriority, InfoBoxPriority) -> number, --- Whether `other` is this constant. `==` answers the same. equals: (InfoBoxPriority, any) -> boolean, } export type InfoBoxPriorityClass = { --- Every constant in ordinal order, as a 1-based array: the same frozen array every `values()` call, so `table.clone` it before changing it. values: () -> {InfoBoxPriority}, --- `valueOf(name)`: the constant named `name`; any other name is an error. valueOf: (string) -> InfoBoxPriority, --- `HIGH`: ordinal 0. HIGH: InfoBoxPriority, --- `MED`: ordinal 1. MED: InfoBoxPriority, --- `NONE`: ordinal 2. NONE: InfoBoxPriority, --- `LOW`: ordinal 3. LOW: InfoBoxPriority, } --- `InfoBoxPriority`'s static functions and constants. declare InfoBoxPriority: InfoBoxPriorityClass --- Enum `OSType`: 4 constants, each one userdata per VM, so `==` is identity and a constant is a table key. `OSType.values()`, `OSType.valueOf(name)`; every constant answers `name()`, `ordinal()` (0-based), `toString()`, `compareTo()` and `equals()`. export type OSType = { --- The constant's name as declared. name: (OSType) -> string, --- The constant's 0-based position in `values()`. ordinal: (OSType) -> number, --- `name()`; `tostring(c)` answers the same. toString: (OSType) -> string, --- This ordinal less `other`'s. compareTo: (OSType, OSType) -> number, --- Whether `other` is this constant. `==` answers the same. equals: (OSType, any) -> boolean, } export type OSTypeClass = { --- Every constant in ordinal order, as a 1-based array: the same frozen array every `values()` call, so `table.clone` it before changing it. values: () -> {OSType}, --- `valueOf(name)`: the constant named `name`; any other name is an error. valueOf: (string) -> OSType, --- The operating system the client runs on: `Windows` (the client is Windows-only). getOSType: () -> OSType, --- `Windows`: ordinal 0. Windows: OSType, --- `MacOS`: ordinal 1. MacOS: OSType, --- `Linux`: ordinal 2. Linux: OSType, --- `Other`: ordinal 3. Other: OSType, } --- `OSType`'s static functions and constants. declare OSType: OSTypeClass --- Enum `RSTimeUnit`: 2 constants, each one userdata per VM, so `==` is identity and a constant is a table key. `RSTimeUnit.values()`, `RSTimeUnit.valueOf(name)`; every constant answers `name()`, `ordinal()` (0-based), `toString()`, `compareTo()` and `equals()`, plus `getDuration()`, `getName()`, `isDateBased()`, `isDurationEstimated()`, `isTimeBased()`. export type RSTimeUnit = { --- The constant's name as declared. name: (RSTimeUnit) -> string, --- The constant's 0-based position in `values()`. ordinal: (RSTimeUnit) -> number, --- This enum's own text for the constant, which can differ from `name()`; `tostring(c)` answers the same. toString: (RSTimeUnit) -> string, --- This ordinal less `other`'s. compareTo: (RSTimeUnit, RSTimeUnit) -> number, --- Whether `other` is this constant. `==` answers the same. equals: (RSTimeUnit, any) -> boolean, --- `getDurationMillis()`: the constant's duration as a number of milliseconds. getDurationMillis: (RSTimeUnit) -> number, --- This constant's `getName()` value, listed on each constant. getName: (RSTimeUnit) -> string, --- This constant's `isDateBased()` value, listed on each constant. isDateBased: (RSTimeUnit) -> boolean, --- This constant's `isDurationEstimated()` value, listed on each constant. isDurationEstimated: (RSTimeUnit) -> boolean, --- This constant's `isTimeBased()` value, listed on each constant. isTimeBased: (RSTimeUnit) -> boolean, } export type RSTimeUnitClass = { --- Every constant in ordinal order, as a 1-based array: the same frozen array every `values()` call, so `table.clone` it before changing it. values: () -> {RSTimeUnit}, --- `valueOf(name)`: the constant named `name`; any other name is an error. valueOf: (string) -> RSTimeUnit, --- `CLIENT_TICKS`: ordinal 0; `getDuration()` 20 ms, `getName()` "Client tick", `isDateBased()` false, `isDurationEstimated()` false, `isTimeBased()` true. CLIENT_TICKS: RSTimeUnit, --- `GAME_TICKS`: ordinal 1; `getDuration()` 600 ms, `getName()` "Game tick", `isDateBased()` false, `isDurationEstimated()` false, `isTimeBased()` true. GAME_TICKS: RSTimeUnit, } --- `RSTimeUnit`'s static functions and constants. declare RSTimeUnit: RSTimeUnitClass --- Enum `LayoutRoom`: 19 constants, each one userdata per VM, so `==` is identity and a constant is a table key. `LayoutRoom.values()`, `LayoutRoom.valueOf(name)`; every constant answers `name()`, `ordinal()` (0-based), `toString()`, `compareTo()` and `equals()`. export type LayoutRoom = { --- The constant's name as declared. name: (LayoutRoom) -> string, --- The constant's 0-based position in `values()`. ordinal: (LayoutRoom) -> number, --- `name()`; `tostring(c)` answers the same. toString: (LayoutRoom) -> string, --- This ordinal less `other`'s. compareTo: (LayoutRoom, LayoutRoom) -> number, --- Whether `other` is this constant. `==` answers the same. equals: (LayoutRoom, any) -> boolean, } export type LayoutRoomClass = { --- Every constant in ordinal order, as a 1-based array: the same frozen array every `values()` call, so `table.clone` it before changing it. values: () -> {LayoutRoom}, --- `valueOf(name)`: the constant named `name`; any other name is an error. valueOf: (string) -> LayoutRoom, --- `START`: ordinal 0. START: LayoutRoom, --- `END`: ordinal 1. END: LayoutRoom, --- `SCAVENGERS`: ordinal 2. SCAVENGERS: LayoutRoom, --- `FARMING`: ordinal 3. FARMING: LayoutRoom, --- `EMPTY`: ordinal 4. EMPTY: LayoutRoom, --- `TEKTON`: ordinal 5. TEKTON: LayoutRoom, --- `MUTTADILES`: ordinal 6. MUTTADILES: LayoutRoom, --- `GUARDIANS`: ordinal 7. GUARDIANS: LayoutRoom, --- `VESPULA`: ordinal 8. VESPULA: LayoutRoom, --- `SHAMANS`: ordinal 9. SHAMANS: LayoutRoom, --- `VASA`: ordinal 10. VASA: LayoutRoom, --- `VANGUARDS`: ordinal 11. VANGUARDS: LayoutRoom, --- `MYSTICS`: ordinal 12. MYSTICS: LayoutRoom, --- `UNKNOWN_COMBAT`: ordinal 13. UNKNOWN_COMBAT: LayoutRoom, --- `CRABS`: ordinal 14. CRABS: LayoutRoom, --- `ICE_DEMON`: ordinal 15. ICE_DEMON: LayoutRoom, --- `TIGHTROPE`: ordinal 16. TIGHTROPE: LayoutRoom, --- `THIEVING`: ordinal 17. THIEVING: LayoutRoom, --- `UNKNOWN_PUZZLE`: ordinal 18. UNKNOWN_PUZZLE: LayoutRoom, } --- `LayoutRoom`'s static functions and constants. declare LayoutRoom: LayoutRoomClass --- Enum `LootRecordType`: 5 constants, each one userdata per VM, so `==` is identity and a constant is a table key. `LootRecordType.values()`, `LootRecordType.valueOf(name)`; every constant answers `name()`, `ordinal()` (0-based), `toString()`, `compareTo()` and `equals()`. export type LootRecordType = { --- The constant's name as declared. name: (LootRecordType) -> string, --- The constant's 0-based position in `values()`. ordinal: (LootRecordType) -> number, --- `name()`; `tostring(c)` answers the same. toString: (LootRecordType) -> string, --- This ordinal less `other`'s. compareTo: (LootRecordType, LootRecordType) -> number, --- Whether `other` is this constant. `==` answers the same. equals: (LootRecordType, any) -> boolean, } export type LootRecordTypeClass = { --- Every constant in ordinal order, as a 1-based array: the same frozen array every `values()` call, so `table.clone` it before changing it. values: () -> {LootRecordType}, --- `valueOf(name)`: the constant named `name`; any other name is an error. valueOf: (string) -> LootRecordType, --- `NPC`: ordinal 0. NPC: LootRecordType, --- `PLAYER`: ordinal 1. PLAYER: LootRecordType, --- `EVENT`: ordinal 2. EVENT: LootRecordType, --- `PICKPOCKET`: ordinal 3. PICKPOCKET: LootRecordType, --- `UNKNOWN`: ordinal 4. UNKNOWN: LootRecordType, } --- `LootRecordType`'s static functions and constants. declare LootRecordType: LootRecordTypeClass --- Enum `WorldRegion`: 8 constants, each one userdata per VM, so `==` is identity and a constant is a table key. `WorldRegion.values()`, `WorldRegion.valueOf(name)`; every constant answers `name()`, `ordinal()` (0-based), `toString()`, `compareTo()` and `equals()`, plus `getAlpha2()`, `getAlpha3()`, `getId()`. export type WorldRegion = { --- The constant's name as declared. name: (WorldRegion) -> string, --- The constant's 0-based position in `values()`. ordinal: (WorldRegion) -> number, --- `name()`; `tostring(c)` answers the same. toString: (WorldRegion) -> string, --- This ordinal less `other`'s. compareTo: (WorldRegion, WorldRegion) -> number, --- Whether `other` is this constant. `==` answers the same. equals: (WorldRegion, any) -> boolean, --- This constant's `getAlpha2()` value, listed on each constant. getAlpha2: (WorldRegion) -> string, --- This constant's `getAlpha3()` value, listed on each constant. getAlpha3: (WorldRegion) -> string, --- This constant's `getId()` value, listed on each constant. getId: (WorldRegion) -> number, } export type WorldRegionClass = { --- Every constant in ordinal order, as a 1-based array: the same frozen array every `values()` call, so `table.clone` it before changing it. values: () -> {WorldRegion}, --- `valueOf(name)`: the constant named `name`; any other name is an error. valueOf: (string) -> WorldRegion, --- `UNITED_STATES_OF_AMERICA`: ordinal 0; `getAlpha2()` "US", `getAlpha3()` "USA", `getId()` 0. UNITED_STATES_OF_AMERICA: WorldRegion, --- `UNITED_KINGDOM`: ordinal 1; `getAlpha2()` "GB", `getAlpha3()` "GBR", `getId()` 1. UNITED_KINGDOM: WorldRegion, --- `AUSTRALIA`: ordinal 2; `getAlpha2()` "AU", `getAlpha3()` "AUS", `getId()` 3. AUSTRALIA: WorldRegion, --- `GERMANY`: ordinal 3; `getAlpha2()` "DE", `getAlpha3()` "DEU", `getId()` 7. GERMANY: WorldRegion, --- `BRAZIL`: ordinal 4; `getAlpha2()` "BR", `getAlpha3()` "BRA", `getId()` 8. BRAZIL: WorldRegion, --- `JAPAN`: ordinal 5; `getAlpha2()` "JP", `getAlpha3()` "JPN", `getId()` 9. JAPAN: WorldRegion, --- `SINGAPORE`: ordinal 6; `getAlpha2()` "SG", `getAlpha3()` "SGP", `getId()` 10. SINGAPORE: WorldRegion, --- `SOUTH_AFRICA`: ordinal 7; `getAlpha2()` "ZA", `getAlpha3()` "ZAF", `getId()` 12. SOUTH_AFRICA: WorldRegion, } --- `WorldRegion`'s static functions and constants. declare WorldRegion: WorldRegionClass --- Enum `HttpWorldType`, separate from the global `WorldType`, which is a different class: 17 constants, each one userdata per VM, so `==` is identity and a constant is a table key. `HttpWorldType.values()`, `HttpWorldType.valueOf(name)`; every constant answers `name()`, `ordinal()` (0-based), `toString()`, `compareTo()` and `equals()`, plus `getMask()`. export type HttpWorldType = { --- The constant's name as declared. name: (HttpWorldType) -> string, --- The constant's 0-based position in `values()`. ordinal: (HttpWorldType) -> number, --- `name()`; `tostring(c)` answers the same. toString: (HttpWorldType) -> string, --- This ordinal less `other`'s. compareTo: (HttpWorldType, HttpWorldType) -> number, --- Whether `other` is this constant. `==` answers the same. equals: (HttpWorldType, any) -> boolean, --- This constant's `getMask()` value, listed on each constant. getMask: (HttpWorldType) -> number, } export type HttpWorldTypeClass = { --- Every constant in ordinal order, as a 1-based array: the same frozen array every `values()` call, so `table.clone` it before changing it. values: () -> {HttpWorldType}, --- `valueOf(name)`: the constant named `name`; any other name is an error. valueOf: (string) -> HttpWorldType, --- `MEMBERS`: ordinal 0; `getMask()` 1. MEMBERS: HttpWorldType, --- `PVP`: ordinal 1; `getMask()` 4. PVP: HttpWorldType, --- `BOUNTY`: ordinal 2; `getMask()` 32. BOUNTY: HttpWorldType, --- `PVP_ARENA`: ordinal 3; `getMask()` 64. PVP_ARENA: HttpWorldType, --- `SKILL_TOTAL`: ordinal 4; `getMask()` 128. SKILL_TOTAL: HttpWorldType, --- `QUEST_SPEEDRUNNING`: ordinal 5; `getMask()` 256. QUEST_SPEEDRUNNING: HttpWorldType, --- `HIGH_RISK`: ordinal 6; `getMask()` 1024. HIGH_RISK: HttpWorldType, --- `HARDCORE_MAIN`: ordinal 7; `getMask()` 2048. HARDCORE_MAIN: HttpWorldType, --- `LAST_MAN_STANDING`: ordinal 8; `getMask()` 16384. LAST_MAN_STANDING: HttpWorldType, --- `BETA_WORLD`: ordinal 9; `getMask()` 65536. BETA_WORLD: HttpWorldType, --- `LEGACY_ONLY`: ordinal 10; `getMask()` 4194304. LEGACY_ONLY: HttpWorldType, --- `EOC_ONLY`: ordinal 11; `getMask()` 8388608. EOC_ONLY: HttpWorldType, --- `NOSAVE_MODE`: ordinal 12; `getMask()` 33554432. NOSAVE_MODE: HttpWorldType, --- `TOURNAMENT`: ordinal 13; `getMask()` 67108864. TOURNAMENT: HttpWorldType, --- `FRESH_START_WORLD`: ordinal 14; `getMask()` 134217728. FRESH_START_WORLD: HttpWorldType, --- `DEADMAN`: ordinal 15; `getMask()` 536870912. DEADMAN: HttpWorldType, --- `SEASONAL`: ordinal 16; `getMask()` 1073741824. SEASONAL: HttpWorldType, } --- `HttpWorldType`'s static functions and constants. declare HttpWorldType: HttpWorldTypeClass --- `Constants`: its constants. A `Color` constant is its packed ARGB number. export type Constants = { } export type ConstantsClass = { --- `Constants.CHUNK_SIZE`: 8. CHUNK_SIZE: number, --- `Constants.CLICK_ACTION_NONE`: 0. CLICK_ACTION_NONE: number, --- `Constants.CLICK_ACTION_SET_HEADING`: 2. CLICK_ACTION_SET_HEADING: number, --- `Constants.CLICK_ACTION_WALK`: 1. CLICK_ACTION_WALK: number, --- `Constants.CLIENT_DEFAULT_ZOOM`: 512. CLIENT_DEFAULT_ZOOM: number, --- `Constants.CLIENT_TICK_LENGTH`: 20. CLIENT_TICK_LENGTH: number, --- `Constants.EXTENDED_SCENE_SIZE`: 184. EXTENDED_SCENE_SIZE: number, --- `Constants.GAME_FIXED_HEIGHT`: 503. GAME_FIXED_HEIGHT: number, --- `Constants.GAME_FIXED_WIDTH`: 765. GAME_FIXED_WIDTH: number, --- `Constants.GAME_TICK_LENGTH`: 600. GAME_TICK_LENGTH: number, --- `Constants.ITEM_SPRITE_HEIGHT`: 32. ITEM_SPRITE_HEIGHT: number, --- `Constants.ITEM_SPRITE_WIDTH`: 36. ITEM_SPRITE_WIDTH: number, --- `Constants.MAX_Z`: 4. MAX_Z: number, --- `Constants.OVERWORLD_MAX_Y`: 4160. OVERWORLD_MAX_Y: number, --- `Constants.REGION_SIZE`: 64. REGION_SIZE: number, --- `Constants.ROOF_FLAG_BETWEEN`: 8. ROOF_FLAG_BETWEEN: number, --- `Constants.ROOF_FLAG_DESTINATION`: 4. ROOF_FLAG_DESTINATION: number, --- `Constants.ROOF_FLAG_HOVERED`: 2. ROOF_FLAG_HOVERED: number, --- `Constants.ROOF_FLAG_POSITION`: 1. ROOF_FLAG_POSITION: number, --- `Constants.SCENE_SIZE`: 104. SCENE_SIZE: number, --- `Constants.TILE_FLAG_BRIDGE`: 2. TILE_FLAG_BRIDGE: number, --- `Constants.TILE_FLAG_UNDER_ROOF`: 4. TILE_FLAG_UNDER_ROOF: number, --- `Constants.TILE_FLAG_VIS_BELOW`: 8. TILE_FLAG_VIS_BELOW: number, --- `Constants.GAME_FIXED_ASPECT_RATIO`: 1.5208747514910537. GAME_FIXED_ASPECT_RATIO: number, --- `Constants.HIGH_ALCHEMY_MULTIPLIER`: 0.6000000238418579. HIGH_ALCHEMY_MULTIPLIER: number, } --- `Constants`'s static functions and constants. declare Constants: ConstantsClass --- `CollisionDataFlag`: its constants. A `Color` constant is its packed ARGB number. export type CollisionDataFlag = { } export type CollisionDataFlagClass = { --- `CollisionDataFlag.BLOCK_LINE_OF_SIGHT_EAST`: 4096. BLOCK_LINE_OF_SIGHT_EAST: number, --- `CollisionDataFlag.BLOCK_LINE_OF_SIGHT_FULL`: 131072. BLOCK_LINE_OF_SIGHT_FULL: number, --- `CollisionDataFlag.BLOCK_LINE_OF_SIGHT_NORTH`: 1024. BLOCK_LINE_OF_SIGHT_NORTH: number, --- `CollisionDataFlag.BLOCK_LINE_OF_SIGHT_SOUTH`: 16384. BLOCK_LINE_OF_SIGHT_SOUTH: number, --- `CollisionDataFlag.BLOCK_LINE_OF_SIGHT_WEST`: 65536. BLOCK_LINE_OF_SIGHT_WEST: number, --- `CollisionDataFlag.BLOCK_MOVEMENT_EAST`: 8. BLOCK_MOVEMENT_EAST: number, --- `CollisionDataFlag.BLOCK_MOVEMENT_FLOOR`: 2097152. BLOCK_MOVEMENT_FLOOR: number, --- `CollisionDataFlag.BLOCK_MOVEMENT_FLOOR_DECORATION`: 262144. BLOCK_MOVEMENT_FLOOR_DECORATION: number, --- `CollisionDataFlag.BLOCK_MOVEMENT_FULL`: 2359552. BLOCK_MOVEMENT_FULL: number, --- `CollisionDataFlag.BLOCK_MOVEMENT_NORTH`: 2. BLOCK_MOVEMENT_NORTH: number, --- `CollisionDataFlag.BLOCK_MOVEMENT_NORTH_EAST`: 4. BLOCK_MOVEMENT_NORTH_EAST: number, --- `CollisionDataFlag.BLOCK_MOVEMENT_NORTH_WEST`: 1. BLOCK_MOVEMENT_NORTH_WEST: number, --- `CollisionDataFlag.BLOCK_MOVEMENT_OBJECT`: 256. BLOCK_MOVEMENT_OBJECT: number, --- `CollisionDataFlag.BLOCK_MOVEMENT_SOUTH`: 32. BLOCK_MOVEMENT_SOUTH: number, --- `CollisionDataFlag.BLOCK_MOVEMENT_SOUTH_EAST`: 16. BLOCK_MOVEMENT_SOUTH_EAST: number, --- `CollisionDataFlag.BLOCK_MOVEMENT_SOUTH_WEST`: 64. BLOCK_MOVEMENT_SOUTH_WEST: number, --- `CollisionDataFlag.BLOCK_MOVEMENT_WEST`: 128. BLOCK_MOVEMENT_WEST: number, } --- `CollisionDataFlag`'s static functions and constants. declare CollisionDataFlag: CollisionDataFlagClass --- `Experience`: its constants and statics. A `Color` constant is its packed ARGB number. export type Experience = { } export type ExperienceClass = { --- The XP a level starts at; an error outside 1-126. getXpForLevel: (number) -> number, --- The level an XP total amounts to, up to 126; an error for negative XP. getLevelForXp: (number) -> number, --- The combat level with its fraction. getCombatLevelPrecise: (number, number, number, number, number, number, number) -> number, --- The combat level. getCombatLevel: (number, number, number, number, number, number, number) -> number, --- Attack or strength levels needed for the next combat level. getNextCombatLevelMelee: (number, number, number, number, number, number, number) -> number, --- Hitpoints or defence levels needed for the next combat level. getNextCombatLevelHpDef: (number, number, number, number, number, number, number) -> number, --- Magic levels needed for the next combat level. getNextCombatLevelMagic: (number, number, number, number, number, number, number) -> number, --- Ranged levels needed for the next combat level. getNextCombatLevelRange: (number, number, number, number, number, number, number) -> number, --- Prayer levels needed for the next combat level. getNextCombatLevelPrayer: (number, number, number, number, number, number, number) -> number, --- `Experience.MAX_COMBAT_LEVEL`: 126. MAX_COMBAT_LEVEL: number, --- `Experience.MAX_REAL_LEVEL`: 99. MAX_REAL_LEVEL: number, --- `Experience.MAX_SKILL_XP`: 200000000. MAX_SKILL_XP: number, --- `Experience.MAX_VIRT_LEVEL`: 126. MAX_VIRT_LEVEL: number, } --- `Experience`'s static functions and constants. declare Experience: ExperienceClass --- `HintArrowType`: its constants. A `Color` constant is its packed ARGB number. export type HintArrowType = { } export type HintArrowTypeClass = { --- `HintArrowType.COORDINATE`: 2. COORDINATE: number, --- `HintArrowType.NONE`: 0. NONE: number, --- `HintArrowType.NPC`: 1. NPC: number, --- `HintArrowType.PLAYER`: 3. PLAYER: number, --- `HintArrowType.WORLDENTITY`: 4. WORLDENTITY: number, } --- `HintArrowType`'s static functions and constants. declare HintArrowType: HintArrowTypeClass --- `JagexColor`: its constants and statics. A `Color` constant is its packed ARGB number. export type JagexColor = { } export type JagexColorClass = { --- Hue, saturation and luminance packed as the game's 16-bit HSL, a signed 16-bit integer. packHSL: (number, number, number) -> number, --- The hue of a packed HSL. unpackHue: (number) -> number, --- The saturation of a packed HSL. unpackSaturation: (number) -> number, --- The luminance of a packed HSL. unpackLuminance: (number) -> number, --- A packed HSL as `HHhSsLLl`. formatHSL: (number) -> string, --- An RGB colour as the game's packed HSL, at `brightness`. rgbToHSL: (number, number) -> number, --- `JagexColor.HUE_MAX`: 63. HUE_MAX: number, --- `JagexColor.LUMINANCE_MAX`: 127. LUMINANCE_MAX: number, --- `JagexColor.SATURATION_MAX`: 7. SATURATION_MAX: number, } --- `JagexColor`'s static functions and constants. declare JagexColor: JagexColorClass --- `KeyCode`: its constants. A `Color` constant is its packed ARGB number. export type KeyCode = { } export type KeyCodeClass = { --- `KeyCode.KC_0`: 25. KC_0: number, --- `KeyCode.KC_1`: 16. KC_1: number, --- `KeyCode.KC_2`: 17. KC_2: number, --- `KeyCode.KC_3`: 18. KC_3: number, --- `KeyCode.KC_4`: 19. KC_4: number, --- `KeyCode.KC_5`: 20. KC_5: number, --- `KeyCode.KC_6`: 21. KC_6: number, --- `KeyCode.KC_7`: 22. KC_7: number, --- `KeyCode.KC_8`: 23. KC_8: number, --- `KeyCode.KC_9`: 24. KC_9: number, --- `KeyCode.KC_A`: 48. KC_A: number, --- `KeyCode.KC_ADD`: 87. KC_ADD: number, --- `KeyCode.KC_ALT`: 86. KC_ALT: number, --- `KeyCode.KC_B`: 68. KC_B: number, --- `KeyCode.KC_BACK_QUOTE`: 28. KC_BACK_QUOTE: number, --- `KeyCode.KC_BACK_SLASH`: 74. KC_BACK_SLASH: number, --- `KeyCode.KC_BACK_SPACE`: 85. KC_BACK_SPACE: number, --- `KeyCode.KC_C`: 66. KC_C: number, --- `KeyCode.KC_CLEAR`: 91. KC_CLEAR: number, --- `KeyCode.KC_CLOSE_BRACKET`: 43. KC_CLOSE_BRACKET: number, --- `KeyCode.KC_COMMA`: 71. KC_COMMA: number, --- `KeyCode.KC_CONTROL`: 82. KC_CONTROL: number, --- `KeyCode.KC_D`: 50. KC_D: number, --- `KeyCode.KC_DECIMAL`: 229. KC_DECIMAL: number, --- `KeyCode.KC_DELETE`: 101. KC_DELETE: number, --- `KeyCode.KC_DIVIDE`: 90. KC_DIVIDE: number, --- `KeyCode.KC_DOWN`: 99. KC_DOWN: number, --- `KeyCode.KC_E`: 34. KC_E: number, --- `KeyCode.KC_END`: 103. KC_END: number, --- `KeyCode.KC_ENTER`: 84. KC_ENTER: number, --- `KeyCode.KC_EQUALS`: 27. KC_EQUALS: number, --- `KeyCode.KC_ESCAPE`: 13. KC_ESCAPE: number, --- `KeyCode.KC_F`: 51. KC_F: number, --- `KeyCode.KC_F1`: 1. KC_F1: number, --- `KeyCode.KC_F10`: 10. KC_F10: number, --- `KeyCode.KC_F11`: 11. KC_F11: number, --- `KeyCode.KC_F12`: 12. KC_F12: number, --- `KeyCode.KC_F2`: 2. KC_F2: number, --- `KeyCode.KC_F3`: 3. KC_F3: number, --- `KeyCode.KC_F4`: 4. KC_F4: number, --- `KeyCode.KC_F5`: 5. KC_F5: number, --- `KeyCode.KC_F6`: 6. KC_F6: number, --- `KeyCode.KC_F7`: 7. KC_F7: number, --- `KeyCode.KC_F8`: 8. KC_F8: number, --- `KeyCode.KC_F9`: 9. KC_F9: number, --- `KeyCode.KC_G`: 52. KC_G: number, --- `KeyCode.KC_H`: 53. KC_H: number, --- `KeyCode.KC_HOME`: 102. KC_HOME: number, --- `KeyCode.KC_I`: 39. KC_I: number, --- `KeyCode.KC_INSERT`: 100. KC_INSERT: number, --- `KeyCode.KC_J`: 54. KC_J: number, --- `KeyCode.KC_K`: 55. KC_K: number, --- `KeyCode.KC_L`: 56. KC_L: number, --- `KeyCode.KC_LEFT`: 96. KC_LEFT: number, --- `KeyCode.KC_M`: 70. KC_M: number, --- `KeyCode.KC_MINUS`: 26. KC_MINUS: number, --- `KeyCode.KC_MULTIPLY`: 89. KC_MULTIPLY: number, --- `KeyCode.KC_N`: 69. KC_N: number, --- `KeyCode.KC_NUMBER_SIGN`: 59. KC_NUMBER_SIGN: number, --- `KeyCode.KC_NUMPAD0`: 228. KC_NUMPAD0: number, --- `KeyCode.KC_NUMPAD1`: 231. KC_NUMPAD1: number, --- `KeyCode.KC_NUMPAD2`: 227. KC_NUMPAD2: number, --- `KeyCode.KC_NUMPAD3`: 233. KC_NUMPAD3: number, --- `KeyCode.KC_NUMPAD4`: 224. KC_NUMPAD4: number, --- `KeyCode.KC_NUMPAD5`: 219. KC_NUMPAD5: number, --- `KeyCode.KC_NUMPAD6`: 225. KC_NUMPAD6: number, --- `KeyCode.KC_NUMPAD7`: 230. KC_NUMPAD7: number, --- `KeyCode.KC_NUMPAD8`: 226. KC_NUMPAD8: number, --- `KeyCode.KC_NUMPAD9`: 232. KC_NUMPAD9: number, --- `KeyCode.KC_O`: 40. KC_O: number, --- `KeyCode.KC_OPEN_BRACKET`: 42. KC_OPEN_BRACKET: number, --- `KeyCode.KC_P`: 41. KC_P: number, --- `KeyCode.KC_PAGE_DOWN`: 105. KC_PAGE_DOWN: number, --- `KeyCode.KC_PAGE_UP`: 104. KC_PAGE_UP: number, --- `KeyCode.KC_PERIOD`: 72. KC_PERIOD: number, --- `KeyCode.KC_Q`: 32. KC_Q: number, --- `KeyCode.KC_QUOTE`: 58. KC_QUOTE: number, --- `KeyCode.KC_R`: 35. KC_R: number, --- `KeyCode.KC_RIGHT`: 97. KC_RIGHT: number, --- `KeyCode.KC_S`: 49. KC_S: number, --- `KeyCode.KC_SEMICOLON`: 57. KC_SEMICOLON: number, --- `KeyCode.KC_SHIFT`: 81. KC_SHIFT: number, --- `KeyCode.KC_SLASH`: 73. KC_SLASH: number, --- `KeyCode.KC_SPACE`: 83. KC_SPACE: number, --- `KeyCode.KC_SUBTRACT`: 88. KC_SUBTRACT: number, --- `KeyCode.KC_T`: 36. KC_T: number, --- `KeyCode.KC_TAB`: 80. KC_TAB: number, --- `KeyCode.KC_U`: 38. KC_U: number, --- `KeyCode.KC_UP`: 98. KC_UP: number, --- `KeyCode.KC_V`: 67. KC_V: number, --- `KeyCode.KC_W`: 33. KC_W: number, --- `KeyCode.KC_X`: 65. KC_X: number, --- `KeyCode.KC_Y`: 37. KC_Y: number, --- `KeyCode.KC_Z`: 64. KC_Z: number, } --- `KeyCode`'s static functions and constants. declare KeyCode: KeyCodeClass --- `SkullIcon`: its constants. A `Color` constant is its packed ARGB number. export type SkullIcon = { } export type SkullIconClass = { --- `SkullIcon.FORINTHRY_SURGE`: 3. FORINTHRY_SURGE: number, --- `SkullIcon.FORINTHRY_SURGE_DEADMAN`: 14. FORINTHRY_SURGE_DEADMAN: number, --- `SkullIcon.FORINTHRY_SURGE_KEYS_FIVE`: 19. FORINTHRY_SURGE_KEYS_FIVE: number, --- `SkullIcon.FORINTHRY_SURGE_KEYS_FOUR`: 18. FORINTHRY_SURGE_KEYS_FOUR: number, --- `SkullIcon.FORINTHRY_SURGE_KEYS_ONE`: 15. FORINTHRY_SURGE_KEYS_ONE: number, --- `SkullIcon.FORINTHRY_SURGE_KEYS_THREE`: 17. FORINTHRY_SURGE_KEYS_THREE: number, --- `SkullIcon.FORINTHRY_SURGE_KEYS_TWO`: 16. FORINTHRY_SURGE_KEYS_TWO: number, --- `SkullIcon.LOOT_KEYS_FIVE`: 12. LOOT_KEYS_FIVE: number, --- `SkullIcon.LOOT_KEYS_FOUR`: 11. LOOT_KEYS_FOUR: number, --- `SkullIcon.LOOT_KEYS_ONE`: 8. LOOT_KEYS_ONE: number, --- `SkullIcon.LOOT_KEYS_THREE`: 10. LOOT_KEYS_THREE: number, --- `SkullIcon.LOOT_KEYS_TWO`: 9. LOOT_KEYS_TWO: number, --- `SkullIcon.NONE`: -1. NONE: number, --- `SkullIcon.SKULL`: 0. SKULL: number, --- `SkullIcon.SKULL_DEADMAN`: 7. SKULL_DEADMAN: number, --- `SkullIcon.SKULL_FIGHT_PIT`: 1. SKULL_FIGHT_PIT: number, --- `SkullIcon.SKULL_HIGH_RISK`: 2. SKULL_HIGH_RISK: number, } --- `SkullIcon`'s static functions and constants. declare SkullIcon: SkullIconClass --- `SoundEffectVolume`: its constants. A `Color` constant is its packed ARGB number. export type SoundEffectVolume = { } export type SoundEffectVolumeClass = { --- `SoundEffectVolume.HIGH`: 127. HIGH: number, --- `SoundEffectVolume.LOW`: 32. LOW: number, --- `SoundEffectVolume.MEDIUM_HIGH`: 96. MEDIUM_HIGH: number, --- `SoundEffectVolume.MEDIUM_LOW`: 64. MEDIUM_LOW: number, --- `SoundEffectVolume.MUTED`: 0. MUTED: number, } --- `SoundEffectVolume`'s static functions and constants. declare SoundEffectVolume: SoundEffectVolumeClass --- `ItemQuantityMode`: its constants. A `Color` constant is its packed ARGB number. export type ItemQuantityMode = { } export type ItemQuantityModeClass = { --- `ItemQuantityMode.ALWAYS`: 1. ALWAYS: number, --- `ItemQuantityMode.NEVER`: 0. NEVER: number, --- `ItemQuantityMode.STACKABLE`: 2. STACKABLE: number, } --- `ItemQuantityMode`'s static functions and constants. declare ItemQuantityMode: ItemQuantityModeClass --- `WidgetConfig`: its constants. A `Color` constant is its packed ARGB number. export type WidgetConfig = { } export type WidgetConfigClass = { --- `WidgetConfig.DRAG`: 131072. DRAG: number, --- `WidgetConfig.DRAG_ON`: 1048576. DRAG_ON: number, --- `WidgetConfig.SHOW_MENU_OPTION_NINE`: 512. SHOW_MENU_OPTION_NINE: number, --- `WidgetConfig.USE_GROUND_ITEM`: 2048. USE_GROUND_ITEM: number, --- `WidgetConfig.USE_ITEM`: 32768. USE_ITEM: number, --- `WidgetConfig.USE_NPC`: 4096. USE_NPC: number, --- `WidgetConfig.USE_OBJECT`: 8192. USE_OBJECT: number, --- `WidgetConfig.USE_PLAYER`: 16384. USE_PLAYER: number, --- `WidgetConfig.USE_WIDGET`: 65536. USE_WIDGET: number, --- `WidgetConfig.WIDGET_USE_TARGET`: 2097152. WIDGET_USE_TARGET: number, } --- `WidgetConfig`'s static functions and constants. declare WidgetConfig: WidgetConfigClass --- `WidgetModalMode`: its constants. A `Color` constant is its packed ARGB number. export type WidgetModalMode = { } export type WidgetModalModeClass = { --- `WidgetModalMode.MODAL_CLICKTHROUGH`: 3. MODAL_CLICKTHROUGH: number, --- `WidgetModalMode.MODAL_NOCLICKTHROUGH`: 0. MODAL_NOCLICKTHROUGH: number, --- `WidgetModalMode.NON_MODAL`: 1. NON_MODAL: number, } --- `WidgetModalMode`'s static functions and constants. declare WidgetModalMode: WidgetModalModeClass --- `WidgetModelType`: its constants. A `Color` constant is its packed ARGB number. export type WidgetModelType = { } export type WidgetModelTypeClass = { --- `WidgetModelType.ITEM`: 4. ITEM: number, --- `WidgetModelType.LOCAL_PLAYER_CHATHEAD`: 3. LOCAL_PLAYER_CHATHEAD: number, --- `WidgetModelType.MODEL`: 1. MODEL: number, --- `WidgetModelType.NPC_CHATHEAD`: 2. NPC_CHATHEAD: number, --- `WidgetModelType.NPC_INDEX_CHATHEAD`: 6. NPC_INDEX_CHATHEAD: number, --- `WidgetModelType.NULL`: 0. NULL: number, --- `WidgetModelType.PLAYER`: 5. PLAYER: number, } --- `WidgetModelType`'s static functions and constants. declare WidgetModelType: WidgetModelTypeClass --- `WidgetPositionMode`: its constants. A `Color` constant is its packed ARGB number. export type WidgetPositionMode = { } export type WidgetPositionModeClass = { --- `WidgetPositionMode.ABSOLUTE_BOTTOM`: 2. ABSOLUTE_BOTTOM: number, --- `WidgetPositionMode.ABSOLUTE_CENTER`: 1. ABSOLUTE_CENTER: number, --- `WidgetPositionMode.ABSOLUTE_LEFT`: 0. ABSOLUTE_LEFT: number, --- `WidgetPositionMode.ABSOLUTE_RIGHT`: 2. ABSOLUTE_RIGHT: number, --- `WidgetPositionMode.ABSOLUTE_TOP`: 0. ABSOLUTE_TOP: number, --- `WidgetPositionMode.BOTTOM_16384THS`: 5. BOTTOM_16384THS: number, --- `WidgetPositionMode.CENTER_16384THS`: 4. CENTER_16384THS: number, --- `WidgetPositionMode.LEFT_16384THS`: 3. LEFT_16384THS: number, --- `WidgetPositionMode.RIGHT_16384THS`: 5. RIGHT_16384THS: number, --- `WidgetPositionMode.TOP_16384THS`: 3. TOP_16384THS: number, } --- `WidgetPositionMode`'s static functions and constants. declare WidgetPositionMode: WidgetPositionModeClass --- `WidgetSizeMode`: its constants. A `Color` constant is its packed ARGB number. export type WidgetSizeMode = { } export type WidgetSizeModeClass = { --- `WidgetSizeMode.ABSOLUTE`: 0. ABSOLUTE: number, --- `WidgetSizeMode.ABSOLUTE_16384THS`: 2. ABSOLUTE_16384THS: number, --- `WidgetSizeMode.MINUS`: 1. MINUS: number, } --- `WidgetSizeMode`'s static functions and constants. declare WidgetSizeMode: WidgetSizeModeClass --- `WidgetTextAlignment`: its constants. A `Color` constant is its packed ARGB number. export type WidgetTextAlignment = { } export type WidgetTextAlignmentClass = { --- `WidgetTextAlignment.BOTTOM`: 2. BOTTOM: number, --- `WidgetTextAlignment.CENTER`: 1. CENTER: number, --- `WidgetTextAlignment.LEFT`: 0. LEFT: number, --- `WidgetTextAlignment.RIGHT`: 2. RIGHT: number, --- `WidgetTextAlignment.TOP`: 0. TOP: number, } --- `WidgetTextAlignment`'s static functions and constants. declare WidgetTextAlignment: WidgetTextAlignmentClass --- `WidgetType`: its constants. A `Color` constant is its packed ARGB number. export type WidgetType = { } export type WidgetTypeClass = { --- `WidgetType.GRAPHIC`: 5. GRAPHIC: number, --- `WidgetType.IF1_TOOLTIP`: 8. IF1_TOOLTIP: number, --- `WidgetType.INPUT_FIELD`: 12. INPUT_FIELD: number, --- `WidgetType.LAYER`: 0. LAYER: number, --- `WidgetType.LINE`: 9. LINE: number, --- `WidgetType.MODEL`: 6. MODEL: number, --- `WidgetType.RECTANGLE`: 3. RECTANGLE: number, --- `WidgetType.TEXT`: 4. TEXT: number, --- `WidgetType.TEXT_INVENTORY`: 7. TEXT_INVENTORY: number, } --- `WidgetType`'s static functions and constants. declare WidgetType: WidgetTypeClass --- `ColorScheme`: its constants. A `Color` constant is its packed ARGB number. export type ColorScheme = { } export type ColorSchemeClass = { --- `ColorScheme.BORDER_COLOR`: 0xFF171717. BORDER_COLOR: number, --- `ColorScheme.BRAND_ORANGE`: 0xFFDC8A00. BRAND_ORANGE: number, --- `ColorScheme.BRAND_ORANGE_TRANSPARENT`: 0x78DC8A00. BRAND_ORANGE_TRANSPARENT: number, --- `ColorScheme.CONTROL_COLOR`: 0xFF1E1E1E. CONTROL_COLOR: number, --- `ColorScheme.DARKER_GRAY_COLOR`: 0xFF1E1E1E. DARKER_GRAY_COLOR: number, --- `ColorScheme.DARKER_GRAY_HOVER_COLOR`: 0xFF3C3C3C. DARKER_GRAY_HOVER_COLOR: number, --- `ColorScheme.DARK_GRAY_COLOR`: 0xFF282828. DARK_GRAY_COLOR: number, --- `ColorScheme.DARK_GRAY_HOVER_COLOR`: 0xFF232323. DARK_GRAY_HOVER_COLOR: number, --- `ColorScheme.GRAND_EXCHANGE_ALCH`: 0xFFF0CF7B. GRAND_EXCHANGE_ALCH: number, --- `ColorScheme.GRAND_EXCHANGE_LIMIT`: 0xFF32A0FA. GRAND_EXCHANGE_LIMIT: number, --- `ColorScheme.GRAND_EXCHANGE_PRICE`: 0xFF6EE16E. GRAND_EXCHANGE_PRICE: number, --- `ColorScheme.LIGHT_GRAY_COLOR`: 0xFFA5A5A5. LIGHT_GRAY_COLOR: number, --- `ColorScheme.MEDIUM_GRAY_COLOR`: 0xFF4D4D4D. MEDIUM_GRAY_COLOR: number, --- `ColorScheme.PROGRESS_COMPLETE_COLOR`: 0xFF37F046. PROGRESS_COMPLETE_COLOR: number, --- `ColorScheme.PROGRESS_ERROR_COLOR`: 0xFFE61E1E. PROGRESS_ERROR_COLOR: number, --- `ColorScheme.PROGRESS_INPROGRESS_COLOR`: 0xFFE6961E. PROGRESS_INPROGRESS_COLOR: number, --- `ColorScheme.SCROLL_TRACK_COLOR`: 0xFF191919. SCROLL_TRACK_COLOR: number, --- `ColorScheme.TEXT_COLOR`: 0xFFC6C6C6. TEXT_COLOR: number, } --- `ColorScheme`'s static functions and constants. declare ColorScheme: ColorSchemeClass --- `JagexColors`: its constants. A `Color` constant is its packed ARGB number. export type JagexColors = { } export type JagexColorsClass = { --- `JagexColors.CHAT_FC_NAME_OPAQUE_BACKGROUND`: 0xFF0000FF. CHAT_FC_NAME_OPAQUE_BACKGROUND: number, --- `JagexColors.CHAT_FC_NAME_TRANSPARENT_BACKGROUND`: 0xFF9070FF. CHAT_FC_NAME_TRANSPARENT_BACKGROUND: number, --- `JagexColors.CHAT_FC_TEXT_OPAQUE_BACKGROUND`: 0xFF7F0000. CHAT_FC_TEXT_OPAQUE_BACKGROUND: number, --- `JagexColors.CHAT_FC_TEXT_TRANSPARENT_BACKGROUND`: 0xFFEF5050. CHAT_FC_TEXT_TRANSPARENT_BACKGROUND: number, --- `JagexColors.CHAT_GAME_EXAMINE_TEXT_OPAQUE_BACKGROUND`: 0xFF000000. CHAT_GAME_EXAMINE_TEXT_OPAQUE_BACKGROUND: number, --- `JagexColors.CHAT_GAME_EXAMINE_TEXT_TRANSPARENT_BACKGROUND`: 0xFFFFFFFF. CHAT_GAME_EXAMINE_TEXT_TRANSPARENT_BACKGROUND: number, --- `JagexColors.CHAT_PRIVATE_MESSAGE_TEXT_OPAQUE_BACKGROUND`: 0xFF7F0000. CHAT_PRIVATE_MESSAGE_TEXT_OPAQUE_BACKGROUND: number, --- `JagexColors.CHAT_PRIVATE_MESSAGE_TEXT_TRANSPARENT_BACKGROUND`: 0xFFBF2020. CHAT_PRIVATE_MESSAGE_TEXT_TRANSPARENT_BACKGROUND: number, --- `JagexColors.CHAT_PUBLIC_TEXT_OPAQUE_BACKGROUND`: 0xFF0000FF. CHAT_PUBLIC_TEXT_OPAQUE_BACKGROUND: number, --- `JagexColors.CHAT_PUBLIC_TEXT_TRANSPARENT_BACKGROUND`: 0xFF9090FF. CHAT_PUBLIC_TEXT_TRANSPARENT_BACKGROUND: number, --- `JagexColors.CHAT_TYPED_TEXT_OPAQUE_BACKGROUND`: 0xFF0000FF. CHAT_TYPED_TEXT_OPAQUE_BACKGROUND: number, --- `JagexColors.CHAT_TYPED_TEXT_TRANSPARENT_BACKGROUND`: 0xFF9090FF. CHAT_TYPED_TEXT_TRANSPARENT_BACKGROUND: number, --- `JagexColors.DARK_ORANGE_INTERFACE_TEXT`: 0xFFFF981F. DARK_ORANGE_INTERFACE_TEXT: number, --- `JagexColors.MENU_TARGET`: 0xFFFF9040. MENU_TARGET: number, --- `JagexColors.MENU_TARGET_TAG`: "". MENU_TARGET_TAG: string, --- `JagexColors.TOOLTIP_BACKGROUND`: 0xFFFFFFA0. TOOLTIP_BACKGROUND: number, --- `JagexColors.TOOLTIP_BORDER`: 0xFF000000. TOOLTIP_BORDER: number, --- `JagexColors.TOOLTIP_TEXT`: 0xFF000000. TOOLTIP_TEXT: number, --- `JagexColors.YELLOW_INTERFACE_TEXT`: 0xFFFFFF00. YELLOW_INTERFACE_TEXT: number, } --- `JagexColors`'s static functions and constants. declare JagexColors: JagexColorsClass --- `Units`: its constants. A `Color` constant is its packed ARGB number. export type Units = { } export type UnitsClass = { --- `Units.MILLISECONDS`: "ms". MILLISECONDS: string, --- `Units.MINUTES`: " mins". MINUTES: string, --- `Units.PERCENT`: "%". PERCENT: string, --- `Units.PIXELS`: "px". PIXELS: string, --- `Units.SECONDS`: "s". SECONDS: string, --- `Units.TICKS`: " ticks". TICKS: string, } --- `Units`'s static functions and constants. declare Units: UnitsClass --- `AlternateSprites`: its constants. A `Color` constant is its packed ARGB number. export type AlternateSprites = { } export type AlternateSpritesClass = { --- `AlternateSprites.DISEASE_HEART`: "1067-DISEASE.png". DISEASE_HEART: string, --- `AlternateSprites.POISON_HEART`: "1067-POISON.png". POISON_HEART: string, --- `AlternateSprites.VENOM_HEART`: "1067-VENOM.png". VENOM_HEART: string, } --- `AlternateSprites`'s static functions and constants. declare AlternateSprites: AlternateSpritesClass --- `ComponentConstants`: its constants. A `Color` constant is its packed ARGB number. export type ComponentConstants = { } export type ComponentConstantsClass = { --- `ComponentConstants.STANDARD_BORDER`: 4. STANDARD_BORDER: number, --- `ComponentConstants.STANDARD_WIDTH`: 129. STANDARD_WIDTH: number, --- `ComponentConstants.STANDARD_BACKGROUND_COLOR`: 0x9C463D32. STANDARD_BACKGROUND_COLOR: number, } --- `ComponentConstants`'s static functions and constants. declare ComponentConstants: ComponentConstantsClass --- `ColorUtil`: its constants and statics. A `Color` constant is its packed ARGB number. export type ColorUtil = { } export type ColorUtilClass = { --- ``. colorTag: (Color) -> string, --- `str`. prependColorTag: (string, Color) -> string, --- `str`. wrapWithColorTag: (string, Color) -> string, --- `#rrggbb`. toHexColor: (Color) -> string, --- Each channel, alpha included, interpolated and rounded half up; a `t` that pushes a channel out of range is an error. colorLerp: (Color, Color, number) -> Color, --- `rrggbb`, lower case. colorToHexCode: (Color) -> string, --- `aarrggbb`, lower case. colorToAlphaHexCode: (Color) -> string, --- The same RGB with `alpha`, clamped to 0-255. colorWithAlpha: (Color, number) -> Color, --- Whether `hex` is `(#|0x)?` and 7-8 hex digits. isAlphaHex: (string) -> boolean, --- Whether `hex` is `(#|0x)?` and 1-8 hex digits. isHex: (string) -> boolean, --- `value` clamped to 0-255. constrainValue: (number) -> number, --- `string` as an integer (`#rrggbb`, `0x...`, decimal, octal) read as ARGB, or `nil` when it does not decode. fromString: (string) -> Color?, --- Six digits or fewer opaque, more read as ARGB; `nil` when it does not decode. fromHex: (string) -> Color?, --- A saturated, bright colour whose hue comes from a hash of the object: a string, integer or boolean; anything else raises. fromObject: (any) -> Color, --- `ColorUtil.MAX_RGB_VALUE`: 255. MAX_RGB_VALUE: number, --- `ColorUtil.MIN_RGB_VALUE`: 0. MIN_RGB_VALUE: number, --- `ColorUtil.CLOSING_COLOR_TAG`: "". CLOSING_COLOR_TAG: string, } --- `ColorUtil`'s static functions and constants. declare ColorUtil: ColorUtilClass --- A compiled regular expression, with flags, groups, lookarounds and classes. Indices are UTF-16 code units; for ASCII text they are byte offsets, and for any text without characters above U+FFFF (all game text) index `i` is byte `utf8.offset(s, i + 1)`, so the text from `a` up to `b` is `string.sub(s, utf8.offset(s, a + 1), utf8.offset(s, b + 1) - 1)`. A syntax error raises `java.util.regex.PatternSyntaxException: ...` with the reason. Groups, lookarounds and classes nest at most 100 deep: deeper raises `PatternSyntaxException: Stack overflow during pattern compilation`. Not supported (they raise): `\N{name}`, `\X`, `\b{g}` and `CANON_EQ`. `tostring(p)` is `p:pattern()`. --- --- `__tostring`: `tostring(p)` is the source regular expression. export type Pattern = { --- A matcher of this pattern over `input`. matcher: (Pattern, string) -> Matcher, --- Alternative to `p:matcher(s):find()`: a one-call search with no `Matcher` object. Whether this pattern matches anywhere in `input`: `p:find(s)` answers what `p:matcher(s):find()` answers, without making the matcher, for a filter that only asks whether a line matches (a chat filter, a hidden-item list). For the match's position or groups, use `matcher`. find: (Pattern, string) -> boolean, --- `(Pattern, string) -> {string}`: --- `input` split around matches, trailing empty strings removed (a 1-based array). --- --- `(Pattern, string, number) -> {string}`: --- `input` split around matches: at most `limit` pieces when positive, every piece when negative, trailing empty strings removed when 0 (or nil). split: ((Pattern, string) -> {string}) & ((Pattern, string, number) -> {string}), --- The source regular expression. pattern: (Pattern) -> string, --- The source regular expression. toString: (Pattern) -> string, --- The flags: those it was compiled with, and those a top-level inline group turned on or off (`(?i)a` answers `CASE_INSENSITIVE`; `(?i:a)` does not). flags: (Pattern) -> number, } export type PatternClass = { --- `(string) -> Pattern`: --- Compile `regex`. --- --- `(string, number) -> Pattern`: --- Compile `regex` with `flags` (`Pattern.CASE_INSENSITIVE`, ... or'ed). compile: ((string) -> Pattern) & ((string, number) -> Pattern), --- A pattern matching `s` literally: `\Q` + s + `\E`, with any `\E` in `s` escaped. quote: (string) -> string, --- Whether `regex` matches the whole of `input`. matches: (string, string) -> boolean, --- `Pattern`'s flag bit. UNIX_LINES: number, --- `Pattern`'s flag bit. CASE_INSENSITIVE: number, --- `Pattern`'s flag bit. COMMENTS: number, --- `Pattern`'s flag bit. MULTILINE: number, --- `Pattern`'s flag bit. LITERAL: number, --- `Pattern`'s flag bit. DOTALL: number, --- `Pattern`'s flag bit. UNICODE_CASE: number, --- `Pattern.CANON_EQ`'s bit. Bento does not implement canonical equivalence: a pattern compiled with it raises. CANON_EQ: number, --- `Pattern`'s flag bit. UNICODE_CHARACTER_CLASS: number, } --- `Pattern`'s static functions and constants. declare Pattern: PatternClass --- A match's groups and their UTF-16 spans (`Pattern`'s doc turns one into byte positions). `Matcher` is one; `Matcher:toMatchResult()` hands out a snapshot, which shares the matcher's text, keeps the match as it was, and answers only these members. export type MatchResult = { --- `(MatchResult) -> string?`: --- The matched text, or nil when the groups were forgotten (`usePattern`). Raises `IllegalStateException` with no match. --- --- `(MatchResult, number) -> string?`: --- Group `group`'s text, or nil when it did not take part (0 is the whole match). group: ((MatchResult) -> string?) & ((MatchResult, number) -> string?), --- `(MatchResult) -> number`: --- Where the match starts (a UTF-16 index). --- --- `(MatchResult, number) -> number`: --- Where group `group` starts, or -1. start: ((MatchResult) -> number) & ((MatchResult, number) -> number), --- `(MatchResult) -> number`: --- `end()`, spelled `end_` because Luau reserves `end`: where the match ends (exclusive). --- --- `(MatchResult, number) -> number`: --- `end(group)`, spelled `end_` because Luau reserves `end`: where group `group` ends, or -1. --- --- Luau reserves `end`, so this member is spelled `end_`; it behaves exactly as `end`. end_: ((MatchResult) -> number) & ((MatchResult, number) -> number), --- How many capturing groups the pattern has. groupCount: (MatchResult) -> number, } --- A regular-expression matcher, a state machine over its text (`find` continues after the last match, an empty match steps one unit on; `replaceAll` leaves it after its last failed `find`, `replaceFirst` on the first match; `usePattern` keeps the position and forgets the groups; regions; transparent and anchoring bounds; `appendReplacement`/`appendTail`). Not provided: `hitEnd`, `requireEnd`, and `replaceAll(Function)` (a Luau callback; use the `find` loop). `tostring(m)` is `m:toString()`. After a search that finds nothing, the next `find()` (or `\G`) goes on from the last match. --- --- `__tostring`: `tostring(m)` is `m:toString()`. export type Matcher = MatchResult & { --- Named group `name`'s text, or nil. group: (Matcher, string) -> string?, --- Where named group `name` starts, or -1. start: (Matcher, string) -> number, --- `end(name)`, spelled `end_` because Luau reserves `end`: where named group `name` ends, or -1. --- --- Luau reserves `end`, so this member is spelled `end_`; it behaves exactly as `end`. end_: (Matcher, string) -> number, --- `(Matcher) -> boolean`: --- The next match: from the region start, or after the previous match. --- --- `(Matcher, number) -> boolean`: --- Reset, then the first match at or after `start`. find: ((Matcher) -> boolean) & ((Matcher, number) -> boolean), --- Whether the whole region matches. matches: (Matcher) -> boolean, --- Whether a match starts at the region start. lookingAt: (Matcher) -> boolean, --- `(Matcher) -> Matcher`: --- Forget the position and the region; this matcher. --- --- `(Matcher, string) -> Matcher`: --- Match `input` from the start; this matcher. reset: ((Matcher) -> Matcher) & ((Matcher, string) -> Matcher), --- The text with every match replaced (`$1`, `${name}`, `\$` in `replacement`). Leaves the matcher after its last (failed) `find`. replaceAll: (Matcher, string) -> string, --- The text with the first match replaced. Leaves the matcher on that match. replaceFirst: (Matcher, string) -> string, --- Append the text since the last append, then the expanded `replacement` (`$1`, `${name}`), to `sb` as one more element; this matcher. `sb` is a Luau array of parts, which `table.concat(sb)` joins. appendReplacement: (Matcher, {string}, string) -> Matcher, --- Append the rest of the text to `sb` (a Luau array of parts, as for `appendReplacement`); `sb`. appendTail: (Matcher, {string}) -> {string}, --- Search only `start`..`end` (UTF-16 indices); this matcher. region: (Matcher, number, number) -> Matcher, --- The region's start. regionStart: (Matcher) -> number, --- The region's end. regionEnd: (Matcher) -> number, --- Whether lookaround sees past the region. hasTransparentBounds: (Matcher) -> boolean, --- Let lookaround and `\b` see past the region (default false); this matcher. useTransparentBounds: (Matcher, boolean) -> Matcher, --- Whether `^`/`$` match at the region's bounds. hasAnchoringBounds: (Matcher) -> boolean, --- Let `^`/`$` match at the region's bounds (default true); this matcher. useAnchoringBounds: (Matcher, boolean) -> Matcher, --- The pattern: the very `Pattern` it was made from (or last given to `usePattern`). pattern: (Matcher) -> Pattern, --- Match with `pattern` from here on: the position and region kept, the groups forgotten (`group()` is nil until the next match, `start()` still the last match's); this matcher. usePattern: (Matcher, Pattern) -> Matcher, --- A snapshot of the current match: a `MatchResult` that shares the text and does not move. toMatchResult: (Matcher) -> MatchResult, --- The remaining results: every match left, as a 1-based array of `MatchResult` snapshots. It is eager: it finds every match now and leaves the matcher after the last (for the first match alone, call `find()`). matchResults: (Matcher) -> {MatchResult}, --- `java.util.regex.Matcher[pattern=.. region=a,b lastmatch=..]`. toString: (Matcher) -> string, } export type MatcherClass = { --- `s` with `\` and `$` escaped, for a literal replacement. quoteReplacement: (string) -> string, } --- `Matcher`'s static functions and constants. declare Matcher: MatcherClass --- Regular-expression string functions: a Luau string cannot gain methods, so the string comes first (`Regex.split(s, ",")`). The regex is `Pattern`'s syntax and semantics, not a Lua pattern; a malformed one raises `java.util.regex.PatternSyntaxException` with the reason. Other string work is Luau's own `string` functions. export type Regex = { } export type RegexClass = { --- Whether `regex` (`Pattern`'s syntax) matches the whole of `s`, as `Pattern.matches(regex, s)`; `string.match` takes a Lua pattern and is not anchored. matches: (string, string) -> boolean, --- `(string, string) -> {string}`: --- `s` split around matches of `regex` (`Pattern`'s syntax, so `"."` and `"|"` are regex operators), trailing empty strings removed, as a 1-based array. `string.split` differs: a plain separator, and it keeps trailing empty strings. --- --- `(string, string, number) -> {string}`: --- As `split(s, regex)`, with at most `limit` pieces when `limit` is positive (the last holds the rest), every piece when negative, trailing empty strings removed when 0. split: ((string, string) -> {string}) & ((string, string, number) -> {string}), --- `Regex.replaceAll`: every match of `regex` replaced by `replacement`, in `Matcher`'s replacement syntax (`$1`, `${name}`, `\\$` for a dollar sign), not `string.gsub`'s (`%1`). A bad group reference raises. replaceAll: (string, string, string) -> string, --- `Regex.replaceFirst`: the first match of `regex` replaced, as `replaceAll` replaces each. replaceFirst: (string, string, string) -> string, } --- `Regex`'s static functions and constants. declare Regex: RegexClass --- Base64 encoders and decoders (RFC 4648 basic and URL-safe, and MIME). A byte array is an array of signed byte numbers; `encodeBytes`/`decodeToBytes` take and give a Luau string's raw bytes instead. export type Base64 = { } export type Base64Class = { --- The basic encoder. getEncoder: () -> Base64Encoder, --- The URL-safe encoder. getUrlEncoder: () -> Base64Encoder, --- The MIME encoder (76-character lines). getMimeEncoder: () -> Base64Encoder, --- The basic decoder. getDecoder: () -> Base64Decoder, --- The URL-safe decoder. getUrlDecoder: () -> Base64Decoder, --- The MIME decoder (ignores characters outside the alphabet). getMimeDecoder: () -> Base64Decoder, } --- `Base64`'s static functions and constants. declare Base64: Base64Class --- A Base64 encoder. export type Base64Encoder = { --- `src` encoded. encodeToString: (Base64Encoder, {number}) -> string, --- `src` encoded, as bytes. encode: (Base64Encoder, {number}) -> {number}, --- As `encodeToString`, with a Luau string's raw bytes in place of a byte array. encodeBytes: (Base64Encoder, string) -> string, --- This encoder, without `=` padding. withoutPadding: (Base64Encoder) -> Base64Encoder, } --- A Base64 decoder: a malformed input raises `java.lang.IllegalArgumentException`. export type Base64Decoder = { --- `src` decoded, as signed bytes. decode: (Base64Decoder, any) -> {number}, --- As `decode`, with the bytes as a Luau string. decodeToBytes: (Base64Decoder, string) -> string, } --- A test of characters, and what it keeps or removes of a string. There is one, --- `Text.JAGEX_PRINTABLE_CHAR_MATCHER`, and no factories for others. A character is a --- UTF-16 unit: a character above U+FFFF is two units, which the printable matcher never --- matches. Runs natively, so `retainFrom` is cheap enough to call on every chat message. export type CharMatcher = { --- The characters of `sequence` the matcher matches, in order: --- `Text.JAGEX_PRINTABLE_CHAR_MATCHER:retainFrom(s)` keeps what the game's fonts draw --- (U+0020-U+007E, U+0080, U+00A0-U+00FF). retainFrom: (CharMatcher, string) -> string, --- The characters of `sequence` the matcher does not match, in order. removeFrom: (CharMatcher, string) -> string, --- Whether the matcher matches the character `c`, a one-character string (Luau has no --- `char`), as `utf8.char(code)` or a `utf8.codes` walk gives it, or `string.sub(s, i, i)` --- on ASCII text (past ASCII it is one byte of a character, and raises as not UTF-8). --- Raises for a string that is not exactly one UTF-16 unit (empty, longer, or one --- character above U+FFFF). matchesCharacter: (CharMatcher, string) -> boolean, } --- What `JaroWinklerDistance` and `LongestCommonSubsequence` both answer: a score of two --- strings. export type SimilarityScore = { --- The score of `left` against `right`: the Jaro-Winkler similarity, or the length of --- the longest common subsequence, as the instance's class computes it. apply: (SimilarityScore, string, string) -> number, } --- The distance `Text.matchesSearchTerms` and `FuzzySearchScorer` use. `apply` is the --- Jaro-Winkler *similarity* (1 for equal strings, 0 for nothing in common), unrounded, its --- common-prefix bonus not capped at four characters. Runs natively, so it is cheap enough --- to score every item name per keystroke. export type JaroWinklerDistance = SimilarityScore export type JaroWinklerDistanceClass = { --- A new scorer. It keeps no state: one instance serves every call. new: () -> JaroWinklerDistance, } --- `JaroWinklerDistance`'s static functions and constants. declare JaroWinklerDistance: JaroWinklerDistanceClass --- The longest common subsequence of two strings, which `FuzzySearchScorer` scores item --- words with. Lengths count UTF-16 units: `lcs:apply(a, b)` is the length of --- `lcs:longestCommonSubsequence(a, b)` in those units, without building the string (`#` of --- the string counts bytes, `utf8.len` code points). export type LongestCommonSubsequence = SimilarityScore & { --- The longest common subsequence of `left` and `right`; where several are longest, the --- one a table walk picks (from the end, preferring to drop from `right` on a tie). Where --- it holds one half of a character above U+FFFF, the string carries that lone surrogate --- in its WTF-8 form (three bytes, `ED A0..BF xx`). That form is not UTF-8: `utf8.len` --- answers `nil` for it, and a member that takes a `string` (the `CharMatcher`s, --- `StringUtils.stripAccents`) refuses it with "string is not valid UTF-8", so code that --- passes such a result on checks `utf8.len` first. Item names are ASCII. Raises --- `java.lang.OutOfMemoryError` where the table would pass 16,777,216 cells (two strings --- of about 4,096 characters); `apply` has no limit. longestCommonSubsequence: (LongestCommonSubsequence, string, string) -> string, } export type LongestCommonSubsequenceClass = { --- A new scorer. It keeps no state: one instance serves every call. new: () -> LongestCommonSubsequence, } --- `LongestCommonSubsequence`'s static functions and constants. declare LongestCommonSubsequence: LongestCommonSubsequenceClass --- How a fuzzy search ranks an item name against what was typed, from the longest common --- subsequence of their words and the Jaro-Winkler similarity of the whole. The whole score --- is one native call, faster than the same string work (lower-casing, `replace`, `split`) --- in Luau over `LongestCommonSubsequence` and `JaroWinklerDistance`. To rank items by a --- query, use `function(item) return scorer:score(query, item:getName()) end`. export type FuzzySearchScorer = { --- The score of `itemName` for `query`: both lower-cased with `-` read as a space; the --- best ratio, over each query word and item word, of their longest common subsequence --- to the query word's length; plus `log10(10 * jaroWinkler) - 0.5` of the whole --- strings; less 1. Above 0 is a match. NaN for a query with an empty word (two spaces --- in a row), and -infinity where nothing matches at all. score: (FuzzySearchScorer, string, string) -> number, } export type FuzzySearchScorerClass = { --- A new scorer. It keeps no state. new: () -> FuzzySearchScorer, } --- `FuzzySearchScorer`'s static functions and constants. declare FuzzySearchScorer: FuzzySearchScorerClass --- String helpers: `stripAccents`, the one a Luau line cannot do. Others are Luau one-liners: --- repeating is `string.rep(c, n)`; a blank test is --- `s == nil or string.find(s, "^%s*$") ~= nil`; capitalizing is --- `string.upper(string.sub(s, 1, 1)) .. string.sub(s, 2)`; left-padding is --- `string.rep(pad or " ", n - #s) .. s` (whole pads; ASCII); a case-insensitive prefix test --- is `string.lower(string.sub(s, 1, #p)) == string.lower(p)` (ASCII case); a substring test --- is `string.find(s, t, 1, true) ~= nil`. export type StringUtils = { } export type StringUtilsClass = { --- `input` with its accents removed: the canonical --- decomposition (NFD, Unicode 10 data), `Ł`/`ł` as `L`/`l`, then every --- character of the Combining Diacritical Marks block (U+0300-U+036F) removed; other --- combining marks (a kana's voicing mark, Hebrew points) stay, decomposed. `nil` for --- `nil`. `stripAccents("Łódź Café")` is `"Lodz Cafe"`. The length in UTF-16 units is --- kept for Latin-1 text (`é` to `e`), not the byte length: `#` drops by one for each --- accented Latin-1 letter, so an index into one is not an index into the other --- (`Matcher` indices on the stripped copy are UTF-16 units). stripAccents: (string?) -> string?, } --- `StringUtils`'s static functions and constants. declare StringUtils: StringUtilsClass --- Reachability with removable tiles and extra walls: which obstacles to --- clear to reach a tile, and whether a tile is reachable with other --- tiles treated as walls (NPCs that block without collision flags). --- --- Every `blockingTiles` form runs a minimum-blocker search once: fewest --- removable tiles to clear first, then fewest steps. export type Reach = { } export type ReachClass = { --- The tiles of `removable` to clear, in walk order, to reach any --- tile of `goals` from the player ("next to any vein", "any attack --- position": add them to `goals`): empty when the best route enters --- no removable tile, `nil` when no goal is reachable even after --- clearing every removable tile. A removable tile on the route --- counts even where it is walkable. blockingTiles: ({WorldPoint}, {WorldPoint}) -> {WorldPoint}?, --- The same, to one `target` tile, and empty whenever `target` is --- reachable by a normal walk. blockingTilesTo: (WorldPoint, {WorldPoint}) -> {WorldPoint}?, --- The same, to any tile of `area`, and empty whenever one of them is --- reachable by a normal walk. blockingTilesToArea: (WorldArea, {WorldPoint}) -> {WorldPoint}?, --- Steps from the player to `target` with the tiles of `blocked` as walls for this --- one query, not a setting later queries inherit; `nil` when `target` cannot be --- reached so. --- --- ```luau --- local past = Reach.pathLengthAvoiding(goal, { npc:getWorldLocation() }) --- if past ~= nil then player:walkTo(goal) end --- ``` pathLengthAvoiding: (WorldPoint, {WorldPoint}) -> number?, } --- `Reach`'s static functions and constants. declare Reach: ReachClass --- Route settings for one walk (`Webwalk:start`, `startTiles`) or one --- `PathQuery`. It starts from Bento's defaults, not the user's webwalker --- settings; set what the question needs. export type RouteOptions = { --- Avoid the Wilderness. setAvoidWilderness: (RouteOptions, boolean) -> (), --- Allow every player-owned-house route. setUseHouse: (RouteOptions, boolean) -> (), --- Allow every teleport (spells, items, portals, levers, minigames). setUseTeleports: (RouteOptions, boolean) -> (), --- Allow or forbid one transport type (`"FAIRY_RING"`, --- `"SPIRIT_TREE"`, `"CHARTER_SHIP"`, ...); raises for an unknown name. setTransport: (RouteOptions, string, boolean) -> (), --- Extra cost in ticks the server adds for one transport type. setTransportCost: (RouteOptions, string, number) -> (), --- Where a route may take its teleport items from, and whether it may use up the ones --- that run out. Raises for another value. setTeleportItems: (RouteOptions, "NONE" | "INVENTORY" | "INVENTORY_NON_CONSUMABLE" | "INVENTORY_AND_BANK" | "INVENTORY_AND_BANK_NON_CONSUMABLE") -> (), --- Let a walk stop at a bank for what later steps need. setBankStops: (RouteOptions, boolean) -> (), --- Most coins one fare or toll may cost. setMaxFare: (RouteOptions, number) -> (), --- Drink stamina potions while walking. setUseStamina: (RouteOptions, boolean) -> (), --- Eat while walking, with Bento's own food logic. setEatFood: (RouteOptions, boolean) -> (), --- Least run energy, in percent (0-100), at which run is turned on while an NPC attacks. setRunFloor: (RouteOptions, number) -> (), --- How many tiles from the target count as arrived. setArriveDistance: (RouteOptions, number) -> (), --- Allow or forbid one house feature (`"PORTALS"`, `"POOL"`, ...); raises for an unknown name. setHouseFeature: (RouteOptions, string, boolean) -> (), --- A query with these options plans as if the inventory held exactly --- the items `ids` (`quantities[i]` of `ids[i]`, 1 where `quantities` --- is shorter or `nil`); worn items stay as they are. The path server --- then admits the item-paid teleports and transports those items pay --- for. `nil` `ids` plans with the live inventory again. Raises for a --- negative id or quantity. setPlannedInventory: (RouteOptions, {number}?, {number}?) -> (), --- Routes keep out of these areas (a way round aggressive NPCs, say), replacing any --- set before; `{}` clears them. A walk still reaches a target inside one: an area --- holding the target is lifted, unless another target lies outside every area, and a --- start inside one walks out of it. An area the path server would refuse (under 1 by --- 1, a plane past 3, off the map) is left out, so is a repeat, and past 256 the rest; --- answers how many were kept. Needs a path server that takes the V4 request, which --- carries the areas. setAvoidAreas: (RouteOptions, {WorldArea}) -> number, } export type RouteOptionsClass = { --- Bento's defaults, not the user's settings (avoid the Wilderness; --- every transport; teleport items from the pack and the bank; bank --- stops; fares up to 10,000 coins; stamina; run floor 50; arrive --- within 1 tile; the house pool). defaults: () -> RouteOptions, } --- `RouteOptions`'s static functions and constants. declare RouteOptions: RouteOptionsClass --- A route question sent to the path server, which does not walk. The --- answer arrives on a later tick: poll `isDone()`. At most four run at --- once per client. A teleport or transport is the route step that uses it, --- and a bank is `toNearestBank()`'s destination. --- --- ```luau --- local q = PathQuery.between(player:tile(), tile) --- -- on a later tick --- if q:isDone() and q:reached() then --- for _, step in q:steps() do --- if step.isTeleport then log:info(step.name) end --- end --- end --- ``` export type PathQuery = { --- Whether the server has answered (or the request failed). isDone: (PathQuery) -> boolean, --- Whether the server found a route to the target; `false` while --- waiting. reached: (PathQuery) -> boolean, --- Why there is no route, or `nil`: the server's termination reason --- (`"NO_BOAT"`, `"CUTOFF_REACHED"`), the code of a request it refused --- (`"UNKNOWN_DOCK"`, `"INVALID_REQUEST"`), else the failure in words. problem: (PathQuery) -> string?, --- Estimated travel ticks (every step's ticks summed), or `nil`. durationTicks: (PathQuery) -> number?, --- Where the route ends (the bank tile for `toNearestBank`, the --- target reached for `plan`), or `nil` until answered. destination: (PathQuery) -> WorldPoint?, --- Where the route begins (for `plan`, the cheapest of its starts), or --- `nil` until a route is found. start: (PathQuery) -> WorldPoint?, --- The route's cost as the path server counts it (tiles walked plus --- each transport's ticks), plus the start's own cost for `plan`; `nil` --- until a route is found. cost: (PathQuery) -> number?, --- The route, one step at a time, or `nil` until a route is found. A walk step is a --- stretch between the server's waypoints, not every tile walked. A transport step --- says what fires it: `option` on one of `itemIds` (`ItemHandle:interact(option)`), --- or `option` on `objectId` (`TileObject:interact(option)`); `Webwalk:start` runs a --- whole route itself. --- --- ```luau --- local steps = q:steps() --- if steps then --- local transports = 0 --- for _, step in steps do --- if step.kind == "transport" then transports += 1 end --- end --- end --- ``` steps: (PathQuery) -> { RouteStep }?, } export type PathQueryClass = { --- Sends the route question from `from` to `to`, with `config` (or --- the webwalker's own settings), and answers on a later tick. Raises --- when four queries are already running. between: (WorldPoint, WorldPoint, RouteOptions?) -> PathQuery, --- The cheapest route from any of `starts` (each costing `startCosts[i]` --- first, 0 where `startCosts` is shorter or `nil`: a teleport's landing --- tile with its extra cost, the player's tile with 0) to whichever of --- `targets` is cheapest to reach (the tiles around an area for "adjacent --- to"). With `config`'s planned inventory the server plans as if those --- items were held, so the transport steps of `steps()` are the teleports --- and transports to bank for; `start()` is the chosen start, `cost()` its --- cost plus the route's. The full catalogue (every teleport the items --- could pay for) stays on the path server; the transports a plan may use --- are `config`'s transport types, not a caller-given list. One request per --- distinct start, at most 16, answered on a later tick; raises for no --- start, no target, more than 16 starts, or when four queries are already --- running. plan: ({WorldPoint}, {number}?, {WorldPoint}, RouteOptions?) -> PathQuery, --- The route from the player to the bank nearest by path, answered on a --- later tick; its `destination()` is the bank tile. toNearestBank: (RouteOptions?) -> PathQuery, --- The route from the player to a Sailing dock with the boat (walk to a dock where one --- of the player's boats is moored, board it, sail, and disembark unless `stayAboard`), --- answered on a later tick. Whether the player can make the trip: `problem()` is --- `"NO_BOAT"` (no usable boat), `"BOAT_UNREACHABLE"` (no sea route fits one, or a --- dock's level or quest), `"UNKNOWN_DOCK"` (the path server has no data for the dock) --- or `"CUTOFF_REACHED"`. Raises for an id outside 0 to 60, as `Webwalk:startDock`. toDock: (number, DockOptions?, RouteOptions?) -> PathQuery, --- The route from the player to open sea with the boat (walk to a dock where one of the --- player's boats is moored, board it, and sail; started aboard, the boat the player is --- on), ending aboard on a sea tile within `within` tiles of `tile` (2 when left out, --- at most 64), answered on a later tick. `destination()` is where the route ends. --- Whether the player can make the trip: `problem()` is `"NO_BOAT"` (no usable boat), --- `"BOAT_UNREACHABLE"` (no sea route fits one: its width, a hazard it does not resist, --- or no sea tile within reach of `tile`) or `"CUTOFF_REACHED"`. Raises for a `within` --- outside 0 to 64, as `Webwalk:startSea`. toSea: (WorldPoint, SeaOptions?, RouteOptions?) -> PathQuery, --- From one place, for one boat, the cheapest sail to each of `docks` (their berths) and then each --- of `tiles` (any sea tile within `options.within` of it, 2 when left out), in that order, answered --- on a later tick: the path server floods the sea once, with a route's moves, hazards and costs, and --- times each sail at the boat's live pace (the side panel aboard, a moored boat's parts ashore). --- What to order stops by, a courier's docks or a charting tour's spots, without a route request per --- pair. The sail starts at `options.fromDock`'s berth or `options.from`, else where the boat is --- (aboard, or its dock); the boat is `options.boat` (a slot, 1 to 5), else the one aboard, else --- the lowest-slot boat moored at a dock. `options.maxCost` stops the flood past that route cost. --- Raises for a dock outside 0 to 60, a `within` outside 0 to 64, no target or more than 256, or --- when four queries are already running; counts as one of them. --- --- ```luau --- local q = PathQuery.seaCosts({ 1, 23 }, nil, { fromDock = 0 }) --- -- on a later tick --- local costs = q:isDone() and q:costs() --- if costs and costs[1].reached then log:info(`{costs[1].ticks} ticks to The Pandemonium`) end --- ``` seaCosts: ({number}, {WorldPoint}?, SeaCostOptions?) -> SeaCostQuery, } --- `PathQuery`'s static functions and constants. declare PathQuery: PathQueryClass --- `PathQuery.seaCosts`' answer: per target, the cheapest sail to it from one place for one boat. It --- arrives on a later tick: poll `isDone()`. export type SeaCostQuery = { --- Whether the server has answered (or the request failed). isDone: (SeaCostQuery) -> boolean, --- Why there are no costs at all, or `nil`: the code of a request the path server refused --- (`"BAD_MESSAGE"` from one that predates sea costs, `"NO_START"` for a start aboard with the --- player ashore), else the failure in words. A target the boat cannot reach is its row's `problem`. problem: (SeaCostQuery) -> string?, --- One row a target, in the order asked (the docks, then the tiles), or `nil` until answered. --- `ticks` is the sailing time at the boat's pace (no boarding, helm or landing); `cost` the --- route's cost as `PathQuery:cost()` counts it; `landable` whether the player may disembark at a --- dock now (its level, quest and gates); `problem` why a row is not `reached` (`"NO_BOAT"`, --- `"BOAT_UNREACHABLE"`, `"CUTOFF_REACHED"`). costs: (SeaCostQuery) -> { SeaCost }?, } --- The calling plugin's own actions: whether what it queued went out, and same-tick --- units. --- --- **When an action happens.** An action call (`npc:interact`, `bank:withdraw`, --- `player:prayer():activate`, ...) queues; it never clicks at once, and its `true` --- means "queued". Actions queued in a `GameTick` handler go out over that tick, in the --- order queued; none is refused when queued, and what cannot go out by the tick's --- deadline is dropped, and shows in `Actions.droppedLastTick()` on the next tick. Actions --- queued anywhere else (`AnimationChanged`, `ChatMessage`, a menu callback) go out shortly --- after, in the same tick, or are dropped (and counted) when it is too late in the tick --- for them. `Actions.sameTick()` keeps a group of actions in one tick or none. export type Actions = { } export type ActionsClass = { --- Whether any action the calling plugin queued has neither gone out nor been --- dropped. Each plugin sees only its own actions. isBusy: () -> boolean, --- How many of the calling plugin's actions the scheduler dropped during the --- previous tick: past the plugin's `setMaxPerTick` cap, not out by that tick's --- deadline (nothing is refused when queued: what the tick cannot send is dropped), --- still unfired when its tick ended, held back past the deadline or left unresolved --- by the virtual mouse, turned away before its press, or cleared while logged out; --- none is kept for a later tick. Read it in `onGameTick` to know whether any of last --- tick's actions were dropped. droppedLastTick: () -> number, --- How many of the calling plugin's actions were refused when they went out on this --- client: queued (`true`), planned and sent to the virtual mouse, then turned down --- before any click, as an option the target does not offer, a target gone by then --- or a widget not there. It only rises, so a count higher than last read means a --- new refusal; `Actions.lastRefusal()` says why. Not counted: actions dropped --- (`droppedLastTick`), and clicks the game itself turns down. refusedCount: () -> number, --- Why the calling plugin's most recent refused action was refused, then the action, --- as the client log says it (`"'Take' is not a ground option on 'Bones': ..."`); --- `nil` when none has been. Read it when `Actions.refusedCount()` rises, so a click --- that can never go out is not queued again and again. lastRefusal: () -> string?, --- Every action the plugin queues from now until the queue is next drained (this --- tick's plan, or, outside `GameTick`, the next client cycle) is admitted to one --- tick together, in the order queued, or not at all. An equip, an eat and a --- prayer never split across ticks, a prayer `flick` (its own two-press unit) and --- a use-on included: a unit queued inside this one joins it. An action made of --- two clicks (a use-on's select and its target, a cast's spell and its target) --- is one same-tick unit by itself. sameTick: () -> (), --- For the calling plugin only: at most `count` of the plugin's actions go into one --- tick's plan, the first queued, and the rest are dropped, counted in --- `Actions.droppedLastTick()`; none is kept for a later tick. Without a cap (`nil` --- clears it, the default) a tick's plan takes everything queued and sends what goes --- out by its deadline: the scheduler caps nothing by count, only this does. Once one of the plugin's actions is dropped, every later one of that --- tick is too, so none goes out ahead of one queued before it. Any count from 1 is --- taken (0 is 1), and a same-tick unit larger than the cap goes out whole as the --- plugin's first of a tick. An action the last tick left unfired goes first and --- counts against the cap. An action queued outside `GameTick` is not planned, so --- not counted. setMaxPerTick: (number?) -> (), } --- `Actions`'s static functions and constants. declare Actions: ActionsClass --- Each constant is its own name (`Spells.HIGH_LEVEL_ALCHEMY == "HIGH_LEVEL_ALCHEMY"`), which every spell intent takes (`player:magic():cast(Spells.HIGH_LEVEL_ALCHEMY)`, `castOnItem`, `select`, `setAutocast`); they also take a display name. Constants rather than display names because two pairs of spells share one ("Ape Atoll Teleport", "Humidify"). A string has no methods, so the getters are statics taking the constant, as `Color`'s are: `Spells.getName(spell)` for the display name, and `player:magic():spellInfo(spell)` for its level, runes and what it is cast on. 197 spells. export type Spells = { } export type SpellsClass = { --- The spell's display name ("High Level Alchemy"), where the constant is its constant name (`HIGH_LEVEL_ALCHEMY`). Also takes a display name, spelled any way (`"high level alchemy"`), and answers the catalog's spelling. getName: (string) -> string, --- The packed id of the spell's button in the spellbook (`InterfaceID.MagicSpellbook`). getWidgetId: (string) -> number, --- The spellbook as the `SPELLBOOK` varbit counts it, 0 standard, 1 ancient, 2 lunar, 3 Arceuus. getSpellbook: (string) -> number, --- The constant whose display name is `name` (lower-cased, a smart apostrophe read as `'`, a no-break space as a space, trimmed; inner spaces and punctuation must match), the first of two spells that share a name, or nil. Not a constant's name (`Spells[name]` is that); the intents' spell arguments are more lenient. fromName: (string) -> string?, --- A new array of every constant, in the catalog's order. values: () -> {string}, --- `Spells.WIND_STRIKE` ("Wind Strike"): the constant's name, which every spell intent takes. WIND_STRIKE: string, --- `Spells.WATER_STRIKE` ("Water Strike"): the constant's name, which every spell intent takes. WATER_STRIKE: string, --- `Spells.EARTH_STRIKE` ("Earth Strike"): the constant's name, which every spell intent takes. EARTH_STRIKE: string, --- `Spells.FIRE_STRIKE` ("Fire Strike"): the constant's name, which every spell intent takes. FIRE_STRIKE: string, --- `Spells.WIND_BOLT` ("Wind Bolt"): the constant's name, which every spell intent takes. WIND_BOLT: string, --- `Spells.WATER_BOLT` ("Water Bolt"): the constant's name, which every spell intent takes. WATER_BOLT: string, --- `Spells.EARTH_BOLT` ("Earth Bolt"): the constant's name, which every spell intent takes. EARTH_BOLT: string, --- `Spells.FIRE_BOLT` ("Fire Bolt"): the constant's name, which every spell intent takes. FIRE_BOLT: string, --- `Spells.WIND_BLAST` ("Wind Blast"): the constant's name, which every spell intent takes. WIND_BLAST: string, --- `Spells.WATER_BLAST` ("Water Blast"): the constant's name, which every spell intent takes. WATER_BLAST: string, --- `Spells.EARTH_BLAST` ("Earth Blast"): the constant's name, which every spell intent takes. EARTH_BLAST: string, --- `Spells.FIRE_BLAST` ("Fire Blast"): the constant's name, which every spell intent takes. FIRE_BLAST: string, --- `Spells.WIND_WAVE` ("Wind Wave"): the constant's name, which every spell intent takes. WIND_WAVE: string, --- `Spells.WATER_WAVE` ("Water Wave"): the constant's name, which every spell intent takes. WATER_WAVE: string, --- `Spells.EARTH_WAVE` ("Earth Wave"): the constant's name, which every spell intent takes. EARTH_WAVE: string, --- `Spells.FIRE_WAVE` ("Fire Wave"): the constant's name, which every spell intent takes. FIRE_WAVE: string, --- `Spells.WIND_SURGE` ("Wind Surge"): the constant's name, which every spell intent takes. WIND_SURGE: string, --- `Spells.WATER_SURGE` ("Water Surge"): the constant's name, which every spell intent takes. WATER_SURGE: string, --- `Spells.EARTH_SURGE` ("Earth Surge"): the constant's name, which every spell intent takes. EARTH_SURGE: string, --- `Spells.FIRE_SURGE` ("Fire Surge"): the constant's name, which every spell intent takes. FIRE_SURGE: string, --- `Spells.CRUMBLE_UNDEAD` ("Crumble Undead"): the constant's name, which every spell intent takes. CRUMBLE_UNDEAD: string, --- `Spells.IBAN_BLAST` ("Iban Blast"): the constant's name, which every spell intent takes. IBAN_BLAST: string, --- `Spells.MAGIC_DART` ("Magic Dart"): the constant's name, which every spell intent takes. MAGIC_DART: string, --- `Spells.SARADOMIN_STRIKE` ("Saradomin Strike"): the constant's name, which every spell intent takes. SARADOMIN_STRIKE: string, --- `Spells.FLAMES_OF_ZAMORAK` ("Flames of Zamorak"): the constant's name, which every spell intent takes. FLAMES_OF_ZAMORAK: string, --- `Spells.CLAWS_OF_GUTHIX` ("Claws of Guthix"): the constant's name, which every spell intent takes. CLAWS_OF_GUTHIX: string, --- `Spells.CONFUSE` ("Confuse"): the constant's name, which every spell intent takes. CONFUSE: string, --- `Spells.WEAKEN` ("Weaken"): the constant's name, which every spell intent takes. WEAKEN: string, --- `Spells.CURSE` ("Curse"): the constant's name, which every spell intent takes. CURSE: string, --- `Spells.VULNERABILITY` ("Vulnerability"): the constant's name, which every spell intent takes. VULNERABILITY: string, --- `Spells.ENFEEBLE` ("Enfeeble"): the constant's name, which every spell intent takes. ENFEEBLE: string, --- `Spells.STUN` ("Stun"): the constant's name, which every spell intent takes. STUN: string, --- `Spells.BIND` ("Bind"): the constant's name, which every spell intent takes. BIND: string, --- `Spells.SNARE` ("Snare"): the constant's name, which every spell intent takes. SNARE: string, --- `Spells.ENTANGLE` ("Entangle"): the constant's name, which every spell intent takes. ENTANGLE: string, --- `Spells.TELE_BLOCK` ("Tele Block"): the constant's name, which every spell intent takes. TELE_BLOCK: string, --- `Spells.LUMBRIDGE_HOME_TELEPORT` ("Lumbridge Home Teleport"): the constant's name, which every spell intent takes. LUMBRIDGE_HOME_TELEPORT: string, --- `Spells.VARROCK_TELEPORT` ("Varrock Teleport"): the constant's name, which every spell intent takes. VARROCK_TELEPORT: string, --- `Spells.VARROCK_TELEPORT_GRAND_EXCHANGE` ("Grand Exchange Varrock Teleport"): the constant's name, which every spell intent takes. VARROCK_TELEPORT_GRAND_EXCHANGE: string, --- `Spells.LUMBRIDGE_TELEPORT` ("Lumbridge Teleport"): the constant's name, which every spell intent takes. LUMBRIDGE_TELEPORT: string, --- `Spells.FALADOR_TELEPORT` ("Falador Teleport"): the constant's name, which every spell intent takes. FALADOR_TELEPORT: string, --- `Spells.TELEPORT_TO_HOUSE` ("Teleport to House"): the constant's name, which every spell intent takes. TELEPORT_TO_HOUSE: string, --- `Spells.TELEPORT_TO_HOUSE_OUTSIDE` ("Outside Teleport to House"): the constant's name, which every spell intent takes. TELEPORT_TO_HOUSE_OUTSIDE: string, --- `Spells.TELEPORT_TO_HOUSE_GROUP_PREVIOUS` ("Group: Previous Teleport to House"): the constant's name, which every spell intent takes. TELEPORT_TO_HOUSE_GROUP_PREVIOUS: string, --- `Spells.CAMELOT_TELEPORT` ("Camelot Teleport"): the constant's name, which every spell intent takes. CAMELOT_TELEPORT: string, --- `Spells.CAMELOT_TELEPORT_SEERS` ("Seer's Camelot Teleport"): the constant's name, which every spell intent takes. CAMELOT_TELEPORT_SEERS: string, --- `Spells.ARDOUGNE_TELEPORT` ("Ardougne Teleport"): the constant's name, which every spell intent takes. ARDOUGNE_TELEPORT: string, --- `Spells.CIVITAS_ILLA_FORTIS_TELEPORT` ("Civitas illa Fortis Teleport"): the constant's name, which every spell intent takes. CIVITAS_ILLA_FORTIS_TELEPORT: string, --- `Spells.WATCHTOWER_TELEPORT` ("Watchtower Teleport"): the constant's name, which every spell intent takes. WATCHTOWER_TELEPORT: string, --- `Spells.WATCHTOWER_TELEPORT_YANILLE` ("Yanille Watchtower Teleport"): the constant's name, which every spell intent takes. WATCHTOWER_TELEPORT_YANILLE: string, --- `Spells.TROLLHEIM_TELEPORT` ("Trollheim Teleport"): the constant's name, which every spell intent takes. TROLLHEIM_TELEPORT: string, --- `Spells.APE_ATOLL_TELEPORT_NORMAL` ("Ape Atoll Teleport"): the constant's name, which every spell intent takes. APE_ATOLL_TELEPORT_NORMAL: string, --- `Spells.KOUREND_CASTLE_TELEPORT` ("Kourend Castle Teleport"): the constant's name, which every spell intent takes. KOUREND_CASTLE_TELEPORT: string, --- `Spells.TELEOTHER_LUMBRIDGE` ("Teleother Lumbridge"): the constant's name, which every spell intent takes. TELEOTHER_LUMBRIDGE: string, --- `Spells.TELEOTHER_FALADOR` ("Teleother Falador"): the constant's name, which every spell intent takes. TELEOTHER_FALADOR: string, --- `Spells.TELEPORT_TO_TARGET` ("Teleport to Target"): the constant's name, which every spell intent takes. TELEPORT_TO_TARGET: string, --- `Spells.TELEOTHER_CAMELOT` ("Teleother Camelot"): the constant's name, which every spell intent takes. TELEOTHER_CAMELOT: string, --- `Spells.TELEPORT_BOAT_TO_ME` ("Teleport boat to me"): the constant's name, which every spell intent takes. TELEPORT_BOAT_TO_ME: string, --- `Spells.TELEPORT_ME_TO_BOAT` ("Teleport me to boat"): the constant's name, which every spell intent takes. TELEPORT_ME_TO_BOAT: string, --- `Spells.BONES_TO_BANANAS` ("Bones to Bananas"): the constant's name, which every spell intent takes. BONES_TO_BANANAS: string, --- `Spells.BONES_TO_PEACHES` ("Bones to Peaches"): the constant's name, which every spell intent takes. BONES_TO_PEACHES: string, --- `Spells.LOW_LEVEL_ALCHEMY` ("Low Level Alchemy"): the constant's name, which every spell intent takes. LOW_LEVEL_ALCHEMY: string, --- `Spells.HIGH_LEVEL_ALCHEMY` ("High Level Alchemy"): the constant's name, which every spell intent takes. HIGH_LEVEL_ALCHEMY: string, --- `Spells.SUPERHEAT_ITEM` ("Superheat Item"): the constant's name, which every spell intent takes. SUPERHEAT_ITEM: string, --- `Spells.LVL_1_ENCHANT` ("Lvl-1 Enchant"): the constant's name, which every spell intent takes. LVL_1_ENCHANT: string, --- `Spells.LVL_2_ENCHANT` ("Lvl-2 Enchant"): the constant's name, which every spell intent takes. LVL_2_ENCHANT: string, --- `Spells.LVL_3_ENCHANT` ("Lvl-3 Enchant"): the constant's name, which every spell intent takes. LVL_3_ENCHANT: string, --- `Spells.LVL_4_ENCHANT` ("Lvl-4 Enchant"): the constant's name, which every spell intent takes. LVL_4_ENCHANT: string, --- `Spells.LVL_5_ENCHANT` ("Lvl-5 Enchant"): the constant's name, which every spell intent takes. LVL_5_ENCHANT: string, --- `Spells.LVL_6_ENCHANT` ("Lvl-6 Enchant"): the constant's name, which every spell intent takes. LVL_6_ENCHANT: string, --- `Spells.LVL_7_ENCHANT` ("Lvl-7 Enchant"): the constant's name, which every spell intent takes. LVL_7_ENCHANT: string, --- `Spells.ENCHANT_CROSSBOW_BOLT` ("Enchant Crossbow Bolt"): the constant's name, which every spell intent takes. ENCHANT_CROSSBOW_BOLT: string, --- `Spells.CHARGE` ("Charge"): the constant's name, which every spell intent takes. CHARGE: string, --- `Spells.TELEKINETIC_GRAB` ("Telekinetic Grab"): the constant's name, which every spell intent takes. TELEKINETIC_GRAB: string, --- `Spells.CHARGE_WATER_ORB` ("Charge Water Orb"): the constant's name, which every spell intent takes. CHARGE_WATER_ORB: string, --- `Spells.CHARGE_EARTH_ORB` ("Charge Earth Orb"): the constant's name, which every spell intent takes. CHARGE_EARTH_ORB: string, --- `Spells.CHARGE_FIRE_ORB` ("Charge Fire Orb"): the constant's name, which every spell intent takes. CHARGE_FIRE_ORB: string, --- `Spells.CHARGE_AIR_ORB` ("Charge Air Orb"): the constant's name, which every spell intent takes. CHARGE_AIR_ORB: string, --- `Spells.MONSTER_INSPECT` ("Monster Inspect"): the constant's name, which every spell intent takes. MONSTER_INSPECT: string, --- `Spells.SMOKE_RUSH` ("Smoke Rush"): the constant's name, which every spell intent takes. SMOKE_RUSH: string, --- `Spells.SHADOW_RUSH` ("Shadow Rush"): the constant's name, which every spell intent takes. SHADOW_RUSH: string, --- `Spells.BLOOD_RUSH` ("Blood Rush"): the constant's name, which every spell intent takes. BLOOD_RUSH: string, --- `Spells.ICE_RUSH` ("Ice Rush"): the constant's name, which every spell intent takes. ICE_RUSH: string, --- `Spells.SMOKE_BURST` ("Smoke Burst"): the constant's name, which every spell intent takes. SMOKE_BURST: string, --- `Spells.SHADOW_BURST` ("Shadow Burst"): the constant's name, which every spell intent takes. SHADOW_BURST: string, --- `Spells.BLOOD_BURST` ("Blood Burst"): the constant's name, which every spell intent takes. BLOOD_BURST: string, --- `Spells.ICE_BURST` ("Ice Burst"): the constant's name, which every spell intent takes. ICE_BURST: string, --- `Spells.SMOKE_BLITZ` ("Smoke Blitz"): the constant's name, which every spell intent takes. SMOKE_BLITZ: string, --- `Spells.SHADOW_BLITZ` ("Shadow Blitz"): the constant's name, which every spell intent takes. SHADOW_BLITZ: string, --- `Spells.BLOOD_BLITZ` ("Blood Blitz"): the constant's name, which every spell intent takes. BLOOD_BLITZ: string, --- `Spells.ICE_BLITZ` ("Ice Blitz"): the constant's name, which every spell intent takes. ICE_BLITZ: string, --- `Spells.SMOKE_BARRAGE` ("Smoke Barrage"): the constant's name, which every spell intent takes. SMOKE_BARRAGE: string, --- `Spells.SHADOW_BARRAGE` ("Shadow Barrage"): the constant's name, which every spell intent takes. SHADOW_BARRAGE: string, --- `Spells.BLOOD_BARRAGE` ("Blood Barrage"): the constant's name, which every spell intent takes. BLOOD_BARRAGE: string, --- `Spells.ICE_BARRAGE` ("Ice Barrage"): the constant's name, which every spell intent takes. ICE_BARRAGE: string, --- `Spells.EDGEVILLE_HOME_TELEPORT` ("Edgeville Home Teleport"): the constant's name, which every spell intent takes. EDGEVILLE_HOME_TELEPORT: string, --- `Spells.PADDEWWA_TELEPORT` ("Paddewwa Teleport"): the constant's name, which every spell intent takes. PADDEWWA_TELEPORT: string, --- `Spells.SENNTISTEN_TELEPORT` ("Senntisten Teleport"): the constant's name, which every spell intent takes. SENNTISTEN_TELEPORT: string, --- `Spells.KHARYRLL_TELEPORT` ("Kharyrll Teleport"): the constant's name, which every spell intent takes. KHARYRLL_TELEPORT: string, --- `Spells.LASSAR_TELEPORT` ("Lassar Teleport"): the constant's name, which every spell intent takes. LASSAR_TELEPORT: string, --- `Spells.DAREEYAK_TELEPORT` ("Dareeyak Teleport"): the constant's name, which every spell intent takes. DAREEYAK_TELEPORT: string, --- `Spells.CARRALLANGER_TELEPORT` ("Carrallanger Teleport"): the constant's name, which every spell intent takes. CARRALLANGER_TELEPORT: string, --- `Spells.ANNAKARL_TELEPORT` ("Annakarl Teleport"): the constant's name, which every spell intent takes. ANNAKARL_TELEPORT: string, --- `Spells.GHORROCK_TELEPORT` ("Ghorrock Teleport"): the constant's name, which every spell intent takes. GHORROCK_TELEPORT: string, --- `Spells.MONSTER_EXAMINE` ("Monster Examine"): the constant's name, which every spell intent takes. MONSTER_EXAMINE: string, --- `Spells.CURE_OTHER` ("Cure Other"): the constant's name, which every spell intent takes. CURE_OTHER: string, --- `Spells.CURE_ME` ("Cure Me"): the constant's name, which every spell intent takes. CURE_ME: string, --- `Spells.CURE_GROUP` ("Cure Group"): the constant's name, which every spell intent takes. CURE_GROUP: string, --- `Spells.STAT_SPY` ("Stat Spy"): the constant's name, which every spell intent takes. STAT_SPY: string, --- `Spells.DREAM` ("Dream"): the constant's name, which every spell intent takes. DREAM: string, --- `Spells.STAT_RESTORE_POT_SHARE` ("Stat Restore Pot Share"): the constant's name, which every spell intent takes. STAT_RESTORE_POT_SHARE: string, --- `Spells.BOOST_POTION_SHARE` ("Boost Potion Share"): the constant's name, which every spell intent takes. BOOST_POTION_SHARE: string, --- `Spells.ENERGY_TRANSFER` ("Energy Transfer"): the constant's name, which every spell intent takes. ENERGY_TRANSFER: string, --- `Spells.HEAL_OTHER` ("Heal Other"): the constant's name, which every spell intent takes. HEAL_OTHER: string, --- `Spells.VENGEANCE_OTHER` ("Vengeance Other"): the constant's name, which every spell intent takes. VENGEANCE_OTHER: string, --- `Spells.VENGEANCE` ("Vengeance"): the constant's name, which every spell intent takes. VENGEANCE: string, --- `Spells.HEAL_GROUP` ("Heal Group"): the constant's name, which every spell intent takes. HEAL_GROUP: string, --- `Spells.LUNAR_HOME_TELEPORT` ("Lunar Home Teleport"): the constant's name, which every spell intent takes. LUNAR_HOME_TELEPORT: string, --- `Spells.MOONCLAN_TELEPORT` ("Moonclan Teleport"): the constant's name, which every spell intent takes. MOONCLAN_TELEPORT: string, --- `Spells.TELE_GROUP_MOONCLAN` ("Tele Group Moonclan"): the constant's name, which every spell intent takes. TELE_GROUP_MOONCLAN: string, --- `Spells.OURANIA_TELEPORT` ("Ourania Teleport"): the constant's name, which every spell intent takes. OURANIA_TELEPORT: string, --- `Spells.WATERBIRTH_TELEPORT` ("Waterbirth Teleport"): the constant's name, which every spell intent takes. WATERBIRTH_TELEPORT: string, --- `Spells.TELE_GROUP_WATERBIRTH` ("Tele Group Waterbirth"): the constant's name, which every spell intent takes. TELE_GROUP_WATERBIRTH: string, --- `Spells.BARBARIAN_TELEPORT` ("Barbarian Teleport"): the constant's name, which every spell intent takes. BARBARIAN_TELEPORT: string, --- `Spells.TELE_GROUP_BARBARIAN` ("Tele Group Barbarian"): the constant's name, which every spell intent takes. TELE_GROUP_BARBARIAN: string, --- `Spells.KHAZARD_TELEPORT` ("Khazard Teleport"): the constant's name, which every spell intent takes. KHAZARD_TELEPORT: string, --- `Spells.TELE_GROUP_KHAZARD` ("Tele Group Khazard"): the constant's name, which every spell intent takes. TELE_GROUP_KHAZARD: string, --- `Spells.FISHING_GUILD_TELEPORT` ("Fishing Guild Teleport"): the constant's name, which every spell intent takes. FISHING_GUILD_TELEPORT: string, --- `Spells.TELE_GROUP_FISHING_GUILD` ("Tele Group Fishing Guild"): the constant's name, which every spell intent takes. TELE_GROUP_FISHING_GUILD: string, --- `Spells.CATHERBY_TELEPORT` ("Catherby Teleport"): the constant's name, which every spell intent takes. CATHERBY_TELEPORT: string, --- `Spells.TELE_GROUP_CATHERBY` ("Tele Group Catherby"): the constant's name, which every spell intent takes. TELE_GROUP_CATHERBY: string, --- `Spells.ICE_PLATEAU_TELEPORT` ("Ice Plateau Teleport"): the constant's name, which every spell intent takes. ICE_PLATEAU_TELEPORT: string, --- `Spells.TELE_GROUP_ICE_PLATEAU` ("Tele Group Ice Plateau"): the constant's name, which every spell intent takes. TELE_GROUP_ICE_PLATEAU: string, --- `Spells.BAKE_PIE` ("Bake Pie"): the constant's name, which every spell intent takes. BAKE_PIE: string, --- `Spells.GEOMANCY` ("Geomancy"): the constant's name, which every spell intent takes. GEOMANCY: string, --- `Spells.CURE_PLANT` ("Cure Plant"): the constant's name, which every spell intent takes. CURE_PLANT: string, --- `Spells.NPC_CONTACT` ("NPC Contact"): the constant's name, which every spell intent takes. NPC_CONTACT: string, --- `Spells.NPC_CONTACT_PREVIOUS` ("Previous NPC Contact"): the constant's name, which every spell intent takes. NPC_CONTACT_PREVIOUS: string, --- `Spells.HUMIDIFY` ("Humidify"): the constant's name, which every spell intent takes. HUMIDIFY: string, --- `Spells.HUMIDIFY_TARGET` ("Humidify"): the constant's name, which every spell intent takes. HUMIDIFY_TARGET: string, --- `Spells.HUNTER_KIT` ("Hunter Kit"): the constant's name, which every spell intent takes. HUNTER_KIT: string, --- `Spells.SPIN_FLAX` ("Spin Flax"): the constant's name, which every spell intent takes. SPIN_FLAX: string, --- `Spells.SUPERGLASS_MAKE` ("Superglass Make"): the constant's name, which every spell intent takes. SUPERGLASS_MAKE: string, --- `Spells.TAN_LEATHER` ("Tan Leather"): the constant's name, which every spell intent takes. TAN_LEATHER: string, --- `Spells.STRING_JEWELLERY` ("String Jewellery"): the constant's name, which every spell intent takes. STRING_JEWELLERY: string, --- `Spells.MAGIC_IMBUE` ("Magic Imbue"): the constant's name, which every spell intent takes. MAGIC_IMBUE: string, --- `Spells.FERTILE_SOIL` ("Fertile Soil"): the constant's name, which every spell intent takes. FERTILE_SOIL: string, --- `Spells.PLANK_MAKE` ("Plank Make"): the constant's name, which every spell intent takes. PLANK_MAKE: string, --- `Spells.RECHARGE_DRAGONSTONE` ("Recharge Dragonstone"): the constant's name, which every spell intent takes. RECHARGE_DRAGONSTONE: string, --- `Spells.SPELLBOOK_SWAP` ("Spellbook Swap"): the constant's name, which every spell intent takes. SPELLBOOK_SWAP: string, --- `Spells.SPELLBOOK_SWAP_NORMAL` ("Standard Spellbook Swap"): the constant's name, which every spell intent takes. SPELLBOOK_SWAP_NORMAL: string, --- `Spells.SPELLBOOK_SWAP_ANCIENT` ("Ancient Spellbook Swap"): the constant's name, which every spell intent takes. SPELLBOOK_SWAP_ANCIENT: string, --- `Spells.SPELLBOOK_SWAP_ARCEUUS` ("Arceuus Spellbook Swap"): the constant's name, which every spell intent takes. SPELLBOOK_SWAP_ARCEUUS: string, --- `Spells.ARCEUUS_HOME_TELEPORT` ("Arceuus Home Teleport"): the constant's name, which every spell intent takes. ARCEUUS_HOME_TELEPORT: string, --- `Spells.ARCEUUS_LIBRARY_TELEPORT` ("Arceuus Library Teleport"): the constant's name, which every spell intent takes. ARCEUUS_LIBRARY_TELEPORT: string, --- `Spells.DRAYNOR_MANOR_TELEPORT` ("Draynor Manor Teleport"): the constant's name, which every spell intent takes. DRAYNOR_MANOR_TELEPORT: string, --- `Spells.BATTLEFRONT_TELEPORT` ("Battlefront Teleport"): the constant's name, which every spell intent takes. BATTLEFRONT_TELEPORT: string, --- `Spells.MIND_ALTAR_TELEPORT` ("Mind Altar Teleport"): the constant's name, which every spell intent takes. MIND_ALTAR_TELEPORT: string, --- `Spells.RESPAWN_TELEPORT` ("Respawn Teleport"): the constant's name, which every spell intent takes. RESPAWN_TELEPORT: string, --- `Spells.SALVE_GRAVEYARD_TELEPORT` ("Salve Graveyard Teleport"): the constant's name, which every spell intent takes. SALVE_GRAVEYARD_TELEPORT: string, --- `Spells.FENKENSTRAINS_CASTLE_TELEPORT` ("Fenkenstrain's Castle Teleport"): the constant's name, which every spell intent takes. FENKENSTRAINS_CASTLE_TELEPORT: string, --- `Spells.WEST_ARDOUGNE_TELEPORT` ("West Ardougne Teleport"): the constant's name, which every spell intent takes. WEST_ARDOUGNE_TELEPORT: string, --- `Spells.HARMONY_ISLAND_TELEPORT` ("Harmony Island Teleport"): the constant's name, which every spell intent takes. HARMONY_ISLAND_TELEPORT: string, --- `Spells.CEMETERY_TELEPORT` ("Cemetery Teleport"): the constant's name, which every spell intent takes. CEMETERY_TELEPORT: string, --- `Spells.BARROWS_TELEPORT` ("Barrows Teleport"): the constant's name, which every spell intent takes. BARROWS_TELEPORT: string, --- `Spells.APE_ATOLL_TELEPORT_ARCEUUS` ("Ape Atoll Teleport"): the constant's name, which every spell intent takes. APE_ATOLL_TELEPORT_ARCEUUS: string, --- `Spells.GHOSTLY_GRASP` ("Ghostly Grasp"): the constant's name, which every spell intent takes. GHOSTLY_GRASP: string, --- `Spells.SKELETAL_GRASP` ("Skeletal Grasp"): the constant's name, which every spell intent takes. SKELETAL_GRASP: string, --- `Spells.UNDEAD_GRASP` ("Undead Grasp"): the constant's name, which every spell intent takes. UNDEAD_GRASP: string, --- `Spells.INFERIOR_DEMONBANE` ("Inferior Demonbane"): the constant's name, which every spell intent takes. INFERIOR_DEMONBANE: string, --- `Spells.SUPERIOR_DEMONBANE` ("Superior Demonbane"): the constant's name, which every spell intent takes. SUPERIOR_DEMONBANE: string, --- `Spells.DARK_DEMONBANE` ("Dark Demonbane"): the constant's name, which every spell intent takes. DARK_DEMONBANE: string, --- `Spells.LESSER_CORRUPTION` ("Lesser Corruption"): the constant's name, which every spell intent takes. LESSER_CORRUPTION: string, --- `Spells.GREATER_CORRUPTION` ("Greater Corruption"): the constant's name, which every spell intent takes. GREATER_CORRUPTION: string, --- `Spells.RESURRECT_LESSER_GHOST` ("Resurrect Lesser Ghost"): the constant's name, which every spell intent takes. RESURRECT_LESSER_GHOST: string, --- `Spells.RESURRECT_LESSER_SKELETON` ("Resurrect Lesser Skeleton"): the constant's name, which every spell intent takes. RESURRECT_LESSER_SKELETON: string, --- `Spells.RESURRECT_LESSER_ZOMBIE` ("Resurrect Lesser Zombie"): the constant's name, which every spell intent takes. RESURRECT_LESSER_ZOMBIE: string, --- `Spells.RESURRECT_SUPERIOR_GHOST` ("Resurrect Superior Ghost"): the constant's name, which every spell intent takes. RESURRECT_SUPERIOR_GHOST: string, --- `Spells.RESURRECT_SUPERIOR_SKELETON` ("Resurrect Superior Skeleton"): the constant's name, which every spell intent takes. RESURRECT_SUPERIOR_SKELETON: string, --- `Spells.RESURRECT_SUPERIOR_ZOMBIE` ("Resurrect Superior Zombie"): the constant's name, which every spell intent takes. RESURRECT_SUPERIOR_ZOMBIE: string, --- `Spells.RESURRECT_GREATER_GHOST` ("Resurrect Greater Ghost"): the constant's name, which every spell intent takes. RESURRECT_GREATER_GHOST: string, --- `Spells.RESURRECT_GREATER_SKELETON` ("Resurrect Greater Skeleton"): the constant's name, which every spell intent takes. RESURRECT_GREATER_SKELETON: string, --- `Spells.RESURRECT_GREATER_ZOMBIE` ("Resurrect Greater Zombie"): the constant's name, which every spell intent takes. RESURRECT_GREATER_ZOMBIE: string, --- `Spells.DARK_LURE` ("Dark Lure"): the constant's name, which every spell intent takes. DARK_LURE: string, --- `Spells.MARK_OF_DARKNESS` ("Mark of Darkness"): the constant's name, which every spell intent takes. MARK_OF_DARKNESS: string, --- `Spells.WARD_OF_ARCEUUS` ("Ward of Arceuus"): the constant's name, which every spell intent takes. WARD_OF_ARCEUUS: string, --- `Spells.BASIC_REANIMATION` ("Basic Reanimation"): the constant's name, which every spell intent takes. BASIC_REANIMATION: string, --- `Spells.ADEPT_REANIMATION` ("Adept Reanimation"): the constant's name, which every spell intent takes. ADEPT_REANIMATION: string, --- `Spells.EXPERT_REANIMATION` ("Expert Reanimation"): the constant's name, which every spell intent takes. EXPERT_REANIMATION: string, --- `Spells.MASTER_REANIMATION` ("Master Reanimation"): the constant's name, which every spell intent takes. MASTER_REANIMATION: string, --- `Spells.DEMONIC_OFFERING` ("Demonic Offering"): the constant's name, which every spell intent takes. DEMONIC_OFFERING: string, --- `Spells.SINISTER_OFFERING` ("Sinister Offering"): the constant's name, which every spell intent takes. SINISTER_OFFERING: string, --- `Spells.SHADOW_VEIL` ("Shadow Veil"): the constant's name, which every spell intent takes. SHADOW_VEIL: string, --- `Spells.VILE_VIGOUR` ("Vile Vigour"): the constant's name, which every spell intent takes. VILE_VIGOUR: string, --- `Spells.DEGRIME` ("Degrime"): the constant's name, which every spell intent takes. DEGRIME: string, --- `Spells.RESURRECT_CROPS` ("Resurrect Crops"): the constant's name, which every spell intent takes. RESURRECT_CROPS: string, --- `Spells.DEATH_CHARGE` ("Death Charge"): the constant's name, which every spell intent takes. DEATH_CHARGE: string, } --- `Spells`'s static functions and constants. declare Spells: SpellsClass --- Scheduled pauses for this plugin, inside windows it declares. There are two kinds: a short --- pause, during some of which the library performs one idle activity of its own, such as --- opening a tab or feeding the kitten; and an AFK pause, with no input at all. The pause --- lengths are the library's; the plugin chooses how often and where. --- --- The plugin cooperates: it declares its windows once, sits out each tick a pause is --- running, and says where a pause would be safe. --- --- ```luau --- function plugin:startUp() --- Humanizer.register(10, 25, 45, 90) --- end --- --- function plugin:onGameTick() --- if Humanizer.paused() then return end --- -- ...the plugin's work... --- if lootCollected and Humanizer.atSafeSpot() then return end --- end --- --- function plugin:shutDown() --- Humanizer.unregister() --- end --- ``` export type Humanizer = { } export type HumanizerClass = { --- Declares this plugin's windows, in whole minutes between pauses: a short pause every --- `shortMin` to `shortMax`, an AFK pause every `afkMin` to `afkMax`. A maximum of 0 --- turns that kind off. Calling it again replaces the windows and restarts both clocks. register: (number, number, number, number) -> (), --- Forgets this plugin's windows and any running pause. Call it from `shutDown`. unregister: () -> (), --- Whether a pause of this plugin's is running: when it is, sit out this tick. `false` --- for a plugin that has not registered. paused: () -> boolean, --- The running pause's kind, `"short"` or `"afk"`; `nil` when none is running. pauseKind: () -> string?, --- Game ticks left in the running pause; 0 when none is running. remainingTicks: () -> number, --- What the running pause is doing, in words (`"open inventory tab"`); `nil` for an AFK --- pause, a quiet short pause, or when none is running. activity: () -> string?, --- Says this is a safe spot: starts a pause when one is due, an AFK pause before a short --- one. `true` while a pause is running, so the plugin sits out the tick. No pause starts --- during a break (`BreakManager`). Call it wherever stopping would do no harm. atSafeSpot: () -> boolean, --- As `atSafeSpot`, but only a short pause may start here: for a spot where the plugin --- can spare a moment and not minutes. atShortSafeSpot: () -> boolean, --- Ends the running pause, if any, and restarts both clocks. cancel: () -> (), } --- `Humanizer`'s static functions and constants. declare Humanizer: HumanizerClass --- Scheduled breaks for this plugin: after a run of play, at a spot the plugin says is safe, --- the client logs out, stands AFK, or logs out to a new world, for a while, and then comes --- back by itself; or it hops worlds without logging out, and carries on. The user turns breaks on per plugin and picks the format and the windows --- in the Break Manager plugin; `register` only suggests defaults, and until the user turns --- breaks on for the plugin no break starts. One break runs at a time, across every plugin. --- --- The plugin cooperates: it registers once, sits out each tick a break is running, and says --- where a break would be safe. --- --- ```luau --- function plugin:startUp() --- BreakManager.register(60, 120, 5, 15, "logout") --- end --- --- function plugin:onGameTick() --- if BreakManager.active() then return end --- -- ...the plugin's work... --- if justBanked and BreakManager.atSafeSpot() then return end --- end --- --- function plugin:shutDown() --- BreakManager.unregister() --- end --- ``` --- --- Check `BreakManager.active()` before the `Humanizer`'s checks: no pause starts during a --- break. export type BreakManager = { } export type BreakManagerClass = { --- Starts this plugin's run clock, and suggests its defaults: `runMin` to `runMax` --- minutes of play between breaks, `breakMin` to `breakMax` minutes of break, and --- `format`. Leave any of them out to take the global default for it; a window with a --- maximum of 0 or less is left out too. The user's saved settings win over all of --- these. Calling it again replaces the defaults and restarts the clock. Raises for a --- `format` other than `"logout"`, `"afk"`, `"newWorld"` or `"hop"`. register: (number?, number?, number?, number?, string?) -> (), --- This plugin takes no more breaks until it registers again. A break this plugin owns --- is abandoned where it stands: an account it logged out stays logged out. Call it --- from `shutDown`. unregister: () -> (), --- Whether a break is running, whichever plugin's it is, while this plugin is --- registered: when it is, sit out this tick. Always `false` for a plugin that has not --- registered. active: () -> boolean, --- Says this is a safe spot: starts this plugin's break when one is due and the user has --- breaks on for it. `true` while a break is running, this one or another plugin's, so --- the plugin sits out the tick. Call it wherever stopping would do no harm, such as just --- after banking. atSafeSpot: () -> boolean, --- The running break's format, `"logout"`, `"afk"`, `"newWorld"` or `"hop"`; `nil` when --- no break is running, or this plugin has not registered. format: () -> string?, --- Seconds left in the running break, rounded up; `nil` when no break is running, or --- this plugin has not registered. Once the break's time is up and the client is on its --- way back this is `nil` too, while `active()` stays `true`. remainingSeconds: () -> number?, --- Seconds until this plugin's next break is due, rounded up; `nil` while breaks are off --- for it, this plugin has not registered, or a break is running. It reads 0 once one is --- due: the break then starts at the next `atSafeSpot()`. untilBreakSeconds: () -> number?, } --- `BreakManager`'s static functions and constants. declare BreakManager: BreakManagerClass --- Predicts where NPCs will stand and when they can attack, tick by tick, and finds tiles --- where they cannot. Give it a profile for each NPC type to simulate (`setProfile`), or let --- the game's NPC data profile them (`useCacheProfiles`); others only block. Ticks are --- relative: 0 is now, 1 the next tick. Each plugin has its own profiles and latest rollout. --- --- The rules: --- --- - Who: NPCs on your plane with a profile, from their server tiles. Each chases what it --- is interacting with now, you or another simulated NPC, and keeps that target for the --- whole rollout. With any other target or none it stands still: no wandering, no aggro. --- - Order: each tick runs the NPCs in ascending index order, then you (one tile walking, --- two running). Other players stay where they are and block. --- - Moving: an NPC in reach of its target stays put. Otherwise it takes one tile straight --- at the target: diagonally, else along x, else along y, else not at all. It never --- routes around an obstacle, so its prediction is wrong for an NPC that does. On top of --- its target, it steps off in one of the four directions, and every outcome is followed. --- - Blocking: terrain, NPCs and players block an NPC's step. An occupied tile stops --- blocking once something walks through it, until its occupant next moves. Your own --- steps are never blocked by an NPC or a player. --- - Reach: melee needs a shared edge with no wall on it, never a diagonal; ranged and magic --- need the target within `range` tiles and line of sight. Neither reaches from on top of --- the target. --- - Attacks: an NPC in reach after its move attacks when its timer has run out, so it can --- move and attack on one tick. The tick is when it attacks, not when the hit lands. Its --- timer is known once it has been seen starting one of its `setAttackAnims`; until then its --- attacks are possible, never certain. --- - Uncertainty: an NPC may be on several tiles at a tick, one per outcome, at most 16. Past --- that it is lost: it has no tile and may attack whenever its timer allows. An attack is --- certain only when its timer is known and every outcome makes it. --- - Not predicted: specials and other NPC-specific behaviour, freezes (a frozen NPC is --- predicted as free) and leashes (none gives up a chase). export type NpcSim = { } export type NpcSimClass = { --- Simulate NPCs of type `npcId`: `style` is "melee", "ranged" or "magic" (any other --- raises an error); `range` the attack range in tiles (ignored for melee); --- `attackSpeedTicks` ticks between attacks. A `range` or `attackSpeedTicks` below 1 --- counts as 1. Replaces the game's NPC data for the type; its `setFlags` and --- `setAttackAnims` still apply on top. setProfile: (number, "melee" | "ranged" | "magic", number, number) -> (), --- Collision flags for `npcId`: `blocksEntities` false for NPCs that neither block nor --- are blocked (Jal-Nib); `fullBlock` true for NPCs that block players and projectiles, --- which here means they block lines of sight through their tiles. --- They apply on top of the type's profile: its `setProfile`, else the game's NPC data's --- when `useCacheProfiles` is on, else the default one (melee, 4 ticks). setFlags: (number, boolean, boolean) -> (), --- The animation ids that mark an attack by `npcId`, for attack timing. Like `setFlags`, --- they apply on top of the type's profile: its `setProfile`, else the game's NPC data's --- when `useCacheProfiles` is on, else the default one (melee, 4 ticks). setAttackAnims: (number, {number}) -> (), --- Forgets every `setProfile`, `setFlags` and `setAttackAnims`, and the latest rollout. clearProfiles: () -> (), --- Simulate every NPC type the client has loaded that can fight (combat level above 0), --- not only those given a `setProfile`: attack speed and style come from the game's own --- NPC data. Ranged and magic NPCs get range 10 (the data holds no range). A `setProfile` --- you set replaces the data's; `setFlags` and `setAttackAnims` apply on top of either. Types --- that cannot fight (pets, shopkeepers) only block. Off by default. useCacheProfiles: (boolean) -> (), --- Simulates `ticks` ticks from now (at most 200) and keeps the result for the queries --- below. The player follows `path` when given, else its own walk: `path` is every tile --- it steps onto, in order (one a tick walking, two running), and tiles outside the --- loaded scene are dropped. False with no scene. rollout: (number, {WorldPoint}?) -> boolean, --- Where `npc` stands at `tick` (its south-west tile); nil when lost, not simulated, or --- past the latest rollout. The first of several when the tick is uncertain. tileAt: (NPC, number) -> WorldPoint?, --- Every tile `npc` may stand on at `tick`; empty where `tileAt` is nil. tilesAt: (NPC, number) -> {WorldPoint}, --- The NPCs that attack you (certainly or possibly) on `tick`. An attack on another NPC --- does not count, here or in `isCertain` and `firstAttack`. attacksAt: (number) -> {NPC}, --- Whether `npc`'s attack on you on `tick` is certain (false when none or only --- possible). isCertain: (NPC, number) -> boolean, --- The first tick `npc` may attack you in the latest rollout; nil when it does not. firstAttack: (NPC) -> number?, --- Whether `npc`, from where it stands now, could attack a player on `tile`. False for --- an NPC without a profile. canAttack: (NPC, WorldPoint) -> boolean, --- Whether standing on `tile` (walking there first) is safe from every simulated NPC: --- within 32 ticks you arrive, none can attack you there and all have stopped moving. --- False when an attack is possible on the way or there, the tile is unreachable, an --- NPC gets lost, or 32 ticks are not enough to tell. isSafespot: (WorldPoint) -> boolean, --- Safe tiles within `radius` (at most 30) of the player, nearest first. With --- `attackRange`, only tiles the player can hit a stalled NPC from: 1 is melee reach, --- more is that range with line of sight. safespots: (number, number?) -> {WorldPoint}, } --- `NpcSim`'s static functions and constants. declare NpcSim: NpcSimClass --- An NPC or a player. Interned: the same userdata every time the plugin meets the same --- actor, so `==` and table keys work; after it despawns it answers its last-known --- values. `getModel()` and `getRenderMode()` are the `Renderable` members it answers. export type Actor = { --- The actor's combat level: an NPC's transformed composition's, a player's --- appearance's. getCombatLevel: (Actor) -> number, --- The actor's name, non-breaking spaces made spaces; `nil` for a despawned NPC --- or a player with none. getName: (Actor) -> string?, --- Whether the actor's target is an NPC or a player (not a tile). It can be true --- while `getInteracting()` is `nil` (the target is out of range). isInteracting: (Actor) -> boolean, --- The actor this one interacts with, found across the client's world views, or --- `nil`. getInteracting: (Actor) -> Actor?, --- The health of the first health bar's current update, in `getHealthScale()` --- units; -1 with no bar showing. The current update is the newest arrived, until --- it expires. getHealthRatio: (Actor) -> number, --- The first health bar's width, the most `getHealthRatio()` can be; -1 with no --- bar. getHealthScale: (Actor) -> number, --- The server-side tile: the head of the actor's path in its world view, plus that --- view's base, on its plane. Ahead of where it renders while it walks. On an --- NPC-owned boat (a charter ship's crew, a trial's master), the sea tile under where it --- renders instead, the tile its `scene:npcs()` row measures by. getWorldLocation: (Actor) -> WorldPoint, --- The client-side position in local units (128 a tile), where the actor --- renders: interpolated between tiles while it moves. getLocalLocation: (Actor) -> LocalPoint, --- Where the camera orbits while it follows the actor (`client:getCameraFocusEntity()` --- is the actor then): its `getLocalLocation()`. getCameraFocus: (Actor) -> LocalPoint, --- The world view the actor is in: the top level, or a world entity's (a boat's). getWorldView: (Actor) -> WorldView, --- The orientation the actor is turning to (0..2047). getOrientation: (Actor) -> number, --- The orientation the actor renders at now. getCurrentOrientation: (Actor) -> number, --- The animation playing (`AnimationID`), -1 for none. getAnimation: (Actor) -> number, --- Set the animation playing, through the game's own sequence setter. No --- `AnimationChanged` follows. Does nothing on a despawned actor. setAnimation: (Actor, number) -> (), --- The frame of the animation playing, -1 for none. getAnimationFrame: (Actor) -> number, --- Set the frame of the animation playing. setAnimationFrame: (Actor, number) -> (), --- The client cycles the animation has spent on its current frame --- (`getAnimationFrame()`'s): 1 up to the frame's length --- (`Animation:getFrameLengths()`) once a cycle has run on it; 0 with no animation, --- or once the actor has despawned. getAnimationFrameCycle: (Actor) -> number, --- How many times the animation has looped since it started: 0 until it first --- passes its end, then 1 more each time it does. Starting another animation, or --- the same one again, starts the count over. 0 with no animation, or once the --- actor has despawned. getAnimationLoopCount: (Actor) -> number, --- The pose (idle or movement) animation playing, -1 for none. getPoseAnimation: (Actor) -> number, --- Set the pose animation playing. setPoseAnimation: (Actor, number) -> (), --- The frame of the pose animation, -1 for none. getPoseAnimationFrame: (Actor) -> number, --- Set the frame of the pose animation. setPoseAnimationFrame: (Actor, number) -> (), --- The client cycles the pose animation has spent on its current frame --- (`getPoseAnimationFrame()`'s); 0 with none, or once the actor has despawned. getPoseAnimationFrameCycle: (Actor) -> number, --- The idle pose animation. getIdlePoseAnimation: (Actor) -> number, --- Set the idle pose animation. setIdlePoseAnimation: (Actor, number) -> (), --- The idle turn-left animation. getIdleRotateLeft: (Actor) -> number, --- Set the idle turn-left animation. setIdleRotateLeft: (Actor, number) -> (), --- The idle turn-right animation. getIdleRotateRight: (Actor) -> number, --- Set the idle turn-right animation. setIdleRotateRight: (Actor, number) -> (), --- The walk animation. getWalkAnimation: (Actor) -> number, --- Set the walk animation. setWalkAnimation: (Actor, number) -> (), --- The walk-backwards animation. getWalkRotate180: (Actor) -> number, --- Set the walk-backwards animation. setWalkRotate180: (Actor, number) -> (), --- The walk-left animation. getWalkRotateLeft: (Actor) -> number, --- Set the walk-left animation. setWalkRotateLeft: (Actor, number) -> (), --- The walk-right animation. getWalkRotateRight: (Actor) -> number, --- Set the walk-right animation. setWalkRotateRight: (Actor, number) -> (), --- The run animation. getRunAnimation: (Actor) -> number, --- Set the run animation. setRunAnimation: (Actor, number) -> (), --- The spot animations the actor carries, one per slot in use, in slot order. getSpotAnims: (Actor) -> {ActorSpotAnim}, --- Whether any slot carries spot animation `spotAnimId`. hasSpotAnim: (Actor, number) -> boolean, --- The actor's single graphic: the first spot animation's id, or -1. getGraphic: (Actor) -> number, --- Set the actor's single graphic: every spot animation removed, then (for an id --- above -1) `graphic` put in slot 0. No `GraphicChanged` follows. Does nothing on a --- despawned actor. setGraphic: (Actor, number) -> (), --- Set the frame of the first spot animation (in slot order), if the actor carries --- one. setSpotAnimFrame: (Actor, number) -> (), --- The canvas polygon of the tile under the actor's local location (one tile; an --- `NPC` answers its whole size), or `nil` when a corner does not project. getCanvasTilePoly: (Actor) -> Polygon?, --- The canvas point to draw `text` at, centred over the actor `zOffset` up: the --- anchor's x less half the text's width in the graphics' current font --- (`getStringBounds`), or `nil` when the point does not project. The text is --- measured only when it does. getCanvasTextLocation: (Actor, Graphics2D, string, number) -> Point?, --- The point `getCanvasTextLocation(graphics, text, zOffset)` gives, for text --- `textWidth` pixels wide, without a graphics (outside a render, or with a width --- measured once). `getCanvasTextLocation` measures the text itself; the x is the --- anchor's minus `textWidth / 2`, truncated to an int. getCanvasTextLocationForWidth: (Actor, number, number) -> Point?, --- The canvas point that centres `image` over the actor, `zOffset` up: its top-left --- corner, or `nil` when the point does not project. getCanvasImageLocation: (Actor, BufferedImage, number) -> Point?, --- The canvas point that centres `sprite` over the actor, `zOffset` up: its top-left --- corner, or `nil` when the point does not project. getCanvasSpriteLocation: (Actor, SpritePixels, number) -> Point?, --- Where the actor is on the minimap, or `nil` when it is outside the minimap's --- radius or the minimap is hidden. getMinimapLocation: (Actor) -> Point?, --- The model's logical height, roughly where the health bar is drawn (200 until a --- model has set it). getLogicalHeight: (Actor) -> number, --- The world area the actor covers: its world location and size (an NPC's --- composition size, 1 for a player). getWorldArea: (Actor) -> WorldArea, --- The text over the actor's head, `nil` for none. getOverheadText: (Actor) -> string?, --- Replace the text over the actor's head, through the game's own string assign --- (a chat filter does this in `onOverheadTextChanged`). setOverheadText: (Actor, string) -> (), --- The client cycles the overhead text still shows for. getOverheadCycle: (Actor) -> number, --- Set the client cycles the overhead text shows for. setOverheadCycle: (Actor, number) -> (), --- Whether the actor has died: set when a death health bar reaches 0 (when --- `ActorDeath` is posted), cleared when one rises above 0. isDead: (Actor) -> boolean, --- Set the dead flag `isDead()` answers. setDead: (Actor, boolean) -> (), --- The side of the actor's footprint in local units, which ground heights under it --- are sampled over. getFootprintSize: (Actor) -> number, --- The vertical offset the actor's animation renders it at. getAnimationHeightOffset: (Actor) -> number, --- The outline of the actor's model on the canvas this frame: the convex hull of the --- model the client builds for it, at its local location and current orientation, at --- its footprint's ground height less its animation height offset. `nil` when it --- does not project, with no scene, in HD (no model is readable there) or once the --- actor is gone. getConvexHull: (Actor) -> Shape?, --- The model the client builds for the actor this frame, a copy; `nil` in HD, off --- the game thread or once the actor is gone. getModel: (Actor) -> Model?, --- How the client draws the actor (`Renderable.RENDERMODE_*`), its own answer: a player --- 2 (`RENDERMODE_SORTED_NO_DEPTH`); an NPC 2 when its model override dresses it as a --- player or its type is drawn so, else 0 (`RENDERMODE_DEFAULT`; also once it is gone). getRenderMode: (Actor) -> number, --- Whether the actor is still in the game. isPresent: (Actor) -> boolean, } --- An NPC. Reachability, path length, line of sight and melee reach are not members of --- it: `scene:reachability()` answers them from the player --- (`reachable(npc:getWorldLocation())`, `reachableAdjacentTiles(npc:getWorldArea())`, --- `pathLengthToArea(npc:getWorldArea())`, `hasLineOfSight(from, to)`), and the NPC --- query's refinements (`reachable()`, `interactable()`, `hasLineOfSight()`) narrow by --- them. export type NPC = Actor & { --- The id of the NPC's transformed composition (what it shows as), -1 once it has --- despawned. getId: (NPC) -> number, --- The archives of the NPC's head icons (one per slot, -1 for an empty one): the ones --- the server set on it, else its transformed composition's; `nil` with neither. getOverheadArchiveIds: (NPC) -> {number}?, --- The sprite indices of the NPC's head icons within their archives (one per slot, --- -1 for an empty one), as `getOverheadArchiveIds()` picks them; `nil` with none. getOverheadSpriteIds: (NPC) -> {number}?, --- Act on the NPC through the virtual mouse: `option` is one of its menu actions --- ("Attack", "Talk-to"; `""` for the first). The scheduler resolves the NPC by --- its world view, index and id, moves the virtual mouse and clicks. `false` when --- the NPC is gone, or it is outside the top level, the boat the player stands in and --- the NPC-owned boats in the scene (on another player's boat). interact: (NPC, string) -> boolean, --- The NPC's health bar (`getHealthRatio()` of `getHealthScale()`), with the NPC --- type's hitpoints from an NPC info table and the hitpoints the bar stands for, --- estimated from them; `nil` with no bar showing, or once the NPC has despawned. health: (NPC) -> NpcHealth?, --- The model override the server set on the NPC (its models, recolours and --- retextures), `nil` for none or once the NPC is gone; not its chathead override. getModelOverrides: (NPC) -> NpcOverrides?, --- The NPC's index in its world view. getIndex: (NPC) -> number, --- The NPC's composition as the server set it (untransformed); `nil` once it has --- despawned. getComposition: (NPC) -> NPCComposition?, --- The composition the NPC shows as: its composition transformed by its varbit --- (or varp) when it has configs, else the composition itself; `nil` when the --- transform picks none, or once it has despawned. getTransformedComposition: (NPC) -> NPCComposition?, } --- A player: an `Actor` with an index and an appearance (`getPlayerComposition()`). export type Player = Actor & { --- The player's index. getId: (Player) -> number, --- The player's appearance (worn equipment, colours, gender), as it is now; `nil` --- before one is decoded. getPlayerComposition: (Player) -> PlayerComposition?, --- The team of the player's cape, 0 for none. getTeam: (Player) -> number, --- Whether the player is in the local player's friends chat. isFriendsChatMember: (Player) -> boolean, --- Whether the player is on the local player's friends list. isFriend: (Player) -> boolean, --- Whether the player is in the local player's clan. isClanMember: (Player) -> boolean, --- The protection prayer over the player's head, `nil` for none. getOverheadIcon: (Player) -> HeadIcon?, --- The skull over the player's head (`SkullIcon`), -1 for none. getSkullIcon: (Player) -> number, --- Set the skull over the player's head. setSkullIcon: (Player, number) -> (), --- The player option named `option` ("Trade with", "Follow", "Attack"; any case, --- colour tags ignored) on this player. The option is matched when the click fires, against the options the client shows then (which --- op is "Trade with" varies), and nothing is clicked when none matches. `false` --- when the player is gone, or it is in another world view. Raises for an empty --- `option`. interact: (Player, string) -> boolean, --- Use what this plugin selected (`player:inventory():select(id)`, --- `player:magic():select(spell)`) on this player. Once per selection, and only after a selection of this plugin's that admits a player (a spell --- that takes NPCs only does not), as `inventory:target` is for an item. --- `inventory:useOnPlayer(itemId, player)` and `magic:castOnPlayer(spell, player)` are --- the select and the use in one call. `false` when it has no such selection, or the --- player is gone or in another world view. target: (Player) -> boolean, } --- A player's appearance, as it was when `getPlayerComposition()` read --- it. export type PlayerComposition = { --- The equipment ids, one per `KitType` index: an item is `ITEM_OFFSET` + its id, a --- kit `KIT_OFFSET` + its id, 0 nothing. The player's own array, as a 1-based view --- (like `client:getIntStack()`): `ids[i]` reads the player's kit now (the ids as --- read once the player has gone), `#ids` is 12, `for i, id in ids` walks it, and --- `ids[i] = id` writes the kit on the game thread, so `setHash()` then dresses the --- player (devtools' `wear`). The write raises on a client whose table has the kit writes --- off. This composition's `getEquipmentId` and `getKitId` keep the ids it was read with; --- after a new appearance a kept array reads the new ids. Copy it with a loop (`ipairs` --- and `table.*` take tables only). getEquipmentIds: (PlayerComposition) -> {number}, --- The item worn in slot `type`, -1 for none (or a kit). getEquipmentId: (PlayerComposition, KitType) -> number, --- The kit in slot `type`, -1 for none (or an item). getKitId: (PlayerComposition, KitType) -> number, --- The five body colours; all 0 when the kit's colours could not be read. getColors: (PlayerComposition) -> {number}, --- 0 male, 1 female; 0 when the kit's gender could not be read. getGender: (PlayerComposition) -> number, --- Whether the gender is 1. `getGender()` is the value itself. isFemale: (PlayerComposition) -> boolean, --- The NPC the player renders as, -1 for none; -1 when the kit's NPC id could not be --- read. getTransformedNpcId: (PlayerComposition) -> number, --- Render the player as NPC `id` (-1: as itself again), as the client's own model build --- reads its kit every frame; this composition's `getTransformedNpcId()` keeps the value --- it was read with (ask `getPlayerComposition()` again). Game thread only; raises on a --- client whose table has the kit writes off. setTransformedNpcId: (PlayerComposition, number) -> (), --- Recompute the appearance hash from the player's kit (its equipment ids and colours) --- through the client's own hash, so the player's model follows a changed kit. Game --- thread only; raises on a client whose table has the kit writes off. setHash: (PlayerComposition) -> (), } export type PlayerCompositionClass = { --- What `getEquipmentIds()` adds to a kit id: 256. KIT_OFFSET: number, --- What `getEquipmentIds()` adds to an item id: 2048. ITEM_OFFSET: number, } --- `PlayerComposition`'s static functions and constants. declare PlayerComposition: PlayerCompositionClass --- A hitsplat, as it was applied. export type Hitsplat = { --- The type the server sent (a `HitsplatID`). getHitsplatType: (Hitsplat) -> number, --- The amount. getAmount: (Hitsplat) -> number, --- The client cycle it stops showing on. getDisappearsOnGameCycle: (Hitsplat) -> number, --- Whether it is one of the local player's, by its `HitsplatID` type. isMine: (Hitsplat) -> boolean, --- Whether it is another player's, by its `HitsplatID` type. isOthers: (Hitsplat) -> boolean, } --- A spot animation an actor carries in one slot. export type ActorSpotAnim = { --- The spot animation's id (`SpotanimID`). getId: (ActorSpotAnim) -> number, --- The height it is drawn at above the actor. getHeight: (ActorSpotAnim) -> number, --- The client cycle it starts on. getStartCycle: (ActorSpotAnim) -> number, --- The frame its animation was on when `getSpotAnims()` handed it out (a copy: ask --- `getSpotAnims()` again for the frame now), -1 where it did not read. getFrame: (ActorSpotAnim) -> number, --- The client cycles it had spent on that frame, as `getFrame()` a copy. getCycle: (ActorSpotAnim) -> number, --- The slot it occupies. getSlot: (ActorSpotAnim) -> number, } --- A health-bar type, as it was read. export type HealthBarConfig = { --- The front (filled) sprite's id, -1 for none. getHealthBarFrontSpriteId: (HealthBarConfig) -> number, --- Set the type's padding (its width padding), as an interface style does in --- `onPostHealthBarConfig` when it swaps the type's sprites. Written while the --- type is live: during that event, or while the game's type cache holds it (a --- value kept after its type left the cache writes nothing). setPadding: (HealthBarConfig, number) -> (), --- The back (empty) sprite's id, -1 for none. getHealthBarBackSpriteId: (HealthBarConfig) -> number, --- The bar's width, the health scale of actors it is shown for (Bento). getWidth: (HealthBarConfig) -> number, --- The type's id (Bento). getId: (HealthBarConfig) -> number, } --- The model override the server set on an NPC, as it was when `getModelOverrides()` read --- it. export type NpcOverrides = { --- The models that replace the NPC's, `nil` when it keeps its own. getModelIds: (NpcOverrides) -> {number}?, --- The colours that replace the composition's recolour targets, `nil` for none. getColorToReplaceWith: (NpcOverrides) -> {number}?, --- The textures that replace the composition's retexture targets, `nil` for none. getTextureToReplaceWith: (NpcOverrides) -> {number}?, --- Whether the NPC renders as the local player. useLocalPlayer: (NpcOverrides) -> boolean, } --- What the camera follows, as `client:getCameraFocusEntity()` answers it. That is the --- `Player`, `NPC` or `WorldEntity` itself (each has `getCameraFocus()` and --- `getWorldView()`), or, while the camera is fixed on a tile, this object: the client's --- one coordinate entity. --- --- `__eq`: `==`: there is one coordinate entity. export type CameraFocusableEntity = { --- The centre of the tile the camera follows, in the local units of the world view --- holding the tile (a boat's, for a tile on it): its `LocalPoint` names the top --- level (0) whichever view that is. Read when asked, as the client sets its one --- coordinate entity at each camera update, so a kept object follows the camera's --- tile; once the camera follows something else, the last tile read. getCameraFocus: (CameraFocusableEntity) -> LocalPoint, --- The top level, whichever world view holds the tile. getWorldView: (CameraFocusableEntity) -> WorldView, --- Whether `other` equals this CameraFocusableEntity, as `==` answers it (`false` for a value of another class). equals: (CameraFocusableEntity, any) -> boolean, } --- An object on a tile: the root of `GameObject`, `WallObject`, --- `DecorativeObject` and `GroundObject`. An interned handle: the same --- userdata every time for the same object, kept across callbacks, --- answering its last-known values once the object is removed or its scene --- reloads. export type TileObject = { --- The scene tag: `worldView >> 52 & 4095`, `id >> 20 & 0xffffffff`, --- `wall >> 19 & 1`, `type >> 16 & 7`, `plane >> 14 & 3`, scene y --- `>> 7 & 127`, scene x `& 127`. The hash of a loc in world view 2 or --- above is past 2^53, which a Luau number does not hold exactly: then --- this raises, and `getHashString()` is the exact form. getHash: (TileObject) -> number, --- The hash as its decimal string, exact for every world view. Use it where --- you key a map by the hash: the number `getHash()` answers passes 2^53 --- for a loc in world view 2 or above (a boat's), and `getHash()` raises --- there. getHashString: (TileObject) -> string, --- The local x of the object's centre. getX: (TileObject) -> number, --- The local y of the object's centre. getY: (TileObject) -> number, --- The height the object was placed at. getZ: (TileObject) -> number, --- The plane of the tile the object is on. getPlane: (TileObject) -> number, --- The loc id (`ObjectID`), as its tag carries it. getId: (TileObject) -> number, --- The world view the object is in. getWorldView: (TileObject) -> WorldView, --- The world tile of the object, against its world view's current --- base: for a game object the middle of its footprint rounded to the --- south-west (`fromScene(minX + (maxX - minX) / 2, ...)`), so a 1x1 --- is its tile, a 2x2 its south-west tile and a 3x3 its middle one; --- for the other kinds the tile of its local centre. A 2x2's --- `getLocalLocation()` is a tile north-east of it. On an NPC-owned boat (a --- charter ship, a Barracuda Trials rum boat), the sea tile under that tile instead, --- the tile its `scene:objects()` row measures by. getWorldLocation: (TileObject) -> WorldPoint, --- The local point of the object's centre. getLocalLocation: (TileObject) -> LocalPoint, --- `(TileObject) -> Point?`: --- Where its local centre projects onto the canvas, at its plane's --- ground height --- (`Perspective.localToCanvas(client, getLocalLocation(), getPlane())`), --- or `nil` when it does not project (another world view, off the --- scene, no camera). --- --- `(TileObject, number) -> Point?`: --- As `getCanvasLocation()`, `zOffset` above the ground. getCanvasLocation: ((TileObject) -> Point?) & ((TileObject, number) -> Point?), --- The outline of the tiles it stands on, on the canvas (a game --- object's whole footprint, `sizeX` by `sizeY`; one tile for the --- rest), as `Perspective.getCanvasTileAreaPoly` gives it; `nil` when --- it does not project. getCanvasTilePoly: (TileObject) -> Polygon?, --- The canvas point to draw `text` at, centred on the object's local --- location `zOffset` up (`Perspective.getCanvasTextLocation`: the anchor --- on its world view's plane, x less half the text's width in the --- graphics' current font, `getStringBounds`); `nil` for `nil` text or --- when the point does not project. The text is measured only when it --- does. getCanvasTextLocation: (TileObject, Graphics2D, string?, number) -> Point?, --- Where the object's local centre is on the minimap --- (`Perspective.localToMinimap(client, getLocalLocation())`), or `nil` --- past the minimap's radius, with the minimap hidden, or with nothing to --- read. getMinimapLocation: (TileObject) -> Point?, --- The point `getCanvasTextLocation(graphics, text, zOffset)` gives, for --- text `textWidth` pixels wide, without a graphics (outside a render, or --- with a width measured once). `getCanvasTextLocation` measures the text --- itself; the point is `Perspective.getCanvasTextLocation`'s (the anchor --- on its world view's plane, `zOffset` up, x less half the width). getCanvasTextLocationForWidth: (TileObject, number, number) -> Point?, --- The shape a click on it lands in, on the canvas: its model's clickbox --- (`Perspective.getClickbox` over the loc's model; a wall's two models as one --- shape, a decoration's at its offsets; an animated loc's model as it poses it --- for the current cycle), `nil` when it does not project, its model is not --- readable (an animated loc, or any loc in HD, where the table has that --- model's read off) or it is gone. getClickbox: (TileObject) -> Shape?, --- Whether the object is still in its scene: Bento's, for code that --- keeps handles (a removed object's handle answers its last values). isPresent: (TileObject) -> boolean, --- Act on the object through the virtual mouse: `option` is one of its --- menu actions ("Open", "Chop down"; `""` for the first). The --- scheduler resolves the loc by id and origin tile in its world view, moves --- the virtual mouse and clicks. `false` when the object is gone, or it is --- outside the top level, the boat the player stands in and the NPC-owned boats in --- the scene (on another player's boat). interact: (TileObject, string) -> boolean, } --- A loc in a tile's game-object layer (an interactable object, a tree, a --- rock), possibly covering several tiles. export type GameObject = TileObject & { --- The outline of its model on the canvas (the convex hull of its --- projected vertices, at its local position, model orientation and --- height; an animated loc's model as it poses it for the current cycle), --- `nil` when it does not project, its model is not readable (an animated --- loc, or any loc in HD, where the table has that model's read off) or it is --- gone. getConvexHull: (GameObject) -> Shape?, --- What the scene draws for it: a model, or an animated loc --- (`getModel()` reads it), `nil` when it is gone. getRenderable: (GameObject) -> Renderable?, --- Its width in tiles, as rotated. sizeX: (GameObject) -> number, --- Its length in tiles, as rotated. sizeY: (GameObject) -> number, --- The scene tile of its south-west corner. getSceneMinLocation: (GameObject) -> Point, --- The scene tile of its north-east corner. getSceneMaxLocation: (GameObject) -> Point, --- Its orientation, 0..2047 (JAU): the loc's rotation times 512 plus --- its model's own orientation. getOrientation: (GameObject) -> number, --- Its model's orientation in JAU: 256 for a diagonal (type 11) loc, --- else 0, as the scene builder places it. getModelOrientation: (GameObject) -> number, --- `type & 31`, `orientation >>> 6 & 3`, `supports items >>> 8 & 1`. getConfig: (GameObject) -> number, --- The id of the animation the loc's dynamic renderable plays, -1 for a static --- loc, in one call. `getRenderable():getAnimation():getId()` reads the same --- id through two handles (a `DynamicObject`, then an `Animation`, `nil` while --- it plays none). A static loc's renderable is a plain `Renderable` with no --- `getAnimation`, so that chain raises there: test --- `typeof(r) == "DynamicObject"` first. getAnimationId: (GameObject) -> number, } --- A loc in a tile's wall layer (a wall, a door, a fence). export type WallObject = TileObject & { --- The outline of its first model on the canvas, `nil` when it does not --- project, has no readable model or is gone. getConvexHull: (WallObject) -> Shape?, --- The outline of its second model (a corner wall's other side), as --- `getConvexHull()`. getConvexHull2: (WallObject) -> Shape?, --- What the scene draws for its first side, `nil` when none (or gone). getRenderable1: (WallObject) -> Renderable?, --- What the scene draws for its second side, `nil` when none (or gone). getRenderable2: (WallObject) -> Renderable?, --- The first orientation, a direction flag (1 west, 2 north, 4 east, --- 8 south; the corners for a diagonal wall). getOrientationA: (WallObject) -> number, --- The second orientation (a corner wall's other side), else 0. getOrientationB: (WallObject) -> number, --- `type & 31`, `orientation >>> 6 & 3`, `supports items >>> 8 & 1`. getConfig: (WallObject) -> number, } --- A loc in a tile's wall-decoration layer. export type DecorativeObject = TileObject & { --- The x offset its first model is drawn at, from its local x (the --- draw site's own offsets). getXOffset: (DecorativeObject) -> number, --- The y offset its first model is drawn at. getYOffset: (DecorativeObject) -> number, --- The x offset its second model (a diagonal decoration's) is drawn at. getXOffset2: (DecorativeObject) -> number, --- The y offset its second model is drawn at. getYOffset2: (DecorativeObject) -> number, --- The outline of its first model on the canvas, at its offsets; `nil` --- when it does not project, has no readable model or is gone. getConvexHull: (DecorativeObject) -> Shape?, --- The outline of its second model, at the second offsets. getConvexHull2: (DecorativeObject) -> Shape?, --- What the scene draws for it, `nil` when none (or gone). getRenderable: (DecorativeObject) -> Renderable?, --- What the scene draws for its second model (a diagonal decoration), --- `nil` when none. getRenderable2: (DecorativeObject) -> Renderable?, --- `type & 31`, `orientation >>> 6 & 3`, `supports items >>> 8 & 1`. getConfig: (DecorativeObject) -> number, } --- A loc in a tile's ground-decoration layer. export type GroundObject = TileObject & { --- The outline of its model on the canvas, `nil` when it does not --- project, has no readable model or is gone. getConvexHull: (GroundObject) -> Shape?, --- What the scene draws for it, `nil` when none (or gone). getRenderable: (GroundObject) -> Renderable?, --- `type & 31`, `orientation >>> 6 & 3`, `supports items >>> 8 & 1`. getConfig: (GroundObject) -> number, } --- An item on the ground. An interned handle, keyed by its tile and its --- spawn serial: the same userdata while the item lies there, answering --- its last values once it is picked up or despawns. Not here: `getModel` --- (model data). export type TileItem = { --- The item id. getId: (TileItem) -> number, --- How many. getQuantity: (TileItem) -> number, --- The tick it becomes visible to other players at, on the --- `client:getTickCount()` clock. getVisibleTime: (TileItem) -> number, --- The tick it despawns at, on the `client:getTickCount()` clock. getDespawnTime: (TileItem) -> number, --- Who owns it: `OWNERSHIP_NONE`, `_SELF`, `_OTHER` or `_GROUP`. getOwnership: (TileItem) -> number, --- Whether only its owner can see it. isPrivate: (TileItem) -> boolean, --- The tile it lies on. The handle is keyed by it, so an item from --- `scene:groundItems()` can say where it is. getTile: (TileItem) -> Tile, --- Whether the item is still on the floor: Bento's, for code that keeps handles (a --- picked-up item's handle answers its last values). isPresent: (TileItem) -> boolean, --- Act on the item through the virtual mouse: `option` is one of its ground actions --- ("Take"; `""` for "Take"). The scheduler resolves THIS stack (its id and its --- tile in its world view, the `GROUND_ITEM_*_OPTION` entry), moves the virtual mouse --- and clicks; a nearer item with a similar name is never taken instead, and nothing --- is clicked when the stack is gone by then. `false` when the item is gone or --- outside the views Bento acts on (on another player's boat), or it has no --- definition. interact: (TileItem, string) -> boolean, --- Use what this plugin selected on this stack (its id and its tile). Once per selection, and only after one of this plugin's that admits a --- ground item (Telekinetic Grab, an item's "Use"); nothing is clicked when the stack --- is gone by the time the click fires. `inventory:useOnGroundItem` and --- `magic:castOnGroundItem` are the select and the use in one call. `false` when it has --- no such selection, or the item is gone or outside the top level and the boat the --- player stands in. target: (TileItem) -> boolean, } export type TileItemClass = { --- No one owns it. OWNERSHIP_NONE: number, --- The local player owns it. OWNERSHIP_SELF: number, --- Another player owns it. OWNERSHIP_OTHER: number, --- The local player's group owns it. OWNERSHIP_GROUP: number, } --- `TileItem`'s static functions and constants. declare TileItem: TileItemClass --- A projectile in flight. An interned handle: the same userdata every --- frame for the same projectile. The game sends a projectile in one of --- two forms: with a slope and a start position (`getSlope()`, --- `getStartPos()`), or with an offset from its source on each axis and a --- curve of its own, and then those two answer `nil`. Not here: --- `getModel`. export type Projectile = { --- The spot animation (`SpotanimID`). getId: (Projectile) -> number, --- The plane it starts on. getSourceLevel: (Projectile) -> number, --- The world tile it starts at. getSourcePoint: (Projectile) -> WorldPoint, --- The plane it ends on. getTargetLevel: (Projectile) -> number, --- The world tile it ends at. getTargetPoint: (Projectile) -> WorldPoint, --- The centre of its target tile as a local point of the top level --- (`LocalPoint.fromWorld(topLevel, getTargetPoint())`), `nil` when the --- tile is outside the scene. It does not follow an aimed-at actor. getTarget: (Projectile) -> LocalPoint?, --- The actor it is aimed at, looked up in the top-level world view, or --- `nil` when it is aimed at a tile (or the actor is gone). getTargetActor: (Projectile) -> Actor?, --- The same as `getTargetActor()`. getInteracting: (Projectile) -> Actor?, --- The actor it was fired from, looked up in the top-level world view, --- or `nil` (fired from a tile, or the actor is gone). getSourceActor: (Projectile) -> Actor?, --- The client cycle it starts moving at. getStartCycle: (Projectile) -> number, --- The client cycle it reaches its target (and despawns) at. getEndCycle: (Projectile) -> number, --- Client cycles until it reaches its target: `getEndCycle()` minus the --- client's cycle now. getRemainingCycles: (Projectile) -> number, --- Its local x now. getX: (Projectile) -> number, --- Its local y now. getY: (Projectile) -> number, --- Its height now. getZ: (Projectile) -> number, --- Its yaw (JAU, 0..2047). getOrientation: (Projectile) -> number, --- How far above the ground at its source it starts, in the units of --- `Perspective.getTileHeight`: it starts at the tile height there minus --- this. getStartHeight: (Projectile) -> number, --- How far above the ground at its target it ends, in the units of --- `Perspective.getTileHeight`: it ends at the tile height there minus --- this. getEndHeight: (Projectile) -> number, --- The animation it plays (its spot animation's), `nil` when it plays --- none. getAnimation: (Projectile) -> Animation?, --- The frame of its animation it is on; -1 when it plays none. getAnimationFrame: (Projectile) -> number, --- How steeply it arcs: the angle it leaves at, larger for a higher --- arc. `nil` for a projectile sent without one (the class's note). getSlope: (Projectile) -> number?, --- How far from its source, along the line to its target, it starts --- (128 to a tile). `nil` for a projectile sent without one (the --- class's note). getStartPos: (Projectile) -> number?, } --- A spot animation played on a tile (an explosion, a splash). An --- interned handle. Not here: `getAnimation`, `getAnimationFrame` (no --- `Animation` class) and `setFinished` (a write). export type GraphicsObject = { --- The spot animation (`SpotanimID`). getId: (GraphicsObject) -> number, --- Where it plays, as a local point of its world view. getLocation: (GraphicsObject) -> LocalPoint, --- The client cycle it starts at. getStartCycle: (GraphicsObject) -> number, --- The plane it plays on. getLevel: (GraphicsObject) -> number, --- Its height. getZ: (GraphicsObject) -> number, --- Whether it has played out (it is removed at the start of the next --- frame). finished: (GraphicsObject) -> boolean, --- The world view it plays in. getWorldView: (GraphicsObject) -> WorldView, } --- A world view: the top-level scene (id 0) or a world entity's (a --- boat's). A value naming the view by id; every getter reads it live. --- Not here: `getMainWorldProjection`, `getCanvasProjection`, --- `createProjectile`. --- --- `__eq`: `==`: the same world view. export type WorldView = { --- Its id. getId: (WorldView) -> number, --- Whether it is the top level. isTopLevel: (WorldView) -> boolean, --- Its scene. getScene: (WorldView) -> Scene, --- The local player's plane in it. getPlane: (WorldView) -> number, --- The tile under the mouse, on this world view's plane (`getPlane()`), or `nil` when --- the mouse is over none of its tiles. The client finds it as it draws the scene, so --- an overlay reads this frame's. While the menu is open, the tile the menu was opened --- over (the column its "Walk here" entry was built from), a snapshot taken when the --- menu opens; `nil` if the open menu has no "Walk here" of this world view. Raises on --- a client whose table does not place the client's field, rather than answer `nil`. getSelectedSceneTile: (WorldView) -> Tile?, --- Its width in tiles. getSizeX: (WorldView) -> number, --- Its length in tiles. getSizeY: (WorldView) -> number, --- The world x of its scene tile (0, 0). getBaseX: (WorldView) -> number, --- The world y of its scene tile (0, 0). getBaseY: (WorldView) -> number, --- The tile corner heights, `[plane][x][y]` (1-based in Luau), a side --- one longer than the scene. A copy: writing it changes nothing. getTileHeights: (WorldView) -> {{{number}}}, --- The tile settings, `[plane][x][y]` (bit 1 blocked floor, bit 2 --- bridge, bit 4 under roof, ...). A copy: writing it changes nothing. getTileSettings: (WorldView) -> {{{number}}}, --- One collision map per plane, `nil` where a plane has none. getCollisionMaps: (WorldView) -> { n: number, [number]: CollisionData? }, --- The NPCs in it: a set walked with `for _, npc in set`, looked up --- with `byIndex`, counted with `#`. npcs: (WorldView) -> NpcSet, --- The players in it, as `npcs()`. players: (WorldView) -> PlayerSet, --- The world entities (boats) in it, by id, as `npcs()`. worldEntities: (WorldView) -> WorldEntitySet, --- The world views of the world entities in it, as `npcs()`. worldViews: (WorldView) -> WorldViewSet, --- The spot animations playing in it, in the client's order. getGraphicsObjects: (WorldView) -> {GraphicsObject}, --- Whether it is an instance (the top level's flag; a world entity's --- world view answers `false`). isInstance: (WorldView) -> boolean, --- The instance template chunks, `[plane][chunkX][chunkY]`, packed as --- `plane << 24 | x << 14 | y << 3 | rotation << 1`, -1 where there is --- none. getInstanceTemplateChunks: (WorldView) -> {{{number}}}, --- The map regions it covers, ascending. getMapRegions: (WorldView) -> {number}, --- `(WorldView, WorldPoint) -> boolean`: --- Whether the world tile's x and y are in it (the plane is not --- tested). --- --- `(WorldView, LocalPoint) -> boolean`: --- Whether the local point is in it. contains: ((WorldView, WorldPoint) -> boolean) & ((WorldView, LocalPoint) -> boolean), --- Whether `other` equals this WorldView, as `==` answers it (`false` for a value of another class). equals: (WorldView, any) -> boolean, } export type WorldViewClass = { --- The top-level world view's id. TOPLEVEL: number, } --- `WorldView`'s static functions and constants. declare WorldView: WorldViewClass --- A world view's scene: its tiles. A value naming the scene by its world --- view; every getter reads it live. Roofs: `setRoofsHidden`. `setMinLevel` --- and `setDrawDistance` set the client's own; the `getOverride*` four read --- the colour override the client draws it with, `getSkybox` the model it --- draws behind it. Not here: the renderer's other setting (`getMinLevel`), --- the edits (`removeTile`, `removeGameObject`), `getExtendedTileSettings`, --- `getUnderlayIds`, `getOverlayIds`, `getTileShapes`. --- --- `__eq`: `==`: the same world view's scene. export type Scene = { --- Every tile, `[plane][x][y]` (1-based in Luau: --- `getTiles()[plane + 1][x + 1][y + 1]`), `nil` where there is none. The --- same array until the scene is rebuilt: the first call in a scene --- builds a handle per tile (about 43k, a millisecond), later ones answer --- it at once. Use `getTile` for a few. To find objects by id, walking --- this array in Luau takes milliseconds a scene: --- `scene:objects():ids(ids):collect()` walks it in Rust. getTiles: (Scene) -> {{{ n: number, [number]: Tile? }}}, --- Every tile of the extended scene, `[plane][x + 40][y + 40]` (184 a --- side). The client builds no tiles past the 104-tile scene, so the --- ring around it is `nil`. The same array until the scene is rebuilt, --- as `getTiles()`. getExtendedTiles: (Scene) -> {{{ n: number, [number]: Tile? }}}, --- One tile, the one `getTiles()[plane + 1][x + 1][y + 1]` holds, at --- `(plane, x, y)` (0-based scene coordinates), or `nil`, without --- building the whole array. getTile: (Scene, number, number, number) -> Tile?, --- The id of the world view the scene belongs to. getWorldViewId: (Scene) -> number, --- The world x of scene tile (0, 0). getBaseX: (Scene) -> number, --- The world y of scene tile (0, 0). getBaseY: (Scene) -> number, --- Whether the scene is an instance. isInstance: (Scene) -> boolean, --- The instance template chunks, as `WorldView:getInstanceTemplateChunks()`. getInstanceTemplateChunks: (Scene) -> {{{number}}}, --- The map regions the scene covers, ascending. getMapRegions: (Scene) -> {number}, --- The tile corner heights, `[plane][x][y]`. A copy. getTileHeights: (Scene) -> {{{number}}}, --- Hide every roof above the local player's plane (`true`, what the game's own --- "hide roofs" setting does) or stop asking (`false`): the client has one roof --- rule, a plane cutoff, so per-roof modes are not available. Held per plugin --- until it asks otherwise or stops, and roofs stay hidden while any plugin --- asks. Does nothing on a client whose table has the render callbacks off. setRoofsHidden: (Scene, boolean) -> (), --- Draw the scene from `minLevel` up: the planes below it are not drawn (to hide the --- planes below the local player, set its plane before each frame). The scene's own --- lowest drawn level, which the client's software (SD) draw reads every frame and its --- low detail sets when a region loads; a level past the scene's planes draws nothing. --- In HD the client draws from what it built when the region loaded, and reads the --- level only then. Game thread only; raises for a level below 0, before the world view --- has a scene, and on a client whose table does not place the scene. setMinLevel: (Scene, number) -> (), --- Draw the scene out to `drawDistance` tiles from the camera: the scene's own draw --- distance, through the client's setter (it tells the renderer and works out what is --- visible again), clamped to the client's 25..90. Called while a frame is drawn (from --- an overlay's `render` or `BeforeRender`), it applies at the start of the next client --- cycle; a distance the scene already has is not set again. The game sets its own back --- when the player changes the draw distance option. Game thread only; raises before --- the world view has a scene and on a client whose table does not place the scene. setDrawDistance: (Scene, number) -> (), --- The scene's draw distance in tiles, the value `setDrawDistance` writes: what the --- client draws out to now (25..90), set by the player's own draw distance option or --- by a plugin. Read it before changing it to put it back. A `setDrawDistance` made --- inside a draw applies at the start of the next client cycle, and this answers the old --- value until then. `nil` before the world view has a scene. Raises on a client whose --- table does not place the scene, rather than answer. getDrawDistance: (Scene) -> number?, --- The hue (0..63) of the colour override the client draws this scene's models with, --- -1 while there is none. A world entity's scene has one while the entity is hidden --- for an overlap (`WorldEntity:isHiddenForOverlap()`); the top level's never does. --- Raises on a client whose table does not place the client's field, rather than --- answer "none". getOverrideHue: (Scene) -> number, --- The saturation (0..7) of the scene's colour override, -1 while there is none --- (`getOverrideHue`). getOverrideSaturation: (Scene) -> number, --- The luminance (0..127) of the scene's colour override, -1 while there is none --- (`getOverrideHue`). getOverrideLuminance: (Scene) -> number, --- How strongly the scene's colour override applies (127 while a world entity is --- hidden for an overlap), 0 while there is none (`getOverrideHue`). getOverrideAmount: (Scene) -> number, --- The skybox the client draws behind the scene, centred on the camera, before anything --- else: the model the server's skybox id names, lit as the client lights it (a copy); --- `nil` while there is none, which is every scene but the top level's, and the top --- level's until the server sends one. While the client draws in HD (its skybox is then --- a model of the HD classes) this is the SD model built from the same id and lighting; --- that build is made by the client, on its thread. getSkybox: (Scene) -> Model?, --- Whether `other` equals this Scene, as `==` answers it (`false` for a value of another class). equals: (Scene, any) -> boolean, } --- One tile of a scene. A value naming the tile by its place (and the --- scene load it belongs to: a tile kept across a reload has nothing on --- it). Not here: the setters (edits). --- --- `__eq`: `==`: the same tile of the same scene load. export type Tile = { --- Its world tile, on its plane (`getPlane()`: for the tile a bridge --- hides, the plane it is on, read from the tile itself). getWorldLocation: (Tile) -> WorldPoint, --- Its centre as a local point. getLocalLocation: (Tile) -> LocalPoint, --- Its scene coordinates. getSceneLocation: (Tile) -> Point, --- Its plane (a bridge tile, moved down a plane, answers the plane it --- is on now; the tile it hides keeps the plane it was built on). getPlane: (Tile) -> number, --- The plane it renders on (where its heights come from): a bridge --- tile's original plane. getRenderLevel: (Tile) -> number, --- The loc game objects on it, every one covering it, padded with --- `nil` to five slots. getGameObjects: (Tile) -> { n: number, [number]: GameObject? }, --- Its wall object, if any. getWallObject: (Tile) -> WallObject?, --- Its decorative object, if any. getDecorativeObject: (Tile) -> DecorativeObject?, --- Its ground object, if any. getGroundObject: (Tile) -> GroundObject?, --- Its item pile, if any items lie on it. getItemLayer: (Tile) -> ItemLayer?, --- Its floor items, `nil` when there are none: the most valuable (the --- item layer's top) first; the rest in the client's value order, --- least valuable first. getGroundItems: (Tile) -> {TileItem}?, --- The tile a bridge tile hides (the plane-0 tile the map load moved --- it over), else `nil`. getBridge: (Tile) -> Tile?, --- Its flat paint (an underlay, or an overlay covering the whole tile), a --- `SceneTilePaint`: the colour of each corner, the texture, the minimap colour and --- whether it is level. `nil` when it has none: no underlay or overlay, or an overlay --- shape, which has a `SceneTileModel` instead; also for a tile kept across a reload. --- Raises on a client whose table does not place the paint. getSceneTilePaint: (Tile) -> SceneTilePaint?, --- Its tile model, a `SceneTileModel`: the floor of a tile whose overlay has a shape (a --- slope, a corner or an edge piece), with its vertices, faces, and the faces' colours --- and texture ids. `nil` when it has none: a flat paint (`getSceneTilePaint`) or --- nothing built; also for a tile kept across a reload. A copy read when asked (the --- client never changes it). Raises on a client whose table does not place the model. getSceneTileModel: (Tile) -> SceneTileModel?, --- Whether `other` equals this Tile, as `==` answers it (`false` for a value of another class). equals: (Tile, any) -> boolean, } --- A tile's item pile: the item layer the client draws the three most --- valuable items of a tile with. A value naming the pile by its tile. It --- answers the members of a `TileObject`, though it is not a `TileObject` --- itself. --- --- `__eq`: `==`: the same tile's pile. export type ItemLayer = { --- The pile's height: the tallest object on its tile, which the items --- are drawn on top of. getHeight: (ItemLayer) -> number, --- The most valuable item, drawn first (walk the rest with --- `Tile:getGroundItems()`). getTop: (ItemLayer) -> TileItem?, --- The second item drawn, if any (the next most valuable of another id). getMiddle: (ItemLayer) -> TileItem?, --- The third item drawn, if any. getBottom: (ItemLayer) -> TileItem?, --- The pile's scene tag (type 3); past 2^53 (it raises) for a pile of --- world view 2 or above: `getHashString()`. getHash: (ItemLayer) -> number, --- `getHash()` as its decimal string, exact for every world view. getHashString: (ItemLayer) -> string, --- The local x of its tile's centre. getX: (ItemLayer) -> number, --- The local y of its tile's centre. getY: (ItemLayer) -> number, --- The ground height at its tile, where it was placed. getZ: (ItemLayer) -> number, --- The plane of its tile. getPlane: (ItemLayer) -> number, --- The world view it is in. getWorldView: (ItemLayer) -> WorldView, --- Its tile's world location. getWorldLocation: (ItemLayer) -> WorldPoint, --- Its tile's centre as a local point. getLocalLocation: (ItemLayer) -> LocalPoint, --- Whether `other` equals this ItemLayer, as `==` answers it (`false` for a value of another class). equals: (ItemLayer, any) -> boolean, } --- A loc type's definition, read from the client's loc type cache. A type --- the client has not loaded is not there: its getters (all but `getId`) --- raise. Not here: the map icon and map scene (their slots are not --- verified), the param getters. --- --- `__eq`: `==`: the same loc type. export type ObjectComposition = { --- The loc id. getId: (ObjectComposition) -> number, --- Its name (`"null"` for an unnamed loc, as the cache stores it). getName: (ObjectComposition) -> string, --- Its five menu actions, `nil` where there is none. Holes are `nil` and the array --- carries `n`, its length: walk it `for i = 1, actions.n`. `table.find` stops at --- the first hole, so search it with your own `contains(actions, x)` that walks to --- `n`. getActions: (ObjectComposition) -> { n: number, [number]: string? }, --- Its menu ops: `getActions()`'s, each as the menu shows it now (an op --- with a conditional text answers that text while its varbit or varp --- is in range), and the sub-ops under each (`getSubOps`). Raises on a --- build whose op layout is not matched (`EntityOps`). getOps: (ObjectComposition) -> EntityOps, --- The loc ids it can turn into, or `nil` when it is not a multiloc. getImpostorIds: (ObjectComposition) -> {number}?, --- The loc it is now, chosen by its varbit (or varp) as the client --- chooses it, or `nil` (not a multiloc, or the choice is -1). getImpostor: (ObjectComposition) -> ObjectComposition?, --- The varbit that chooses the impostor, or -1. getVarbitId: (ObjectComposition) -> number, --- The varp that chooses the impostor, or -1. getVarPlayerId: (ObjectComposition) -> number, --- Its width in tiles, unrotated. getSizeX: (ObjectComposition) -> number, --- Its length in tiles, unrotated. getSizeY: (ObjectComposition) -> number, --- Whether `other` equals this ObjectComposition, as `==` answers it (`false` for a value of another class). equals: (ObjectComposition, any) -> boolean, } --- A loc type's menu ops, from `ObjectComposition:getOps()`, or the --- sub-ops of one of them (`getSubOps(op)`). A value naming the list (the --- loc type, and the op whose sub-ops it is); every getter reads it live --- from the client's loc type cache, and raises once the type has left it, --- as the composition's getters do. On a client whose table does not place --- the layout, every getter raises. --- --- Indexing: a type's own ops count from 0 (op 0 is --- `MenuAction.GAME_OBJECT_FIRST_OPTION`, `getActions()[1]`), and a sub-op --- list is indexed by sub-op id, which starts at 1, so its slot 0 is --- `nil`. `getNumOps()` is the highest index, not a count: --- `for i = 0, ops:getNumOps()` reads every slot. --- --- `__eq`: `==`: the same list of the same loc type. export type EntityOps = { --- The highest index of the list: its size minus one, so -1 for a --- type with no ops and, for a sub-op list, its highest sub-op id. A --- loop `i < getNumOps()` therefore stops before the last slot. getNumOps: (EntityOps) -> number, --- The op at `idx` as the menu shows it now: the first of its --- conditional texts whose varbit (or varp) value is in range, else its --- own text. `nil` outside the list, for a slot with no op (a hidden op --- included), and for an empty text. getOp: (EntityOps, number) -> string?, --- The sub-ops of op `idx`, an `EntityOps` indexed by sub-op id, or --- `nil` for an op with none (and for every op of a sub-op list). Raises --- for an `idx` outside the list and for a slot with no op, so test --- `getOp(idx)` first. getSubOps: (EntityOps, number) -> EntityOps?, --- Whether `other` equals this EntityOps, as `==` answers it (`false` for a value of another class). equals: (EntityOps, any) -> boolean, } export type EntityOpsClass = { --- `EntityOps.MAX_OPS`: 5, the ops a loc or NPC type has. MAX_OPS: number, } --- `EntityOps`'s static functions and constants. declare EntityOps: EntityOpsClass --- One plane's collision flags (`CollisionDataFlag`). export type CollisionData = { --- The flags, `[x][y]` over the scene (1-based in Luau). A copy. getFlags: (CollisionData) -> {{number}}, } --- A world entity: a boat and the world view it carries. Not here: --- `getTargetLocation`, `getTargetOrientation`. --- --- `__eq`: `==`: the same world entity. export type WorldEntity = { --- The world view it carries (its id is the entity's). getWorldView: (WorldEntity) -> WorldView, --- Op `op` (1 to 5) of this world entity (a boat). By op number, since a world entity's op texts are not read. Raises for an op outside --- 1 to 5. interact: (WorldEntity, number) -> boolean, --- Where it is in the world view it sails in: its fine position now (128 to a tile; --- world view 0), `nil` once it is gone. Raises on a client whose table does not --- place the world entity's fields. getLocalLocation: (WorldEntity) -> LocalPoint?, --- Which way it faces (0..2047, the client's angle units). Raises once it is gone, --- and on a client whose table does not place its fields. getOrientation: (WorldEntity) -> number, --- Who owns it: `OWNER_TYPE_NOT_PLAYER`, `OWNER_TYPE_OTHER_PLAYER` or --- `OWNER_TYPE_SELF_PLAYER` (the local player's own boat), as the server sent it. --- Raises once it is gone, and on a client whose table does not place its fields. getOwnerType: (WorldEntity) -> number, --- Whether the client draws it hidden because it overlaps another (faded out, as the --- client fades a boat that overlaps the local player's). Raises once it is gone, and --- on a client whose table does not place its fields. isHiddenForOverlap: (WorldEntity) -> boolean, --- Its config (the kind of boat it is), `nil` while it has none or once it is gone. --- Raises on a client whose table does not place its fields. getConfig: (WorldEntity) -> WorldEntityConfig?, --- Where the camera orbits while it follows the boat (`client:getCameraFocusEntity()` is --- the boat then): its `getLocalLocation()`. `nil` once it is gone; raises as --- `getLocalLocation()` does. getCameraFocus: (WorldEntity) -> LocalPoint?, --- Where `point`, a local point in this entity's own world view, is in the world view it --- sails in, as the entity stands and turns now (world view 0). What a plugin measures --- from or tests against the main world goes through this first; for a point in any --- world view, `WorldPoint.fromLocalMainWorld` also finds the entity and undoes --- instancing. `nil` once the entity is gone. Raises when `point` is in another world --- view, and on a client whose table does not place its fields. transformToMainWorld: (WorldEntity, LocalPoint) -> LocalPoint?, --- Whether `other` equals this WorldEntity, as `==` answers it (`false` for a value of another class). equals: (WorldEntity, any) -> boolean, } export type WorldEntityClass = { --- Not owned by a player. OWNER_TYPE_NOT_PLAYER: number, --- Owned by another player. OWNER_TYPE_OTHER_PLAYER: number, --- Owned by the local player. OWNER_TYPE_SELF_PLAYER: number, } --- `WorldEntity`'s static functions and constants. declare WorldEntity: WorldEntityClass --- A world entity's config: the kind of boat (or other world entity) it is, from the --- cache's world entity configs. --- --- `__eq`: `==`: the same config. export type WorldEntityConfig = { --- Its id in the cache. getId: (WorldEntityConfig) -> number, --- Whether `other` equals this WorldEntityConfig, as `==` answers it (`false` for a value of another class). equals: (WorldEntityConfig, any) -> boolean, } --- A world view's set of NPCs, players, world entities or world views, --- by index. Walk it with `for _, x in set` (ascending index), count it --- with `#set`, look one up with `set:byIndex(i)` (the entity whose --- index is `i`). It is no array: `set[1]` raises, naming those two. --- Not here: `stream()` (Luau has no streams; to filter, walk the set --- with a `for` loop and an `if`). --- --- `__len`: How many it holds. --- `__eq`: `==`: the same set of the same world view. export type IndexedObjectSet = { --- Whether `other` equals this IndexedObjectSet, as `==` answers it (`false` for a value of another class). equals: (IndexedObjectSet, any) -> boolean, } --- `WorldView:npcs()`: an `IndexedObjectSet` of `NPC`. --- --- `__len`: How many it holds. --- `__eq`: `==`: the same set of the same world view. --- `__iter`: Every NPC, by ascending index. export type NpcSet = IndexedObjectSet & { --- The NPC at `index`, or `nil`. byIndex: (NpcSet, number) -> NPC?, } --- `WorldView:players()`: an `IndexedObjectSet` of `Player`. --- --- `__len`: How many it holds. --- `__eq`: `==`: the same set of the same world view. --- `__iter`: Every player, by ascending index. export type PlayerSet = IndexedObjectSet & { --- The player at `index`, or `nil`. byIndex: (PlayerSet, number) -> Player?, } --- `WorldView:worldEntities()`: an `IndexedObjectSet` of `WorldEntity`. --- --- `__len`: How many it holds. --- `__eq`: `==`: the same set of the same world view. --- `__iter`: Every world entity, by ascending id. export type WorldEntitySet = IndexedObjectSet & { --- The world entity with id `index`, or `nil`. byIndex: (WorldEntitySet, number) -> WorldEntity?, } --- `WorldView:worldViews()`: an `IndexedObjectSet` of `WorldView`. --- --- `__len`: How many it holds. --- `__eq`: `==`: the same set of the same world view. --- `__iter`: Every world view, by ascending id. export type WorldViewSet = IndexedObjectSet & { --- The world view with id `index`, or `nil`. byIndex: (WorldViewSet, number) -> WorldView?, } --- The flat paint of a tile with no overlay shape (an underlay, or an overlay covering the --- whole tile), as `tile:getSceneTilePaint()` hands it out: the colour of each corner, the --- texture, the minimap colour and whether the tile is level. The client makes it when the --- region loads and never changes it, so a kept paint answers what it did. --- `getSceneTilePaint` raises on a client whose table does not place it. --- --- `__eq`: `==`: the same paint (the tile's one object). export type SceneTilePaint = { --- The south-west corner's colour: the tile's HSL (15-bit, the overlay's when there is --- one) with the corner's lightness in its low 7 bits, as the client draws it; 12345678 --- when the tile has no colour there (a hidden overlay). getSwColor: (SceneTilePaint) -> number, --- The south-east corner's colour (`getSwColor`). getSeColor: (SceneTilePaint) -> number, --- The north-east corner's colour (`getSwColor`). The client does not draw a paint whose --- north-east colour is 12345678. getNeColor: (SceneTilePaint) -> number, --- The north-west corner's colour (`getSwColor`). getNwColor: (SceneTilePaint) -> number, --- The texture id the tile is drawn with, -1 for none (always -1 for an underlay). getTexture: (SceneTilePaint) -> number, --- The tile's minimap colour, 24-bit RGB (the palette's, at the client's brightness when --- the region loaded), 0 for none: what the minimap fills the tile with. getRBG: (SceneTilePaint) -> number, --- Whether the tile is an overlay whose four corners are at one height: always --- `false` for an underlay. isFlat: (SceneTilePaint) -> boolean, --- Whether `other` equals this SceneTilePaint, as `==` answers it (`false` for a value of another class). equals: (SceneTilePaint, any) -> boolean, } --- The floor of a tile whose overlay has a shape (a slope, a corner or an edge piece), as --- `tile:getSceneTileModel()` hands it out: its vertices, its faces, each face's three --- colours and texture, its shape and rotation, and its two minimap colours. The client --- makes it when the region loads and never changes it, so a kept model answers what it --- did. Each array getter builds a new table (1-based, at most six entries). --- `getSceneTileModel` raises on a client whose table does not place it. --- --- `__eq`: `==`: the same model (the tile's one object). export type SceneTileModel = { --- Each vertex's x, in local units (the tile's `x * 128` plus the vertex's offset into --- the tile: 0, 32, 64, 96 or 128). getVertexX: (SceneTileModel) -> {number}, --- Each vertex's height (the corner heights, or two corners' averaged; more negative is --- higher). getVertexY: (SceneTileModel) -> {number}, --- Each vertex's z (the scene's y), in local units, as `getVertexX`. getVertexZ: (SceneTileModel) -> {number}, --- Each face's first vertex, a 0-based index into the vertex arrays (add 1 to index the --- Luau tables). getFaceX: (SceneTileModel) -> {number}, --- Each face's second vertex (`getFaceX`). getFaceY: (SceneTileModel) -> {number}, --- Each face's third vertex (`getFaceX`). getFaceZ: (SceneTileModel) -> {number}, --- Each face's colour at its first vertex: the underlay's or the overlay's HSL (by the --- face) with the vertex's lightness in its low 7 bits; 12345678 for a colour the client --- does not draw. getTriangleColorA: (SceneTileModel) -> {number}, --- Each face's colour at its second vertex (`getTriangleColorA`). getTriangleColorB: (SceneTileModel) -> {number}, --- Each face's colour at its third vertex (`getTriangleColorA`). getTriangleColorC: (SceneTileModel) -> {number}, --- Each face's texture id: the overlay's texture for an overlay face, -1 for an underlay --- face; `nil` when the tile has no texture. getTriangleTextureId: (SceneTileModel) -> {number}?, --- The overlay's shape, 2..12 (shapes 0 and 1 are flat paints, `getSceneTilePaint`). getShape: (SceneTileModel) -> number, --- The overlay's rotation, 0..3 (quarter turns). getRotation: (SceneTileModel) -> number, --- The underlay's minimap colour, 24-bit RGB (the palette's, at the client's brightness --- when the region loaded), 0 when the tile has no underlay colour. getModelUnderlay: (SceneTileModel) -> number, --- The overlay's minimap colour, 24-bit RGB, at least 1 (1 when the overlay has no --- colour). getModelOverlay: (SceneTileModel) -> number, --- Whether the tile's four corners are at one height. isFlat: (SceneTileModel) -> boolean, --- Whether `other` equals this SceneTileModel, as `==` answers it (`false` for a value of another class). equals: (SceneTileModel, any) -> boolean, } --- An interface component or a dynamic widget. The same userdata every time the plugin --- meets the same widget; a widget of a closed (unloaded) interface answers its last-known --- core and ignores writes. Every `setOn*Listener` takes one array: a script id then its --- arguments, or a function first (called with the `ScriptEvent`; refused until the plugin --- runtime registers its listener sink, which the build reports). export type Widget = { --- The packed component id, `(group << 16) | component`; a dynamic widget's is its --- component's. getId: (Widget) -> number, --- The slot in the component's children, -1 for a component. getIndex: (Widget) -> number, --- The widget type (`WidgetType`). getType: (Widget) -> number, --- Sets the widget type. setType: (Widget, number) -> (), --- The content type. getContentType: (Widget) -> number, --- Sets the content type. setContentType: (Widget, number) -> Widget, --- The click mask (`WidgetConfig` flags) the widget itself carries. getClickMask: (Widget) -> number, --- Sets the click mask. setClickMask: (Widget, number) -> Widget, --- Whether the widget is an IF3 (scripted) widget. isIf3: (Widget) -> boolean, --- The parent widget, or `nil` (a root of the top-level interface, or an interface --- that is not open). A dynamic widget's parent is its component --- (`client:getWidget(getParentId())`). getParent: (Widget) -> Widget?, --- The parent's id: the widget's own parent component, else the component its --- interface is mounted on, else -1. getParentId: (Widget) -> number, --- Slot `index` of [`getChildren`]: `nil` for an empty slot, a negative index, one past --- the end, or a dynamic widget (whose own children array is empty). Raises when `index` --- is not an int: nil, a fraction, NaN, inf or past int32. getChild: (Widget, number) -> Widget?, --- The widget's own children array, slot-indexed with holes; `nil` when it is empty. --- A component's holds every dynamic widget of it, those created under a dynamic --- layer included (they record the layer as their dynamic parent); a dynamic widget's --- is always empty (`nil`). A child's [`getIndex`] is its slot here. getChildren: (Widget) -> { n: number, [number]: Widget? }?, --- The dynamic widgets whose parent is this one, without holes: a component's own --- (those not created under a dynamic layer), or a dynamic layer's. getDynamicChildren: (Widget) -> {Widget}, --- Replaces the children array, for the arrays Bento can apply to the client's vector: --- `nil` drops it, and an array keeps, drops or pads what the widget has (each entry --- the widget slot `i` holds now, or `nil` where it is empty). Any other array (one --- that moves or adopts a widget) raises. A static layer only. setChildren: (Widget, { n: number, [number]: Widget? }?) -> (), --- The components whose parent is this one (none for a dynamic widget). getStaticChildren: (Widget) -> {Widget}, --- The root components of the interface mounted on this component. getNestedChildren: (Widget) -> {Widget}, --- `(Widget, number, number) -> Widget`: --- Creates a dynamic child of `type` in slot `index` (-1: after the last), as the --- client's `CC_CREATE` does; an occupied slot is replaced. --- --- `(Widget, number) -> Widget`: --- Creates a dynamic child of `type` after the last. createChild: ((Widget, number, number) -> Widget) & ((Widget, number) -> Widget), --- Empties every slot of the widget's own children array, keeping its length: --- `getChildren()` then answers holes and `createChild(-1, ...)` starts at slot 0. A --- dynamic widget's own array is empty, so on one this changes nothing. deleteAllChildren: (Widget) -> (), --- Whether the widget or any ancestor (through the mount of its interface) is --- hidden; a widget outside the top-level interface with no parent is hidden. isHidden: (Widget) -> boolean, --- Whether the widget's own hidden flag is set. isSelfHidden: (Widget) -> boolean, --- Sets the widget's own hidden flag. setHidden: (Widget, boolean) -> Widget, --- Where the widget was last drawn on the canvas, as the client's draw loop records --- it (`(-1, -1)` before its first draw; a hidden widget keeps where it was drawn --- last): the draw record, once the overlay layer points install in the client; --- before them (a test VM, the host process), the place its layout gives, which is --- where a widget drawn this frame was drawn. getCanvasLocation: (Widget) -> Point, --- The canvas area the widget covers: [`getCanvasLocation`] (the draw record once the --- layer points install, the layout before) and its laid-out size. getBounds: (Widget) -> Rectangle, --- Whether `point` is inside [`getBounds`] (the draw record's place once the layer --- points install, the layout's before). contains: (Widget, Point) -> boolean, --- The laid-out width. getWidth: (Widget) -> number, --- Sets the laid-out width (the next `revalidate()` recomputes it from the original). setWidth: (Widget, number) -> (), --- The laid-out height. getHeight: (Widget) -> number, --- Sets the laid-out height. setHeight: (Widget, number) -> (), --- The laid-out x, relative to the parent. getRelativeX: (Widget) -> number, --- Sets the laid-out x. setRelativeX: (Widget, number) -> (), --- The laid-out y, relative to the parent. getRelativeY: (Widget) -> number, --- Sets the laid-out y. setRelativeY: (Widget, number) -> (), --- The x before the position mode applies. getOriginalX: (Widget) -> number, --- Sets the x the position mode applies to; `revalidate()` makes it take effect. setOriginalX: (Widget, number) -> Widget, --- The y before the position mode applies. getOriginalY: (Widget) -> number, --- Sets the y the position mode applies to. setOriginalY: (Widget, number) -> Widget, --- The width before the width mode applies. getOriginalWidth: (Widget) -> number, --- Sets the width the width mode applies to. setOriginalWidth: (Widget, number) -> Widget, --- The height before the height mode applies. getOriginalHeight: (Widget) -> number, --- Sets the height the height mode applies to. setOriginalHeight: (Widget, number) -> Widget, --- `(Widget, number, number) -> Widget`: --- Sets the original x and y. --- --- `(Widget, number, number, number, number) -> Widget`: --- Sets the original x and y and their position modes. setPos: ((Widget, number, number) -> Widget) & ((Widget, number, number, number, number) -> Widget), --- `(Widget, number, number) -> Widget`: --- Sets the original width and height. --- --- `(Widget, number, number, number, number) -> Widget`: --- Sets the original width and height and their size modes. setSize: ((Widget, number, number) -> Widget) & ((Widget, number, number, number, number) -> Widget), --- The x position mode (`WidgetPositionMode`). getXPositionMode: (Widget) -> number, --- Sets the x position mode. setXPositionMode: (Widget, number) -> Widget, --- The y position mode. getYPositionMode: (Widget) -> number, --- Sets the y position mode. setYPositionMode: (Widget, number) -> Widget, --- The width mode (`WidgetSizeMode`). getWidthMode: (Widget) -> number, --- Sets the width mode. setWidthMode: (Widget, number) -> Widget, --- The height mode. getHeightMode: (Widget) -> number, --- Sets the height mode. setHeightMode: (Widget, number) -> Widget, --- Lays the widget out again against its parent (size, then position). revalidate: (Widget) -> (), --- `revalidate()`, then the children against the scroll size. revalidateScroll: (Widget) -> (), --- The scroll x. getScrollX: (Widget) -> number, --- Sets the scroll x. setScrollX: (Widget, number) -> Widget, --- The scroll y. getScrollY: (Widget) -> number, --- Sets the scroll y. setScrollY: (Widget, number) -> Widget, --- The scrollable width. getScrollWidth: (Widget) -> number, --- Sets the scrollable width. setScrollWidth: (Widget, number) -> Widget, --- The scrollable height. getScrollHeight: (Widget) -> number, --- Sets the scrollable height. setScrollHeight: (Widget, number) -> Widget, --- The text. getText: (Widget) -> string, --- Sets the text. setText: (Widget, string) -> Widget, --- The text colour, RGB. getTextColor: (Widget) -> number, --- Sets the text colour, RGB. setTextColor: (Widget, number) -> Widget, --- The font id. getFontId: (Widget) -> number, --- The font the text is drawn in, `nil` when the font id is -1 or names no font of --- the game's font archive (as the client's: it loads none). getFont: (Widget) -> FontTypeFace?, --- Sets the font id. setFontId: (Widget, number) -> Widget, --- Whether the text is drawn with a shadow. getTextShadowed: (Widget) -> boolean, --- Sets whether the text is drawn with a shadow. setTextShadowed: (Widget, boolean) -> Widget, --- The line height. getLineHeight: (Widget) -> number, --- Sets the line height. setLineHeight: (Widget, number) -> Widget, --- The horizontal text alignment (`WidgetTextAlignment`). getXTextAlignment: (Widget) -> number, --- Sets the horizontal text alignment. setXTextAlignment: (Widget, number) -> Widget, --- The vertical text alignment. getYTextAlignment: (Widget) -> number, --- Sets the vertical text alignment. setYTextAlignment: (Widget, number) -> Widget, --- The name (the op base: what menu entries name the widget by). getName: (Widget) -> string, --- Sets the name. setName: (Widget, string) -> Widget, --- The target verb (`Use` targets). getTargetVerb: (Widget) -> string, --- Sets the target verb. setTargetVerb: (Widget, string) -> (), --- The opacity, 0 (opaque) to 255. getOpacity: (Widget) -> number, --- Sets the opacity. setOpacity: (Widget, number) -> Widget, --- The sprite id. getSpriteId: (Widget) -> number, --- Sets the sprite id. setSpriteId: (Widget, number) -> Widget, --- Whether the sprite tiles. getSpriteTiling: (Widget) -> boolean, --- Sets whether the sprite tiles. setSpriteTiling: (Widget, boolean) -> Widget, --- The border type (the sprite outline thickness). getBorderType: (Widget) -> number, --- Sets the border type. setBorderType: (Widget, number) -> (), --- Whether a rectangle is filled. isFilled: (Widget) -> boolean, --- Sets whether a rectangle is filled. setFilled: (Widget, boolean) -> Widget, --- The model id. getModelId: (Widget) -> number, --- Sets the model id. setModelId: (Widget, number) -> Widget, --- The model type (`WidgetModelType`). getModelType: (Widget) -> number, --- Sets the model type. setModelType: (Widget, number) -> Widget, --- The model's animation id. getAnimationId: (Widget) -> number, --- Sets the model's animation id. setAnimationId: (Widget, number) -> Widget, --- The model's x rotation, 0..2047. getRotationX: (Widget) -> number, --- Sets the model's x rotation. setRotationX: (Widget, number) -> Widget, --- The model's y rotation, 0..2047. getRotationY: (Widget) -> number, --- Sets the model's y rotation. setRotationY: (Widget, number) -> Widget, --- The model's z rotation, 0..2047. getRotationZ: (Widget) -> number, --- Sets the model's z rotation. setRotationZ: (Widget, number) -> Widget, --- The model zoom. getModelZoom: (Widget) -> number, --- Sets the model zoom. setModelZoom: (Widget, number) -> Widget, --- The item the widget shows, -1 for none. getItemId: (Widget) -> number, --- Sets the item the widget shows. setItemId: (Widget, number) -> Widget, --- The item quantity. getItemQuantity: (Widget) -> number, --- Sets the item quantity. setItemQuantity: (Widget, number) -> Widget, --- The item quantity mode (when the quantity is drawn). getItemQuantityMode: (Widget) -> number, --- Sets the item quantity mode. setItemQuantityMode: (Widget, number) -> Widget, --- The menu ops, `nil` for an unset one; `nil` when there are none. Holes are --- `nil` and the array carries `n`, its length: walk it `for i = 1, ops.n`. --- `table.find` stops at the first hole, so search it with your own --- `contains(ops, x)` that walks to `n`. getActions: (Widget) -> { n: number, [number]: string? }?, --- Sets menu op `index`, 0-based (the ops grow to hold it; `nil` empties it). Indices --- past 31 raise: the client's menu reads no more, and the op table is the client's --- allocation. setAction: (Widget, number, string?) -> (), --- Drops the menu ops: `getActions()` answers `nil` after. The sub-ops stay. clearActions: (Widget) -> (), --- Sets sub-op `subop` of menu op `index` (both 0-based), growing the sub-op table --- to hold it; indices past 31 raise (the client's menu reads no more). setSubOp: (Widget, number, number, string?) -> (), --- Choose `option`, one of the widget's menu ops ("Withdraw-1", "Close"; `""` for its --- first), through the virtual mouse. The scheduler moves the virtual mouse onto the --- widget and clicks, and the menu entry it runs is that op of this widget (a dynamic --- child's index as its first param). `false` when the widget is gone, or it has no --- such op (`getActions()`, the text as the menu shows it). interact: (Widget, string) -> boolean, --- Press menu op `op` of the widget (1-based, a `CC_OP` identifier: action index + 1) --- through the virtual mouse, `childIndex` the menu entry's first param (the widget's --- own index when omitted, -1 for a component). The scheduler moves the virtual mouse --- onto the widget and clicks, and the entry it runs is that op (`CC_OP_LOW_PRIORITY` --- past op 5, as the menu has it); the item id comes from the widget's own item. --- `false` when the widget is gone. Raises for an `op` outside 1..10. --- `interact(option)` names the op by its text instead. interactOp: (Widget, number, number?) -> boolean, --- Press an if1 button of this widget: `menuAction` is --- `MenuAction.WIDGET_TYPE_1` ("ok"), `WIDGET_CLOSE`, `WIDGET_TYPE_4` (a toggle), --- `WIDGET_TYPE_5` (a select) or `WIDGET_CONTINUE`, as the widget's menu entry names it --- (an old interface's button; `interact(option)` presses a `CC_OP` op, which every --- current interface uses). `false` when the widget is gone, or `menuAction` is another --- type. pressButton: (Widget, MenuAction) -> boolean, --- Whether the widget's listeners run. hasListener: (Widget) -> boolean, --- Sets whether the widget's listeners run (a listener setter does not). setHasListener: (Widget, boolean) -> Widget, --- Whether clicks pass through the widget to what is under it (`false`) or stop. getNoClickThrough: (Widget) -> boolean, --- Sets whether clicks stop at the widget. setNoClickThrough: (Widget, boolean) -> (), --- Whether scrolling stops at the widget. getNoScrollThrough: (Widget) -> boolean, --- Sets whether scrolling stops at the widget. setNoScrollThrough: (Widget, boolean) -> (), --- The drag dead zone, in pixels. getDragDeadZone: (Widget) -> number, --- Sets the drag dead zone. setDragDeadZone: (Widget, number) -> (), --- The drag dead time, in client cycles. getDragDeadTime: (Widget) -> number, --- Sets the drag dead time. setDragDeadTime: (Widget, number) -> (), --- The container the widget can be dragged in, when one is set. getDragParent: (Widget) -> Widget?, --- The op listener: the script id, then its arguments; `nil` when unset. getOnOpListener: (Widget) -> {number | string}?, --- The key listener. getOnKeyListener: (Widget) -> {number | string}?, --- The load listener (run when the interface loads). getOnLoadListener: (Widget) -> {number | string}?, --- The inventory-transmit listener. getOnInvTransmitListener: (Widget) -> {number | string}?, --- The var-transmit listener. getOnVarTransmitListener: (Widget) -> {number | string}?, --- The vars the var-transmit listener runs for, `nil` when it runs for any. getVarTransmitTrigger: (Widget) -> {number}?, --- Sets the op listener: the script id then its arguments, a function first, or --- nothing (cleared). `hasListener` must be set for it to run. A function, here or in --- any `setOn*Listener`, is an error on a client whose table has the --- `ScriptEvent_execute` site off: nothing there would run it. setOnOpListener: (Widget, (((ScriptEvent) -> ()) | number)?, ...any) -> (), --- Sets the dialog-abort listener. setOnDialogAbortListener: (Widget, (((ScriptEvent) -> ()) | number)?, ...any) -> (), --- Sets the key listener. setOnKeyListener: (Widget, (((ScriptEvent) -> ()) | number)?, ...any) -> (), --- Sets the mouse-over listener. setOnMouseOverListener: (Widget, (((ScriptEvent) -> ()) | number)?, ...any) -> (), --- Sets the mouse-repeat listener. setOnMouseRepeatListener: (Widget, (((ScriptEvent) -> ()) | number)?, ...any) -> (), --- Sets the mouse-leave listener. setOnMouseLeaveListener: (Widget, (((ScriptEvent) -> ()) | number)?, ...any) -> (), --- Sets the timer listener (every client cycle). setOnTimerListener: (Widget, (((ScriptEvent) -> ()) | number)?, ...any) -> (), --- Sets the target-enter listener. setOnTargetEnterListener: (Widget, (((ScriptEvent) -> ()) | number)?, ...any) -> (), --- Sets the target-leave listener. setOnTargetLeaveListener: (Widget, (((ScriptEvent) -> ()) | number)?, ...any) -> (), --- Sets the click listener (the first cycle the mouse is held on the widget). setOnClickListener: (Widget, (((ScriptEvent) -> ()) | number)?, ...any) -> (), --- Sets the hold listener (every cycle but the first the mouse is held). setOnHoldListener: (Widget, (((ScriptEvent) -> ()) | number)?, ...any) -> (), --- Sets the release listener. setOnReleaseListener: (Widget, (((ScriptEvent) -> ()) | number)?, ...any) -> (), --- Sets the drag listener. setOnDragListener: (Widget, (((ScriptEvent) -> ()) | number)?, ...any) -> (), --- Sets the drag-complete listener. setOnDragCompleteListener: (Widget, (((ScriptEvent) -> ()) | number)?, ...any) -> (), --- Sets the scroll-wheel listener. setOnScrollWheelListener: (Widget, (((ScriptEvent) -> ()) | number)?, ...any) -> (), --- Sets the var-transmit listener. setOnVarTransmitListener: (Widget, (((ScriptEvent) -> ()) | number)?, ...any) -> (), } --- An inventory the client holds: slot-indexed arrays of item ids (-1 empty) and --- quantities, read live. The same userdata for the same container until the client --- removes it. export type ItemContainer = { --- The container's id (`InventoryID`), with 0x8000 for another player's. getId: (ItemContainer) -> number, --- Every slot's item, empty slots as id -1 quantity 0. getItems: (ItemContainer) -> {Item}, --- The item in `slot`, or `nil` for an empty slot or one past the end. getItem: (ItemContainer, number) -> Item?, --- Whether any slot holds `itemId`. contains: (ItemContainer, number) -> boolean, --- `(ItemContainer, number) -> number`: --- How many of `itemId` the container holds: the quantity of the first slot of it --- holding more than one (a stack), else the number of slots holding it (unstacked --- items, one each). --- --- `(ItemContainer) -> number`: --- How many slots hold an item. count: ((ItemContainer, number) -> number) & ((ItemContainer) -> number), --- How many slots there are, empty ones included. size: (ItemContainer) -> number, --- The first slot holding `itemId`, or -1. find: (ItemContainer, number) -> number, } --- An item and a quantity (a value: `==` compares them). --- --- `__eq`: `==`: the same id and quantity. --- `__tostring`: The item as text: `Item(id=..., quantity=...)`. export type Item = { --- The item id, -1 for an empty slot. getId: (Item) -> number, --- The quantity. getQuantity: (Item) -> number, --- The slot it was read from (`ItemContainer:getItems()`, `getItem`), -1 for an item --- not read from a slot. getSlot: (Item) -> number, --- Choose `option` ("Eat", "Wield", "Drop", ...) on the item where it was read from, --- through the virtual mouse. It acts on an item --- `client:getItemContainer(InventoryID.INV)` or `.WORN` handed out (`getItems()`, --- `getItem(slot)`): the op is resolved from the item's definition and the scheduler --- moves the virtual mouse onto its slot and clicks. `false` when the item came from --- another container, its slot no longer holds it, or it has no such option. Raises for --- an item not read from a slot (`Item.new`). interact: (Item, string) -> boolean, --- Whether `other` equals this Item, as `==` answers it (`false` for a value of another class). equals: (Item, any) -> boolean, } export type ItemClass = { --- An item of `id` and `quantity`. new: (number, number) -> Item, } --- `Item`'s static functions and constants. declare Item: ItemClass --- An item a widget draws, with where: what `WidgetItemOverlay` hands --- `renderItemOverlay`. export type WidgetItem = { --- The item id. getId: (WidgetItem) -> number, --- The quantity. getQuantity: (WidgetItem) -> number, --- The widget drawing it. getWidget: (WidgetItem) -> Widget?, --- `(WidgetItem) -> Rectangle`: --- Where it is drawn, the drag included. The same `Rectangle` while the item is --- drawn there (and a new one once a plugin changed the one it had). --- --- `(WidgetItem, boolean) -> Rectangle?`: --- Where it is drawn: while dragged (`nil` when it is not) or not. The same --- `Rectangle` `getCanvasBounds()` hands out for those bounds. getCanvasBounds: ((WidgetItem) -> Rectangle) & ((WidgetItem, boolean) -> Rectangle?), --- Where it is drawn while dragged, `nil` when it is not: the same `Rectangle` --- `getCanvasBounds()` hands out while it is dragged. getDraggingCanvasBounds: (WidgetItem) -> Rectangle?, --- The top-left corner of `getCanvasBounds()`. getCanvasLocation: (WidgetItem) -> Point, } export type WidgetItemClass = { --- A widget item: the item, its quantity, where it is drawn, the widget drawing it, and --- where it is drawn while dragged (`nil` when it is not). new: (number, number, Rectangle, Widget?, Rectangle?) -> WidgetItem, } --- `WidgetItem`'s static functions and constants. declare WidgetItem: WidgetItemClass --- An open sub-interface: what `client:getComponentTable()` holds, one per component --- another interface is open in. --- --- `__eq`: `==`: the same component, interface and mode. export type WidgetNode = { --- The interface (group) open in the component. getId: (WidgetNode) -> number, --- How it is open (`WidgetModalMode`: 0 modal, 1 non-modal, 3 modal click-through). getModalMode: (WidgetNode) -> number, --- Whether `other` equals this WidgetNode, as `==` answers it (`false` for a value of another class). equals: (WidgetNode, any) -> boolean, } --- The masks the server set on a range of a component's slots (what --- `client:getWidgetConfig(widget)` hands back). export type WidgetConfigNode = { --- The click mask (`WidgetConfig` flags), in place of the widget's own. getClickMask: (WidgetConfigNode) -> number, --- The op mask: which of the widget's ops are enabled (bit `i` for op `i + 1`). getOpMask: (WidgetConfigNode) -> number, } --- A bitmap font in Jagex's format: what `Widget:getFont()` hands out. Its metrics are --- the game cache's font archive, and its width reader answers as the client's does; the --- same font is `==` itself however it was reached. --- --- `__eq`: `==`: the same font id. export type FontTypeFace = { --- The width, in pixels, the client lays `text` out at in this font: each char's --- glyph advance, `` a mod icon's width, other tags (``, `
`, ...) --- and `@word@` colour codes nothing; 0 for `nil`. getTextWidth: (FontTypeFace, string?) -> number, --- The ascent: how far below the top of a line its baseline is. getBaseline: (FontTypeFace) -> number, --- Whether `other` equals this FontTypeFace, as `==` answers it (`false` for a value of another class). equals: (FontTypeFace, any) -> boolean, } --- What started a script. One `ScriptPreFired:getScriptEvent()` hands is valid only --- while that event is delivered; a listener callback's, or a built one, lives on. export type ScriptEvent = { --- The widget the `WIDGET_ID` and `WIDGET_INDEX` sentinels name. getSource: (ScriptEvent) -> Widget?, --- The drag-complete target, `nil` when there is none. getTarget: (ScriptEvent) -> Widget?, --- The arguments: index 1 is the script id, then the script's arguments as the event --- holds them (sentinels not replaced). A copy: a write to it changes nothing (see --- `setArgument`). getArguments: (ScriptEvent) -> {number | string}, --- Sets argument `index` (1-based as the Luau array `getArguments()` hands out: 1 --- is the script id, 2 the script's first argument) to `value`. In a --- `ScriptPreFired` handler it reaches the script when the delivery ends; an int --- stays an int and a string a string. setArgument: (ScriptEvent, number, any) -> (), --- The menu op. getOp: (ScriptEvent) -> number, --- The op base (the menu target text). getOpbase: (ScriptEvent) -> string, --- The mouse x, relative to the source's parent. getMouseX: (ScriptEvent) -> number, --- The mouse y, relative to the source's parent. getMouseY: (ScriptEvent) -> number, --- The typed key's Jagex key code. getTypedKeyCode: (ScriptEvent) -> number, --- The typed character. getTypedKeyChar: (ScriptEvent) -> number, --- Runs the script the event names, on the client thread, now (not while a script --- runs: it is not reentrant). A listener token first runs that callback. run: (ScriptEvent) -> (), } export type ScriptEventClass = { --- The `MOUSE_X` sentinel: an int argument replaced by the event's mouse x. MOUSE_X: number, --- The `MOUSE_Y` sentinel. MOUSE_Y: number, --- The `MENU_OP` sentinel: replaced by the op. MENU_OP: number, --- The `WIDGET_ID` sentinel: replaced by the source's id. WIDGET_ID: number, --- The `WIDGET_INDEX` sentinel: replaced by the source's index. WIDGET_INDEX: number, --- The `WIDGET_TARGET_ID` sentinel. WIDGET_TARGET_ID: number, --- The `WIDGET_TARGET_INDEX` sentinel. WIDGET_TARGET_INDEX: number, --- The `KEY_CODE` sentinel. KEY_CODE: number, --- The `KEY_CHAR` sentinel. KEY_CHAR: number, --- The `NAME` sentinel: a string argument replaced by the op base. NAME: string, } --- `ScriptEvent`'s static functions and constants. declare ScriptEvent: ScriptEventClass --- A `ScriptEvent` being built: --- `client:createScriptEventBuilder({...}):setSource(w):build():run()`. export type ScriptEventBuilder = { --- The arguments: index 1 is the script id. getArguments: (ScriptEventBuilder) -> {number | string}, --- Replaces the arguments: the script id first. setArguments: (ScriptEventBuilder, { n: number, [number]: any? }) -> ScriptEventBuilder, --- The widget the `WIDGET_ID` and `WIDGET_INDEX` sentinels name. getSource: (ScriptEventBuilder) -> Widget?, --- Sets the widget the `WIDGET_ID` and `WIDGET_INDEX` sentinels name (what runs a --- widget's own listener, as `getOnLoadListener()` hands it). setSource: (ScriptEventBuilder, Widget) -> ScriptEventBuilder, --- The drag-complete target. getTarget: (ScriptEventBuilder) -> Widget?, --- Sets the drag-complete target. setTarget: (ScriptEventBuilder, Widget) -> ScriptEventBuilder, --- The menu op. getOp: (ScriptEventBuilder) -> number, --- Sets the menu op. setOp: (ScriptEventBuilder, number) -> ScriptEventBuilder, --- The event to `run()`. build: (ScriptEventBuilder) -> ScriptEvent, } --- The game client, as the `client` global. Every member reads the client as it is when --- called. Arrays come back as 1-based Luau arrays: varp `varp` is --- `client:getVarps()[varp + 1]`. export type Client = { --- The game state (`GameState.of` of the client's value; `UNKNOWN` for one with no --- constant). getGameState: (Client) -> GameState, --- Set the game state through the client's own setter. `LOADING` while logged in --- reloads the scene: its `GameStateChanged` is posted at once, and the `LOGGED_IN` --- one when the reload ends. Any other change is posted at the start of the next --- client cycle. `UNKNOWN` and `LOGIN_SCREEN_AUTHENTICATOR` raise: the client has no --- such state. Game thread only. setGameState: (Client, GameState) -> (), --- Game ticks since the client started, bumped right after the `GameTick` --- subscribers ran. getTickCount: (Client) -> number, --- The client cycle counter (every 20 ms client cycle, in every game state). getGameCycle: (Client) -> number, --- The world the client is on (or will log in to, on the login screen). getWorld: (Client) -> number, --- The current world's types, as a set (`WorldType.fromMask` of its flags). getWorldType: (Client) -> {[WorldType]: boolean}, --- The game build's revision (242 on 242-1); 0 for a build this client has no --- profile of. getRevision: (Client) -> number, --- Frames drawn over the last second. getFPS: (Client) -> number, --- The logged-in account's hash as its --- decimal string ("-1" when not logged in). A 64-bit hash does not fit a Luau --- number exactly, so the hash comes as a string. Use it as a key. getAccountHashString: (Client) -> string, --- The login screen's username field ("" before there is one). getUsername: (Client) -> string, --- Set the login screen's username field; a `UsernameChanged` follows. Game thread --- only. setUsername: (Client, string) -> (), --- Set the login screen's authenticator code field (login index 4), to paste a code --- into it; nothing is posted. The client's own submit takes the field only when it is --- six characters long. Game thread only; raises on a client whose table does not place --- the field. setOtp: (Client, string) -> (), --- Which login screen page is up: 0 the welcome page, 2 the credentials, and so on --- (the client's login state). getLoginIndex: (Client) -> number, --- The credentials field with focus: 0 the username, 1 the password. getCurrentLoginField: (Client) -> number, --- A new, empty world description to fill in with the `World` setters. createWorld: (Client) -> World, --- On the login screen, switch the world the client will log in to (the client's --- own world change, through Bento's world hopper). Only the world's id is used; --- the rest is looked up in the world list. changeWorld: (Client, World) -> (), --- Logged in, hop to the world through the world switcher (a virtual-mouse click on --- its row; the switcher is opened first when it is not open). Only the world's id is --- used. hopToWorld: (Client, World) -> (), --- The local player, or nil before the client has one. getLocalPlayer: (Client) -> Player?, --- The top-level world view's NPCs (also --- `getTopLevelWorldView():npcs()`). getNpcs: (Client) -> {NPC}, --- The players the client's player info lists. getPlayers: (Client) -> {Player}, --- The top-level world view (the scene the local player is in; boats have their own). getTopLevelWorldView: (Client) -> WorldView, --- World view `id`, or nil when the client has none with that id. getWorldView: (Client, number) -> WorldView?, --- The top-level world view's scene. getScene: (Client) -> Scene, --- Every projectile in flight. getProjectiles: (Client) -> {Projectile}, --- The top-level world view's collision maps, one per plane (nil with no scene). getCollisionMaps: (Client) -> { n: number, [number]: CollisionData? }, --- The top-level scene's tile settings, `[plane][x][y]` (a copy). getTileSettings: (Client) -> {{{number}}}, --- Item `id`'s definition, loaded through the client's cache on demand; an id with --- none answers the client's default (named "null"). getItemDefinition: (Client, number) -> ItemComposition, --- NPC type `id`'s definition (without the varbit transform), loaded on demand; nil --- when the client has none to give. getNpcDefinition: (Client, number) -> NPCComposition?, --- Loc type `id`'s definition. getObjectDefinition: (Client, number) -> ObjectComposition, --- `(Client, number) -> number`: --- Varbit `varbit`'s value, read through its definition (loaded on demand). 0 for --- an id the client has no varbit for. --- --- `(Client, {number}, number) -> number`: --- Varbit `varbit` out of a varp array the caller holds (`varps[1]` is varp 0, as --- `getVarps()` hands it out). 0 when its varp is past the array. getVarbitValue: ((Client, number) -> number) & ((Client, {number}, number) -> number), --- Varbit `varbit` as the server last sent it. getServerVarbitValue: (Client, number) -> number, --- Varp `varp`'s value; raises for an id past the client's varps, and for one that is --- not an int. getVarpValue: (Client, number) -> number, --- Varp `varp` as the server last sent it. getServerVarpValue: (Client, number) -> number, --- Every varp, a copy taken now: index `varp + 1` is varp `varp`. getVarps: (Client) -> {number}, --- Every varp as the server last sent it, indexed as `getVarps()`. getServerVarps: (Client) -> {number}, --- Set varp `varp` client-side (the server does not hear it): no `VarbitChanged` is --- posted, and a later change is reported from the value the server last set. Game --- thread only. setVarpValue: (Client, number, number) -> (), --- Set varbit `varbit` client-side (the server does not hear it): the value --- masked to the varbit's bits. No `VarbitChanged` is posted. Raises for an id --- the client has no varbit for. Game thread only. setVarbit: (Client, number, number) -> (), --- Varbit `varbit`'s definition, or nil for an id the client has none for. getVarbit: (Client, number) -> VarbitComposition?, --- The clientscripts index (cache archive 12): whether Bento's script overlays --- still apply (`isOverlayOutdated()`). getIndexScripts: (Client) -> IndexDataBase, --- The config index (cache archive 2), whose groups are the cache's definitions (group --- 14 the varbits, listed with `getFileIds(14)`). getIndexConfig: (Client) -> IndexDataBase, --- Cache index `id` (archive `id`: 2 the config, 7 the models, 8 the sprites, 12 the --- scripts), or `nil` for one Bento does not serve. Served are 0 to 15 and 17 to 22. --- Not served: 16, which the client keeps no archive for; 23, 24 and 25, which the --- client can leave pointing at archives it has freed while it reloads its cache, so --- they cannot be read safely; and any other number. getIndex: (Client, number) -> IndexDataBase?, --- `s` with the client's text macros expanded: each `@name@` is replaced by the value --- the game's scripts set for that name, ignoring its case, and by nothing when they --- set none (`@blu@text` is `text`). The rest of `s` is kept, tags and all. --- Widget text and chat messages may hold macros, so run them through this before --- matching what the game shows. Raises on a client whose offset table does not place --- the macro table. macroExpand: (Client, string) -> string, --- Client int `var`; 0 when it is unset. getVarcIntValue: (Client, number) -> number, --- Client string `var`; "" when it is unset. getVarcStrValue: (Client, number) -> string, --- Set client int `var` (no `VarClientIntChanged`). Game thread only. setVarcIntValue: (Client, number, number) -> (), --- Set client string `var` (no `VarClientStrChanged`). Game thread only. setVarcStrValue: (Client, number, string) -> (), --- Every client var that holds a number or a string, by id: a copy taken now. getVarcMap: (Client) -> { [number]: number | string }, --- `skill`'s real (unboosted) level. Raises when the client's stats cannot be read --- ("the client's stats are not readable"); `getRealSkillLevels()` is the form with --- no raise, empty then. getRealSkillLevel: (Client, Skill) -> number, --- `skill`'s current (boosted or drained) level. Raises when the client's stats cannot --- be read, as `getRealSkillLevel` does; `getBoostedSkillLevels()` is the form with no --- raise, empty then. getBoostedSkillLevel: (Client, Skill) -> number, --- `skill`'s experience; -1 for a skill past the client's arrays. getSkillExperience: (Client, Skill) -> number, --- Every real level, by skill: index `Skill.X:ordinal() + 1`. getRealSkillLevels: (Client) -> {number}, --- Every current level, indexed as `getRealSkillLevels()`. getBoostedSkillLevels: (Client) -> {number}, --- Every skill's experience, indexed as `getRealSkillLevels()`. getSkillExperiences: (Client) -> {number}, --- The total level: the real levels of every skill `Skill` names. getTotalLevel: (Client) -> number, --- The total experience: every entry of the client's experience array. getOverallExperience: (Client) -> number, --- Run energy in hundredths of a percent (0..=10000). getEnergy: (Client) -> number, --- Carried weight, in kilograms. getWeight: (Client) -> number, --- Mark `skill` changed, so the interfaces' stat listeners run again at the next --- interface tick, as after a stat update from the server (no `StatChanged` is --- posted). Logged in, on the game thread only: the client's changed-stat counter --- is also its logged-in gate, so outside a session this raises. queueChangedSkill: (Client, Skill) -> (), --- Apply varp `varp`'s engine settings again and mark it changed, so the interfaces' --- var listeners run again at the next interface tick (no `VarbitChanged` is posted). --- Logged in, on the game thread only. queueChangedVarp: (Client, number) -> (), --- Whether `prayer` is on (its varbit is 1). isPrayerActive: (Client, Prayer) -> boolean, --- Whether the loaded map is an instance. isInInstancedRegion: (Client) -> boolean, --- The instance's template chunks, `[plane][x][y]` (each index + 1 in Luau), packed --- as `InstanceTemplates` has them; -1 for a chunk with none. Nil when the client --- has no map. getInstanceTemplateChunks: (Client) -> {{{number}}}?, --- The region ids the loaded map was built from. getMapRegions: (Client) -> {number}, --- The tile the player is walking to (the destination flag), in the top-level --- world view; nil when there is none. getLocalDestinationLocation: (Client) -> LocalPoint?, --- The top-level scene's base x (0 when no scene is loaded). getBaseX: (Client) -> number, --- The top-level scene's base y (0 when no scene is loaded). getBaseY: (Client) -> number, --- The top-level world view's plane. getPlane: (Client) -> number, --- The camera's east coordinate, local units. getCameraX: (Client) -> number, --- The camera's north coordinate, local units (y is north). getCameraY: (Client) -> number, --- The camera's height (z). getCameraZ: (Client) -> number, --- This frame's camera pitch (0..2047 of a full turn's 16384 units). getCameraPitch: (Client) -> number, --- This frame's camera yaw (0..16383). getCameraYaw: (Client) -> number, --- The pitch the camera is turning towards. getCameraPitchTarget: (Client) -> number, --- The yaw the camera is turning towards. getCameraYawTarget: (Client) -> number, --- Turn the camera towards `pitch`; the client eases to it. Game thread only. setCameraPitchTarget: (Client, number) -> (), --- Turn the camera towards `yaw`; the client eases to it. Game thread only. setCameraYawTarget: (Client, number) -> (), --- Lift (or restore) the camera's pitch limits. Game thread only. setCameraPitchRelaxerEnabled: (Client, boolean) -> (), --- The 3D projection's focal length. getScale: (Client) -> number, --- The free-camera ("oculus orb") state: 0 follows the player. getOculusOrbState: (Client) -> number, --- Set the free-camera state. Game thread only. setOculusOrbState: (Client, number) -> (), --- The camera's focal point, east. getOculusOrbFocalPointX: (Client) -> number, --- The camera's focal point, north. getOculusOrbFocalPointY: (Client) -> number, --- The point the camera orbits, a local point in the top-level world view: what --- `getCameraFocus()` answers on `client:getCameraFocusEntity()`'s result, without --- the entity. Nil when the client has no camera yet. getCameraFocusPoint: (Client) -> LocalPoint?, --- The world view of the entity the camera follows --- (`client:getCameraFocusEntity():getWorldView()`), without the entity. A player or --- an NPC answers the view it is in (a boat's while it is aboard one), a boat the view --- it carries, a fixed tile the top level. Nil before the client has a world view, or --- while the target is not in any. Raises on a client whose table does not place the --- target, rather than answer nil. getCameraFocusWorldView: (Client) -> WorldView?, --- What the camera follows: the `Player` or `NPC` (the handle every other read of it --- gives, so `==` against `getLocalPlayer()` holds), the `WorldEntity` (a boat), or, --- while the camera is fixed on a tile, the client's coordinate entity (a --- `CameraFocusableEntity`). Each answers `getCameraFocus()` and `getWorldView()`. --- Nil before the client has a world view, or while the target is not in any. Raises --- on a client whose table does not place the target, rather than answer nil. getCameraFocusEntity: (Client) -> CameraFocusableEntity?, --- Make every widget take a targeted op (a spell or an item's "Use" on it) while --- `value` is set: every widget's click mask carries `WidgetConfig.WIDGET_USE_TARGET` --- (set it while you pick a widget, as a widget inspector does). Game thread only; --- raises on a client whose table does not place the click mask. setAllWidgetsAreOpTargetable: (Client, boolean) -> (), --- How far the minimap is zoomed (pixels per tile; 4 is the client's default, which --- it also answers before the client has a minimap). getMinimapZoom: (Client) -> number, --- Scale how fast the arrow keys and a mouse drag turn the camera: 1 is the client's --- speed, clamped to 0.2..5. Game thread only. Raises on a client whose table has --- the camera input off. setCameraSpeed: (Client, number) -> (), --- Make a mouse drag of the camera turn its pitch the other way (the arrow keys are --- not inverted). Game thread only; raises as `setCameraSpeed` does. setInvertPitch: (Client, boolean) -> (), --- Make a mouse drag of the camera turn its yaw the other way (the arrow keys are not --- inverted). Game thread only; raises as `setCameraSpeed` does. setInvertYaw: (Client, boolean) -> (), --- Stop (or let again) the camera shaking when the game shakes it: the camera's five --- shake axes are skipped. The pitch floor a shake sets is kept. Game thread only; --- raises as `setCameraSpeed` does. setCameraShakeDisabled: (Client, boolean) -> (), --- The free camera's ("oculus orb") speed without Shift held: the client's own --- setting (12 by default; the game's scripts set it too). Game thread only; raises --- as `setCameraSpeed` does. setOculusOrbNormalSpeed: (Client, number) -> (), --- `(Client, number) -> ()`: --- Zoom the minimap to `zoom` pixels per tile, clamped to 2..8, through the client's --- own zoom (which redraws the minimap), while the minimap zoom is on; while it is --- off (`setMinimapZoom(false)`) this does nothing. The zoom is the client's own, on --- from the start. The client's zoom is whole pixels per tile, so a fraction is --- rounded to the nearest. Nothing changes before the client has a minimap and a --- scene. Game thread only; raises as `setCameraSpeed` does. --- --- `(Client, boolean) -> ()`: --- Turn the minimap zoom on (or off) and put the minimap back at the default zoom (4) --- either way. While it is off the player's mouse wheel does not zoom the minimap and --- `setMinimapZoom(zoom)` does nothing. The flag is the client's own minimap zoom --- flag, which the game's own minimap zoom setting also sets. Before the client has a --- scene the zoom reset is skipped (the client starts at 4). Called while a frame is --- drawn (from an overlay's `render`), the flag is set at once and the zoom goes back --- to 4 at the next client cycle, so `getMinimapZoom()` reads the old zoom until then. --- Game thread only; raises as `setCameraSpeed` does. setMinimapZoom: ((Client, number) -> ()) & ((Client, boolean) -> ()), --- Whether the minimap zoom is on: the flag `setMinimapZoom(enabled)` sets, read from --- the client's minimap, so it also follows the game's own minimap zoom setting. The --- client starts it on, and before the client has made its minimap this answers --- `true`, the value the minimap's constructor stores. Raises on a client whose table --- has the camera input off, as `setMinimapZoom` does. isMinimapZoom: (Client) -> boolean, --- Which mouse buttons drag the camera while held: bit `b` set for button `b` (1 left, 2 --- right, 4 middle; 20 is right and middle). 0 puts back the game's own rule (the middle --- button, by its option). A button keeps its own meaning: a right press still opens the --- menu. A mask without the middle bit does not stop the middle button dragging while --- the game's option is on (the client would take that press as a left click). Game --- thread only; raises on a client whose table does not place the press handling. setCameraMouseButtonMask: (Client, number) -> (), --- A picture of plane `z` (0..3) of the loaded scene, 736 pixels a side (the 184-tile --- extended scene at 4 pixels a tile, north up), drawn by the client's own minimap --- code: floors, walls, doors and map icons, background 1. The 104-tile scene is at --- tile 40; the border round it is background (160 pixels off each side to crop it). --- The scene's outermost tile on each side is also background (the client builds no --- floor there). The minimap the player sees is not changed. Background only when --- nothing is loaded or `z` is not a plane. Game thread only; raises on a client whose --- table does not place the minimap draw. drawInstanceMap: (Client, number) -> SpritePixels, --- The canvas width, pixels: the canvas the game lays its interfaces out in and --- draws, the window over the client's own UI scale (its "UiScaling" setting, whose --- default follows the monitor's DPI). The same unit as overlays, mouse events and --- `getMouseCanvasPosition()`. getCanvasWidth: (Client) -> number, --- The canvas height, pixels (see `getCanvasWidth`). getCanvasHeight: (Client) -> number, --- The canvas size: the window over the client's own UI scale (its "UiScaling" --- setting), raised to keep 765 × 503 at the window's aspect. While stretched that is --- the window over `1 + factor / 100`, by the same rule. getRealDimensions: (Client) -> Dimension, --- The size the canvas is drawn at, in the units a plugin sees: the canvas size, as --- `getRealDimensions()`. The client stretches its canvas to the window by its own UI --- scale and maps the pointer back to the canvas itself, so mouse events, overlays and --- clicks are all in canvas pixels, and the `stretched / real` ratio is 1. This is not --- the window's own size in pixels. getStretchedDimensions: (Client) -> Dimension, --- Whether stretched mode is on: what `setStretchedEnabled` last set, client-wide --- (`false` until then). The client draws its canvas at its own UI scale either way. isStretchedEnabled: (Client) -> boolean, --- Turn stretched mode on or off, client-wide. The canvas changes at the next --- `invalidateStretching(true)`. setStretchedEnabled: (Client, boolean) -> (), --- How much smaller than the window resizable mode draws the game before stretching --- it, percent (the scale is `1 + factor / 100`: 50 draws at 1.5×), client-wide; --- applied by `invalidateStretching(true)` while stretched mode is on. The client's UI --- scale is 25..400 percent, so a factor outside -75..300 takes effect at the nearer --- end. setScalingFactor: (Client, number) -> (), --- Apply stretched mode. With `resize`: while stretched mode is on in resizable mode, --- the client's own "UiScaling" setting becomes `100 + factor` percent through the --- client's setter, which recomputes the canvas and lays the interfaces out again as --- when the player changes the setting; otherwise the player's own value goes back --- (unless they changed it meanwhile). Without `resize` nothing changes. The player's --- own value is also kept outside the client while the setting holds a stretched one, --- so after an exit or a crash while stretched, turning stretched mode off still puts --- it back, and a session no plugin stretches starts at the player's own scale. The --- setting is the client's own, which the client saves, so until Bento next runs the --- client starts at the stretched scale; in fixed mode the game is drawn at the --- player's own scale. Game thread only; raises on a client whose table does not place --- the setting. invalidateStretching: (Client, boolean) -> (), --- Where the 3D viewport starts on the canvas, x. getViewportXOffset: (Client) -> number, --- Where the 3D viewport starts on the canvas, y. getViewportYOffset: (Client) -> number, --- The 3D viewport's width. getViewportWidth: (Client) -> number, --- The 3D viewport's height. getViewportHeight: (Client) -> number, --- Whether the client is in resizable mode. isResized: (Client) -> boolean, --- The cursor, canvas pixels. getMouseCanvasPosition: (Client) -> Point, --- Client cycles since the last mouse event (a move, press or wheel notch). getMouseIdleTicks: (Client) -> number, --- Client cycles since the last key went down or up. getKeyboardIdleTicks: (Client) -> number, --- The mouse buttons held: 1 left, 2 right, 4 middle; 0 for none. getMouseCurrentButton: (Client) -> number, --- When a mouse button last went down, Unix epoch milliseconds; 0 before the first --- press. The time since is --- `Instant.now():toEpochMilli() - client:getMouseLastPressedMillis()` (the wall --- clock; `os` is not in the sandbox, and `utils:elapsedMs()` counts from the client's --- start, so a difference with it is meaningless). getMouseLastPressedMillis: (Client) -> number, --- Client cycles the clicked widget has been held (the drag's age). getDragTime: (Client) -> number, --- Whether key `keycode` (`KeyCode`, the client's own key codes) is held. isKeyPressed: (Client, number) -> boolean, --- How long the client waits idle before logging out, client cycles (the client's --- "AFK timeout" setting, which it keeps in whole minutes: 15000 is five). getIdleTimeout: (Client) -> number, --- Set the idle logout, in whole minutes: the client keeps it in minutes (its "AFK --- timeout" setting). For a timeout in ticks, --- `setIdleTimeoutMinutes(math.ceil(ticks / 3000))`. Not saved to the client's --- preferences file. Game thread only. setIdleTimeoutMinutes: (Client, number) -> (), --- Whether the server hint arrow is showing. hasHintArrow: (Client) -> boolean, --- The hint arrow's type (`HintArrowType`). getHintArrowType: (Client) -> number, --- The tile a coordinate hint arrow points at; nil for any other type. getHintArrowPoint: (Client) -> WorldPoint?, --- `(Client, WorldPoint) -> ()`: --- Point the hint arrow at the middle of `point`. Game thread only. --- --- `(Client, LocalPoint) -> ()`: --- Point the hint arrow at `point`, within its tile. Game thread only. --- --- `(Client, NPC) -> ()`: --- Point the hint arrow at `npc`. Game thread only. --- --- `(Client, Player) -> ()`: --- Point the hint arrow at `player`. Game thread only. setHintArrow: ((Client, WorldPoint) -> ()) & ((Client, LocalPoint) -> ()) & ((Client, NPC) -> ()) & ((Client, Player) -> ()), --- Hide the hint arrow. Game thread only. clearHintArrow: (Client) -> (), --- The NPC an NPC hint arrow points at; nil for any other arrow, or one whose NPC --- is gone. getHintArrowNpc: (Client) -> NPC?, --- The player a player hint arrow points at; nil otherwise. getHintArrowPlayer: (Client) -> Player?, --- The eight Grand Exchange slots' offers, in slot order (an empty slot is an --- `EMPTY` offer). Empty when the client has none yet. getGrandExchangeOffers: (Client) -> {GrandExchangeOffer}, --- The ids the Grand Exchange search shows, in order, for a `GrandExchangeSearched` --- subscriber that consumed the event (`nil`: none). Each is kept as a signed 16-bit --- value (an id over 32767 wraps, and comes back whole). Takes effect at the search's --- next result read. Never raises: on a client the search is not hooked on it is kept --- but nothing reads it, and the log says so once. setGeSearchResultIds: (Client, {number}?) -> (), --- How many of those ids the search shows; -1 is the client's "too many matches". --- Kept, never refused, as `setGeSearchResultIds` is. setGeSearchResultCount: (Client, number) -> (), --- The next id the search reads (0 starts over). Kept, never refused, as --- `setGeSearchResultIds` is. setGeSearchResultIndex: (Client, number) -> (), --- How many item definitions the client's cache holds: item ids run from 0 to one --- below it, so a search walks them (`itemManager:getItemComposition(id)` for --- each). 0 before the cache is loaded. Raises on a client whose table does not --- place the count. getItemCount: (Client) -> number, --- `(Client, number) -> ()`: --- Play sound effect `id` as the client's own synth packet does. Game thread only. --- --- `(Client, number, number, number, number) -> ()`: --- Play sound effect `id` at scene tile (`x`, `y`), heard within `range` tiles. --- Game thread only. --- --- `(Client, number, number, number, number, number) -> ()`: --- `playSoundEffect(id, x, y, range)` after `delay` client cycles. --- --- `(Client, number, number) -> ()`: --- Play sound effect `id` now, at the player's sound effect volume, or at `volume` --- (0..127, `SoundEffectVolume`'s scale) while the player has sound effects muted: --- past the client's queue, so no `SoundEffectPlayed` is posted and no delay applies. --- An effect the client has not loaded yet plays nothing. Game thread only; raises on --- a client whose table has the effect chain off. playSoundEffect: ((Client, number) -> ()) & ((Client, number, number, number, number) -> ()) & ((Client, number, number, number, number, number) -> ()) & ((Client, number, number) -> ()), --- The top-level world view's ambient sounds: the looping area sounds its locs and --- NPCs make. `for _, effect in client:getAmbientSoundEffects() do` walks them --- oldest first, as the client lists them when walked; --- `client:getAmbientSoundEffects():clear()` stops them all (game thread only). --- Walking raises on a client whose table does not place the list; clearing, on one --- whose table has the client's stop off. getAmbientSoundEffects: (Client) -> AmbientSoundEffectDeque, --- The client's preferences: the remembered username and the sound effect volume. getPreferences: (Client) -> Preferences, --- Turn the client's low detail on (or off): the client's own low-detail flag (the one --- its `lowmem` / `highmem` commands set), then, while logged in, the scene is loaded --- again (`setGameState(LOADING)`) so it is built under it. What it changes is the --- client's: a region loads with the current plane as the scene's lowest drawn level, a --- loc spawning on another plane is skipped, idle players are drawn without their idle --- animation past 50 players (200 without it), and the next login tells the server. --- Ground decorations stay and tile textures are not simplified (the client's low --- detail has neither), and the client's audio is left as it is. Game thread only; --- raises on a client whose table does not place the flag. changeMemoryMode: (Client, boolean) -> (), --- Let the client draw frames apart from its 20 ms cycle: paced to --- `setUnlockedFpsTarget`'s rate, or not at all until one is set (cleared by --- `setUnlockedFps(false)`). `false` puts the client's own frame limit back (its --- "FpsLimit" setting). The client already draws frames apart from its cycle, paced by --- its own limit, so `false` gives that limit; while the window is not focused the --- client's own background limit applies; and when the player changes the client's --- frame limit, the client's applies until this is called again. Game thread only; --- raises on a client whose table does not place the frame pacer. setUnlockedFps: (Client, boolean) -> (), --- The frame rate to pace to while the FPS is unlocked (`setUnlockedFps(true)`); 0 or --- less is none. Kept while locked, and applied when unlocked. Game thread only; --- raises as `setUnlockedFps` does. setUnlockedFpsTarget: (Client, number) -> (), --- Draw the map `chunks` zones (8 tiles each) past the 104 tiles the game loads, on every --- side: 117HD's "Expanded map loading". 0 (the default) draws only the game's own scene; --- 5, the most, draws 184 tiles across. What the ring adds is scenery only (ground and --- locs: no players, NPCs or items, which the server sends for the 104 tiles alone), it --- cannot be clicked, and nothing the game or a plugin reads changes: the scene, its --- coordinates and every event stay the game's. How far of it shows is the draw distance --- (`Scene:setDrawDistance`, up to 90 tiles). It is built from the client cycle after the --- call and again after each scene load, a few cycles later than the scene (its map --- files may first have to load). Drawn in SD only, and not in an instance. Raises --- outside 0..5, and on a client whose code is not the code it was written for. Game --- thread only. setExpandedMapLoading: (Client, number) -> (), --- The chunks `setExpandedMapLoading` last set (0 until one is set). getExpandedMapLoading: (Client) -> number, --- The client's textures: their brightness, the textures themselves and their pixels --- (`TextureProvider`). getTextureProvider: (Client) -> TextureProvider, --- Whether the title screen's fire is drawn (true by default). While false the --- client's fire is neither drawn nor animated, wherever the client draws it (both --- columns of the title screen and a login interface's fire); set true again, it --- carries on from where it stood. `true` always succeeds (it is what the client does --- by itself); `false` is game thread only and raises on a client whose table does not --- place the fire's draw. setShouldRenderLoginScreenFire: (Client, boolean) -> (), --- Which animations the client tweens between frames (animation smoothing): players, --- NPCs, animated objects and the spot animations on actors whose sequence id --- `filter` answers true for are drawn moving smoothly from each frame towards the next --- on every frame drawn, not only once per 20 ms cycle. An actor is asked by its action --- (else its pose); one doing both at once, and skeletal animations, are drawn as the --- game draws them. `nil` stops all smoothing. One filter for the client: the last set, --- by any plugin, wins, and it is cleared when the plugin that set it stops. `filter` --- must be pure: it is asked once for every sequence id the game has, on the game --- thread, at the plugin's next invoke point (within a 20 ms cycle; nothing is tweened --- until then), not while frames are drawn, so what it reads later changes nothing. --- The frames between are applied unrounded, so a tweened part turns continuously, in --- SD and in HD. --- Game thread only; raises on a client whose table does not place what smoothing --- reads. setAnimationInterpolationFilter: (Client, ((number) -> boolean)?) -> (), --- The animation smoothing filter last set (`setAnimationInterpolationFilter`), by --- any plugin, or `nil` while smoothing is off. getAnimationInterpolationFilter: (Client) -> ((number) -> boolean)?, --- Draw the client's own menu now, at `alpha` (0 transparent .. 255 opaque): call it --- from a `BeforeMenuRender` subscriber, then `event:consume()` so the client does not --- draw it again on top. At 255 it is the client's draw exactly; below, the menu's --- boxes and outlines are blended over what is under them and its text and icons stay --- opaque. Its rows, colours and footer blend separately, the outline's corner pixels --- blend twice, and an alpha outside 0..255 is clamped. Raises outside --- `BeforeMenuRender` (the menu is drawn only inside the client's draw of it), off the --- game thread, and on a client whose table does not place the menu draw. drawOriginalMenu: (Client, number) -> (), --- The local player's follower (a pet, a familiar, a quest follower), or nil: the --- first follower varp the session changed (`VarPlayerID.FOLLOWER_NPC` or --- `FOLLOWER_NPC_SECONDARY`, the varps the cache gives client code 17), whose low 16 --- bits are an NPC index in the local player's world view. Nil with no local player, --- before a follower varp has changed since login, while it names no NPC (-1 when --- there is no follower), or when that NPC is not loaded. Raises on a client whose --- table does not place the client's follower list. getFollower: (Client) -> NPC?, --- The widget the running script's `cc_*` instructions act on (the script VM's active --- component register: the component `cc_find` found or `cc_create` made, the one to --- read in `ScriptPostFired` after a draw script), or nil when the register is empty. --- Raises where the table does not place the script VM. getScriptActiveWidget: (Client) -> Widget?, --- The widget whose input field has the keyboard focus (a field the game types into --- instead of the chatbox), or nil when none has it. getFocusedInputFieldWidget: (Client) -> Widget?, --- The running script's int array in local `arrayId` (the script's own array): --- `arr[i]` reads value `i - 1`, `arr[i] = v` writes it on the game thread, `#arr` --- is its length. Nil for a long or string array; raises when there is no such --- local, or no array in it. Read it in the `ScriptCallbackEvent` (or --- `ScriptPreFired`/`ScriptPostFired`) that hands out the id: the view finds the --- local again on every access, so after that script moves on it reads whatever the --- local holds then. Raises where the table does not place the script VM; a write --- also raises on a client whose table has the writes off. getArray: (Client, number) -> {number}?, --- Close the sub-interface `interfaceNode` names client-side, as the client closes one --- (no packet; the group unloaded when `unload`; `WidgetClosed` posted first). Raises --- "WidgetNode is no longer valid" when that interface is no longer open in that --- component. Game thread only, for example from `clientThread:invokeAtTickEnd`. Asked --- from a callback the client's own close raised (`WidgetClosed`, `WidgetUnloaded`, a --- sub-change script), it raises "the client is making that change itself right now": --- ask with `clientThread:invokeLater` instead. Raises on a client whose table has the --- close off. closeInterface: (Client, WidgetNode, boolean) -> (), --- Open the world switcher, through the virtual mouse: the logout panel first when --- another is showing, then its "World Switcher" button. It opens a tick or two --- later. It gives up after three clicks, or three openings of the logout panel, that --- did not open it. Raises when not logged in. openWorldHopper: (Client) -> (), --- `(Client, number) -> Widget?`: --- The widget with packed id `id` (`group << 16 | child`), or nil when its --- interface is not loaded. Raises when `id` is not an int: nil, a fraction, NaN, inf or --- past int32, so an id read from data needs checking before it gets here. --- --- `(Client, number, number) -> Widget?`: --- Component `childId` of interface `groupId`, or nil when the interface is not --- loaded or has no such component. Raises when either is not an int, as the packed --- form does. getWidget: ((Client, number) -> Widget?) & ((Client, number, number) -> Widget?), --- The top-level interface's root components. getWidgetRoots: (Client) -> {Widget}, --- Every open sub-interface, keyed by the component it is open in: --- `client:getComponentTable()[componentId]`. getComponentTable: (Client) -> {[number]: WidgetNode}, --- The `IF_SETEVENTS` masks the server set on the widget's component and slot; nil --- when it set none (the widget's own `getClickMask()` applies then). getWidgetConfig: (Client, Widget) -> WidgetConfigNode?, --- The top-level interface's id, -1 when none is open. getTopLevelInterfaceId: (Client) -> number, --- The draggable widget a mouse press landed on (the client's clicked widget), from --- the press until the release, whether or not the drag has begun; nil when there is --- none. getDraggedWidget: (Client) -> Widget?, --- The widget under the dragged one that takes a drop (its config has --- `WidgetConfig.DRAG_ON`), as the client found it this cycle; nil when there is --- none. getDraggedOnWidget: (Client) -> Widget?, --- Where the drag in progress drops (`nil`: nowhere, so the release sends no --- IF_BUTTOND). The client derives it again every cycle: set it from `onWidgetDrag`. --- A widget that is gone drops nowhere, as `nil`. Game thread only. setDraggedOnWidget: (Client, Widget?) -> (), --- Whether a widget is in target mode: a spell or an item's "Use" is selected. isWidgetSelected: (Client) -> boolean, --- The widget in target mode (the selected spell, or the inventory slot of a "Use" --- item); nil when none is, or it is gone. getSelectedWidget: (Client) -> Widget?, --- `false` turns target mode off: nothing else runs (no `onTargetLeave`; a plugin that --- changed the source widget's look restores it). `true` keeps target mode on when it --- is on already, and raises otherwise: the client has no target mode without the --- spell or item that started it (start one with a virtual-mouse click on it). Game --- thread only. setWidgetSelected: (Client, boolean) -> (), --- `(Client, number) -> ItemContainer?`: --- Item container `id` (an `InventoryID`), or nil when the client has none. --- --- `(Client, LegacyInventoryID) -> ItemContainer?`: --- Item container `inventory` (an `InventoryID`), or nil. getItemContainer: ((Client, number) -> ItemContainer?) & ((Client, LegacyInventoryID) -> ItemContainer?), --- Run clientscript `args[1]` with the rest as its arguments, now, on the game --- thread: `client:runScript(id, a, b)` (or the arguments as one array). runScript: (Client, ...any) -> (), --- A script event to fill in and `run()`: the script id first, then its arguments, --- as `runScript` takes them. createScriptEventBuilder: (Client, ...any) -> ScriptEventBuilder, --- The script VM's int stack, the interpreter's own array. While a --- `ScriptCallbackEvent` is delivered it is that event's stacks, and a write is staged --- for the hook to write back after the last subscriber; anywhere else it is the VM as --- it is, which after `runScript(...)` holds the script's results from slot 0 --- (`client:getIntStack()[1]`), read-only. In a `ScriptPostFired` the VM as it is can --- be written: the top slot (`stack[client:getIntStackSize()]`) is what the script --- returns, so a write changes its answer, for example making `bankmain_searching` --- answer true (where the event is raised at the script's `return`; elsewhere it --- raises). 1-based, like every Luau array; `#stack` is the array's length. The same --- object on every call. getIntStack: (Client) -> {number}, --- The int stack's size, where `getIntStack()` reads it. getIntStackSize: (Client) -> number, --- Set the int stack's size (staged into the `ScriptCallbackEvent` being delivered; --- an error anywhere else). setIntStackSize: (Client, number) -> (), --- The script VM's object stack (the strings scripts pass), as `getIntStack()` is --- the int stack: the event's while one is delivered, else the VM's, read-only. getObjectStack: (Client) -> { number | string }, --- The object stack's size, where `getObjectStack()` reads it. getObjectStackSize: (Client) -> number, --- Set the object stack's size (staged into the `ScriptCallbackEvent` being --- delivered; an error anywhere else). setObjectStackSize: (Client, number) -> (), --- The root right-click menu (one object for the client's life). getMenu: (Client) -> Menu, --- The menu's entries, in the client's order (`getMenu():getMenuEntries()`). getMenuEntries: (Client) -> {MenuEntry}, --- Replace the menu's entries (`getMenu():setMenuEntries(entries)`). setMenuEntries: (Client, {MenuEntry}) -> (), --- Add an entry at `idx` (`getMenu():createMenuEntry(idx)`; -1 is the top). createMenuEntry: (Client, number) -> MenuEntry, --- Whether the right-click menu is open. isMenuOpen: (Client) -> boolean, --- The open menu's left edge, canvas pixels. getMenuX: (Client) -> number, --- The open menu's top edge. getMenuY: (Client) -> number, --- The open menu's width. getMenuWidth: (Client) -> number, --- The open menu's height. getMenuHeight: (Client) -> number, --- `(Client, ChatMessageType, string, string, string?) -> MessageNode`: --- Add a line to the chatbox through the client's own message add (a `ChatMessage` --- is posted for it), and hand back its node. A group ironman type (`CLAN_GIM_CHAT`, --- `CLAN_GIM_MESSAGE`) is stored as its clan type with `|` before the text. Game --- thread only. --- --- `(Client, ChatMessageType, string, string, string?, boolean) -> MessageNode`: --- `addChatMessage`, posting the `ChatMessage` only when `postEvent` is true. addChatMessage: ((Client, ChatMessageType, string, string, string?) -> MessageNode) & ((Client, ChatMessageType, string, string, string?, boolean) -> MessageNode), --- Have the chatbox rebuild its lines (after a message node was changed). refreshChat: (Client) -> (), --- Every chat message the chatbox holds, by message id. getMessages: (Client) -> ChatMessageTable, --- The chatbox's line buffers, by chat type. getChatLineMap: (Client) -> {[number]: ChatLineBuffer}, --- The friends list. getFriendContainer: (Client) -> FriendContainer, --- The ignore list. getIgnoreContainer: (Client) -> NameableContainer, --- The friends chat the player is in, or nil. getFriendsChatManager: (Client) -> FriendsChatManager?, --- `(Client) -> ClanChannel?`: --- The player's clan channel, or nil. --- --- `(Client, number) -> ClanChannel?`: --- Clan `clanId`'s channel (`ClanID`), or nil. getClanChannel: ((Client) -> ClanChannel?) & ((Client, number) -> ClanChannel?), --- The guest clan channel the player is in, or nil. getGuestClanChannel: (Client) -> ClanChannel?, --- `(Client) -> ClanSettings?`: --- The player's clan's settings (its members, online or not), or nil. --- --- `(Client, number) -> ClanSettings?`: --- Clan `clanId`'s settings (`ClanID`), or nil. getClanSettings: ((Client) -> ClanSettings?) & ((Client, number) -> ClanSettings?), --- The settings of the guest clan the player is in, or nil. getGuestClanSettings: (Client) -> ClanSettings?, --- Whether `name` is on the friends list (and online, when `mustBeLoggedIn`). isFriended: (Client, string, boolean) -> boolean, --- The sprite overrides, sprite id to `SpritePixels` as a keyed table (the same table --- every call, shared by every plugin): `t[spriteId] = sprite` makes the client load --- `sprite` wherever it loads that `SpriteID`, `t[spriteId] = nil` gives the client --- its own back, `t[spriteId]` reads it, `for id, sprite in t` walks it. Shows at once --- (no cache reset is needed). A put the client cannot take (its table does not place --- the override sites) is an error. A remove of an id the map does not hold changes --- nothing and never raises. getSpriteOverrides: (Client) -> {[number]: SpritePixels}, --- The widget sprite overrides, by packed widget id (`InterfaceID`), the same keyed --- table form: the widget draws `sprite` in place of its own sprite while its --- `getSpriteId()` is not -1, as the sprite is (no flips, outline or shadow). getWidgetSpriteOverrides: (Client) -> {[number]: SpritePixels}, --- The client's widget sprite cache; `reset()` empties it (call it beside every --- override put and remove). getWidgetSpriteCache: (Client) -> NodeCache, --- The chat icons `` draws, as a live 1-based view of the client's array (one for --- every plugin): `icons[n + 1]` is the icon `` draws, `icons[i] = sprite` --- replaces it (drawn from the next frame), `#icons` is the length, `for i, s in icons` --- walks it. A view, like `getIntStack()`: copy it with a loop --- (`for i, s in icons do copy[i] = s end`). A slot you set reads back as the sprite you --- set (`icons[i] = s` then `icons[i] == s`). `nil` before the client loaded its icons. --- An error on a client whose table does not place it. getModIcons: (Client) -> {IndexedSprite}?, --- Make `modIcons` (a table of `IndexedSprite`s) the chat icons `` draws, for --- every plugin. Each icon is copied into the client as it is now. setModIcons: (Client, {IndexedSprite}) -> (), --- A new, empty `IndexedSprite` (no pixels, no palette, every size 0). createIndexedSprite: (Client) -> IndexedSprite, --- The minimap's dot sprites, a live 1-based view by dot id + 1 (`DOT_ITEM` 0 is --- `dots[1]`, then `DOT_NPC`, `DOT_PLAYER`, `DOT_FRIEND`, `DOT_TEAM`, --- `DOT_FRIENDSCHAT`, `DOT_CLAN`): `dots[i]` is a copy of the sprite the minimap draws --- (`nil` before it built its dots), `dots[i] = sprite` makes the minimap draw `sprite` --- for that dot from the next frame. Copy it with a loop, as `getModIcons()`. The --- client's own dot colour settings rebuild a dot when they change. Reading or writing --- a dot raises on a client whose table does not place it. getMapDots: (Client) -> {SpritePixels}, --- Make the minimap draw `compass` as its compass (copied as it is now) until the next --- call. An error on a client whose table does not place it. setCompass: (Client, SpritePixels) -> (), --- The click cross frames (4 yellow, then 4 red), as a live 1-based view of the array --- the client draws from (one for every plugin): `crosses[i]` is a copy of frame --- `i - 1`, `crosses[i] = sprite` makes the client draw `sprite` for it from the next --- click on, `#crosses` is the count, `for i, s in crosses` walks it. Copy it with a --- loop, as `getMapDots()`. `nil` before the client loaded its crosses. An error on a --- client whose table does not place it. getCrossSprites: (Client) -> {SpritePixels}?, --- Empty the client's health bar definition and sprite caches: every health bar, --- those already over an actor too, looks its sprites up again at its next draw, so a --- sprite override put since shows. An error on a client whose table does not place --- it. resetHealthBarCaches: (Client) -> (), --- Draw `pixels` as the login screen's background (copied as it is now): wider than --- 765 centred, else at the login area's left, and 383 wide or less beside its mirror --- image. `nil` gives the client its own background back. It stays across logins (put --- back as the client reloads its title screen). An error on a client whose table --- does not place it. setLoginScreen: (Client, SpritePixels?) -> (), --- The sprites cache index (archive 8), for `getSprites`. getIndexSprites: (Client) -> IndexDataBase, --- Every frame of sprite group `archiveId` (a `SpriteID`), decoded now: the client's --- `SpriteBuffer` read, as `spriteManager:getSprite` reads one frame. `nil` when the --- client cannot read the group now (before the login screen, a group not in the cache --- yet) or for a `fileId` other than 0 (a sprite group's one file). `source` is --- `client:getIndexSprites()`; another index raises. getSprites: (Client, IndexDataBase, number, number) -> {SpritePixels}?, --- A sprite of `pixels` (`width * height` ints, row by row, as given: `getPixels()` --- answers them back unchanged, alpha included, and 0 draws nothing). createSpritePixels: (Client, {number}, number, number) -> SpritePixels, --- Item `itemId`'s inventory sprite as the client draws it (`quantity`, `border`, --- `shadowColor`, `stackable` mode, `scale`), at once on the game thread; nil when it --- cannot be drawn now. `noted` must be false (a noted item is its own id) and `scale` --- 512, else it is an error. Drawn only at the login screen or logged in: while --- logging in, loading or hopping this answers nil until the state is back. createItemSprite: (Client, number, number, number, number, number, boolean, number) -> SpritePixels?, --- The world map's view (whether or not it is open). getWorldMap: (Client) -> WorldMap, --- Cache enum `id`, loaded on demand. getEnum: (Client, number) -> EnumComposition, --- DB row `rowID`'s values in `column` at tuple position `tupleIndex` (0-based): one --- per tuple the row holds there, or its table's default when the row does not set --- the column; empty when neither does. Numbers and strings (a value past 2^53 as its --- decimal string). Raises "tuple index too large", and for a column the table does --- not have. The client's own caches, on the game thread only. getDBTableField: (Client, number, number, number) -> { number | string }, --- The rows of DB table `table` whose `column` holds `value` at tuple position --- `tupleIndex` (0-based), in the client's index order; empty when none does. `value` is --- a whole number (it matches an int or long column) or a string (a string column); --- anything else matches nothing. The client's own DB table index, loaded through its --- cache, on the game thread only. Raises for a tuple position the column does not have, --- for a table the client has no index for, and on a client whose table has the client's --- index getters off. getDBRowsByValue: (Client, number, number, number, any) -> {number}, --- Every row of DB table `table`, in the client's index order (its master index), or --- `nil` when the client has none for it. On the game thread only; raises as --- `getDBRowsByValue` does. getDBTableRows: (Client, number) -> {number}?, --- Map element definition `id` (the client loads them all once, at the cache load). --- Raises for an id past the definitions, before the load, and on a client whose table --- does not place the definitions. getMapElementConfig: (Client, number) -> MapElementConfig, --- Cache struct `id`. getStructComposition: (Client, number) -> StructComposition, --- A new client-side scene entity of this plugin, inactive, a `ClientObject` --- Drawn by the client's own scene in SD, --- and by its HD renderer in HD from the HD model the same recipe builds. createClientObject: (Client) -> ClientObject, --- `(Client, number) -> Model?`: --- Cache model `id`, lit with `ModelData`'s defaults; `nil` when the cache has no such --- model (the SD model in either mode). Raises off the game thread or before the --- client is attached. --- --- `(Client, number, {number}?, {number}?) -> Model?`: --- Cache model `id` with each `colorToFind[i]` face colour replaced by --- `colorToReplace[i]` (HSL, a signed 16-bit value or its unsigned value), lit with --- `ModelData`'s defaults; `nil` when the cache has no such model. A `colorToReplace` --- shorter than `colorToFind` raises. loadModel: (Client, number, {number}?, {number}?) -> Model?, --- Cache model `id`'s data, to recolour and light; `nil` when the cache has no such --- model. Each call makes a new one, so a recolour never reaches another. loadModelData: (Client, number) -> ModelData?, --- Sequence `id`, for `ClientObject:setAnimation`; `nil` for one with no frames that is --- not skeletal. loadAnimation: (Client, number) -> Animation?, --- The client's frame buffer: the canvas-sized ARGB image the client draws its whole --- interface into (the 3D scene is drawn on the GPU and composited under it), or nil --- before the client has made it. `getPixels()` is that buffer itself, read and written --- in place. Game thread only; raises on a client whose table has the frame buffer off. --- The handle follows the client's current buffer, so one kept across a canvas resize --- answers the new size and pixels. getBufferProvider: (Client) -> BufferProvider?, } --- A cache enum (a key to value table), read from the client's definition when a --- member is called. export type EnumComposition = { --- How many entries. size: (EnumComposition) -> number, --- Every key, in the enum's order. getKeys: (EnumComposition) -> {number}, --- Every int value, in key order. getIntVals: (EnumComposition) -> {number}, --- Every string value, in key order. getStringVals: (EnumComposition) -> {string}, --- The int value at `key`, or the enum's default. getIntValue: (EnumComposition, number) -> number, --- The string value at `key`, or the enum's default. getStringValue: (EnumComposition, number) -> string, --- The long value at `key`, or the enum's default. getLongValue: (EnumComposition, number) -> number, } --- A definition with params (a struct, an item, an NPC type). Its params are read with the --- client's own lookups, with the param's default where the definition does not set one: a --- struct's and an item's on the game thread only, an NPC type's from its own param map on --- any thread. A set param asked as the other kind raises. An NPC type's unset param --- answers 0 / `""` where its definition is out of reach: the client never loaded it, or --- the table does not place the client's `ParamType` cache, and where the unset param is of --- the other kind. export type ParamHolder = { --- Int param `paramID`, or the param's default when this does not set it; raises --- when this sets it as a string. An NPC type's default is 0 where the table does not --- place the `ParamType` cache. getIntValue: (ParamHolder, number) -> number, --- String param `paramID`, or the param's default when this does not set it; --- raises when this sets it as an int. An NPC type's default is `""` where the table --- does not place the `ParamType` cache. getStringValue: (ParamHolder, number) -> string, } --- A cache struct, a bag of params. export type StructComposition = ParamHolder & { --- The struct's id. getId: (StructComposition) -> number, } --- An item's definition (`client:getItemDefinition(id)`, --- `itemManager:getItemComposition(id)`), loaded through the client's cache on demand. export type ItemComposition = ParamHolder & { --- The item's id. getId: (ItemComposition) -> number, --- The name, as the client shows it ("Members object" for a members item on a free --- world). getName: (ItemComposition) -> string, --- The name as on a members world. getMembersName: (ItemComposition) -> string, --- The note template (799) for a noted item, else -1. getNote: (ItemComposition) -> number, --- The other side of the note link (the noted item for an unnoted one, and back), --- else -1. getLinkedNoteId: (ItemComposition) -> number, --- The bank placeholder's id (or, for a placeholder, the item's), else -1. getPlaceholderId: (ItemComposition) -> number, --- The placeholder template (14401) for a placeholder, else -1. getPlaceholderTemplateId: (ItemComposition) -> number, --- The store value. getPrice: (ItemComposition) -> number, --- The high alchemy value: `getPrice() * 0.6` in single precision, truncated. getHaPrice: (ItemComposition) -> number, --- Whether it is a members item. isMembers: (ItemComposition) -> boolean, --- Whether it stacks. isStackable: (ItemComposition) -> boolean, --- Whether the Grand Exchange trades it. isGeTradeable: (ItemComposition) -> boolean, --- The inventory actions, five slots, nil where there is none. Holes are `nil` and --- the array carries `n`, its length: walk it `for i = 1, actions.n`. `table.find` --- stops at the first hole, so search it with your own `contains(actions, x)` that --- walks to `n`. getInventoryActions: (ItemComposition) -> { n: number, [number]: string? }, --- Each inventory action's sub-options (nil where an action has none). getSubops: (ItemComposition) -> {{ n: number, [number]: string? }}, --- The inventory action shift-click runs (0-based), -1 for none. getShiftClickActionIndex: (ItemComposition) -> number, } --- An NPC type, a `ParamHolder` (its params are `getIntValue` / `getStringValue`, read --- from the type's own param map on any thread). Read live, where an NPC or the --- client's type cache holds it. --- --- `__eq`: `==`: the same type, so it holds for two reads of one type. export type NPCComposition = ParamHolder & { --- The type's name (`"null"` for one with none, as the cache stores it). getName: (NPCComposition) -> string, --- The type's id. getId: (NPCComposition) -> number, --- The type's five right-click actions, `nil` where one is empty. Holes are `nil` --- and the array carries `n`, its length: walk it `for i = 1, actions.n`. --- `table.find` stops at the first hole, so search it with your own --- `contains(actions, x)` that walks to `n`. getActions: (NPCComposition) -> { n: number, [number]: string? }, --- The type's transform table (ids by varbit value), `nil` for a type with none. getConfigs: (NPCComposition) -> {number}?, --- The type this one shows as now: the configs entry its varbit (or varp) value --- picks, the last one when the value is out of range; `nil` when that entry is -1, --- or the type has no configs. transform: (NPCComposition) -> NPCComposition?, --- The type's size in tiles. getSize: (NPCComposition) -> number, --- The type's combat level. getCombatLevel: (NPCComposition) -> number, --- Whether the type is a follower (a pet). isFollower: (NPCComposition) -> boolean, --- Whether the type can be interacted with. isInteractible: (NPCComposition) -> boolean, --- Whether the type shows on the minimap. isMinimapVisible: (NPCComposition) -> boolean, --- The type's six levels, in `STAT_*` order: attack, defence, strength, hitpoints, --- ranged, magic (1 each where the cache sets none). Raises on a client build whose --- offset table does not place them. `getCombatStats()` has them by name, with the --- type's bonuses. getStats: (NPCComposition) -> {number}, --- Bento-only: the type's levels and bonuses by name (an `NpcCombatStats`). The --- bonuses are the params the game cache sets on the type; the game server keeps its --- own copy, which a script can override. Raises where `getStats()` does, and when the --- client no longer holds the type. getCombatStats: (NPCComposition) -> NpcCombatStats, --- Bento-only: game ticks between the type's attacks, as the game cache sets it --- (param 14, 4 where it sets none). A boss whose script paces its attacks itself can --- differ: TzTok-Jad's reads 4 although he attacks every 8 ticks. getAttackSpeedTicks: (NPCComposition) -> number, --- Bento-only: the kind of hit the type's attack is, as the game cache sets it --- (param 26): `"stab"`, `"slash"`, `"crush"` (where it sets none), `"ranged"` or --- `"magic"`, `nil` for a value that is not known. A monster with several attacks --- has one here. getAttackType: (NPCComposition) -> string?, --- Bento-only: the slayer task the type counts for, as the id the `SLAYER_TARGET` var --- holds for that task (42 abyssal demons; Vorkath's is 25, blue dragons), `nil` for --- none (param 50). getSlayerTaskId: (NPCComposition) -> number?, --- Bento-only: the item id the type leaves on death, its bones or ashes (param 46: --- Bones, 526, where the cache sets none), `nil` for an NPC that leaves nothing. getDeathItem: (NPCComposition) -> number?, --- Bento-only: whether the cache marks the type a dragon (the dragonbane weapons). isDragon: (NPCComposition) -> boolean, --- Bento-only: whether the cache marks the type a kalphite (the keris), scarabs --- included. isKalphite: (NPCComposition) -> boolean, --- Bento-only: whether the cache marks the type a golem (the barronite mace), --- gargoyles included. isGolem: (NPCComposition) -> boolean, --- Bento-only: whether the cache marks the type xerician (a Chambers of Xeric --- monster). isXerician: (NPCComposition) -> boolean, --- Whether `other` equals this NPCComposition, as `==` answers it (`false` for a value of another class). equals: (NPCComposition, any) -> boolean, } export type NPCCompositionClass = { --- `getStats()`'s attack level index (0; Luau's array is 1-based, so --- `getStats()[NPCComposition.STAT_ATTACK + 1]`). STAT_ATTACK: number, --- `getStats()`'s defence level index (1). STAT_DEFENCE: number, --- `getStats()`'s strength level index (2). STAT_STRENGTH: number, --- `getStats()`'s hitpoints level index (3). STAT_HITPOINTS: number, --- `getStats()`'s ranged level index (4). STAT_RANGED: number, --- `getStats()`'s magic level index (5). STAT_MAGIC: number, } --- `NPCComposition`'s static functions and constants. declare NPCComposition: NPCCompositionClass --- Bento-only: an NPC type's levels and equipment-style bonuses --- (`NPCComposition:getCombatStats()`), as read when it was handed out. export type NpcCombatStats = { --- Attack level. attack: number, --- Defence level. defence: number, --- Strength level. strength: number, --- Hitpoints level: the NPC's full health. hitpoints: number, --- Ranged level. ranged: number, --- Magic level. magic: number, --- Stab attack bonus. attackStab: number, --- Slash attack bonus. attackSlash: number, --- Crush attack bonus. attackCrush: number, --- Magic attack bonus. attackMagic: number, --- Ranged attack bonus. attackRanged: number, --- Stab defence bonus. defenceStab: number, --- Slash defence bonus. defenceSlash: number, --- Crush defence bonus. defenceCrush: number, --- Magic defence bonus. defenceMagic: number, --- Ranged defence bonus: `nil` for every NPC but the sailing sea creatures, as the --- game cache holds no ranged defence for the rest. defenceRanged: number?, --- Melee strength bonus. meleeStrength: number, --- Ranged strength bonus. rangedStrength: number, --- Magic damage bonus, in percent. magicDamage: number, } --- One slot's Grand Exchange offer, as read when it was handed out. export type GrandExchangeOffer = { --- How many items have been traded. getQuantitySold: (GrandExchangeOffer) -> number, --- The item. getItemId: (GrandExchangeOffer) -> number, --- How many items the offer is for. getTotalQuantity: (GrandExchangeOffer) -> number, --- The price per item. getPrice: (GrandExchangeOffer) -> number, --- Coins spent (or received) so far. getSpent: (GrandExchangeOffer) -> number, --- Where the offer is: buying, bought, cancelled, ... or empty. getState: (GrandExchangeOffer) -> GrandExchangeOfferState, } --- Where a varbit lives. export type VarbitComposition = { --- The varp the varbit is in. getIndex: (VarbitComposition) -> number, --- Its lowest bit. getLeastSignificantBit: (VarbitComposition) -> number, --- Its highest bit. getMostSignificantBit: (VarbitComposition) -> number, } --- One of the client's cache indexes, as `client:getIndex(id)`, `getIndexConfig()`, --- `getIndexSprites()` and `getIndexScripts()` hand them out. export type IndexDataBase = { --- Whether any of Bento's script overlays in this index was kept back because the --- game's file changed and Bento could not re-apply its patch to it (it re-applies the --- patch where it can); once true it stays true. `false` for an index Bento overlays --- nothing in. isOverlayOutdated: (IndexDataBase) -> boolean, --- The ids of group `groupId`'s files, ascending (empty for a group with no files), read --- from the client's own index of this archive; `nil` for a group the index does not --- list. A copy. On the game thread only; raises before the client has the archive's --- index and on a client whose table does not place its archive tables. getFileIds: (IndexDataBase, number) -> {number}?, --- File `fileId` of group `groupId`, as the game's cache holds it once unpacked: its --- bytes as signed numbers (-128 to 127; `bit32.band(b, 255)` is the unsigned byte), a --- copy. `nil` for a group or file the index does not list, and for a file the client --- has not fetched yet: asking makes the client fetch it as it would for itself, so --- ask again on a later tick. Reading leaves the client's own copy of the file as it --- was. On the game thread only; raises before the client has the archive's index and --- on a client whose table has the cache file getter off. loadData: (IndexDataBase, number, number) -> {number}?, } --- A world description, made by `client:createWorld()` and filled in with the setters, --- for `changeWorld` / `hopToWorld` (which use its id). export type World = { --- The world number. getId: (World) -> number, --- Set the world number. setId: (World, number) -> (), --- Its types. getTypes: (World) -> {[WorldType]: boolean}, --- Set its types. setTypes: (World, {[WorldType]: boolean}) -> (), --- How many players are on it. getPlayerCount: (World) -> number, --- Set the player count. setPlayerCount: (World, number) -> (), --- Its location (region) code. getLocation: (World) -> number, --- Set the location code. setLocation: (World, number) -> (), --- Its index in the client's world list. getIndex: (World) -> number, --- Set the index. setIndex: (World, number) -> (), --- Its activity text. getActivity: (World) -> string, --- Set the activity text. setActivity: (World, string) -> (), --- Its host address. getAddress: (World) -> string, --- Set the host address. setAddress: (World, string) -> (), } --- One of the client's own lists, not a copy: each walk and each `clear()` reads the --- list as it is then. `for _, x in deque do` walks it oldest first. Which list, and --- what it holds, is the subclass's: `AmbientSoundEffectDeque` --- (`client:getAmbientSoundEffects()`). Not here: `addLast` (a plugin cannot add to the --- client's lists). --- --- `__eq`: `==`: the same list of the client's. export type Deque = { --- Whether `other` equals this Deque, as `==` answers it (`false` for a value of another class). equals: (Deque, any) -> boolean, } --- What `client:getAmbientSoundEffects()` returns: the top-level world view's --- ambient sound list, of `AmbientSoundEffect`. --- --- `__eq`: `==`: the same list of the client's. --- `__iter`: Every ambient sound in the list now, oldest first. Raises on a client whose export type AmbientSoundEffectDeque = Deque & { --- Stop every ambient sound in the list (game thread only): the list is empty after --- it. The client's own stop does it, the one a scene reload makes, so a sound --- already playing fades out over 150 ms. Nothing happens when the list is empty. --- Raises on a client whose table does not place the list. clear: (AmbientSoundEffectDeque) -> (), } --- One ambient sound of `client:getAmbientSoundEffects()`, a loc's or an NPC's looping area --- sound. Its id and plane are what the client held when the list was walked. --- --- `__eq`: Whether both are the same sound of the client's. export type AmbientSoundEffect = { --- The sound effect's id (`SoundEffectID`), -1 for none. getSoundEffectId: (AmbientSoundEffect) -> number, --- The background sound effect ids, one of which plays at random now and then, or nil --- when it has none. Read from the client while it still holds the sound (in the --- list, or fading out after a `clear()`), in whichever world view holds it (a boat's --- included); nil once the client has dropped it or made another sound at its --- address. getBackgroundSoundEffectIds: (AmbientSoundEffect) -> {number}?, --- The plane it is on. getPlane: (AmbientSoundEffect) -> number, --- Whether `other` equals this AmbientSoundEffect, as `==` answers it (`false` for a value of another class). equals: (AmbientSoundEffect, any) -> boolean, } --- A map element definition (`client:getMapElementConfig(id)`), the cache config the world map --- draws an icon of (`WorldMapIcon:getType()` names one). export type MapElementConfig = { --- The definition's category (its opcode 19), -1 when it has none. getCategory: (MapElementConfig) -> number, } --- The client's own settings, read (and written) live. Every getter raises on a client --- whose table does not place them, and each setter on one whose table has it off. --- --- `__eq`: `==`: always (there is one). export type Preferences = { --- The username the login screen remembers ("" when none is). getRememberedUsername: (Preferences) -> string, --- Set the username the login screen remembers: the client's own setting's text, written --- in place; nothing is saved now (the client saves it with its preferences) and the --- login screen's field is not changed (`client:setUsername(name)` does that). Game --- thread only; raises for text longer than 255 bytes or holding a NUL. setRememberedUsername: (Preferences, string) -> (), --- The sound effect volume, 0 (muted) to 127 (`SoundEffectVolume`): the client's own --- 0..100 setting on that scale (its five steps 0, 25, 50, 75 and 100 are 0, 32, 64, --- 96 and 127). getSoundEffectVolume: (Preferences) -> number, --- Set the sound effect volume (0..127, as `getSoundEffectVolume`): the client plays --- its next sound effects at it; nothing is saved and the settings menu's slider is --- not moved. Game thread only; raises outside 0..127. setSoundEffectVolume: (Preferences, number) -> (), --- Whether `other` equals this Preferences, as `==` answers it (`false` for a value of another class). equals: (Preferences, any) -> boolean, } --- The client's own texture provider, as `client:getTextureProvider()` hands it out: the --- brightness its textures are made at, the textures, and their pixels. Every member raises --- on a client whose table does not place the provider. --- --- `__eq`: `==`: always (there is one). export type TextureProvider = { --- The brightness the client makes its textures at: lower is brighter, 0.9, 0.8, 0.7 --- and 0.6 for the game's four brightness steps (the client's own "Brightness" --- setting, 0..100, as the client applies it, `1 - v / 200`, `v + 10` while the --- client raises it, so a value between the steps reads proportionally), or what --- `setBrightness` last set. Raises on a client whose table does not place its --- settings, and before the client has its preferences. getBrightness: (TextureProvider) -> number, --- The client's textures, by id: texture `id` is at `textures[id + 1]`, nil where --- the client has no texture at that id, and `n` holds the length --- (`for i = 1, textures.n do`). Raises before the client has made its textures (its --- loader makes them once, at start-up). getTextures: (TextureProvider) -> { n: number, [number]: Texture? }, --- Make the client's textures at `brightness` from now on (lower is brighter): the --- client's own setter, which drops every texture's pixels, so `load` makes them again --- at it and `getBrightness` answers it. The scene on screen is drawn from the --- renderer's own copy of the textures, which the client makes again only when its --- brightness option changes, so this changes what `load` and `getBrightness` answer --- and the pixels the client's next upload takes, not the scene now; the game's option --- sets its own brightness back when the player changes it; and inside a frame's draw --- (an overlay's `render`, a `BeforeRender` subscriber) it applies at the top of the --- next client cycle. Game thread only; raises before the client has made its textures. setBrightness: (TextureProvider, number) -> (), --- Texture `id`'s pixels at the provider's brightness: `size * size` ARGB colours (128 x --- 128), made as the client makes them (it keeps 20 textures' pixels and drops the least --- recently used, and marks the texture used), or nil for no texture at `id` or one --- whose sprite the client has not got yet. A copy: writing it changes nothing in the --- client. Game thread only; raises for an `id` outside `getTextures()` and before the --- client has made its textures. load: (TextureProvider, number) -> {number}?, --- Whether `other` equals this TextureProvider, as `==` answers it (`false` for a value of another class). equals: (TextureProvider, any) -> boolean, } --- One of the client's textures, from `TextureProvider:getTextures()`. --- Its animation is here; its pixels are `TextureProvider:load(id)`'s. --- --- `__eq`: `==`: the same texture of the client's. export type Texture = { --- How the texture scrolls: 0 not at all, 1 to 4 the four ways it can (1 and 2 up and --- down, 3 and 4 sideways), from the game cache; fixed for the client's run. getAnimationDirection: (Texture) -> number, --- How far the texture scrolls each client cycle, in pixels, from the game cache; fixed --- for the client's run. getAnimationSpeed: (Texture) -> number, --- Whether `other` equals this Texture, as `==` answers it (`false` for a value of another class). equals: (Texture, any) -> boolean, } --- The client's frame buffer, as `client:getBufferProvider()` hands it out. The pixels are --- straight (not premultiplied) ARGB: the interface opaque (alpha `0xff`), translucent --- fills at their alpha, and the 3D viewport transparent (0), because the client draws the --- scene on the GPU and composites this buffer over it. --- --- `__eq`: `==`: always (there is one). export type BufferProvider = { --- The buffer itself: `pixels[i]` reads pixel `i - 1` (row by row, `getWidth()` pixels a --- row) as a signed 32-bit int, `pixels[i] = argb` stores it in the frame now (an int, or --- its unsigned 32-bit form as `bit32` gives it), and `#pixels` is --- `getWidth() * getHeight()`. Past the end a read is nil and a write raises. Every access --- is the client's buffer as it is now. Inside an overlay's `render`, a layer's --- `Graphics2D` draws reach the buffer after every overlay of that layer has rendered, so --- a pixel written there lands under them and a read does not see them yet. Outside the --- frame's draw (an event, a client tick) the buffer is the other of the client's two --- frame buffers: it holds the frame before the last one shown, and the next frame clears --- it before drawing, so a write there is never shown. Game thread only. getPixels: (BufferProvider) -> {number}, --- The buffer's width: the canvas width in pixels, one row of `getPixels()`. getWidth: (BufferProvider) -> number, --- The buffer's height: the canvas height in pixels. getHeight: (BufferProvider) -> number, --- Whether `other` equals this BufferProvider, as `==` answers it (`false` for a value of another class). equals: (BufferProvider, any) -> boolean, } --- Bento's rendering, the `gfx` global: whether the client draws in HD, and the post-process --- pipeline with its passes, params, lights and colour LUT. A plugin selects passes and --- supplies numbers; the shaders are the host's. Every post-process member but `isAvailable` --- raises on a client whose table has the pipeline off. export type Gfx = { --- Whether the client is drawing with its HD renderer right now (`client.HD_ACTIVE`). --- Raises on a build that does not place that field, rather than answering --- false: false is SD. isHdActive: (Gfx) -> boolean, --- Whether HD has been asked for (`client.HD_REQUESTED`). It can differ from --- `isHdActive`: the client picks the request up when it next applies it. --- Raises on a build that does not place that field. isHdRequested: (Gfx) -> boolean, --- Whether the GL context records its draws for the deferred-render thread to replay --- (the render preferences' deferred-rendering flag). Raises on a build that --- does not place it, or before the client has its render preferences. isDeferredRendering: (Gfx) -> boolean, --- Whether the client holds an HD renderer (its renderer global is non-zero). --- False in SD. Raises on a build that does not place the global, or when it cannot be --- read. hasHdRenderer: (Gfx) -> boolean, --- Ask the client for HD (`true`) or SD (`false`) through its own switch, applied at the --- top of the next client tick, which clears its model caches and reloads the scene; --- nothing happens if it is already in that mode. Not a write of the request --- byte: that alone would leave the request and `isHdActive` disagreeing. Game thread --- only; raises when not logged in, when the client forbids HD, and on a client whose --- table has the switch off. setHdRequested: (Gfx, boolean) -> (), --- Which look HD draws with: the full one (`true`: sun, skybox, the map's environment), or --- the client's flat-lit default (`false`). Holds for the session, including the default the --- client puts back at each login, and waits for HD if asked in SD. Changing it while HD is --- on reloads the scene. Raises on a client whose table has the switch off. setHdLook: (Gfx, boolean) -> (), --- Whether the post-process pipeline can run on this client. isAvailable: (Gfx) -> boolean, --- What holds on this client: any of "postfx", "environment" and "depth" (the fog and sky --- passes may read scene depth on this build), "lights" and "typeOverrides". Empty where the pipeline --- cannot run. Cheap enough for every tick. It is about the build, not a frame: --- `getPassState` says when a pass stood aside, `getDepthSource` where depth came from. getCapabilities: (Gfx) -> {string}, --- Why the pipeline cannot run here, for a settings page: "" when it can. getUnavailableReason: (Gfx) -> string, --- Every pass, in the order they run. getPasses: (Gfx) -> {string}, --- Ask for a pass or stop asking. Asking again brings back a pass the frame budget --- dropped. Raises on a pass that does not exist. setPassEnabled: (Gfx, string, boolean) -> (), --- Whether a pass is asked for. isPassEnabled: (Gfx, string) -> boolean, --- What a pass is doing: "off", "on", "failed" (its shader or GL failed, off for the --- session) or "dropped" (over the frame budget, ask again to bring it back). getPassState: (Gfx, string) -> string, --- Set a param, `pass.knob`, or `budget.ms`. Raises on a name that does not exist and on --- a value outside its range, rather than clamping, so a data bug shows. setParam: (Gfx, string, number) -> (), --- A param's value. getParam: (Gfx, string) -> number, --- Replace the lights: a flat list of x, y, z, radius, r, g, b, strength. x and y are world --- tiles (fractions allowed), z is height above the ground in tiles, radius is in tiles and --- rgb is 0 to 1. A light off the loaded scene is left out. Call it when the set changes --- and after a scene load. setLights: (Gfx, {number}) -> (), --- Remove every light. clearLights: (Gfx) -> (), --- Replace the colour LUT: packed ARGB of a size by size by size cube, as a size*size by --- size strip. `grade.lut` says how much of it shows. setLut: (Gfx, {number}, number) -> (), --- Where the depth passes got depth last frame: "none", "sd-copy", "sd-resolve" or "hd". getDepthSource: (Gfx) -> string, --- The last frame's post-process cost in milliseconds. getFrameMs: (Gfx) -> number, --- The client's own anti-aliasing level, with `2 ^ level` samples. `nil` where it cannot run --- on this build. getAntiAliasing: (Gfx) -> number?, --- The highest level `setAntiAliasing` takes. `nil` where it cannot run on this build. getAntiAliasingMax: (Gfx) -> number?, --- Ask for the client's own anti-aliasing at a level, set at the top of the next client tick --- through its own setting, so it is the player's setting too and is saved with their --- preferences. A renderer switch can put back the level the client cached, so set it after --- one. False where it cannot run on this build, or for a negative level. setAntiAliasing: (Gfx, number) -> boolean, --- Replace textures on a type: `kind` is "loc", "npc", "obj", "spotanim" or "kit", `find` --- and `replace` are the client's texture ids, paired. Put back each time the client builds --- that type, so one call at startup lasts; a type it already loaded takes it at the next --- `flushOverrides`. An NPC only changes textures it already replaces. In SD an untextured --- model cannot gain a texture. False when overrides cannot run here, the kind is unknown, --- or the lists do not pair up; an id that never loads is simply never used. setRetexture: (Gfx, string, number, {number}, {number}) -> boolean, --- Set an overlay's texture, shown from the next scene build. False when the overlay does --- not exist or overlays are not loaded yet. setOverlayTexture: (Gfx, number, number) -> boolean, --- Forget every retexture and put every overlay back. Types the client already rebuilt keep --- their lists until `flushOverrides`. clearOverrides: (Gfx) -> (), --- Have the client rebuild its types and reload the scene at the top of the next tick, with --- its loading screen. For types it had already loaded when their overrides were registered. --- False where overrides cannot run, or the client is not logged in by then. flushOverrides: (Gfx) -> boolean, } --- An NPC appeared: raised after the NPC update that added it, before that update's --- `NpcChanged` events. export type NpcSpawned = { --- The NPC; never `nil`. From a legacy (differ) delivery read after the NPC left --- the map, the handle it had, with its last-known values. getNpc: (NpcSpawned) -> NPC, } export type NpcSpawnedClass = { --- `"NpcSpawned"`: the class's name, which host APIs that take the class itself read. __eventClass: string, } --- `NpcSpawned`'s static functions and constants. declare NpcSpawned: NpcSpawnedClass --- An NPC is leaving: raised before the game removes it, so it is still readable. export type NpcDespawned = { --- The NPC, readable for the length of the event; never `nil`. From a legacy (differ) --- delivery, made after it left the map, the handle it had, with its last-known values. getNpc: (NpcDespawned) -> NPC, } export type NpcDespawnedClass = { --- `"NpcDespawned"`: the class's name, which host APIs that take the class itself read. __eventClass: string, } --- `NpcDespawned`'s static functions and constants. declare NpcDespawned: NpcDespawnedClass --- An NPC's composition changed (a transform): raised at the end of the NPC update, --- after its `NpcSpawned` events. export type NpcChanged = { --- The NPC; never `nil`. From a legacy (differ) delivery read after the NPC left --- the map, the handle it had, with its last-known values. getNpc: (NpcChanged) -> NPC, --- The composition the NPC had before the change. getOld: (NpcChanged) -> NPCComposition?, } export type NpcChangedClass = { --- `"NpcChanged"`: the class's name, which host APIs that take the class itself read. __eventClass: string, } --- `NpcChanged`'s static functions and constants. declare NpcChanged: NpcChangedClass --- A player appeared in a world view: raised after the player update that added it. export type PlayerSpawned = { --- The player; never `nil`. From a legacy (differ) delivery read after the player --- left the map, the handle it had, with its last-known values. getPlayer: (PlayerSpawned) -> Player, } export type PlayerSpawnedClass = { --- `"PlayerSpawned"`: the class's name, which host APIs that take the class itself read. __eventClass: string, } --- `PlayerSpawned`'s static functions and constants. declare PlayerSpawned: PlayerSpawnedClass --- A player is leaving a world view: raised before the game removes it, so it is --- still readable. The local player is not filtered out. export type PlayerDespawned = { --- The player, readable for the length of the event; never `nil`. From a legacy (differ) --- delivery, made after it left the map, the handle it had, with its last-known values. getPlayer: (PlayerDespawned) -> Player, } export type PlayerDespawnedClass = { --- `"PlayerDespawned"`: the class's name, which host APIs that take the class itself read. __eventClass: string, } --- `PlayerDespawned`'s static functions and constants. declare PlayerDespawned: PlayerDespawnedClass --- A player's appearance was decoded (equipment, kits, colours, name). export type PlayerChanged = { --- The player; never `nil`. From a legacy (differ) delivery read after the player --- left the map, the handle it had, with its last-known values. getPlayer: (PlayerChanged) -> Player, } export type PlayerChangedClass = { --- `"PlayerChanged"`: the class's name, which host APIs that take the class itself read. __eventClass: string, } --- `PlayerChanged`'s static functions and constants. declare PlayerChanged: PlayerChangedClass --- An actor's animation was assigned (it started one, or one ended: -1). An NPC's --- changes inside an NPC update are delivered at that update's end, after its spawns. export type AnimationChanged = { --- The actor; read `getAnimation()` on it for the new animation. Never `nil`: from --- a legacy (differ) delivery about an actor that has left the map since, the --- handle it had, with its last-known values. getActor: (AnimationChanged) -> Actor, --- The animation before the change, -1 for none. getOldAnimation: (AnimationChanged) -> number, } export type AnimationChangedClass = { --- `"AnimationChanged"`: the class's name, which host APIs that take the class itself read. __eventClass: string, } --- `AnimationChanged`'s static functions and constants. declare AnimationChanged: AnimationChangedClass --- An actor's interacting target was assigned. A player's on every assignment; an --- NPC's only when the target changed: the client writes an NPC's target inline in --- its mask decode, so a re-sent identical target is not seen. export type InteractingChanged = { --- The actor whose target changed. `nil` from a legacy delivery (a client where the --- actor sites do not install), which does not say whether it is an NPC or a player. getSource: (InteractingChanged) -> Actor?, --- The actor it targets now, `nil` for none. getTarget: (InteractingChanged) -> Actor?, } export type InteractingChangedClass = { --- `"InteractingChanged"`: the class's name, which host APIs that take the class itself read. __eventClass: string, } --- `InteractingChanged`'s static functions and constants. declare InteractingChanged: InteractingChangedClass --- A hit splat was applied to an actor, whether or not the game keeps it to draw. export type HitsplatApplied = { --- The actor hit; never `nil`. From a legacy (differ) delivery read after the --- actor left the map, the handle it had, with its last-known values. getActor: (HitsplatApplied) -> Actor, --- The hit splat. getHitsplat: (HitsplatApplied) -> Hitsplat, } export type HitsplatAppliedClass = { --- `"HitsplatApplied"`: the class's name, which host APIs that take the class itself read. __eventClass: string, } --- `HitsplatApplied`'s static functions and constants. declare HitsplatApplied: HitsplatAppliedClass --- A spot animation was set on (or cleared from) an actor; read `getGraphic()` or --- `getSpotAnims()` on it. export type GraphicChanged = { --- The actor. `nil` from a legacy delivery (a client where the actor sites do not install), --- which does not say whether it is an NPC or a player. getActor: (GraphicChanged) -> Actor?, } export type GraphicChangedClass = { --- `"GraphicChanged"`: the class's name, which host APIs that take the class itself read. __eventClass: string, } --- `GraphicChanged`'s static functions and constants. declare GraphicChanged: GraphicChangedClass --- An actor's overhead text was assigned (public chat, a forced line, a script). A --- handler may replace it with `getActor():setOverheadText(text)`. export type OverheadTextChanged = { --- The actor. `nil` from a legacy delivery (a client where the actor sites do not install), --- which does not say whether it is an NPC or a player. getActor: (OverheadTextChanged) -> Actor?, --- The text assigned. getOverheadText: (OverheadTextChanged) -> string, } export type OverheadTextChangedClass = { --- `"OverheadTextChanged"`: the class's name, which host APIs that take the class itself read. __eventClass: string, } --- `OverheadTextChanged`'s static functions and constants. declare OverheadTextChanged: OverheadTextChangedClass --- An actor died: one of the death health bars reached 0 (`isDead()` is true from --- now until a bar rises again). export type ActorDeath = { --- The actor; never `nil`. From a legacy (differ) delivery read after the actor left --- the map, the handle it had, with its last-known values. getActor: (ActorDeath) -> Actor, } export type ActorDeathClass = { --- `"ActorDeath"`: the class's name, which host APIs that take the class itself read. __eventClass: string, } --- `ActorDeath`'s static functions and constants. declare ActorDeath: ActorDeathClass --- A health-bar type was decoded: a handler may restyle it (an interface style --- swapping its sprites). export type PostHealthBarConfig = { --- The health-bar type, as it reads now (`nil` from a legacy delivery, which --- carries only its id). getHealthBarConfig: (PostHealthBarConfig) -> HealthBarConfig?, } export type PostHealthBarConfigClass = { --- `"PostHealthBarConfig"`: the class's name, which host APIs that take the class itself read. __eventClass: string, } --- `PostHealthBarConfig`'s static functions and constants. declare PostHealthBarConfig: PostHealthBarConfigClass --- The game constructed a graphics object (a spot animation on a tile: a spell --- splash, a cannonball's impact, Zalcano's falling rocks). Raised at the end of the --- constructor, its only creation path. export type GraphicsObjectCreated = { --- The graphics object. getGraphicsObject: (GraphicsObjectCreated) -> GraphicsObject?, } export type GraphicsObjectCreatedClass = { --- `"GraphicsObjectCreated"`: the class's name, which host APIs that take the class itself read. __eventClass: string, } --- `GraphicsObjectCreated`'s static functions and constants. declare GraphicsObjectCreated: GraphicsObjectCreatedClass --- A loc's ambient sound was made (a fountain's splash, a fire's crackle): raised as the --- client adds it to its world view's ambient sounds, a scene load's locs one by one --- included. An NPC's ambient sound raises nothing. Raised where the table has the maker --- on; on any other client, never. export type AmbientSoundEffectCreated = { --- The sound just made: the last of its world view's ambient sounds now (for the top --- level, the last of `client:getAmbientSoundEffects()`, and `==` to it). getAmbientSoundEffect: (AmbientSoundEffectCreated) -> AmbientSoundEffect, } export type AmbientSoundEffectCreatedClass = { --- `"AmbientSoundEffectCreated"`: the class's name, which host APIs that take the class itself read. __eventClass: string, } --- `AmbientSoundEffectCreated`'s static functions and constants. declare AmbientSoundEffectCreated: AmbientSoundEffectCreatedClass --- A chat message was added to the chatbox, raised synchronously after the game stored --- it (every line, repeated ones included). Change the line through `getMessageNode()`; --- the event's own setters only change what later subscribers read. export type ChatMessage = { --- The message in the chatbox: edit it with `setValue`, `setName`, --- `setClientFormatMessage`. `nil` for a message the differ reported. getMessageNode: (ChatMessage) -> MessageNode?, --- The message's type: `CLAN_GIM_CHAT` / `CLAN_GIM_MESSAGE` for a line of your --- group-ironman channel. getType: (ChatMessage) -> ChatMessageType, --- The sender's name as received (icon tags included), `""` for a game message. getName: (ChatMessage) -> string, --- The message's text (a group-ironman line's without the `|` the game stores before --- it). getMessage: (ChatMessage) -> string, --- The friends-chat or clan channel it came through, or `nil`. getSender: (ChatMessage) -> string?, --- When it was added, in seconds since the Unix epoch. getTimestamp: (ChatMessage) -> number, --- Set the node later subscribers read (not the chatbox). setMessageNode: (ChatMessage, MessageNode?) -> (), --- Set the type later subscribers read. setType: (ChatMessage, ChatMessageType) -> (), --- Set the name later subscribers read. setName: (ChatMessage, string?) -> (), --- Set the text later subscribers read (the chatbox keeps its own: use the node's --- `setValue` for that). setMessage: (ChatMessage, string?) -> (), --- Set the channel later subscribers read. setSender: (ChatMessage, string?) -> (), --- Set the timestamp later subscribers read. setTimestamp: (ChatMessage, number) -> (), } export type ChatMessageClass = { --- `"ChatMessage"`: the class's name, which host APIs that take the class itself read. __eventClass: string, } --- `ChatMessage`'s static functions and constants. declare ChatMessage: ChatMessageClass --- A `::command` was typed in the chatbox, raised when the chatbox script reaches its --- command callback (the game still handles the command as it would). export type CommandExecuted = { --- The word after `::` (`""` when a space follows the colons). getCommand: (CommandExecuted) -> string, --- The words after the command, split on single spaces. Lua arrays start at 1. getArguments: (CommandExecuted) -> {string}, } export type CommandExecutedClass = { --- `"CommandExecuted"`: the class's name, which host APIs that take the class itself read. __eventClass: string, } --- `CommandExecuted`'s static functions and constants. declare CommandExecuted: CommandExecutedClass --- You joined or left a friends chat. `FriendsChatSync` also covers the server resending --- the channel you are in. export type FriendsChatChanged = { --- Whether you joined (else left). isJoined: (FriendsChatChanged) -> boolean, } export type FriendsChatChangedClass = { --- `"FriendsChatChanged"`: the class's name, which host APIs that take the class itself read. __eventClass: string, } --- `FriendsChatChanged`'s static functions and constants. declare FriendsChatChanged: FriendsChatChangedClass --- Someone joined your friends chat. export type FriendsChatMemberJoined = { --- Who joined. getMember: (FriendsChatMemberJoined) -> FriendsChatMember, } export type FriendsChatMemberJoinedClass = { --- `"FriendsChatMemberJoined"`: the class's name, which host APIs that take the class itself read. __eventClass: string, } --- `FriendsChatMemberJoined`'s static functions and constants. declare FriendsChatMemberJoined: FriendsChatMemberJoinedClass --- Someone left your friends chat. export type FriendsChatMemberLeft = { --- Who left. getMember: (FriendsChatMemberLeft) -> FriendsChatMember, } export type FriendsChatMemberLeftClass = { --- `"FriendsChatMemberLeft"`: the class's name, which host APIs that take the class itself read. __eventClass: string, } --- `FriendsChatMemberLeft`'s static functions and constants. declare FriendsChatMemberLeft: FriendsChatMemberLeftClass --- The whole friends chat was read: joining, leaving, or the server resending the channel --- you are in. Anything kept from before is out of date. When `isSync()`, a --- `FriendsChatMemberJoined` follows for every member. export type FriendsChatSync = { --- Whether you are in the channel after it: a join or a resync, not leaving. isSync: (FriendsChatSync) -> boolean, } export type FriendsChatSyncClass = { --- `"FriendsChatSync"`: the class's name, which host APIs that take the class itself read. __eventClass: string, } --- `FriendsChatSync`'s static functions and constants. declare FriendsChatSync: FriendsChatSyncClass --- You removed someone from your friends or ignore list. export type RemovedFriend = { --- Who was removed: a `Friend` or an `Ignore`. getNameable: (RemovedFriend) -> Nameable, } export type RemovedFriendClass = { --- `"RemovedFriend"`: the class's name, which host APIs that take the class itself read. __eventClass: string, } --- `RemovedFriend`'s static functions and constants. declare RemovedFriend: RemovedFriendClass --- You joined, left or were sent in full a clan channel, raised when the client sets one --- of its five channel slots. export type ClanChannelChanged = { --- The slot's new channel, or `nil` when you left it. getClanChannel: (ClanChannelChanged) -> ClanChannel?, --- Which slot (`ClanID`): 0 your clan, 1 your group-ironman group, -1 the guest --- channel. getClanId: (ClanChannelChanged) -> number, --- Whether it is the guest channel. isGuest: (ClanChannelChanged) -> boolean, } export type ClanChannelChangedClass = { --- `"ClanChannelChanged"`: the class's name, which host APIs that take the class itself read. __eventClass: string, } --- `ClanChannelChanged`'s static functions and constants. declare ClanChannelChanged: ClanChannelChangedClass --- Someone joined a clan channel you are in. export type ClanMemberJoined = { --- The channel they joined. getClanChannel: (ClanMemberJoined) -> ClanChannel, --- Who joined. getClanMember: (ClanMemberJoined) -> ClanChannelMember, } export type ClanMemberJoinedClass = { --- `"ClanMemberJoined"`: the class's name, which host APIs that take the class itself read. __eventClass: string, } --- `ClanMemberJoined`'s static functions and constants. declare ClanMemberJoined: ClanMemberJoinedClass --- Someone left a clan channel you are in. export type ClanMemberLeft = { --- The channel they left. getClanChannel: (ClanMemberLeft) -> ClanChannel, --- Who left: it answers what it last was. getClanMember: (ClanMemberLeft) -> ClanChannelMember, } export type ClanMemberLeftClass = { --- `"ClanMemberLeft"`: the class's name, which host APIs that take the class itself read. __eventClass: string, } --- `ClanMemberLeft`'s static functions and constants. declare ClanMemberLeft: ClanMemberLeftClass --- A friend, ignore or friends-chat entry lost its previous name because another entry --- of the list now carries it, raised where the client clears it (its list decode), with --- the entry as it is after: `getPrevName()` is `nil`. export type NameableNameChanged = { --- The entry: a `Friend`, an `Ignore` or a `FriendsChatMember`. getNameable: (NameableNameChanged) -> Nameable, } export type NameableNameChangedClass = { --- `"NameableNameChanged"`: the class's name, which host APIs that take the class itself read. __eventClass: string, } --- `NameableNameChanged`'s static functions and constants. declare NameableNameChanged: NameableNameChangedClass --- A server tick ended (every 600 ms while logged in): posted at the top of the client --- cycle after the one whose packets ended it. Carries nothing. export type GameTick = { } export type GameTickClass = { --- `"GameTick"`: the class's name, which host APIs that take the class itself read. __eventClass: string, } --- `GameTick`'s static functions and constants. declare GameTick: GameTickClass --- A logged-in client cycle (every 20 ms) finished its packets and its interface tick; --- the cycle's clientscripts and menu come next. Carries nothing. export type ClientTick = { } export type ClientTickClass = { --- `"ClientTick"`: the class's name, which host APIs that take the class itself read. __eventClass: string, } --- `ClientTick`'s static functions and constants. declare ClientTick: ClientTickClass --- A client cycle ended, in every game state (`clientThread:invokeAtTickEnd` jobs ran just --- before). Carries nothing. export type PostClientTick = { } export type PostClientTickClass = { --- `"PostClientTick"`: the class's name, which host APIs that take the class itself read. __eventClass: string, } --- `PostClientTick`'s static functions and constants. declare PostClientTick: PostClientTickClass --- A frame is about to be drawn. Carries nothing. export type BeforeRender = { } export type BeforeRenderClass = { --- `"BeforeRender"`: the class's name, which host APIs that take the class itself read. __eventClass: string, } --- `BeforeRender`'s static functions and constants. declare BeforeRender: BeforeRenderClass --- The canvas the game draws into changed size (`client:getCanvasWidth()` and --- `getCanvasHeight()` answer the new one). Carries nothing. export type CanvasSizeChanged = { } export type CanvasSizeChangedClass = { --- `"CanvasSizeChanged"`: the class's name, which host APIs that take the class itself read. __eventClass: string, } --- `CanvasSizeChanged`'s static functions and constants. declare CanvasSizeChanged: CanvasSizeChangedClass --- The login screen's username field changed (`client:getUsername()` answers the new --- one). Carries nothing. export type UsernameChanged = { } export type UsernameChangedClass = { --- `"UsernameChanged"`: the class's name, which host APIs that take the class itself read. __eventClass: string, } --- `UsernameChanged`'s static functions and constants. declare UsernameChanged: UsernameChangedClass --- The game state changed. Raised by the runtime at the top of the cycle after the one --- that changed it, for every transition but a logged-in region reload. A plugin's own --- `client:setGameState(GameState.LOADING)` while logged in is posted at the call, and --- the `LOGGED_IN` that ends its reload when the reload ends. export type GameStateChanged = { --- The new state. getGameState: (GameStateChanged) -> GameState, } export type GameStateChangedClass = { --- `"GameStateChanged"`: the class's name, which host APIs that take the class itself read. __eventClass: string, } --- `GameStateChanged`'s static functions and constants. declare GameStateChanged: GameStateChangedClass --- A stat update from the server, a level-unchanged xp drop included. Raised in the --- packet that carried it. export type StatChanged = { --- The skill. getSkill: (StatChanged) -> Skill, --- Its experience. getXp: (StatChanged) -> number, --- Its real level. getLevel: (StatChanged) -> number, --- Its current (boosted or drained) level. getBoostedLevel: (StatChanged) -> number, } export type StatChangedClass = { --- `"StatChanged"`: the class's name, which host APIs that take the class itself read. __eventClass: string, } --- `StatChanged`'s static functions and constants. declare StatChanged: StatChangedClass --- The XP-drop script showed a drop the server did not send (its `fakeXpDrop` --- callback): a skill's xp drop at 200m xp, or a drop a plugin fakes. export type FakeXpDrop = { --- The skill. getSkill: (FakeXpDrop) -> Skill, --- The xp the drop shows. getXp: (FakeXpDrop) -> number, } export type FakeXpDropClass = { --- `"FakeXpDrop"`: the class's name, which host APIs that take the class itself read. __eventClass: string, } --- `FakeXpDrop`'s static functions and constants. declare FakeXpDrop: FakeXpDropClass --- A Grand Exchange slot changed: the server replaced it, or the login reset it (eight --- `EMPTY` offers, before the game state is `LOGGED_IN`). export type GrandExchangeOfferChanged = { --- The slot's offer now. getOffer: (GrandExchangeOfferChanged) -> GrandExchangeOffer, --- The slot, 0..=7. getSlot: (GrandExchangeOfferChanged) -> number, } export type GrandExchangeOfferChangedClass = { --- `"GrandExchangeOfferChanged"`: the class's name, which host APIs that take the class itself read. __eventClass: string, } --- `GrandExchangeOfferChanged`'s static functions and constants. declare GrandExchangeOfferChanged: GrandExchangeOfferChangedClass --- A sound with no position is about to be played. Consume it and it is not. export type SoundEffectPlayed = { --- The sound. getSoundId: (SoundEffectPlayed) -> number, --- Its delay, client cycles. getDelay: (SoundEffectPlayed) -> number, --- Do not play it. consume: (SoundEffectPlayed) -> (), } export type SoundEffectPlayedClass = { --- `"SoundEffectPlayed"`: the class's name, which host APIs that take the class itself read. __eventClass: string, } --- `SoundEffectPlayed`'s static functions and constants. declare SoundEffectPlayed: SoundEffectPlayedClass --- A sound at a scene tile, heard within a range, is about to be played. Consume it and --- it is not. export type AreaSoundEffectPlayed = { --- The sound. getSoundId: (AreaSoundEffectPlayed) -> number, --- The scene tile's x (-1 on a legacy copy, which carried a world tile). getSceneX: (AreaSoundEffectPlayed) -> number, --- The scene tile's y. getSceneY: (AreaSoundEffectPlayed) -> number, --- How far it is heard, tiles. getRange: (AreaSoundEffectPlayed) -> number, --- Its delay, client cycles. getDelay: (AreaSoundEffectPlayed) -> number, --- Do not play it. consume: (AreaSoundEffectPlayed) -> (), } export type AreaSoundEffectPlayedClass = { --- `"AreaSoundEffectPlayed"`: the class's name, which host APIs that take the class itself read. __eventClass: string, } --- `AreaSoundEffectPlayed`'s static functions and constants. declare AreaSoundEffectPlayed: AreaSoundEffectPlayedClass --- The game canvas gained or lost keyboard focus. export type FocusChanged = { --- Whether the canvas has focus now. isFocused: (FocusChanged) -> boolean, } export type FocusChangedClass = { --- `"FocusChanged"`: the class's name, which host APIs that take the class itself read. __eventClass: string, } --- `FocusChanged`'s static functions and constants. declare FocusChanged: FocusChangedClass --- The client switched between fixed and resizable mode. export type ResizeableChanged = { --- Whether the client is resizable now. isResized: (ResizeableChanged) -> boolean, } export type ResizeableChangedClass = { --- `"ResizeableChanged"`: the class's name, which host APIs that take the class itself read. __eventClass: string, } --- `ResizeableChanged`'s static functions and constants. declare ResizeableChanged: ResizeableChangedClass --- The client's world changed (`client:getWorld()` answers the new one). export type WorldChanged = { } export type WorldChangedClass = { --- `"WorldChanged"`: the class's name, which host APIs that take the class itself read. __eventClass: string, } --- `WorldChanged`'s static functions and constants. declare WorldChanged: WorldChangedClass --- The logged-in account's hash changed (`client:getAccountHash()` answers the new one). export type AccountHashChanged = { } export type AccountHashChangedClass = { --- `"AccountHashChanged"`: the class's name, which host APIs that take the class itself read. __eventClass: string, } --- `AccountHashChanged`'s static functions and constants. declare AccountHashChanged: AccountHashChangedClass --- The client finished loading the world list (the login screen's world select, the --- world switcher). export type WorldListLoad = { --- Every world, in the order the server sent them, before the client sorts the --- list. Each `World` is a copy: its setters change only it. getWorlds: (WorldListLoad) -> {World}, } export type WorldListLoadClass = { --- `"WorldListLoad"`: the class's name, which host APIs that take the class itself read. __eventClass: string, } --- `WorldListLoad`'s static functions and constants. declare WorldListLoad: WorldListLoadClass --- A Grand Exchange item search is about to run: raised synchronously inside the search's --- clientscript opcode, before the client searches. It carries nothing: the query is --- `client:getVarcStrValue(VarClientID.MESLAYERINPUT)`. To show results of your own, --- consume it and set them with `client:setGeSearchResultIndex(0)`, --- `client:setGeSearchResultCount(n)` and `client:setGeSearchResultIds(ids)`: the search --- then shows those ids (in their order), and the client's own search does not run. Raised --- where the table has the search's hook on. export type GrandExchangeSearched = { --- You have set the results: the client's own search does not run, and the search --- shows the ids you set. Later subscribers still get the event, and can check --- `isConsumed()` to leave it alone. consume: (GrandExchangeSearched) -> (), --- Whether a subscriber consumed it. isConsumed: (GrandExchangeSearched) -> boolean, } export type GrandExchangeSearchedClass = { --- `"GrandExchangeSearched"`: the class's name, which host APIs that take the class itself read. __eventClass: string, } --- `GrandExchangeSearched`'s static functions and constants. declare GrandExchangeSearched: GrandExchangeSearchedClass --- An item appeared on the ground (dropped, spawned, or re-posted for --- every item of the current plane when the client logs in), while --- logged in. export type ItemSpawned = { --- The item. getItem: (ItemSpawned) -> TileItem, --- The tile it lies on. getTile: (ItemSpawned) -> Tile, } export type ItemSpawnedClass = { --- `"ItemSpawned"`: the class's name, which host APIs that take the class itself read. __eventClass: string, } --- `ItemSpawned`'s static functions and constants. declare ItemSpawned: ItemSpawnedClass --- An item left the ground (picked up, despawned, or its zone was --- cleared), while logged in. Raised while it is still on its tile. export type ItemDespawned = { --- The item. getItem: (ItemDespawned) -> TileItem, --- The tile it lay on. getTile: (ItemDespawned) -> Tile, } export type ItemDespawnedClass = { --- `"ItemDespawned"`: the class's name, which host APIs that take the class itself read. __eventClass: string, } --- `ItemDespawned`'s static functions and constants. declare ItemDespawned: ItemDespawnedClass --- A floor item's quantity is about to change (raised before the write, in any --- game state). export type ItemQuantityChanged = { --- The item. getItem: (ItemQuantityChanged) -> TileItem, --- The tile it lies on. getTile: (ItemQuantityChanged) -> Tile, --- The quantity before. getOldQuantity: (ItemQuantityChanged) -> number, --- The quantity after. getNewQuantity: (ItemQuantityChanged) -> number, } export type ItemQuantityChangedClass = { --- `"ItemQuantityChanged"`: the class's name, which host APIs that take the class itself read. __eventClass: string, } --- `ItemQuantityChanged`'s static functions and constants. declare ItemQuantityChanged: ItemQuantityChangedClass --- The client added an entry to the menu, or to a submenu (a loc's or an item's --- sub-ops, right after their parent). Raised once per entry, in the order the client --- added them, before it sorts the menu, so `getMenuEntry()`'s setters (and --- `client:getMenu():createMenuEntry(-1)`) shape what the menu shows. An entry a --- plugin creates is not announced. export type MenuEntryAdded = { --- The entry the client added, live. From a legacy delivery (a build without the menu --- sites), a detached, read-only entry with the event's fields. getMenuEntry: (MenuEntryAdded) -> MenuEntry, --- The entry's option text. getOption: (MenuEntryAdded) -> string, --- The entry's target text. getTarget: (MenuEntryAdded) -> string, --- The entry's `MenuAction` id (`getMenuEntry():getType():getId()`). getType: (MenuEntryAdded) -> number, --- The entry's identifier. getIdentifier: (MenuEntryAdded) -> number, --- The entry's first parameter. getActionParam0: (MenuEntryAdded) -> number, --- The entry's second parameter. getActionParam1: (MenuEntryAdded) -> number, --- The entry's item id. getItemId: (MenuEntryAdded) -> number, } export type MenuEntryAddedClass = { --- `"MenuEntryAdded"`: the class's name, which host APIs that take the class itself read. __eventClass: string, } --- `MenuEntryAdded`'s static functions and constants. declare MenuEntryAdded: MenuEntryAddedClass --- The menu is about to open. Its array is the event's own, and is not read back: --- change the menu with `client:getMenu():setMenuEntries(...)`, which is applied --- before the menu lays out. export type MenuOpened = { --- The menu's entries, bottom first: the last is shown at the top. getMenuEntries: (MenuOpened) -> {MenuEntry}, --- Replace the event's array (what later subscribers' `getMenuEntries()` read). setMenuEntries: (MenuOpened, {MenuEntry}) -> (), --- The entry shown at the top (the array's last), or `nil` for an empty menu. getFirstEntry: (MenuOpened) -> MenuEntry?, } export type MenuOpenedClass = { --- `"MenuOpened"`: the class's name, which host APIs that take the class itself read. __eventClass: string, } --- `MenuOpened`'s static functions and constants. declare MenuOpened: MenuOpenedClass --- An entry was clicked (a left click on the top entry, or a pick in the open menu; --- "Cancel" too), before its action runs. `consume()` stops the action. A change to --- the entry's identifier or params is what the action then uses; a type set now is --- ignored, as the opcode is read before the event. A click Bento itself drives (an --- `interact` call) names the action Bento performs. export type MenuOptionClicked = { --- The clicked entry, live. From a legacy delivery (a build without the menu sites), --- a detached, read-only entry with the event's fields: the menu has moved on since. getMenuEntry: (MenuOptionClicked) -> MenuEntry, --- Whether a subscriber consumed it. isConsumed: (MenuOptionClicked) -> boolean, --- Stop the action: the client runs nothing for this click. consume: (MenuOptionClicked) -> (), --- The entry's first parameter. getParam0: (MenuOptionClicked) -> number, --- The entry's second parameter. getParam1: (MenuOptionClicked) -> number, --- The entry's option text. getMenuOption: (MenuOptionClicked) -> string, --- The entry's target text. getMenuTarget: (MenuOptionClicked) -> string, --- The entry's action. getMenuAction: (MenuOptionClicked) -> MenuAction, --- The entry's identifier: the object, actor or item the action targets. getId: (MenuOptionClicked) -> number, --- Whether it is an inventory item op ("Use" and "Examine" are not). isItemOp: (MenuOptionClicked) -> boolean, --- The item op 1-5 of an inventory item op, else -1. getItemOp: (MenuOptionClicked) -> number, --- The item id, or -1. getItemId: (MenuOptionClicked) -> number, --- The widget the clicked entry acts on (`getMenuEntry():getWidget()`), or `nil`. getWidget: (MenuOptionClicked) -> Widget?, --- Deprecated: use `getParam0()`. getActionParam: (MenuOptionClicked) -> number, --- Deprecated: use `getParam1()`. getWidgetId: (MenuOptionClicked) -> number, } export type MenuOptionClickedClass = { --- `"MenuOptionClicked"`: the class's name, which host APIs that take the class itself read. __eventClass: string, } --- `MenuOptionClicked`'s static functions and constants. declare MenuOptionClicked: MenuOptionClickedClass --- A left click is about to run the top entry where the client's own rule would not --- open the menu. `setForceRightClick(true)` opens it. export type MenuShouldLeftClick = { --- Whether a subscriber asked for the menu to open. isForceRightClick: (MenuShouldLeftClick) -> boolean, --- Open the menu on this left click (or not). setForceRightClick: (MenuShouldLeftClick, boolean) -> (), } export type MenuShouldLeftClickClass = { --- `"MenuShouldLeftClick"`: the class's name, which host APIs that take the class itself read. __eventClass: string, } --- `MenuShouldLeftClick`'s static functions and constants. declare MenuShouldLeftClick: MenuShouldLeftClickClass --- The client sorted the menu for the last time this cycle and clicks are next. Only --- while the menu is closed. The place to reorder entries --- (`client:getMenu():setMenuEntries(...)`) so a left click runs the new top entry. export type PostMenuSort = { } export type PostMenuSortClass = { --- `"PostMenuSort"`: the class's name, which host APIs that take the class itself read. __eventClass: string, } --- `PostMenuSort`'s static functions and constants. declare PostMenuSort: PostMenuSortClass --- The open menu is about to be drawn. Consuming it skips the client's drawing of --- the menu this frame (to draw one of your own). export type BeforeMenuRender = { --- Skip the client's drawing of the menu this frame. consume: (BeforeMenuRender) -> (), --- Whether a subscriber consumed it. isConsumed: (BeforeMenuRender) -> boolean, --- Consume it, or take a consume back. setConsumed: (BeforeMenuRender, boolean) -> (), } export type BeforeMenuRenderClass = { --- `"BeforeMenuRender"`: the class's name, which host APIs that take the class itself read. __eventClass: string, } --- `BeforeMenuRender`'s static functions and constants. declare BeforeMenuRender: BeforeMenuRenderClass --- A game object (a loc in the interactable layer) was added to the scene: --- by a loc change, or as part of a newly loaded scene (after --- `WorldViewLoaded`, once per object on its origin tile). export type GameObjectSpawned = { --- The object. getGameObject: (GameObjectSpawned) -> GameObject, --- Its origin (south-west) tile. getTile: (GameObjectSpawned) -> Tile, } export type GameObjectSpawnedClass = { --- `"GameObjectSpawned"`: the class's name, which host APIs that take the class itself read. __eventClass: string, } --- `GameObjectSpawned`'s static functions and constants. declare GameObjectSpawned: GameObjectSpawnedClass --- A game object is being removed from the scene (by a loc change; a --- scene reload removes its objects without one). Raised while it is --- still on its tile: the handle answers its values, and is dead after. export type GameObjectDespawned = { --- The object. getGameObject: (GameObjectDespawned) -> GameObject, --- Its origin tile. getTile: (GameObjectDespawned) -> Tile, } export type GameObjectDespawnedClass = { --- `"GameObjectDespawned"`: the class's name, which host APIs that take the class itself read. __eventClass: string, } --- `GameObjectDespawned`'s static functions and constants. declare GameObjectDespawned: GameObjectDespawnedClass --- A wall object was added to the scene. export type WallObjectSpawned = { --- The object. getWallObject: (WallObjectSpawned) -> WallObject, --- Its tile. getTile: (WallObjectSpawned) -> Tile, } export type WallObjectSpawnedClass = { --- `"WallObjectSpawned"`: the class's name, which host APIs that take the class itself read. __eventClass: string, } --- `WallObjectSpawned`'s static functions and constants. declare WallObjectSpawned: WallObjectSpawnedClass --- A wall object is being removed from the scene (raised while it is --- still on its tile). export type WallObjectDespawned = { --- The object. getWallObject: (WallObjectDespawned) -> WallObject, --- Its tile. getTile: (WallObjectDespawned) -> Tile, } export type WallObjectDespawnedClass = { --- `"WallObjectDespawned"`: the class's name, which host APIs that take the class itself read. __eventClass: string, } --- `WallObjectDespawned`'s static functions and constants. declare WallObjectDespawned: WallObjectDespawnedClass --- A decorative object was added to the scene. export type DecorativeObjectSpawned = { --- The object. getDecorativeObject: (DecorativeObjectSpawned) -> DecorativeObject, --- Its tile. getTile: (DecorativeObjectSpawned) -> Tile, } export type DecorativeObjectSpawnedClass = { --- `"DecorativeObjectSpawned"`: the class's name, which host APIs that take the class itself read. __eventClass: string, } --- `DecorativeObjectSpawned`'s static functions and constants. declare DecorativeObjectSpawned: DecorativeObjectSpawnedClass --- A decorative object is being removed from the scene (raised while it is --- still on its tile). export type DecorativeObjectDespawned = { --- The object. getDecorativeObject: (DecorativeObjectDespawned) -> DecorativeObject, --- Its tile. getTile: (DecorativeObjectDespawned) -> Tile, } export type DecorativeObjectDespawnedClass = { --- `"DecorativeObjectDespawned"`: the class's name, which host APIs that take the class itself read. __eventClass: string, } --- `DecorativeObjectDespawned`'s static functions and constants. declare DecorativeObjectDespawned: DecorativeObjectDespawnedClass --- A ground object was added to the scene. export type GroundObjectSpawned = { --- The object. getGroundObject: (GroundObjectSpawned) -> GroundObject, --- Its tile. getTile: (GroundObjectSpawned) -> Tile, } export type GroundObjectSpawnedClass = { --- `"GroundObjectSpawned"`: the class's name, which host APIs that take the class itself read. __eventClass: string, } --- `GroundObjectSpawned`'s static functions and constants. declare GroundObjectSpawned: GroundObjectSpawnedClass --- A ground object is being removed from the scene (raised while it is --- still on its tile). export type GroundObjectDespawned = { --- The object. getGroundObject: (GroundObjectDespawned) -> GroundObject, --- Its tile. getTile: (GroundObjectDespawned) -> Tile, } export type GroundObjectDespawnedClass = { --- `"GroundObjectDespawned"`: the class's name, which host APIs that take the class itself read. __eventClass: string, } --- `GroundObjectDespawned`'s static functions and constants. declare GroundObjectDespawned: GroundObjectDespawnedClass --- A clientscript ran the script-callback opcode: raised synchronously, before --- the script's next instruction, so a handler that changes the stacks --- (`client:getIntStack()`, `client:getObjectStack()`, the sizes) changes what --- the script sees. export type ScriptCallbackEvent = { --- The callback's name, the string the script pushed before the opcode --- (`"bankSearchFilter"`, …). getEventName: (ScriptCallbackEvent) -> string, --- The id of the script that ran the opcode, or -1 when it is not known. getScriptId: (ScriptCallbackEvent) -> number, } export type ScriptCallbackEventClass = { --- `"ScriptCallbackEvent"`: the class's name, which host APIs that take the class itself read. __eventClass: string, } --- `ScriptCallbackEvent`'s static functions and constants. declare ScriptCallbackEvent: ScriptCallbackEventClass --- A clientscript is about to run: a root script (started by a listener or --- `client:runScript`), or one a script `invoke`s. Raised synchronously; for a --- nested script the arguments are on the stacks (`client:getIntStack()`). --- A subscription takes every script the client runs, thousands a second. To hear only --- some, name them: `eventFilters.onScriptPreFired = { scriptId = { ... } }`, or --- `eventBus:subscribe`'s fourth argument. export type ScriptPreFired = { --- The script's id. getScriptId: (ScriptPreFired) -> number, --- What started the root script (its arguments, source widget, op, ...): `nil` --- unless this is a root script a `ScriptEvent` started. Valid while this event is --- delivered. getScriptEvent: (ScriptPreFired) -> ScriptEvent?, } export type ScriptPreFiredClass = { --- `"ScriptPreFired"`: the class's name, which host APIs that take the class itself read. __eventClass: string, } --- `ScriptPreFired`'s static functions and constants. declare ScriptPreFired: ScriptPreFiredClass --- A clientscript returned, at its `return` instruction. On a client where that --- instruction cannot be hooked: a root script's when its run ends, a nested one's when --- the caller is seen to continue (its next `invoke` or the root's end). --- A subscription takes every script the client runs, thousands a second. To hear only --- some, name them: `eventFilters.onScriptPostFired = { scriptId = { ... } }`, or --- `eventBus:subscribe`'s fourth argument. export type ScriptPostFired = { --- The script's id. getScriptId: (ScriptPostFired) -> number, } export type ScriptPostFiredClass = { --- `"ScriptPostFired"`: the class's name, which host APIs that take the class itself read. __eventClass: string, } --- `ScriptPostFired`'s static functions and constants. declare ScriptPostFired: ScriptPostFiredClass --- A varp or varbit changed: one for every varbit of a written varp whose bits changed, --- then one for the varp itself (`getVarbitId()` -1) when bits no changed varbit covers --- changed as well. Raised at the write. export type VarbitChanged = { --- The varbit that changed, or -1 for a varp change. getVarbitId: (VarbitChanged) -> number, --- The varp that changed (a varbit's own varp for a varbit change; -1 on the --- differ's legacy copy of a varbit change, which does not carry it). getVarpId: (VarbitChanged) -> number, --- The new value. getValue: (VarbitChanged) -> number, --- The value before the change. getOldValue: (VarbitChanged) -> number, --- The new value as a `long`: `getValue()` widened. The client's varps are 32-bit, and it --- also has 64-bit varps. A change to a 64-bit one is raised with the long's low 32 bits --- only, so there this is those 32 bits widened, not the long. Declared `number`; every --- 32-bit value fits exactly. getLongValue: (VarbitChanged) -> number, --- Deprecated: use `getVarpId()`. getIndex: (VarbitChanged) -> number, --- Set the value: later subscribers of this change see the new value (the --- client's varp is not touched). Refused on the differ's read-only copy. setValue: (VarbitChanged, number) -> (), --- Set the varbit id, as `setValue`. setVarbitId: (VarbitChanged, number) -> (), --- Set the varp id, as `setValue`. setVarpId: (VarbitChanged, number) -> (), } export type VarbitChangedClass = { --- `"VarbitChanged"`: the class's name, which host APIs that take the class itself read. __eventClass: string, } --- `VarbitChanged`'s static functions and constants. declare VarbitChanged: VarbitChangedClass --- A client int was set by a clientscript (the client's own writes, not a --- plugin's `setVarcIntValue`). export type VarClientIntChanged = { --- The client int. getIndex: (VarClientIntChanged) -> number, --- The value it was set to. getValue: (VarClientIntChanged) -> number, } export type VarClientIntChangedClass = { --- `"VarClientIntChanged"`: the class's name, which host APIs that take the class itself read. __eventClass: string, } --- `VarClientIntChanged`'s static functions and constants. declare VarClientIntChanged: VarClientIntChangedClass --- A client string was set by a clientscript. export type VarClientStrChanged = { --- The client string. getIndex: (VarClientStrChanged) -> number, --- The value it was set to. getValue: (VarClientStrChanged) -> string, } export type VarClientStrChangedClass = { --- `"VarClientStrChanged"`: the class's name, which host APIs that take the class itself read. __eventClass: string, } --- `VarClientStrChanged`'s static functions and constants. declare VarClientStrChanged: VarClientStrChangedClass --- An interface finished loading, after its components' onLoad scripts ran (posted --- whenever the group's onLoad runner returns with the group loaded, a reopen of a --- loaded group included). export type WidgetLoaded = { --- The interface (group) id. getGroupId: (WidgetLoaded) -> number, --- Set the group id: later subscribers of this event read `groupId`; the game does --- not. Refused on the differ's read-only copy, and on anything but a `WidgetLoaded` --- raised at its hook (it never changes nothing silently). setGroupId: (WidgetLoaded, number) -> (), } export type WidgetLoadedClass = { --- `"WidgetLoaded"`: the class's name, which host APIs that take the class itself read. __eventClass: string, } --- `WidgetLoaded`'s static functions and constants. declare WidgetLoaded: WidgetLoadedClass --- An interface is about to be closed: posted before anything is torn down, so its --- widgets still read. export type WidgetClosed = { --- The interface (group) id. getGroupId: (WidgetClosed) -> number, --- How it was open (`WidgetModalMode`: 0 modal, 1 non-modal, 3 modal click-through). getModalMode: (WidgetClosed) -> number, --- Whether the interface is unloaded (`false` when the same interface is reopened at --- once). isUnload: (WidgetClosed) -> boolean, } export type WidgetClosedClass = { --- `"WidgetClosed"`: the class's name, which host APIs that take the class itself read. __eventClass: string, } --- `WidgetClosed`'s static functions and constants. declare WidgetClosed: WidgetClosedClass --- An inventory the client holds changed: one per update the server sent, delivered at the --- end of the client cycle, before `ClientTick`. The container is read when the event is --- delivered: one the client created and removed again within the cycle is not seen, and --- past 32 updates in one cycle the oldest are not seen (the client's ring holds 32). export type ItemContainerChanged = { --- The container's id (`InventoryID`), with 0x8000 for another player's. getContainerId: (ItemContainerChanged) -> number, --- The container, read live (`nil` only when the client removed it again before the --- event was delivered). getItemContainer: (ItemContainerChanged) -> ItemContainer?, } export type ItemContainerChangedClass = { --- `"ItemContainerChanged"`: the class's name, which host APIs that take the class itself read. __eventClass: string, } --- `ItemContainerChanged`'s static functions and constants. declare ItemContainerChanged: ItemContainerChangedClass --- A widget is being dragged: posted every client cycle the drag holds, the release --- cycle included, before the client processes it, so `client:setDraggedOnWidget(...)` --- here decides where the drop lands (`nil` on the release cycle sends nothing). The --- widgets are `client:getDraggedWidget()` and `client:getDraggedOnWidget()`. Carries --- nothing. export type WidgetDrag = { } export type WidgetDragClass = { --- `"WidgetDrag"`: the class's name, which host APIs that take the class itself read. __eventClass: string, } --- `WidgetDrag`'s static functions and constants. declare WidgetDrag: WidgetDragClass --- A world view has a new scene: posted after the scene is swapped in, and --- before the `*ObjectSpawned` events of every object in it. export type WorldViewLoaded = { --- The world view. getWorldView: (WorldViewLoaded) -> WorldView, } export type WorldViewLoadedClass = { --- `"WorldViewLoaded"`: the class's name, which host APIs that take the class itself read. __eventClass: string, } --- `WorldViewLoaded`'s static functions and constants. declare WorldViewLoaded: WorldViewLoadedClass --- A world view's scene is about to go: before a reload clears it, when a --- world entity's world view is removed, and for every loaded world view --- on logout or a hop. No `*ObjectDespawned` events follow. export type WorldViewUnloaded = { --- The world view. getWorldView: (WorldViewUnloaded) -> WorldView, } export type WorldViewUnloadedClass = { --- `"WorldViewUnloaded"`: the class's name, which host APIs that take the class itself read. __eventClass: string, } --- `WorldViewUnloaded`'s static functions and constants. declare WorldViewUnloaded: WorldViewUnloadedClass --- The top-level scene is built (tiles, locs, tile settings) and about to be --- finalized. Raised on the client thread, before the client links its bridges: --- a tile read here is not yet moved under its bridge. export type PreMapLoad = { --- The world view the scene is loading for (the top level). getWorldView: (PreMapLoad) -> WorldView, --- The scene being loaded. getScene: (PreMapLoad) -> Scene, } export type PreMapLoadClass = { --- `"PreMapLoad"`: the class's name, which host APIs that take the class itself read. __eventClass: string, } --- `PreMapLoad`'s static functions and constants. declare PreMapLoad: PreMapLoadClass --- A world entity (a boat) appeared: posted before its world view loads. export type WorldEntitySpawned = { --- The world entity. getWorldEntity: (WorldEntitySpawned) -> WorldEntity, } export type WorldEntitySpawnedClass = { --- `"WorldEntitySpawned"`: the class's name, which host APIs that take the class itself read. __eventClass: string, } --- `WorldEntitySpawned`'s static functions and constants. declare WorldEntitySpawned: WorldEntitySpawnedClass --- A world entity is being removed: last, after its players and NPCs --- despawned and its world view unloaded. export type WorldEntityDespawned = { --- The world entity. getWorldEntity: (WorldEntityDespawned) -> WorldEntity, } export type WorldEntityDespawnedClass = { --- `"WorldEntityDespawned"`: the class's name, which host APIs that take the class itself read. __eventClass: string, } --- `WorldEntityDespawned`'s static functions and constants. declare WorldEntityDespawned: WorldEntityDespawnedClass --- A projectile is about to move this frame: posted every frame for every --- projectile that has started, with where it is heading. Not posted for --- a projectile sent with a slope (`getSlope()` is not `nil`): --- `client:getProjectiles()` lists those too. Not here: the setters --- (nothing reads them back). export type ProjectileMoved = { --- The projectile. getProjectile: (ProjectileMoved) -> Projectile, --- Where it is heading: the centre of its target tile as a local point of --- the top level (it does not follow an aimed-at actor), `nil` when the --- tile is outside the scene. getPosition: (ProjectileMoved) -> LocalPoint?, --- How far above the ground at its target the projectile ends: its --- `getProjectile():getEndHeight()`. Raises once the projectile is gone. getZ: (ProjectileMoved) -> number, } export type ProjectileMovedClass = { --- `"ProjectileMoved"`: the class's name, which host APIs that take the class itself read. __eventClass: string, } --- `ProjectileMoved`'s static functions and constants. declare ProjectileMoved: ProjectileMovedClass --- A player died and dropped loot: the stacks that spawned under them in the tick they --- died. Raised at the cycle after the tick, read-only. export type PlayerLootReceived = { --- The stacks, in spawn order. getItems: (PlayerLootReceived) -> {ItemStack}, --- The dead player's name, as the last tick before it despawned had it ("" when none --- did). A handle made after the despawn would not know the name. getPlayerName: (PlayerLootReceived) -> string, --- The dead player's combat level, as the last tick before it despawned had it (0 --- when none did): `getPlayer().getCombatLevel()`. getPlayerCombatLevel: (PlayerLootReceived) -> number, --- The dead player's index (`Player:getId()`). getPlayerIndex: (PlayerLootReceived) -> number, } export type PlayerLootReceivedClass = { --- `"PlayerLootReceived"`: the class's name, which host APIs that take the class itself read. __eventClass: string, } --- `PlayerLootReceived`'s static functions and constants. declare PlayerLootReceived: PlayerLootReceivedClass --- Loot the game's own loot tracker reported (script `loottracker_add_loot`), by NPC --- definition. Raised at the cycle after it, read-only. export type ServerNpcLoot = { --- The stacks. getItems: (ServerNpcLoot) -> {ItemStack}, --- The NPC's definition: `client.getNpcDefinition(id)` of the id the loot script --- named when it ran, loaded through the client's own loader when the game has not --- loaded it; `nil` only for an id the client has no definition for. getComposition: (ServerNpcLoot) -> NPCComposition?, } export type ServerNpcLootClass = { --- `"ServerNpcLoot"`: the class's name, which host APIs that take the class itself read. __eventClass: string, } --- `ServerNpcLoot`'s static functions and constants. declare ServerNpcLoot: ServerNpcLootClass --- The world list was fetched again. export type WorldsFetch = { --- The new list. getWorldResult: (WorldsFetch) -> WorldResult, } export type WorldsFetchClass = { --- `"WorldsFetch"`: the class's name, which host APIs that take the class itself read. __eventClass: string, } --- `WorldsFetch`'s static functions and constants. declare WorldsFetch: WorldsFetchClass --- Bento loads every image before it draws, so the observer argument of `drawImage` is --- always `nil`. export type ImageObserver = { } --- Every graphics object Bento hands out is a `Graphics2D`, whose base this is. export type Graphics = { --- Sets the colour (and the paint) for the draws that follow; `nil` is ignored. setColor: (Graphics, Color?) -> (), --- The current colour (the last `setColor`, or the colour of the last colour paint). getColor: (Graphics) -> Color, --- Sets the font; `nil` is ignored. setFont: (Graphics, Font?) -> (), --- The current font. getFont: (Graphics) -> Font, --- `(Graphics) -> FontMetrics`: --- The metrics of the current font, under the current text antialiasing. --- --- `(Graphics, Font) -> FontMetrics`: --- The metrics of `font`, under the current text antialiasing. getFontMetrics: ((Graphics) -> FontMetrics) & ((Graphics, Font) -> FontMetrics), --- Intersects the clip with a rectangle. clipRect: (Graphics, number, number, number, number) -> (), --- `(Graphics, Shape?) -> ()`: --- Replaces the clip with `shape`; `nil` removes it. --- --- `(Graphics, number, number, number, number) -> ()`: --- Replaces the clip with a rectangle. setClip: ((Graphics, Shape?) -> ()) & ((Graphics, number, number, number, number) -> ()), --- The clip in user space, or `nil` with none. getClip: (Graphics) -> Shape?, --- The clip's bounds in user space, or `nil` with none. getClipBounds: (Graphics) -> Rectangle?, --- Whether a rectangle might intersect the clip (a bounds test). hitClip: (Graphics, number, number, number, number) -> boolean, --- `(Graphics) -> Graphics2D`: --- A new graphics object with a copy of this one's state. --- --- `(Graphics, number, number, number, number) -> Graphics2D`: --- A new graphics object translated to (x, y) and clipped to (0, 0, w, h). create: ((Graphics) -> Graphics2D) & ((Graphics, number, number, number, number) -> Graphics2D), --- Releases a graphics object `create` made; later calls on it draw nothing. The --- graphics `render` is handed is never released. dispose: (Graphics) -> (), --- A line (Bresenham without antialiasing). drawLine: (Graphics, number, number, number, number) -> (), --- A rectangle's outline: columns x..=x+w, rows y..=y+h. drawRect: (Graphics, number, number, number, number) -> (), --- A filled rectangle. fillRect: (Graphics, number, number, number, number) -> (), --- Fills a rectangle with the background colour. clearRect: (Graphics, number, number, number, number) -> (), --- An oval's outline in the rectangle. drawOval: (Graphics, number, number, number, number) -> (), --- A filled oval in the rectangle. fillOval: (Graphics, number, number, number, number) -> (), --- A rounded rectangle's outline. drawRoundRect: (Graphics, number, number, number, number, number, number) -> (), --- A filled rounded rectangle. fillRoundRect: (Graphics, number, number, number, number, number, number) -> (), --- An open arc's outline (angles in degrees, counter-clockwise from 3 o'clock). drawArc: (Graphics, number, number, number, number, number, number) -> (), --- A filled pie arc. fillArc: (Graphics, number, number, number, number, number, number) -> (), --- `(Graphics, Polygon) -> ()`: --- A closed polygon's outline. --- --- `(Graphics, {number}, {number}, number) -> ()`: --- A closed polygon's outline from the first `n` points of the two arrays. drawPolygon: ((Graphics, Polygon) -> ()) & ((Graphics, {number}, {number}, number) -> ()), --- `(Graphics, Polygon) -> ()`: --- A filled polygon (even-odd). --- --- `(Graphics, {number}, {number}, number) -> ()`: --- A filled polygon from the first `n` points (even-odd). fillPolygon: ((Graphics, Polygon) -> ()) & ((Graphics, {number}, {number}, number) -> ()), --- An open polyline from the first `n` points. drawPolyline: (Graphics, {number}, {number}, number) -> (), } --- What an overlay draws with: strokes, shapes, fonts, images, a composite, a transform, a --- clip and rendering hints. `drawString` puts y on the baseline with no shadow, and calls --- draw in call order. An overlay's `render(graphics)` gets one; it draws only while an --- overlay renders. export type Graphics2D = Graphics & { --- Sets the stroke `draw` and the line primitives use. setStroke: (Graphics2D, BasicStroke) -> (), --- The current stroke. getStroke: (Graphics2D) -> BasicStroke, --- Sets the composite (`AlphaComposite`: a rule and an extra alpha). setComposite: (Graphics2D, AlphaComposite) -> (), --- The current composite. getComposite: (Graphics2D) -> AlphaComposite, --- `(Graphics2D, Color?) -> ()`: --- Paints with a colour (as `setColor`); `nil` is ignored. --- --- `(Graphics2D, Paint) -> ()`: --- Paints with a two-colour gradient. `getColor` keeps the last colour. setPaint: ((Graphics2D, Color?) -> ()) & ((Graphics2D, Paint) -> ()), --- Sets the background colour `clearRect` fills with. setBackground: (Graphics2D, Color) -> (), --- The background colour. getBackground: (Graphics2D) -> Color, --- Sets one rendering hint. Antialiasing, text antialiasing, stroke control and --- interpolation change how later draws rasterize; the rest are stored and answered. A --- value of another key raises. setRenderingHint: (Graphics2D, RenderingHintsKey, any) -> (), --- The value of one rendering hint (its default where none was set; `nil` for an --- interpolation hint never set). getRenderingHint: (Graphics2D, RenderingHintsKey) -> number?, --- `(Graphics2D, number, number) -> ()`: --- Translates the origin by whole pixels. --- --- `(Graphics2D, number, number) -> ()`: --- Translates the origin. translate: (Graphics2D, number, number) -> (), --- `(Graphics2D, number) -> ()`: --- Rotates by `theta` radians about the origin. --- --- `(Graphics2D, number, number, number) -> ()`: --- Rotates by `theta` radians about (x, y). rotate: ((Graphics2D, number) -> ()) & ((Graphics2D, number, number, number) -> ()), --- Scales. scale: (Graphics2D, number, number) -> (), --- Shears. shear: (Graphics2D, number, number) -> (), --- Concatenates `tx` to the transform. transform: (Graphics2D, AffineTransform) -> (), --- Replaces the transform. setTransform: (Graphics2D, AffineTransform) -> (), --- A copy of the transform. getTransform: (Graphics2D) -> AffineTransform, --- Intersects the clip with `shape` (user space). clip: (Graphics2D, Shape) -> (), --- Strokes `shape` with the current stroke. draw: (Graphics2D, Shape) -> (), --- Fills `shape` (its winding rule). fill: (Graphics2D, Shape) -> (), --- `(Graphics2D, string, number, number) -> ()`: --- Draws `s` with its baseline at y and its left edge at x, in the current font and --- colour, with no shadow. --- --- `(Graphics2D, string, number, number) -> ()`: --- `drawString` at a fractional position. drawString: (Graphics2D, string, number, number) -> (), --- `(Graphics2D, Image?, number, number, ImageObserver?) -> boolean`: --- Draws `img` with its top-left at (x, y). `true`, as for any loaded image. --- --- `(Graphics2D, Image?, number, number, number, number, ImageObserver?) -> boolean`: --- Draws `img` scaled into the rectangle. --- --- `(Graphics2D, Image?, number, number, number, number, number, number, number, number, ImageObserver?) -> boolean`: --- Draws the source rectangle (sx1, sy1)-(sx2, sy2) of `img` into the destination --- rectangle (dx1, dy1)-(dx2, dy2), flipping where the corners are reversed. --- --- `(Graphics2D, Image?, AffineTransform, ImageObserver?) -> boolean`: --- Draws `img` through `xform` (after the current transform). drawImage: ((Graphics2D, Image?, number, number, ImageObserver?) -> boolean) & ((Graphics2D, Image?, number, number, number, number, ImageObserver?) -> boolean) & ((Graphics2D, Image?, number, number, number, number, number, number, number, number, ImageObserver?) -> boolean) & ((Graphics2D, Image?, AffineTransform, ImageObserver?) -> boolean), } --- A mutable 2x3 matrix. export type AffineTransform = { --- `m00`. getScaleX: (AffineTransform) -> number, --- `m11`. getScaleY: (AffineTransform) -> number, --- `m01`. getShearX: (AffineTransform) -> number, --- `m10`. getShearY: (AffineTransform) -> number, --- `m02`. getTranslateX: (AffineTransform) -> number, --- `m12`. getTranslateY: (AffineTransform) -> number, --- The transform's type flags (`TYPE_TRANSLATION` | ...). getType: (AffineTransform) -> number, --- The determinant. getDeterminant: (AffineTransform) -> number, --- Whether it is the identity. isIdentity: (AffineTransform) -> boolean, --- Concatenates a translation. translate: (AffineTransform, number, number) -> (), --- `(AffineTransform, number) -> ()`: --- Concatenates a rotation by `theta` radians. --- --- `(AffineTransform, number, number) -> ()`: --- Concatenates a rotation by the angle of the vector (vecx, vecy), exact on the axes. --- --- `(AffineTransform, number, number, number) -> ()`: --- Concatenates a rotation by `theta` radians about (x, y). rotate: ((AffineTransform, number) -> ()) & ((AffineTransform, number, number) -> ()) & ((AffineTransform, number, number, number) -> ()), --- Concatenates a scale. scale: (AffineTransform, number, number) -> (), --- Concatenates a shear. shear: (AffineTransform, number, number) -> (), --- `this = this x tx`. concatenate: (AffineTransform, AffineTransform) -> (), --- `this = tx x this`. preConcatenate: (AffineTransform, AffineTransform) -> (), --- Replaces the matrix with `tx`'s. setTransform: (AffineTransform, AffineTransform) -> (), --- Resets to the identity. setToIdentity: (AffineTransform) -> (), --- The inverse; raises `NoninvertibleTransformException` when the determinant is 0. createInverse: (AffineTransform) -> AffineTransform, --- Whether `other` is an `AffineTransform` with the same matrix. equals: (AffineTransform, any) -> boolean, } export type AffineTransformClass = { --- `() -> AffineTransform`: --- The identity. --- --- `(number, number, number, number, number, number) -> AffineTransform`: --- The matrix `[m00 m01 m02; m10 m11 m12]`, the arguments running column by column. --- --- `(AffineTransform) -> AffineTransform`: --- A copy of `tx`. new: (() -> AffineTransform) & ((number, number, number, number, number, number) -> AffineTransform) & ((AffineTransform) -> AffineTransform), --- A translation. getTranslateInstance: (number, number) -> AffineTransform, --- A rotation by `theta` radians. getRotateInstance: (number) -> AffineTransform, --- A scale. getScaleInstance: (number, number) -> AffineTransform, } --- `AffineTransform`'s static functions and constants. declare AffineTransform: AffineTransformClass --- What `Graphics2D.setPaint` takes besides a `Color`: a gradient. export type Paint = { --- The paint's transparency: `OPAQUE` (1) when both colours are opaque, else --- `TRANSLUCENT` (3). getTransparency: (Paint) -> number, } --- A linear gradient between two points and colours. export type GradientPaint = Paint & { --- The first colour. getColor1: (GradientPaint) -> Color, --- The second colour. getColor2: (GradientPaint) -> Color, --- Whether it repeats. isCyclic: (GradientPaint) -> boolean, } export type GradientPaintClass = { --- `(number, number, Color, number, number, Color) -> GradientPaint`: --- From (x1, y1) in `c1` to (x2, y2) in `c2`, not cyclic. --- --- `(number, number, Color, number, number, Color, boolean) -> GradientPaint`: --- As `new`, cyclic or not. new: ((number, number, Color, number, number, Color) -> GradientPaint) & ((number, number, Color, number, number, Color, boolean) -> GradientPaint), } --- `GradientPaint`'s static functions and constants. declare GradientPaint: GradientPaintClass --- The type of a rendering hint's key. Its objects are the `RenderingHints.KEY_*` constants. export type RenderingHintsKey = { --- Whether `value` is one of this key's `RenderingHints.VALUE_*` constants. isCompatibleValue: (RenderingHintsKey, any) -> boolean, } --- `OverlayMenuEntry`: an entry an overlay shows in the right-click menu while shift is --- held over it. --- --- `__eq`: `==` answers as `equals` does. export type OverlayMenuEntry = { --- The entry's `MenuAction`. getMenuAction: (OverlayMenuEntry) -> MenuAction, --- The option text. getOption: (OverlayMenuEntry) -> string, --- The target text. getTarget: (OverlayMenuEntry) -> string, --- Whether `other` is an entry with the same action, option and target (the callback is --- not compared). equals: (OverlayMenuEntry, any) -> boolean, --- The text form: `OverlayMenuEntry(menuAction=..., option=..., target=...)`. toString: (OverlayMenuEntry) -> string, } export type OverlayMenuEntryClass = { --- An entry with no callback: picking it posts `OverlayMenuClicked`. new: (MenuAction, string, string) -> OverlayMenuEntry, } --- `OverlayMenuEntry`'s static functions and constants. declare OverlayMenuEntry: OverlayMenuEntryClass --- A Porter-Duff rule and an extra alpha. `AlphaComposite.SrcOver` and the other instance constants are one object each per VM; `==` is identity and `equals` compares rule and alpha. Graphics2D draws every rule in software; source-over into the game's raster uses the game's own blend. export type AlphaComposite = { --- The same rule with `alpha`. Raises for an alpha out of range. derive: (AlphaComposite, number) -> AlphaComposite, --- The extra alpha. getAlpha: (AlphaComposite) -> number, --- The rule constant. getRule: (AlphaComposite) -> number, --- Whether `other` is an `AlphaComposite` with the same rule and alpha. equals: (AlphaComposite, any) -> boolean, } export type AlphaCompositeClass = { --- `(number) -> AlphaComposite`: --- The composite for `rule` with alpha 1. Raises for an unknown rule. --- --- `(number, number) -> AlphaComposite`: --- The composite for `rule` with `alpha` (0..1). Raises for an unknown rule or an alpha out of range. getInstance: ((number) -> AlphaComposite) & ((number, number) -> AlphaComposite), --- `CLEAR`: 1. CLEAR: number, --- `SRC`: 2. SRC: number, --- `SRC_OVER`: 3. SRC_OVER: number, --- `DST_OVER`: 4. DST_OVER: number, --- `SRC_IN`: 5. SRC_IN: number, --- `DST_IN`: 6. DST_IN: number, --- `SRC_OUT`: 7. SRC_OUT: number, --- `DST_OUT`: 8. DST_OUT: number, --- `DST`: 9. DST: number, --- `SRC_ATOP`: 10. SRC_ATOP: number, --- `DST_ATOP`: 11. DST_ATOP: number, --- `XOR`: 12. XOR: number, --- `Clear`, alpha 1. Clear: AlphaComposite, --- `Src`, alpha 1. Src: AlphaComposite, --- `SrcOver`, alpha 1: the default. SrcOver: AlphaComposite, --- `DstOver`, alpha 1. DstOver: AlphaComposite, --- `SrcIn`, alpha 1. SrcIn: AlphaComposite, --- `DstIn`, alpha 1. DstIn: AlphaComposite, --- `SrcOut`, alpha 1. SrcOut: AlphaComposite, --- `DstOut`, alpha 1. DstOut: AlphaComposite, --- `Dst`, alpha 1. Dst: AlphaComposite, --- `SrcAtop`, alpha 1. SrcAtop: AlphaComposite, --- `DstAtop`, alpha 1. DstAtop: AlphaComposite, --- `Xor`, alpha 1. Xor: AlphaComposite, } --- `AlphaComposite`'s static functions and constants. declare AlphaComposite: AlphaCompositeClass --- The keys and values for `Graphics2D.setRenderingHint`. A key is a `RenderingHintsKey` object; a value is a number, unique per value, compatible with its own key only (`==` compares them). export type RenderingHints = { } export type RenderingHintsClass = { --- Antialiasing: shapes. KEY_ANTIALIASING: RenderingHintsKey, --- Rendering quality (stored). KEY_RENDERING: RenderingHintsKey, --- Dithering (stored). KEY_DITHERING: RenderingHintsKey, --- Antialiasing: text. KEY_TEXT_ANTIALIASING: RenderingHintsKey, --- Fractional metrics (stored). KEY_FRACTIONALMETRICS: RenderingHintsKey, --- Image interpolation. KEY_INTERPOLATION: RenderingHintsKey, --- Alpha interpolation (stored). KEY_ALPHA_INTERPOLATION: RenderingHintsKey, --- Colour rendering (stored). KEY_COLOR_RENDERING: RenderingHintsKey, --- Stroke normalization. KEY_STROKE_CONTROL: RenderingHintsKey, --- Antialias on. VALUE_ANTIALIAS_ON: number, --- Antialias off. VALUE_ANTIALIAS_OFF: number, --- Antialias default (off). VALUE_ANTIALIAS_DEFAULT: number, --- Render for speed. VALUE_RENDER_SPEED: number, --- Render for quality. VALUE_RENDER_QUALITY: number, --- Render default. VALUE_RENDER_DEFAULT: number, --- No dithering. VALUE_DITHER_DISABLE: number, --- Dithering. VALUE_DITHER_ENABLE: number, --- Dithering default. VALUE_DITHER_DEFAULT: number, --- Text antialias on. VALUE_TEXT_ANTIALIAS_ON: number, --- Text antialias off. VALUE_TEXT_ANTIALIAS_OFF: number, --- Text antialias as the shapes'. VALUE_TEXT_ANTIALIAS_DEFAULT: number, --- Text antialias by the font's GASP table: each strike antialiased or not by its face's `gasp` table at its pixel size. VALUE_TEXT_ANTIALIAS_GASP: number, --- LCD text (drawn as on). VALUE_TEXT_ANTIALIAS_LCD_HRGB: number, --- LCD text (drawn as on). VALUE_TEXT_ANTIALIAS_LCD_HBGR: number, --- LCD text (drawn as on). VALUE_TEXT_ANTIALIAS_LCD_VRGB: number, --- LCD text (drawn as on). VALUE_TEXT_ANTIALIAS_LCD_VBGR: number, --- Fractional metrics off. VALUE_FRACTIONALMETRICS_OFF: number, --- Fractional metrics on (stored). VALUE_FRACTIONALMETRICS_ON: number, --- Fractional metrics default. VALUE_FRACTIONALMETRICS_DEFAULT: number, --- Nearest-neighbour image scaling. VALUE_INTERPOLATION_NEAREST_NEIGHBOR: number, --- Bilinear image scaling. VALUE_INTERPOLATION_BILINEAR: number, --- Bicubic image scaling. VALUE_INTERPOLATION_BICUBIC: number, --- Alpha interpolation for speed. VALUE_ALPHA_INTERPOLATION_SPEED: number, --- Alpha interpolation for quality. VALUE_ALPHA_INTERPOLATION_QUALITY: number, --- Alpha interpolation default. VALUE_ALPHA_INTERPOLATION_DEFAULT: number, --- Colour rendering for speed. VALUE_COLOR_RENDER_SPEED: number, --- Colour rendering for quality. VALUE_COLOR_RENDER_QUALITY: number, --- Colour rendering default. VALUE_COLOR_RENDER_DEFAULT: number, --- Stroke control default (normalized). VALUE_STROKE_DEFAULT: number, --- Strokes normalized to the pixel grid. VALUE_STROKE_NORMALIZE: number, --- Strokes at their exact geometry. VALUE_STROKE_PURE: number, } --- `RenderingHints`'s static functions and constants. declare RenderingHints: RenderingHintsClass --- Subclass it with `local X = class(Overlay)` and define `function X:render(graphics)`, returning a `Dimension` or nil. `X.new(...)` runs `Overlay`'s constructor (its fields at their defaults: `TOP_LEFT`, `UNDER_WIDGETS`, `PRIORITY_DEFAULT`, movable, snappable, resettable, minimum size 32) before `X:init(...)`. Register it with `overlayManager:add(overlay)`; the game thread then calls `render` every frame at the overlay's layer, placed by the overlay renderer. The getters and setters read and set its fields. `getName()` answers the class's simple name, which keys its saved position: the name `class(Overlay, "MyOverlay")` gave it (or `X.__name`); else the name of the module that defines it, when that module defines no other overlay class (`src/MyOverlay.luau`); else a stable per-plugin name, `.Overlay1`, `Overlay2`, ... in the order the plugin first builds each class. export type Overlay = { --- `X.super.init(self, plugin)` in a subclass's `init` does nothing: `X.new(...)` has run `Overlay`'s constructor before `X:init(...)`. Keep the call or drop it. init: (Overlay, any?) -> (), --- Draws the overlay with `graphics` (translated to the overlay's location, in the font its position calls for) and answers its size, or nil. Abstract: a subclass defines it. render: (Overlay, Graphics2D) -> Dimension?, --- The overlay's name, the key its saved position is stored under: the class's `__name`, else a stable per-plugin fallback (see the class doc). Override it to choose another. getName: (Overlay) -> string, --- Sets where the overlay goes; DYNAMIC and TOOLTIP make it neither movable nor snappable, DETACHED movable only, the rest both. setPosition: (Overlay, OverlayPosition) -> (), --- The position. getPosition: (Overlay) -> OverlayPosition, --- Sets the layer it draws in (default UNDER_WIDGETS). Takes effect when the manager next rebuilds its layers (add, remove, save). setLayer: (Overlay, OverlayLayer) -> (), --- The layer. getLayer: (Overlay) -> OverlayLayer, --- `(Overlay, number) -> ()`: --- Sets the priority (`Overlay.PRIORITY_*`): dynamic overlays with a higher one draw later, others earlier. --- --- `(Overlay, OverlayPriority) -> ()`: --- The deprecated form: LOW, NONE, MED, HIGH, HIGHEST map to `PRIORITY_LOW` ... `PRIORITY_HIGHEST`. setPriority: ((Overlay, number) -> ()) & ((Overlay, OverlayPriority) -> ()), --- The priority. getPriority: (Overlay) -> number, --- Sets the location the user dragged it to (relative to its origin), or nil. setPreferredLocation: (Overlay, Point?) -> (), --- The preferred location, or nil: the very `Point` given to `setPreferredLocation`, until the user drags or resets the overlay; then the one the renderer set. getPreferredLocation: (Overlay) -> Point?, --- Sets the preferred size, or nil. setPreferredSize: (Overlay, Dimension?) -> (), --- The preferred size, or nil: the very `Dimension` given to `setPreferredSize`, until the user resizes or resets the overlay; then the one the renderer set. getPreferredSize: (Overlay) -> Dimension?, --- Sets the snap corner the user dropped it on, or nil. setPreferredPosition: (Overlay, OverlayPosition?) -> (), --- The preferred position, or nil. getPreferredPosition: (Overlay) -> OverlayPosition?, --- Where it was last drawn: location and the size `render` answered. A copy. getBounds: (Overlay) -> Rectangle, --- Whether Alt-drag may move it. setMovable: (Overlay, boolean) -> (), --- Whether Alt-drag may move it. isMovable: (Overlay) -> boolean, --- Whether it may be dropped on a snap corner. setSnappable: (Overlay, boolean) -> (), --- Whether it may be dropped on a snap corner. isSnappable: (Overlay) -> boolean, --- Whether Alt-drag on an edge resizes it. setResizable: (Overlay, boolean) -> (), --- Whether Alt-drag on an edge resizes it. isResizable: (Overlay) -> boolean, --- Whether Alt-right-click resets it. setResettable: (Overlay, boolean) -> (), --- Whether Alt-right-click resets it. isResettable: (Overlay) -> boolean, --- Whether other overlays may be dragged onto it (its `onDrag` decides). setDragTargetable: (Overlay, boolean) -> (), --- Whether other overlays may be dragged onto it. isDragTargetable: (Overlay) -> boolean, --- The smallest a resize may make it (default 32). setMinimumSize: (Overlay, number) -> (), --- The smallest a resize may make it. getMinimumSize: (Overlay) -> number, --- Also draw after interface `interfaceId` (usually with layer MANUAL). drawAfterInterface: (Overlay, number) -> (), --- `(Overlay, number, number) -> ()`: --- Also draw after layer widget (groupId, childId). Raises outside 0..65535. --- --- `(Overlay, number) -> ()`: --- Also draw after the layer component (a packed id). drawAfterLayer: ((Overlay, number, number) -> ()) & ((Overlay, number) -> ()), --- The draw hooks (a copy). getDrawHooks: (Overlay) -> {number}, --- `(Overlay, MenuAction, string, string) -> OverlayMenuEntry`: --- Adds a shift-right-click entry; picking it posts `OverlayMenuClicked`. --- --- `(Overlay, MenuAction, string, string, ((any) -> ())?) -> OverlayMenuEntry`: --- Adds a shift-right-click entry that calls `callback` with the game's `MenuEntry` when it is picked. addMenuEntry: (Overlay, MenuAction, string, string, ((any) -> ())?) -> OverlayMenuEntry, --- Removes the first equal entry. removeMenuEntry: (Overlay, MenuAction, string, string) -> (), --- The live list of entries: `table.insert` adds. getMenuEntries: (Overlay) -> {OverlayMenuEntry}, --- Called after a render in which the pointer was over it (and no menu was open). Does nothing; override it. onMouseOver: (Overlay) -> (), --- Called when `other` is dropped on this drag-targetable overlay: true consumes the drop. False; override it. onDrag: (Overlay, Overlay) -> boolean, --- The area dragging keeps it inside, or nil for the canvas. Nil; override it. getParentBounds: (Overlay) -> Rectangle?, --- Called when its placement was reset. Does nothing; override it. revalidate: (Overlay) -> (), } export type OverlayClass = { --- `() -> Overlay`: --- `Overlay` is abstract, so build your own subclass (`class(Overlay)`, whose `new` runs this constructor first). Called on `Overlay` itself it makes a bare overlay with no `render`. --- --- `(any?) -> Overlay`: --- As `new()`; the plugin is the caller's to keep (`self.plugin = plugin`). new: (any?) -> Overlay, --- `Overlay.PRIORITY_LOW`: 0.0. PRIORITY_LOW: number, --- `Overlay.PRIORITY_DEFAULT`: 0.25. PRIORITY_DEFAULT: number, --- `Overlay.PRIORITY_MED`: 0.5. PRIORITY_MED: number, --- `Overlay.PRIORITY_HIGH`: 0.75. PRIORITY_HIGH: number, --- `Overlay.PRIORITY_HIGHEST`: 1.0. PRIORITY_HIGHEST: number, } --- `Overlay`'s static functions and constants. declare Overlay: OverlayClass --- The `overlayManager` global: one manager for every plugin's overlays, drawing them at their layers by position and then priority (`Overlay:setPriority`) and keeping the positions the user dragged them to in the client's config. `removeIf` and `anyMatch` see this plugin's overlays (another plugin's are not values a plugin can hold). export type OverlayManager = { --- Adds the overlay and loads its saved position; false when it was already added. It draws at the client's own layer points where the table has them on; on any other client it draws at present time over the game's interfaces, and an overlay placed after an interface or a layer draws nothing there. add: (OverlayManager, Overlay) -> boolean, --- Removes the overlay; false when it was not added. remove: (OverlayManager, Overlay) -> boolean, --- Removes this plugin's overlays `filter` answers true for, in the order they were added; whether any was. removeIf: (OverlayManager, (Overlay) -> boolean) -> boolean, --- Whether `filter` answers true for any of this plugin's overlays. anyMatch: (OverlayManager, (Overlay) -> boolean) -> boolean, --- Forgets the overlay's dragged position, size and corner, saves that, and calls `revalidate` on this plugin's overlays. resetOverlay: (OverlayManager, Overlay) -> (), --- Saves the overlay's position, size and location to the client's config, and rebuilds the layers. saveOverlay: (OverlayManager, Overlay) -> (), } export type OverlayManagerClass = { --- `OverlayManager.OPTION_CONFIGURE`: "Configure", the option of an overlay's config entry. OPTION_CONFIGURE: string, } --- `OverlayManager`'s static functions and constants. declare OverlayManager: OverlayManagerClass --- The drawing helpers most overlays use: a 2 px outline then a translucent fill for a polygon, a black shadow one pixel down-right under text, a shadowed minimap dot. export type OverlayUtil = { } export type OverlayUtilClass = { --- `(Graphics2D, Shape, Color) -> ()`: --- Outlines `poly` in `color` with a 2 px stroke, then fills it with `Color.new(0, 0, 0, 50)`; the stroke is put back. --- --- `(Graphics2D, Shape, Color, BasicStroke) -> ()`: --- As the three-argument form, outlined with `borderStroke`. --- --- `(Graphics2D, Shape, Color, Color, BasicStroke) -> ()`: --- Outlines `poly` in `color` with `borderStroke`, fills it with `fillColor`, and puts the stroke back. renderPolygon: ((Graphics2D, Shape, Color) -> ()) & ((Graphics2D, Shape, Color, BasicStroke) -> ()) & ((Graphics2D, Shape, Color, Color, BasicStroke) -> ()), --- A 4 px dot at `mini` in `color` (made opaque) over a black one a pixel lower. renderMinimapLocation: (Graphics2D, Point, Color) -> (), --- `text` with its baseline at `txtLoc`, in `color` made opaque, over a black copy one pixel down and right. Nothing for `nil` or empty text. renderTextLocation: (Graphics2D, Point, string?, Color) -> (), --- `(Client, Graphics2D, LocalPoint, BufferedImage, number) -> ()`: --- Draws `image` centred over the local point, `zOffset` up (`Perspective.getCanvasImageLocation`); nothing when the point does not project. --- --- `(Graphics2D, Point, BufferedImage?) -> ()`: --- Draws `image` with its top-left at `imgLoc`. renderImageLocation: ((Client, Graphics2D, LocalPoint, BufferedImage, number) -> ()) & ((Graphics2D, Point, BufferedImage?) -> ()), --- The actor's tile (`renderPolygon`) and `text` above it at its logical height + 40 (`renderTextLocation`). renderActorOverlay: (Graphics2D, Actor, string?, Color) -> (), --- The actor's tile (`renderPolygon`) and `image` centred `zOffset` above it. renderActorOverlayImage: (Graphics2D, Actor, BufferedImage, Color, number) -> (), --- `(Graphics2D, TileObject, string?, Color) -> ()`: --- The object's tiles (`renderPolygon`), its minimap dot, and `text` at its location. --- --- `(Client, Graphics2D, LocalPoint, BufferedImage, Color) -> ()`: --- The tile at the local point (`renderPolygon`) and `image` centred on it. renderTileOverlay: ((Graphics2D, TileObject, string?, Color) -> ()) & ((Client, Graphics2D, LocalPoint, BufferedImage, Color) -> ()), --- Outlines `area` (in `borderHoverColor` when it contains the mouse, else `borderColor`) and fills it in `fillColor`. Nothing for `nil`. renderHoverableArea: (Graphics2D, Shape?, Point, Color, Color, Color) -> (), --- Turns antialiasing on, as the renderer does for every layer. setGraphicProperties: (Graphics2D) -> (), } --- `OverlayUtil`'s static functions and constants. declare OverlayUtil: OverlayUtilClass --- Anything that renders itself on a `Graphics2D` and says how big it was. export type RenderableEntity = { --- `render(graphics)`: draw on `graphics` and answer the size drawn, or `nil`. An --- exception the component throws is a Luau error with its message, after the draws --- before it. render: (RenderableEntity, Graphics2D) -> Dimension?, } --- A component a panel lays out. A plugin's own one is a table with these four methods. export type LayoutableRenderableEntity = RenderableEntity & { --- `getBounds()`: where the last render put it (`nil` for a `TooltipComponent`). getBounds: (LayoutableRenderableEntity) -> Rectangle?, --- `setPreferredLocation(position)`: where the next render puts it. setPreferredLocation: (LayoutableRenderableEntity, Point?) -> (), --- `setPreferredSize(dimension)`: the size the next render lays out in (ignored by --- `ImageComponent` and `TooltipComponent`). setPreferredSize: (LayoutableRenderableEntity, Dimension?) -> (), } --- `PanelComponent`: children laid out vertically or horizontally, optionally wrapping, --- on the standard translucent background with its two-tone border. export type PanelComponent = LayoutableRenderableEntity & { --- `getChildren()`: the live list of children, a Luau array: `table.insert` adds, --- `table.clear` clears. getChildren: (PanelComponent) -> {LayoutableRenderableEntity}, --- `getPreferredSize()`. getPreferredSize: (PanelComponent) -> Dimension?, --- `setBackgroundColor(color)`: `nil` draws no background. setBackgroundColor: (PanelComponent, Color?) -> (), --- `getBackgroundColor()`. getBackgroundColor: (PanelComponent) -> Color?, --- `setOrientation(orientation)`. setOrientation: (PanelComponent, ComponentOrientation?) -> (), --- `setWrap(wrap)`: start a new column (row) once the preferred height (width) is --- reached. setWrap: (PanelComponent, boolean) -> (), --- `setBorder(border)`: the left, top, right and bottom padding, as a `Rectangle`'s --- x, y, width and height. setBorder: (PanelComponent, Rectangle?) -> (), --- `setGap(gap)`: the space between children. setGap: (PanelComponent, Point?) -> (), } export type PanelComponentClass = { --- `PanelComponent.new()`: vertical, `STANDARD_WIDTH` wide, 4 px border, no gap. new: () -> PanelComponent, } --- `PanelComponent`'s static functions and constants. declare PanelComponent: PanelComponentClass --- `LineComponent`: a left and a right string, word-wrapped when they do not fit. export type LineComponent = LayoutableRenderableEntity & { --- `setLeft(left)`. setLeft: (LineComponent, string?) -> (), --- `setRight(right)`. setRight: (LineComponent, string?) -> (), --- `setLeftColor(color)`. setLeftColor: (LineComponent, Color?) -> (), --- `setRightColor(color)`. setRightColor: (LineComponent, Color?) -> (), --- `setLeftFont(font)`: `nil` uses the graphics' font. setLeftFont: (LineComponent, Font?) -> (), --- `setRightFont(font)`: `nil` uses the graphics' font. setRightFont: (LineComponent, Font?) -> (), } export type LineComponentClass = { --- `LineComponent.builder()`. builder: () -> LineComponentBuilder, } --- `LineComponent`'s static functions and constants. declare LineComponent: LineComponentClass --- `LineComponent.LineComponentBuilder`: each method sets one field and returns the --- builder itself; `build()` makes a component, and may be called again. export type LineComponentBuilder = { --- `left(left)`. left: (LineComponentBuilder, string?) -> LineComponentBuilder, --- `right(right)`. right: (LineComponentBuilder, string?) -> LineComponentBuilder, --- `leftColor(color)`. leftColor: (LineComponentBuilder, Color?) -> LineComponentBuilder, --- `rightColor(color)`. rightColor: (LineComponentBuilder, Color?) -> LineComponentBuilder, --- `leftFont(font)`. leftFont: (LineComponentBuilder, Font?) -> LineComponentBuilder, --- `rightFont(font)`. rightFont: (LineComponentBuilder, Font?) -> LineComponentBuilder, --- `preferredLocation(location)`. preferredLocation: (LineComponentBuilder, Point?) -> LineComponentBuilder, --- `preferredSize(size)`. preferredSize: (LineComponentBuilder, Dimension?) -> LineComponentBuilder, --- `build()`: a new `LineComponent` with the builder's values. build: (LineComponentBuilder) -> LineComponent, } --- `TitleComponent`: one line of text centred in the preferred width. export type TitleComponent = LayoutableRenderableEntity & { --- `setText(text)`. setText: (TitleComponent, string?) -> (), --- `setColor(color)`. setColor: (TitleComponent, Color?) -> (), } export type TitleComponentClass = { --- `TitleComponent.builder()`. builder: () -> TitleComponentBuilder, } --- `TitleComponent`'s static functions and constants. declare TitleComponent: TitleComponentClass --- `TitleComponent.TitleComponentBuilder`. export type TitleComponentBuilder = { --- `text(text)`. text: (TitleComponentBuilder, string?) -> TitleComponentBuilder, --- `color(color)`. color: (TitleComponentBuilder, Color?) -> TitleComponentBuilder, --- `preferredLocation(location)`. preferredLocation: (TitleComponentBuilder, Point?) -> TitleComponentBuilder, --- `preferredSize(size)`. preferredSize: (TitleComponentBuilder, Dimension?) -> TitleComponentBuilder, --- `build()`. build: (TitleComponentBuilder) -> TitleComponent, } --- `TextComponent`: a string at a baseline, with `` runs and a shadow or a --- four-way outline. export type TextComponent = RenderableEntity & { --- `setText(text)`. setText: (TextComponent, string?) -> (), --- `(TextComponent, Point?) -> ()`: --- `setPosition(position)`: the baseline's start. --- --- `(TextComponent, number, number) -> ()`: --- `setPosition(x, y)`. setPosition: ((TextComponent, Point?) -> ()) & ((TextComponent, number, number) -> ()), --- `setColor(color)`: `nil` draws the text in the shadow's black. setColor: (TextComponent, Color?) -> (), --- `setOutline(outline)`: four offset copies instead of the shadow. setOutline: (TextComponent, boolean) -> (), --- `setFont(font)`: `nil` uses the graphics' font. setFont: (TextComponent, Font?) -> (), } export type TextComponentClass = { --- `TextComponent.new()`: white, shadowed, the graphics' font. new: () -> TextComponent, } --- `TextComponent`'s static functions and constants. declare TextComponent: TextComponentClass --- `ProgressBarComponent`: a filled bar with a centred label and optional side labels. export type ProgressBarComponent = LayoutableRenderableEntity & { --- `setMinimum(minimum)`. setMinimum: (ProgressBarComponent, number) -> (), --- `setMaximum(maximum)`. setMaximum: (ProgressBarComponent, number) -> (), --- `setValue(value)`. setValue: (ProgressBarComponent, number) -> (), --- `setLabelDisplayMode(mode)`. setLabelDisplayMode: (ProgressBarComponent, LabelDisplayMode?) -> (), --- `setCenterLabel(label)`: appended to the mode's text. setCenterLabel: (ProgressBarComponent, string?) -> (), --- `setLeftLabel(label)`. setLeftLabel: (ProgressBarComponent, string?) -> (), --- `setRightLabel(label)`. setRightLabel: (ProgressBarComponent, string?) -> (), --- `setForegroundColor(color)`: the filled part. setForegroundColor: (ProgressBarComponent, Color?) -> (), --- `setBackgroundColor(color)`: the empty part. setBackgroundColor: (ProgressBarComponent, Color?) -> (), --- `setFontColor(color)`. setFontColor: (ProgressBarComponent, Color?) -> (), } export type ProgressBarComponentClass = { --- `ProgressBarComponent.new()`: 0 to 100, a percentage label, green on white. new: () -> ProgressBarComponent, --- `ProgressBarComponent.LabelDisplayMode`: the nested class `LabelDisplayMode`. LabelDisplayMode: LabelDisplayModeClass, } --- `ProgressBarComponent`'s static functions and constants. declare ProgressBarComponent: ProgressBarComponentClass --- An enum: what a progress bar's label shows. Reached as `ProgressBarComponent.LabelDisplayMode` (and the global `LabelDisplayMode`): 4 constants, each one userdata per VM, so `==` is identity and a constant is a table key; `values()`, `valueOf(name)`, and on a constant `name()`, `ordinal()` (0-based), `toString()`, `compareTo()` and `equals()`. --- --- `__tostring`: `tostring` is the name. export type LabelDisplayMode = { --- The constant's name as declared. name: (LabelDisplayMode) -> string, --- The constant's 0-based position in `values()`. ordinal: (LabelDisplayMode) -> number, --- `name()`; `tostring(c)` answers the same. toString: (LabelDisplayMode) -> string, --- This ordinal less `other`'s. compareTo: (LabelDisplayMode, LabelDisplayMode) -> number, --- Whether `other` is this constant. `==` answers the same. equals: (LabelDisplayMode, any) -> boolean, } export type LabelDisplayModeClass = { --- Every constant in ordinal order, as a new 1-based array. values: () -> {LabelDisplayMode}, --- The constant named `name`; any other name is an error. valueOf: (string) -> LabelDisplayMode, --- `PERCENTAGE`: ordinal 0, the value as a percentage. PERCENTAGE: LabelDisplayMode, --- `FULL`: ordinal 1, `value/maximum`. FULL: LabelDisplayMode, --- `TEXT_ONLY`: ordinal 2, the centre label only. TEXT_ONLY: LabelDisplayMode, --- `BOTH`: ordinal 3, `value/maximum (percentage)`. BOTH: LabelDisplayMode, } --- `LabelDisplayMode`'s static functions and constants. declare LabelDisplayMode: LabelDisplayModeClass --- `ProgressPieComponent`: a pie slice of `progress` turns from 12 o'clock inside a --- circle, centred on `position`. export type ProgressPieComponent = RenderableEntity & { --- `setDiameter(diameter)`. setDiameter: (ProgressPieComponent, number) -> (), --- `setBorderColor(color)`. setBorderColor: (ProgressPieComponent, Color?) -> (), --- `setFill(color)`. setFill: (ProgressPieComponent, Color?) -> (), --- `setProgress(progress)`: the filled fraction, 1 for a full circle. setProgress: (ProgressPieComponent, number) -> (), --- `setPosition(position)`: the centre. setPosition: (ProgressPieComponent, Point?) -> (), --- `setBorder(color, size)`: the border's colour and a `BasicStroke(size)`. setBorder: (ProgressPieComponent, Color?, number) -> (), } export type ProgressPieComponentClass = { --- `ProgressPieComponent.new()`: 25 px, white, a 1 px border. new: () -> ProgressPieComponent, } --- `ProgressPieComponent`'s static functions and constants. declare ProgressPieComponent: ProgressPieComponentClass --- `ImageComponent`: an image at its natural size. export type ImageComponent = LayoutableRenderableEntity export type ImageComponentClass = { --- `ImageComponent.new(image)`: draws `image` as it is at each render (an item image --- that loads later shows once loaded); `nil` renders nothing. new: (BufferedImage?) -> ImageComponent, } --- `ImageComponent`'s static functions and constants. declare ImageComponent: ImageComponentClass --- `SplitComponent`: two components one after the other, the second laid out in what --- the first leaves of the preferred size. export type SplitComponent = LayoutableRenderableEntity & { --- `setFirst(first)`. setFirst: (SplitComponent, LayoutableRenderableEntity?) -> (), --- `setSecond(second)`. setSecond: (SplitComponent, LayoutableRenderableEntity?) -> (), --- `setOrientation(orientation)`. setOrientation: (SplitComponent, ComponentOrientation?) -> (), --- `setGap(gap)`. setGap: (SplitComponent, Point?) -> (), } export type SplitComponentClass = { --- `SplitComponent.builder()`. builder: () -> SplitComponentBuilder, } --- `SplitComponent`'s static functions and constants. declare SplitComponent: SplitComponentClass --- `SplitComponent.SplitComponentBuilder`. export type SplitComponentBuilder = { --- `first(first)`. first: (SplitComponentBuilder, LayoutableRenderableEntity?) -> SplitComponentBuilder, --- `second(second)`. second: (SplitComponentBuilder, LayoutableRenderableEntity?) -> SplitComponentBuilder, --- `preferredLocation(location)`. preferredLocation: (SplitComponentBuilder, Point?) -> SplitComponentBuilder, --- `preferredSize(size)`. preferredSize: (SplitComponentBuilder, Dimension?) -> SplitComponentBuilder, --- `orientation(orientation)`. orientation: (SplitComponentBuilder, ComponentOrientation?) -> SplitComponentBuilder, --- `gap(gap)`. gap: (SplitComponentBuilder, Point?) -> SplitComponentBuilder, --- `build()`: a new `SplitComponent` holding the same two halves. build: (SplitComponentBuilder) -> SplitComponent, } --- `TooltipComponent`: a tooltip box: `
` lines, `` runs, `` mod icons. export type TooltipComponent = LayoutableRenderableEntity & { --- `setText(text)`. setText: (TooltipComponent, string?) -> (), --- `setBackgroundColor(color)`. setBackgroundColor: (TooltipComponent, Color?) -> (), --- `setPosition(position)`: the top-left corner. setPosition: (TooltipComponent, Point?) -> (), } export type TooltipComponentClass = { --- `TooltipComponent.new()`. new: () -> TooltipComponent, } --- `TooltipComponent`'s static functions and constants. declare TooltipComponent: TooltipComponentClass --- `BackgroundComponent`: the panel fill and its two-tone border. export type BackgroundComponent = RenderableEntity & { --- `setBackgroundColor(color)`. setBackgroundColor: (BackgroundComponent, Color?) -> (), --- `setRectangle(rectangle)`: what to fill. setRectangle: (BackgroundComponent, Rectangle?) -> (), --- `setFill(fill)`: `false` draws the border only. setFill: (BackgroundComponent, boolean) -> (), } export type BackgroundComponentClass = { --- `() -> BackgroundComponent`: --- `BackgroundComponent.new()`: the standard colour, an empty rectangle, filled. --- --- `(Color?, Rectangle?, boolean) -> BackgroundComponent`: --- `BackgroundComponent.new(backgroundColor, rectangle, fill)`. new: (() -> BackgroundComponent) & ((Color?, Rectangle?, boolean) -> BackgroundComponent), } --- `BackgroundComponent`'s static functions and constants. declare BackgroundComponent: BackgroundComponentClass --- `InfoBoxComponent`: one infobox: the box, its image centred, its caption. export type InfoBoxComponent = LayoutableRenderableEntity & { --- `getTooltip()`. getTooltip: (InfoBoxComponent) -> string?, --- `setTooltip(tooltip)`. setTooltip: (InfoBoxComponent, string?) -> (), --- `setText(text)`: the caption. setText: (InfoBoxComponent, string?) -> (), --- `setColor(color)`: the caption's. setColor: (InfoBoxComponent, Color?) -> (), --- `setFont(font)`: the caption's at 32 px and up (the small font below). setFont: (InfoBoxComponent, Font?) -> (), --- `setOutline(outline)`. setOutline: (InfoBoxComponent, boolean) -> (), --- `setBackgroundColor(color)`. setBackgroundColor: (InfoBoxComponent, Color?) -> (), --- `setImage(image)`: drawn as it is at each render. setImage: (InfoBoxComponent, BufferedImage?) -> (), } export type InfoBoxComponentClass = { --- `InfoBoxComponent.new()`. new: () -> InfoBoxComponent, } --- `InfoBoxComponent`'s static functions and constants. declare InfoBoxComponent: InfoBoxComponentClass --- A text tooltip, or a component shown as one. export type Tooltip = { --- `getText()`. getText: (Tooltip) -> string?, --- `setText(text)`. setText: (Tooltip, string?) -> (), --- `getComponent()`. getComponent: (Tooltip) -> LayoutableRenderableEntity?, --- `setComponent(component)`. setComponent: (Tooltip, LayoutableRenderableEntity?) -> (), } export type TooltipClass = { --- `(string?) -> Tooltip`: --- `Tooltip.new(text)`: `
` lines, `` runs and `` mod icons. --- --- `(LayoutableRenderableEntity) -> Tooltip`: --- `Tooltip.new(component)`: a component drawn where the tooltip goes (a panel's --- background becomes the configured overlay colour). new: ((string?) -> Tooltip) & ((LayoutableRenderableEntity) -> Tooltip), } --- `Tooltip`'s static functions and constants. declare Tooltip: TooltipClass --- The `tooltipManager` global: the tooltips to show this frame. One queue for every --- plugin: the tooltip pass draws every plugin's tooltips stacked under the cursor in the --- order they were queued, then clears the queue. Each `Tooltip` is read when it is drawn: --- a `setText` after `add` shows. The overlay draws natively, so a tooltip's component --- must be built from the built-in components: one holding a plugin's own --- `LayoutableRenderableEntity` table is refused by `add`. export type TooltipManager = { --- `add(tooltip)`: after the ones already queued. Raises for a component holding a --- plugin's own `LayoutableRenderableEntity` table (see the class). add: (TooltipManager, Tooltip) -> (), --- `addFront(tooltip)`: before the ones already queued. Raises as `add` does. addFront: (TooltipManager, Tooltip) -> (), --- `clear()`: removes every plugin's queued tooltips. clear: (TooltipManager) -> (), } --- An `Overlay` whose content is one `PanelComponent`, `self.panelComponent`. Subclass it with `local X = class(OverlayPanel)`; the subclass's `render` fills `self.panelComponent:getChildren()` and returns `X.super.render(self, graphics)`, which lays the panel out at the overlay's resized size and empties the children afterwards (`setClearChildren(false)` keeps them). export type OverlayPanel = Overlay & { --- The panel `render` draws. panelComponent: PanelComponent, --- `panelComponent`. getPanelComponent: (OverlayPanel) -> PanelComponent, --- Whether `render` empties the panel's children (default true). isClearChildren: (OverlayPanel) -> boolean, --- Whether `render` empties the panel's children. setClearChildren: (OverlayPanel, boolean) -> (), --- Whether the font follows the resized width (default false). isDynamicFont: (OverlayPanel) -> boolean, --- Whether the font follows the resized width. setDynamicFont: (OverlayPanel, boolean) -> (), --- The background used instead of the standard one, or nil. getPreferredColor: (OverlayPanel) -> Color?, --- The background used instead of the standard one, or nil. setPreferredColor: (OverlayPanel, Color?) -> (), } export type OverlayPanelClass = { --- Whether `obj` is an instance of this class or a subclass of it, as made with `class`. isInstance: (any) -> boolean, --- `() -> OverlayPanel`: --- An `Overlay` with a new `PanelComponent`, resizable. A subclass's `new` runs it first. --- --- `(any?) -> OverlayPanel`: --- As `new()`; the plugin is the caller's to keep, as with `Overlay`. new: (any?) -> OverlayPanel, } --- `OverlayPanel`'s static functions and constants. declare OverlayPanel: OverlayPanelClass --- An overlay drawn per item after the inventory, bank or equipment interface. Subclass it with `local X = class(WidgetItemOverlay)`, call `showOnInventory()` (`showOnBank()`, `showOnEquipment()`, `showOnInterfaces(...)`) in `init`, and define `X:renderItemOverlay(graphics, itemId, widgetItem)`. It is DYNAMIC, PRIORITY_LOW and MANUAL; its position and layer cannot be set. export type WidgetItemOverlay = Overlay & { --- Draws over one item. Abstract: a subclass defines it. renderItemOverlay: (WidgetItemOverlay, Graphics2D, number, WidgetItem) -> (), --- Draw after the inventory and every interface that shows it (bank, deposit box, shop, GE, equipment and price checker sides, seed vault, trade, costumes). showOnInventory: (WidgetItemOverlay) -> (), --- Draw after the bank's and the shared bank's item containers. showOnBank: (WidgetItemOverlay) -> (), --- Draw after the worn equipment interface. showOnEquipment: (WidgetItemOverlay) -> (), --- Draw after each interface id given, as arguments or one array. showOnInterfaces: (WidgetItemOverlay, ...number) -> (), } export type WidgetItemOverlayClass = { --- Whether `obj` is an instance of this class or a subclass of it, as made with `class`. isInstance: (any) -> boolean, --- Position DYNAMIC, priority `PRIORITY_LOW`, layer MANUAL. A subclass's `new` runs it first. new: () -> WidgetItemOverlay, } --- `WidgetItemOverlay`'s static functions and constants. declare WidgetItemOverlay: WidgetItemOverlayClass --- One box of the infobox panel. Subclass it with `local X = class(InfoBox, "X")` and define `getText()` and `getTextColor()`; call `X.super.init(self, image, plugin)` inside `X:init(...)`. The plugin argument may be left out (`X.super.init(self, image)`, or `self:setImage(image)` alone): a box without one reports the plugin its VM runs (`getPlugin()`, `getName()`). Add it with `infoBoxManager:addInfoBox(box)`. Every frame the panel reads `render()`, `getText()`, `getTextColor()` and `getTooltip()`, in that order, in the plugin's own callback (`getName()` and `getMenuEntries()` when the box is added and while it is hovered); `cull()` is asked once a game tick. An answer of the wrong type (a number from `getText()`) skips the box and is logged against the plugin. `getName()` without an override is `_`: the plugin class's name, else its descriptor name without spaces, and the box class's name, `class(InfoBox, "MyBox")` or `X.__name = "MyBox"`, else the name of the module that defines it when that module defines no other box class (`src/CannonCounter.luau`, one class to a file), else `Counter`, `Timer`, ... for the framework's, else `InfoBox__`, where the class's own first method is defined: the name is the key a detached group is saved under, so it must not change across restarts. Give the class a name. export type InfoBox = { --- The caption. Abstract: a subclass defines it. getText: (InfoBox) -> string?, --- The caption's colour (nil: white). Abstract: a subclass defines it. getTextColor: (InfoBox) -> Color?, --- Whether to show the box this frame: true; override it. Anything but `true` hides it. render: (InfoBox) -> boolean, --- Whether to remove the box (asked once a game tick): false; override it. cull: (InfoBox) -> boolean, --- The key its detached group is saved under: `_` (see the class doc). Override it to choose another. getName: (InfoBox) -> string, --- The plugin it was made with: the manager orders a priority's boxes by its name. getPlugin: (InfoBox) -> PluginObject?, --- The image. getImage: (InfoBox) -> BufferedImage?, --- Sets the image; once added, `infoBoxManager:updateInfoBoxImage(box)` rescales it. setImage: (InfoBox, BufferedImage?) -> (), --- The priority (default NONE). getPriority: (InfoBox) -> InfoBoxPriority?, --- The priority: HIGH boxes come first, then MED, NONE, LOW; within one, by plugin name. Read when the box is added. setPriority: (InfoBox, InfoBoxPriority?) -> (), --- The hover tooltip (`
`, ``), or nil. getTooltip: (InfoBox) -> string?, --- The hover tooltip. setTooltip: (InfoBox, string?) -> (), --- The live list of the box's shift-right-click entries (the manager adds Detach, Flip and, outside the default group, Delete). getMenuEntries: (InfoBox) -> {OverlayMenuEntry}, --- Replaces the list. setMenuEntries: (InfoBox, {OverlayMenuEntry}) -> (), } export type InfoBoxClass = { --- Whether `obj` is an instance of this class or a subclass of it, as made with `class`. isInstance: (any) -> boolean, --- The constructor: the image, the plugin, priority NONE. A subclass calls it as `X.super.init(self, image, plugin)`. new: (BufferedImage?, any?) -> InfoBox, } --- `InfoBox`'s static functions and constants. declare InfoBox: InfoBoxClass --- An infobox showing a number in white. `Counter.new(image, plugin, count)`, or subclass it (`X.super.init(self, image, plugin, count)`). export type Counter = InfoBox & { --- The count. getCount: (Counter) -> number, --- The count. setCount: (Counter, number) -> (), --- The text form: `Counter(count=5)`. toString: (Counter) -> string, } export type CounterClass = { --- Whether `obj` is an instance of this class or a subclass of it, as made with `class`. isInstance: (any) -> boolean, --- A counter at `count`. new: (BufferedImage?, any?, number) -> Counter, } --- `Counter`'s static functions and constants. declare Counter: CounterClass --- An infobox counting down `m:ss` on the wall clock from when it was made, red in its last tenth, hidden and culled once it has run out. export type Timer = InfoBox & { --- When it was made. getStartTime: (Timer) -> Instant, --- When it runs out. getEndTime: (Timer) -> Instant, --- From start to end. getDuration: (Timer) -> Duration, --- Run out `duration` after the start; raises `IllegalArgumentException` for a negative one. setDuration: (Timer, Duration) -> (), --- Run out `duration` from now; raises `IllegalArgumentException` for a negative one. updateDuration: (Timer, Duration) -> (), --- The text form: `Timer(startTime=..., endTime=..., duration=...)`. toString: (Timer) -> string, } export type TimerClass = { --- Whether `obj` is an instance of this class or a subclass of it, as made with `class`. isInstance: (any) -> boolean, --- A timer of `period` `unit`s from now; raises `IllegalArgumentException` for a period of 0 or less. new: (number, ChronoUnit, BufferedImage?, any?) -> Timer, } --- `Timer`'s static functions and constants. declare Timer: TimerClass --- An infobox showing `m:ss` into (or, reversed, left of) a period that restarts forever. export type LoopTimer = InfoBox & { --- When it was made. getStartTime: (LoopTimer) -> Instant, --- The period. getDuration: (LoopTimer) -> Duration, --- Whether it counts down. isReverse: (LoopTimer) -> boolean, --- The text form: `LoopTimer(startTime=..., duration=..., reverse=...)`. toString: (LoopTimer) -> string, } export type LoopTimerClass = { --- Whether `obj` is an instance of this class or a subclass of it, as made with `class`. isInstance: (any) -> boolean, --- `(number, ChronoUnit, BufferedImage?, any?, boolean) -> LoopTimer`: --- A loop of `period` `unit`s from now; raises `IllegalArgumentException` for a period of 0 or less. --- --- `(number, ChronoUnit, BufferedImage?, any?) -> LoopTimer`: --- As the five-argument form, not reversed. new: ((number, ChronoUnit, BufferedImage?, any?, boolean) -> LoopTimer) & ((number, ChronoUnit, BufferedImage?, any?) -> LoopTimer), } --- `LoopTimer`'s static functions and constants. declare LoopTimer: LoopTimerClass --- The `infoBoxManager` global: one manager for every plugin's boxes, laid out by the infobox overlay (35 px boxes in rows of four, the image centred, the caption below, the hovered box's tooltip and its Detach / Flip / Delete entries), its groups and their orientations kept in the `infoboxlayer` and `infoboxoverlay` config groups. `getInfoBoxes`, `removeIf` and `cull` see this plugin's boxes (another plugin's are not values a plugin can hold). export type InfoBoxManager = { --- Adds the box to its saved group (the default one unless detached), after the boxes of a higher or equal priority and plugin name; scales its image to the box size. Raises for nil. addInfoBox: (InfoBoxManager, InfoBox) -> (), --- Removes the box and the manager's menu entries; nil or a box not added does nothing. removeInfoBox: (InfoBoxManager, InfoBox?) -> (), --- Removes this plugin's boxes `filter` answers true for (each asked once, then removed). removeIf: (InfoBoxManager, (InfoBox) -> boolean) -> (), --- This plugin's boxes, group by group in the manager's order. getInfoBoxes: (InfoBoxManager) -> {InfoBox}, --- Removes this plugin's boxes whose `cull()` answers true (also done once a game tick). cull: (InfoBoxManager) -> (), --- Scales the box's image to fit the box size (shrinking only), after `setImage`. updateInfoBoxImage: (InfoBoxManager, InfoBox) -> (), } --- The base of every image. A Bento image is always a `BufferedImage` (or an --- `AsyncBufferedImage`); this class carries what every image has, and is the --- type a parameter of type `Image` takes. `==` compares identity: two handles --- to the same image are equal. --- --- `__eq`: Whether `other` is the same image (identity). export type Image = { --- The width; the observer is ignored (pass `nil`), as a Bento image is --- always complete. getWidth: (Image, ImageObserver?) -> number, --- The height; the observer is ignored (pass `nil`). getHeight: (Image, ImageObserver?) -> number, --- A scaled copy: area averaging when `hints` has `SCALE_SMOOTH` or --- `SCALE_AREA_AVERAGING`, else pixel replication. A size of -1 keeps the --- aspect ratio from the other, in `int` arithmetic; a size of 0 is an --- error. The copy is made now. getScaledInstance: (Image, number, number, number) -> Image, --- Whether `other` equals this Image, as `==` answers it (`false` for a value of another class). equals: (Image, any) -> boolean, } export type ImageClass = { --- `Image.SCALE_DEFAULT`. SCALE_DEFAULT: number, --- `Image.SCALE_FAST`. SCALE_FAST: number, --- `Image.SCALE_SMOOTH`. SCALE_SMOOTH: number, --- `Image.SCALE_REPLICATE`. SCALE_REPLICATE: number, --- `Image.SCALE_AREA_AVERAGING`. SCALE_AREA_AVERAGING: number, } --- `Image`'s static functions and constants. declare Image: ImageClass --- An image with its pixels in memory, stored as `TYPE_INT_ARGB` (straight --- alpha). `getRGB`/`setRGB` take and give signed 32-bit `int`s (`0xAARRGGBB`, --- negative when alpha is 0x80 or more): a `Color` goes in as `Color.getRGB(c)`. --- --- `__eq`: Whether `other` is the same image (identity). export type BufferedImage = Image & { --- The image type it was made with: `TYPE_INT_ARGB` for every image Bento --- makes itself, and the type a PNG decodes to for a decoded one --- (`TYPE_4BYTE_ABGR` for RGBA, `TYPE_CUSTOM` for grey and alpha). getType: (BufferedImage) -> number, --- The pixel at `(x, y)` as a signed 32-bit ARGB `int`. Outside the image is --- an error ("Coordinate out of bounds!"). getRGB: (BufferedImage, number, number) -> number, --- `(BufferedImage, number, number, number) -> ()`: --- Set the pixel at `(x, y)` (an opaque type keeps alpha 0xff). --- --- `(BufferedImage, number, number, number, number, {number}, number, number) -> ()`: --- Set a `w` x `h` block from `rgbArray`: the pixel at --- `(startX + i, startY + j)` is `rgbArray[offset + j * scansize + i]`, --- `offset` counting from 0 (element 1 of a Luau array is offset 0). setRGB: ((BufferedImage, number, number, number) -> ()) & ((BufferedImage, number, number, number, number, {number}, number, number) -> ()), --- The `w` x `h` rectangle at `(x, y)`, sharing this image's pixels: --- writes to either show in the other. Outside the image, or an empty size, --- is an error. getSubimage: (BufferedImage, number, number, number, number) -> BufferedImage, --- A `Graphics2D` drawing into this image: each call draws at once. Dispose --- it when done (nothing leaks if not). createGraphics: (BufferedImage) -> Graphics2D, --- The same as `createGraphics()`. getGraphics: (BufferedImage) -> Graphics2D, --- Whether the pixels are all there: an item image (`ItemManager:getImage`) --- is a blank `AsyncBufferedImage` until its sprite renders (`onLoaded` waits --- for it); every other image always is. isLoaded: (BufferedImage) -> boolean, } export type BufferedImageClass = { --- `BufferedImage.new(width, height, imageType)`: transparent, or black --- for an opaque type. `TYPE_INT_RGB`, `TYPE_INT_ARGB`, the BGR and --- 4-byte ABGR types and the premultiplied ones are stored; the packed --- grey, 565/555, binary and indexed types are an error. new: (number, number, number) -> BufferedImage, --- `BufferedImage.TYPE_CUSTOM`. TYPE_CUSTOM: number, --- `BufferedImage.TYPE_INT_RGB`. TYPE_INT_RGB: number, --- `BufferedImage.TYPE_INT_ARGB`. TYPE_INT_ARGB: number, --- `BufferedImage.TYPE_INT_ARGB_PRE`. TYPE_INT_ARGB_PRE: number, --- `BufferedImage.TYPE_INT_BGR`. TYPE_INT_BGR: number, --- `BufferedImage.TYPE_3BYTE_BGR`. TYPE_3BYTE_BGR: number, --- `BufferedImage.TYPE_4BYTE_ABGR`. TYPE_4BYTE_ABGR: number, --- `BufferedImage.TYPE_4BYTE_ABGR_PRE`. TYPE_4BYTE_ABGR_PRE: number, } --- `BufferedImage`'s static functions and constants. declare BufferedImage: BufferedImageClass --- A `BufferedImage` whose pixels arrive later. `ItemManager:getImage` returns --- one, blank (36x32, transparent) until the client renders the item; drawing it --- draws whatever it holds now. `onLoaded` runs a function once it has loaded. --- --- `__eq`: Whether `other` is the same image (identity). export type AsyncBufferedImage = BufferedImage & { --- Run `r` on the client thread once the image has loaded: at the next client tick when it already has, else with the image's other listeners, in the order added, at the client tick it loads by. Never inside this call. An image whose item never renders never runs `r`. onLoaded: (AsyncBufferedImage, () -> ()) -> (), --- `(AsyncBufferedImage, JButton) -> ()`: --- Show this image on `c`: `c:setIcon(ImageIcon.new(image))`, and while the image has not loaded, `c:repaint()` with its `onLoaded` listeners, so the item shows once it renders (the icon shares the image's pixels). --- --- `(AsyncBufferedImage, JLabel) -> ()`: --- Show this image on `c`: `c:setIcon(ImageIcon.new(image))`, and while the image has not loaded, `c:repaint()` with its `onLoaded` listeners, so the item shows once it renders (the icon shares the image's pixels). addTo: ((AsyncBufferedImage, JButton) -> ()) & ((AsyncBufferedImage, JLabel) -> ()), } --- A sprite as the client stores it, its pixels --- trimmed to `getWidth() x getHeight()` and placed at `getOffsetX()`, --- `getOffsetY()` in a `getMaxWidth() x getMaxHeight()` frame. export type SpritePixels = { --- The stored width (the pixels' row length). getWidth: (SpritePixels) -> number, --- The stored height. getHeight: (SpritePixels) -> number, --- The full frame's width. getMaxWidth: (SpritePixels) -> number, --- The full frame's height. getMaxHeight: (SpritePixels) -> number, --- Where the stored pixels start in the frame, across. getOffsetX: (SpritePixels) -> number, --- Where the stored pixels start in the frame, down. getOffsetY: (SpritePixels) -> number, --- The pixels, row by row (a copy; element 1 is pixel 0): a client sprite's --- 24-bit RGB, `0` transparent and a drawn black `1`; a sprite made from `int`s --- (`client:createSpritePixels`, `ImageUtil.getImageSpritePixels`) answers them as --- given. A write to the copy does not change the sprite. getPixels: (SpritePixels) -> {number}, --- A new `getWidth() x getHeight()` image of the pixels, every non-zero --- pixel ORed opaque (a drawn black reads `0xff000001`). toBufferedImage: (SpritePixels) -> BufferedImage, --- A new image of the sprite's outline in `color`: each pixel that is `0` or --- `0xffffff` beside a non-zero one becomes `color`, every other pixel --- transparent (a lone `0xffffff` is kept, which is a transparent white). toBufferedOutline: (SpritePixels, Color) -> BufferedImage, } export type SpritePixelsClass = { --- `SpritePixels.DEFAULT_SHADOW_COLOR`. DEFAULT_SHADOW_COLOR: number, } --- `SpritePixels`'s static functions and constants. declare SpritePixels: SpritePixelsClass --- Image helpers. Unless a member says otherwise, each makes a new `BufferedImage` and leaves its argument as it was. `rotateImage` samples bilinearly: exact for a right angle, within a level of rounding at a few pixels for other angles. export type ImageUtil = { } export type ImageUtilClass = { --- The image itself: every Bento image is already a `BufferedImage`. bufferedImageFromImage: (Image) -> BufferedImage, --- The image itself when its type is `TYPE_INT_ARGB`, else a `TYPE_INT_ARGB` image it is drawn into (a decoded PNG, a premultiplied or 4-byte ABGR image): a transparent pixel comes out 0 and a faint pixel's colour is rounded. toARGB: (Image) -> BufferedImage, --- Every pixel `color`, keeping its alpha. recolorImage: (Image, Color) -> BufferedImage, --- `offset` added to red, green and blue, clamped. luminanceOffset: (Image, number) -> BufferedImage, --- Red, green and blue scaled by `percentage`, clamped. luminanceScale: (Image, number) -> BufferedImage, --- `(Image, number) -> BufferedImage`: --- `offset` added to alpha, clamped. The two overloads are told apart by the number: a whole number (`50`, and also `1.0`) is this one. --- --- `(Image, number) -> BufferedImage`: --- Alpha scaled by `percentage`, clamped. Reached with a fractional number (`0.5`); a whole number reaches the `int` overload. alphaOffset: (Image, number) -> BufferedImage, --- A greyed copy, as Swing's disabled icons (`GrayFilter`, brighter, 50%). grayscaleImage: (BufferedImage) -> BufferedImage, --- `(BufferedImage, number, number) -> BufferedImage`: --- A smoothly scaled (area-averaged) copy of the given size. --- --- `(BufferedImage, number, number, boolean) -> BufferedImage`: --- A smoothly scaled copy; with `preserveAspectRatio`, the longer side fits and the other keeps the ratio. resizeImage: ((BufferedImage, number, number) -> BufferedImage) & ((BufferedImage, number, number, boolean) -> BufferedImage), --- The image centred on a transparent canvas of the given size. resizeCanvas: (BufferedImage, number, number) -> BufferedImage, --- The image rotated `theta` radians about its centre, on a canvas the size of its rotated bounds, of the image's type when that has alpha (`TYPE_4BYTE_ABGR` for an RGBA PNG), else `TYPE_INT_ARGB`. rotateImage: (BufferedImage, number) -> BufferedImage, --- A mirrored copy. flipImage: (BufferedImage, boolean, boolean) -> BufferedImage, --- `(BufferedImage, Color) -> BufferedImage`: --- The image with a one-pixel `color` outline, corners left out. --- --- `(BufferedImage, Color, boolean) -> BufferedImage`: --- The image with a one-pixel `color` outline, corners included when `outlineCorners`. outlineImage: ((BufferedImage, Color) -> BufferedImage) & ((BufferedImage, Color, boolean) -> BufferedImage), --- Every non-transparent pixel `color`. fillImage: (BufferedImage, Color) -> BufferedImage, --- An image resource: `path` resolved against the class `c`. A relative path with the plugin's own class (pass the plugin object, a panel, or `nil`) is the plugin's package, whose resources are its `assets/` folder: `notes_icon.png` reads `assets/notes_icon.png` (then the package root, so `assets/notes_icon.png` also works). A relative path with a built-in class (`AlternateSprites`, `ColorScheme`, or one Bento has no global for, by its name as a string: `"IconTextField"`) is the built-in resource in that class's package. `/x.png` is the resource root: the built-in shared resources first (`/util/reset.png`, `/util/arrow_right.png`, `/skill_icons/attack.png`), then the plugin's `assets/x.png`. A missing file is an `IllegalArgumentException` (`x.png is not found`); a file that is not a PNG is `nil` (Bento decodes PNG only). The image's `getType()` is what the PNG decodes to (`TYPE_4BYTE_ABGR` for an RGBA PNG, `TYPE_CUSTOM` for grey and alpha), and a grey PNG's samples are answered through the grey curve (a sample of 98 is 167). loadImageResource: (any?, string) -> BufferedImage?, --- The image as `SpritePixels`: its ARGB pixels, every fully transparent one 0. Pass the `client` global. getImageSpritePixels: (BufferedImage, Client) -> SpritePixels, --- The image as an `IndexedSprite` (a chat icon for `client:getModIcons()`): a palette of its fully opaque colours after an unused entry 0, every other pixel transparent (index 0), its sizes, no offsets. Opaque black finds the unused entry 0, so it is transparent. More than 255 colours raises. Pass the `client` global. getImageIndexedSprite: (BufferedImage, Client) -> IndexedSprite, --- The image encoded in `data` (a byte string, e.g. an HTTP body or `Asset.bytes`), or `nil` when it is not one, with the type and samples `loadImageResource` gives. Bento decodes PNG only. fromBytes: (string) -> BufferedImage?, } --- `ImageUtil`'s static functions and constants. declare ImageUtil: ImageUtilClass --- The `spriteManager` global: the client's archive sprites as images. export type SpriteManager = { --- Frame `file` of sprite `archive` (a `SpriteID`), as an image of its --- stored size, or `nil` while the client cannot read it (before the login --- screen, or a group it has not loaded). A `file` the group does not hold is an --- error (`ArrayIndexOutOfBoundsException`). The same sprite is the --- same image while it is cached (128 are kept). Frames --- past the first read `nil` on a client whose table does not place them. getSprite: (SpriteManager, number, number) -> BufferedImage?, --- `(SpriteManager, number, number, (BufferedImage) -> ()) -> ()`: --- Call `user` with frame `file` of sprite `archive`: at once when the sprite is cached or the client can read it now (an error in `user` is this call's), else on the client thread at the first client tick it can. --- --- `(SpriteManager, number, number, InfoBox) -> ()`: --- As the `user` overload, but the sprite is set on `infoBox` (`setImage`), then `infoBoxManager:updateInfoBoxImage(infoBox)`. getSpriteAsync: ((SpriteManager, number, number, (BufferedImage) -> ()) -> ()) & ((SpriteManager, number, number, InfoBox) -> ()), --- Replace game sprites with the plugin's images. `add` is an array of objects with `getSpriteId()` and `getFileName()` methods (such as an override enum). Nothing for an empty array; else, at the next client tick (`clientThread:invokeLater`), each override's `getFileName()` is loaded from the plugin's resources (`ImageUtil.loadImageResource`), made a sprite (`ImageUtil.getImageSpritePixels`) and put in `client:getSpriteOverrides()` under its `getSpriteId()`, so the client draws it wherever it loads that sprite. addSpriteOverrides: (SpriteManager, {any}) -> (), --- At the next client tick, remove each override's `getSpriteId()` from `client:getSpriteOverrides()`, so the client draws its own sprite again. removeSpriteOverrides: (SpriteManager, {any}) -> (), --- `(SpriteManager, JButton, number, number) -> ()`: --- Show frame `file` of sprite `archive` on `c`: `getSpriteAsync(archive, file, ...)`, then from Swing's queue (`SwingUtilities.invokeLater`) `c:setIcon(ImageIcon.new(sprite))`, so the icon is set after this call, once the client can read the sprite. --- --- `(SpriteManager, JLabel, number, number) -> ()`: --- Show frame `file` of sprite `archive` on `c`: `getSpriteAsync(archive, file, ...)`, then from Swing's queue (`SwingUtilities.invokeLater`) `c:setIcon(ImageIcon.new(sprite))`, so the icon is set after this call, once the client can read the sprite. addSpriteTo: ((SpriteManager, JButton, number, number) -> ()) & ((SpriteManager, JLabel, number, number) -> ()), } --- The `skillIconManager` global: skill icons. export type SkillIconManager = { --- `(SkillIconManager, Skill, boolean) -> BufferedImage`: --- `skill`'s icon, small (16x16) or large (25x25 and the like). The same skill --- and size is the same image. --- --- `(SkillIconManager, Skill) -> BufferedImage`: --- `skill`'s large icon. getSkillImage: ((SkillIconManager, Skill, boolean) -> BufferedImage) & ((SkillIconManager, Skill) -> BufferedImage), } --- The `itemManager` global: item images, prices, stats and canonical ids. export type ItemManager = { --- `(ItemManager, number) -> AsyncBufferedImage`: --- The item's 36x32 icon, with no quantity: `getImage(itemId, 1, false)`. --- --- `(ItemManager, number, number, boolean) -> AsyncBufferedImage`: --- The item's 36x32 icon as the client draws it in an interface --- (`createItemSprite(itemId, quantity, 1, SpritePixels.DEFAULT_SHADOW_COLOR, --- stackable ? ALWAYS : NEVER, false, CLIENT_DEFAULT_ZOOM)`): a black border, --- the shadow, and the quantity when `stackable`. Blank until the client renders --- it (at once on the client thread, else at a later client tick), then filled --- in; the same arguments give the same image while cached (128 are kept). getImage: ((ItemManager, number) -> AsyncBufferedImage) & ((ItemManager, number, number, boolean) -> AsyncBufferedImage), --- The outline of the item's icon in `outlineColor` --- (`createItemSprite(itemId, itemQuantity, 1, 0, 0, false, --- CLIENT_DEFAULT_ZOOM).toBufferedOutline(outlineColor)`). On the client thread --- this renders at once; an outline that cannot render yet is blank until it can. getItemOutline: (ItemManager, number, number, Color) -> BufferedImage, --- The item's price: `getItemPriceWithSource(itemID, true)`, the wiki price --- being the default source. getItemPrice: (ItemManager, number) -> number, --- The item's price: coins 1, platinum tokens 1000, a --- noted item its unnoted one's, a worn variant its inventory one's, an --- untradeable mapped to what it is worth (`ItemMapping`), else the price --- list's (the wiki price through `getWikiPrice` when `useWikiPrice`), else 0. getItemPriceWithSource: (ItemManager, number, boolean) -> number, --- The wiki price, guarded: the guide price when the wiki has none, the wiki --- price up to 1000, else whichever is lower of it and five times the guide --- price. getWikiPrice: (ItemManager, ItemPrice) -> number, --- The item's stats, or `nil` for a noted item or one with no known stats: --- equipable, weight (kg), buy limit and equipment bonuses, of its canonical --- id. getItemStats: (ItemManager, number) -> ItemStats?, --- The price list's rows whose name contains `itemName`, ignoring case, in the --- list's order. search: (ItemManager, string) -> {ItemPrice}, --- The item's un-noted, un-placeholdered id (and a worn variant's --- inventory id). canonicalize: (ItemManager, number) -> number, --- The item's definition: `client:getItemDefinition(itemId)` (never `nil`: an --- unknown id is the client's default, named "null"). getItemComposition: (ItemManager, number) -> ItemComposition, --- The ids of the items the Grand Exchange lists (`isGeTradeable()`, `getNote() == -1`) --- whose lower-cased name contains `query`, compared as given: the first `limit` by item --- id, then sorted by name, equal names by item id. A walk of `getItemComposition` over --- `client:getItemCount()` as one call: the names are read once and kept, so a search per --- keystroke reads no item. Raises for a negative `limit`. searchGeItems: (ItemManager, string, number) -> {number}, --- The ids of the items `searchGeItems` walks whose `FuzzySearchScorer:score(query, name)` --- is above 0: best score first, then by name, equal names by item id, at most `limit`. --- One call, the scoring included. A `query` with an empty word (`"a b"`, `" a"`, and `-` --- reads as a space) scores NaN, so finds nothing. Raises for a negative `limit`. fuzzySearchGeItems: (ItemManager, string, number) -> {number}, } --- One row of the price list. export type ItemPrice = { --- The item id. getId: (ItemPrice) -> number, --- The item's name, as the price list has it. getName: (ItemPrice) -> string, --- The Grand Exchange guide price (a 64-bit integer). getPrice: (ItemPrice) -> number, --- The wiki's real-time price (a 64-bit integer), 0 when it has none. getWikiPrice: (ItemPrice) -> number, } --- An item's equipability, weight, buy limit and equipment bonuses. export type ItemStats = { --- Whether the item can be worn. isEquipable: (ItemStats) -> boolean, --- The weight in kilograms (0 when the client has not loaded the item). getWeight: (ItemStats) -> number, --- The Grand Exchange buy limit (0 when unknown). getGeLimit: (ItemStats) -> number, --- The equipment bonuses, or `nil` for an item that is not worn. getEquipment: (ItemStats) -> ItemEquipmentStats?, } export type ItemStatsClass = { --- `ItemStats.new(equipable, weight, geLimit, equipment)`. new: (boolean, number, number, ItemEquipmentStats?) -> ItemStats, } --- `ItemStats`'s static functions and constants. declare ItemStats: ItemStatsClass --- An item's equipment slot and bonuses. export type ItemEquipmentStats = { --- The equipment slot (`EquipmentInventorySlot` index). getSlot: (ItemEquipmentStats) -> number, --- Whether it is two-handed. isTwoHanded: (ItemEquipmentStats) -> boolean, --- Stab attack bonus. getAstab: (ItemEquipmentStats) -> number, --- Slash attack bonus. getAslash: (ItemEquipmentStats) -> number, --- Crush attack bonus. getAcrush: (ItemEquipmentStats) -> number, --- Magic attack bonus. getAmagic: (ItemEquipmentStats) -> number, --- Ranged attack bonus. getArange: (ItemEquipmentStats) -> number, --- Stab defence bonus. getDstab: (ItemEquipmentStats) -> number, --- Slash defence bonus. getDslash: (ItemEquipmentStats) -> number, --- Crush defence bonus. getDcrush: (ItemEquipmentStats) -> number, --- Magic defence bonus. getDmagic: (ItemEquipmentStats) -> number, --- Ranged defence bonus. getDrange: (ItemEquipmentStats) -> number, --- Melee strength bonus. getStr: (ItemEquipmentStats) -> number, --- Ranged strength bonus. getRstr: (ItemEquipmentStats) -> number, --- Magic damage bonus, percent. getMdmg: (ItemEquipmentStats) -> number, --- Prayer bonus. getPrayer: (ItemEquipmentStats) -> number, --- Attack speed, in game ticks. getAspeed: (ItemEquipmentStats) -> number, } export type ItemEquipmentStatsClass = { --- A new builder with every field 0. builder: () -> ItemEquipmentStatsBuilder, } --- `ItemEquipmentStats`'s static functions and constants. declare ItemEquipmentStats: ItemEquipmentStatsClass --- What `ItemEquipmentStats.builder()` makes: each setter sets its field on this builder and answers it, so chained and statement-by-statement use set the same builder; `build()` makes the stats, every field not set 0. A Luau table (`typeof` answers `table`). export type ItemEquipmentStatsBuilder = { --- Sets the equipment slot. slot: (ItemEquipmentStatsBuilder, number) -> ItemEquipmentStatsBuilder, --- Sets whether it is two-handed. isTwoHanded: (ItemEquipmentStatsBuilder, boolean) -> ItemEquipmentStatsBuilder, --- Sets the stab attack bonus. astab: (ItemEquipmentStatsBuilder, number) -> ItemEquipmentStatsBuilder, --- Sets the slash attack bonus. aslash: (ItemEquipmentStatsBuilder, number) -> ItemEquipmentStatsBuilder, --- Sets the crush attack bonus. acrush: (ItemEquipmentStatsBuilder, number) -> ItemEquipmentStatsBuilder, --- Sets the magic attack bonus. amagic: (ItemEquipmentStatsBuilder, number) -> ItemEquipmentStatsBuilder, --- Sets the ranged attack bonus. arange: (ItemEquipmentStatsBuilder, number) -> ItemEquipmentStatsBuilder, --- Sets the stab defence bonus. dstab: (ItemEquipmentStatsBuilder, number) -> ItemEquipmentStatsBuilder, --- Sets the slash defence bonus. dslash: (ItemEquipmentStatsBuilder, number) -> ItemEquipmentStatsBuilder, --- Sets the crush defence bonus. dcrush: (ItemEquipmentStatsBuilder, number) -> ItemEquipmentStatsBuilder, --- Sets the magic defence bonus. dmagic: (ItemEquipmentStatsBuilder, number) -> ItemEquipmentStatsBuilder, --- Sets the ranged defence bonus. drange: (ItemEquipmentStatsBuilder, number) -> ItemEquipmentStatsBuilder, --- Sets the melee strength bonus. str: (ItemEquipmentStatsBuilder, number) -> ItemEquipmentStatsBuilder, --- Sets the ranged strength bonus. rstr: (ItemEquipmentStatsBuilder, number) -> ItemEquipmentStatsBuilder, --- Sets the magic damage bonus (`build` rounds it to single precision). mdmg: (ItemEquipmentStatsBuilder, number) -> ItemEquipmentStatsBuilder, --- Sets the prayer bonus. prayer: (ItemEquipmentStatsBuilder, number) -> ItemEquipmentStatsBuilder, --- Sets the attack speed. aspeed: (ItemEquipmentStatsBuilder, number) -> ItemEquipmentStatsBuilder, --- The stats set so far (each field not set is 0). build: (ItemEquipmentStatsBuilder) -> ItemEquipmentStats, --- A debug string of the fields. toString: (ItemEquipmentStatsBuilder) -> string, } --- An item's base item, and a base item's variations. export type ItemVariationMapping = { } export type ItemVariationMappingClass = { --- The base item of variation `itemId`, or `itemId` itself. map: (number) -> number, --- Every variation of base item `itemId`, the base last; `{ itemId }` for --- an item that is not a base. getVariations: (number) -> {number}, } --- `ItemVariationMapping`'s static functions and constants. declare ItemVariationMapping: ItemVariationMappingClass --- What `client:getWorldMap()` answers: the world map's view, read from the client's --- world map whether or not it is open. export type WorldMap = { --- The world tile at the centre of the map, or `nil` before the world map --- has been opened this session (the client has no world map yet). getWorldMapPosition: (WorldMap) -> Point?, --- The zoom the map draws at, pixels per tile, or 0 before the world map has --- been opened this session. getWorldMapZoom: (WorldMap) -> number, --- Scroll the map to `worldPoint`: when the map's current area contains the tile, --- it becomes the map's scroll target (`x - regionLowX * 64`, `y - regionLowY * --- 64`), and the client scrolls the map there over the next frames. Does nothing when --- the area does not contain the tile, or before the world map has an area (it was --- never opened this session); on the client thread only. setWorldMapPositionTarget: (WorldMap, WorldPoint) -> (), --- The canvas point at the centre of `worldPoint`'s tile on the open world map, or `nil` --- when the map is closed or its surface does not hold the tile, by the client's own --- surface test (`WorldMapData.surfaceContainsPosition`, on the client thread; elsewhere --- the area's region bounds only). worldPointToGraphicsPoint: (WorldMap, WorldPoint) -> Point?, --- The surface of the map's current area, or `nil` before the world map has an area this --- session: the client loads one when the map is first opened. getWorldMapData: (WorldMap) -> WorldMapData?, --- The world map's renderer, or `nil` before the world map has loaded an area this --- session. Raises on a client whose table does not place its layout. getWorldMapRenderer: (WorldMap) -> WorldMapRenderer?, } --- What `WorldMapPoint.builder()` makes: each setter sets its field and answers the builder; `build()` makes the point. export type WorldMapPointBuilder = { --- Sets `image` and answers the builder. image: (WorldMapPointBuilder, BufferedImage?) -> WorldMapPointBuilder, --- Sets `worldPoint` and answers the builder. worldPoint: (WorldMapPointBuilder, WorldPoint?) -> WorldMapPointBuilder, --- Sets `target` and answers the builder. target: (WorldMapPointBuilder, WorldPoint?) -> WorldMapPointBuilder, --- Sets `jumpOnClick` and answers the builder. jumpOnClick: (WorldMapPointBuilder, boolean) -> WorldMapPointBuilder, --- Sets `name` and answers the builder. name: (WorldMapPointBuilder, string?) -> WorldMapPointBuilder, --- Sets `tooltip` and answers the builder. tooltip: (WorldMapPointBuilder, string?) -> WorldMapPointBuilder, --- Sets `imagePoint` and answers the builder. imagePoint: (WorldMapPointBuilder, Point?) -> WorldMapPointBuilder, --- Sets `snapToEdge` and answers the builder. snapToEdge: (WorldMapPointBuilder, boolean) -> WorldMapPointBuilder, --- The point, with the fields set so far. build: (WorldMapPointBuilder) -> WorldMapPoint, --- The builder itself. self: (WorldMapPointBuilder) -> WorldMapPointBuilder, --- A debug string of the fields. toString: (WorldMapPointBuilder) -> string, } --- An image on the world map, added with `worldMapPointManager:add(point)`. A Luau table, so a plugin subclasses it (`local X = class(WorldMapPoint)`) and overrides `getImage`, `getName`, `getTooltip`, `onEdgeSnap`, `onEdgeUnsnap`; the world map overlay calls the overrides every frame it draws. The fields have getters and setters (`getX`/`isX`/`setX`), and are stored on the instance under their own names. export type WorldMapPoint = { --- The image drawn at the point (`nil`: nothing is drawn). Override it to draw another. getImage: (WorldMapPoint) -> BufferedImage?, --- Set the image drawn at the point. setImage: (WorldMapPoint, BufferedImage?) -> (), --- The tile the image is drawn at. getWorldPoint: (WorldMapPoint) -> WorldPoint?, --- Set the tile the image is drawn at. setWorldPoint: (WorldMapPoint, WorldPoint?) -> (), --- Where "Focus on" scrolls the map (`nil`: the point's own tile). getTarget: (WorldMapPoint) -> WorldPoint?, --- Set where "Focus on" scrolls the map. setTarget: (WorldMapPoint, WorldPoint?) -> (), --- The pixel of the image drawn on the tile (`nil`: the image's centre). getImagePoint: (WorldMapPoint) -> Point?, --- Set the pixel of the image drawn on the tile. setImagePoint: (WorldMapPoint, Point?) -> (), --- Whether the image stays at the map's edge when its tile is off the map. isSnapToEdge: (WorldMapPoint) -> boolean, --- Set whether the image stays at the map's edge. setSnapToEdge: (WorldMapPoint, boolean) -> (), --- Whether the image is at the edge now (the overlay sets it). isCurrentlyEdgeSnapped: (WorldMapPoint) -> boolean, --- Set whether the image is at the edge now. setCurrentlyEdgeSnapped: (WorldMapPoint, boolean) -> (), --- Whether hovering the image offers "Focus on" its name. isJumpOnClick: (WorldMapPoint) -> boolean, --- Set whether hovering the image offers "Focus on". setJumpOnClick: (WorldMapPoint, boolean) -> (), --- The name the "Focus on" entry shows. Override it to show another. getName: (WorldMapPoint) -> string?, --- Set the name the "Focus on" entry shows. setName: (WorldMapPoint, string?) -> (), --- The tooltip shown while the image is hovered (`
` breaks lines). Override it to show another. getTooltip: (WorldMapPoint) -> string?, --- Set the tooltip shown while the image is hovered. setTooltip: (WorldMapPoint, string?) -> (), --- Called when the image snaps to the map's edge; does nothing (override it). onEdgeSnap: (WorldMapPoint) -> (), --- Called when the image leaves the map's edge; does nothing (override it). onEdgeUnsnap: (WorldMapPoint) -> (), } export type WorldMapPointClass = { --- `(WorldPoint?, BufferedImage?) -> WorldMapPoint`: --- A point at `worldPoint` showing `image`; a subclass (`class(WorldMapPoint)`) calls it as `X.super.init(self, worldPoint, image)`. --- --- `(WorldMapPointBuilder) -> WorldMapPoint`: --- A point with every field from `builder`. new: ((WorldPoint?, BufferedImage?) -> WorldMapPoint) & ((WorldMapPointBuilder) -> WorldMapPoint), --- A builder with every field unset. builder: () -> WorldMapPointBuilder, } --- `WorldMapPoint`'s static functions and constants. declare WorldMapPoint: WorldMapPointClass --- The `worldMapPointManager` global: the points the world map overlay draws, in the order they were added. Each plugin has its own overlay: it is registered with `overlayManager` on the first `add`, and draws on the world map interface, after it. The plugins' overlays share two things: the game's tooltip is hidden while any of them draws a tooltip, and "Focus on" is offered for whichever plugin's point is hovered. Points of different plugins draw in their plugins' overlay order, not in one add order. export type WorldMapPointManager = { --- Add a point (again, if it is there already). add: (WorldMapPointManager, WorldMapPoint) -> (), --- Remove the first point that is this one, or another point whose fields, read through the getters, are all equal. remove: (WorldMapPointManager, WorldMapPoint) -> (), --- Remove every point `filter` answers true for. removeIf: (WorldMapPointManager, (WorldMapPoint) -> boolean) -> (), } --- A client cache, here the client's widget sprite cache --- (`client:getWidgetSpriteCache()`). export type NodeCache = { --- Empty the cache, so each widget sprite is loaded again (and an override put --- since shows). Here an overridden sprite is never taken from the client's cache, --- so a put or remove shows without it; this drops the override sprites Bento has --- built for widgets (their flips, outline and shadow), which are built again from --- the map. Nothing is asked of the client while both override maps are empty, so a --- reset does not raise on a build that cannot take overrides; with an override held, --- an error where the client cannot take them (as `put`). reset: (NodeCache) -> (), } --- A palette sprite, as the chat icons are (`` draws --- `client:getModIcons()[n + 1]`). Pixels are palette indices (signed bytes, so an index --- past 127 reads back negative), 0 transparent; the palette is 24-bit RGB, entry 0 unused. --- Placing one in the client copies it as it is then (see `client:setModIcons`). --- --- `__eq`: Identity: the same sprite (a mod icon read twice is one object until it is export type IndexedSprite = { --- The palette indices, row by row (`width * height` of them). getPixels: (IndexedSprite) -> {number}, --- Set the palette indices (each taken as a signed byte: -1 is index 255). setPixels: (IndexedSprite, {number}) -> (), --- The palette: 24-bit RGB colours, entry 0 unused (index 0 is never drawn). getPalette: (IndexedSprite) -> {number}, --- Set the palette (at most 256 colours). setPalette: (IndexedSprite, {number}) -> (), --- Where the stored pixels start in the full frame, across. getOffsetX: (IndexedSprite) -> number, --- Set the across offset. setOffsetX: (IndexedSprite, number) -> (), --- Where the stored pixels start in the full frame, down. getOffsetY: (IndexedSprite) -> number, --- Set the down offset. setOffsetY: (IndexedSprite, number) -> (), --- The stored pixels' width. getWidth: (IndexedSprite) -> number, --- Set the stored pixels' width. setWidth: (IndexedSprite, number) -> (), --- The stored pixels' height. getHeight: (IndexedSprite) -> number, --- Set the stored pixels' height. setHeight: (IndexedSprite, number) -> (), --- The full frame's width: what the font advances by after the icon. getOriginalWidth: (IndexedSprite) -> number, --- Set the full frame's width. setOriginalWidth: (IndexedSprite, number) -> (), --- The full frame's height: the font aligns the icon's bottom on the text's baseline --- by it. getOriginalHeight: (IndexedSprite) -> number, --- Set the full frame's height. setOriginalHeight: (IndexedSprite, number) -> (), --- Whether `other` equals this IndexedSprite, as `==` answers it (`false` for a value of another class). equals: (IndexedSprite, any) -> boolean, } --- The surface of the map's current area (`WorldMap:getWorldMapData()`), read from the --- client whenever a member is called. export type WorldMapData = { --- Whether the surface holds world tile `x`, `y`: the client's own test on the client --- thread, elsewhere the area's region bounds only. `false` once the map has no area. surfaceContainsPosition: (WorldMapData, number, number) -> boolean, } --- The world map's renderer (`WorldMap:getWorldMapRenderer()`), read from the client --- whenever a member is called. export type WorldMapRenderer = { --- Whether the renderer has loaded its area (`false` once the client has no renderer). isLoaded: (WorldMapRenderer) -> boolean, --- The area's regions, by column then row (`regions[x + 1][y + 1]`); empty before the --- renderer has loaded, or once the client has no renderer. getMapRegions: (WorldMapRenderer) -> {{WorldMapRegion}}, } --- One region of the world map's area. export type WorldMapRegion = { --- The region's map icons (its map elements the client shows), read now in the --- client's order; empty once the renderer no longer holds this region (the map changed --- area since `getMapRegions()`). getMapIcons: (WorldMapRegion) -> {WorldMapIcon}, } --- One map icon of a region. export type WorldMapIcon = { --- The map element the icon draws (`client:getMapElementConfig(id)`). getType: (WorldMapIcon) -> number, --- The icon's tile on the map's surface (the region's origin times 64 plus its tile). getCoordinate: (WorldMapIcon) -> WorldPoint, } --- The `chatIconManager` global: chat icons (``) a plugin adds to the client's --- icons, and the friends chat and clan rank icons, one list for every plugin. The icons --- it appends are the client's `client:getModIcons()` entries; its deferred work (the rank --- icons' load, a registered icon's placing, the game state resets) runs at the next --- client tick. Where the table does not place the mod icons, nothing is placed. export type ChatIconManager = { --- Add `image` as a chat icon (`ImageUtil.getImageIndexedSprite`: at most 255 --- opaque colours, every other pixel transparent); its id. It gets its slot at the next --- client tick, so `chatIconIndex(id)` is -1 until then. An `AsyncBufferedImage` is --- refused ("invalid image"). registerChatIcon: (ChatIconManager, BufferedImage) -> number, --- Add a transparent 13x13 chat icon now, to fill in later with `updateChatIcon`; its --- id. Game thread only; an error before the client loaded its icons. reserveChatIcon: (ChatIconManager) -> number, --- Make icon `iconId` show `image` (drawn from the next frame). An id no icon has is --- an error. updateChatIcon: (ChatIconManager, number, BufferedImage) -> (), --- Icon `iconId`'s slot in the client's icons: the `n` of ``, -1 while it has --- none (before the next tick placed it) or for an id no icon has. chatIconIndex: (ChatIconManager, number) -> number, --- `(ChatIconManager, FriendsChatRank) -> BufferedImage?`: --- The friends chat rank's 11x11 icon, outlined (`nil` for `UNRANKED`, before the rank --- icons are loaded, and while its sprite is not read yet). --- --- `(ChatIconManager, ClanTitle) -> BufferedImage?`: --- The clan title's 11x11 icon (`nil` before the rank icons are loaded, and while its --- sprite is not read yet). getRankImage: ((ChatIconManager, FriendsChatRank) -> BufferedImage?) & ((ChatIconManager, ClanTitle) -> BufferedImage?), --- `(ChatIconManager, FriendsChatRank) -> number`: --- The friends chat rank's slot in the client's icons (``'s `n`), -1 before the --- rank icons are loaded. --- --- `(ChatIconManager, ClanTitle) -> number`: --- The clan title's slot in the client's icons (``'s `n`), -1 before the rank --- icons are loaded. getIconNumber: ((ChatIconManager, FriendsChatRank) -> number) & ((ChatIconManager, ClanTitle) -> number), } --- Something the scene draws: a model, an animated loc, an actor. A renderable a loc --- hands out is held by address and read when asked. export type Renderable = { --- Its model now: the model itself (a copy) for a `Model` or a static loc's --- renderable, read when asked (in HD, the SD model rebuilt from the loc); for an animated --- loc's (a `DynamicObject`) the model it poses for the current cycle, built when asked --- (which moves its animation on to that cycle, as the next frame would; where the table has --- that read on, and the SD model in HD likewise); `nil` once the loc is gone and its --- renderable with it. A renderable held by address never builds an actor's model: that is --- the actor's own `getModel()`. getModel: (Renderable) -> Model?, --- Its height (`Renderable.height`): the model's height once its bounds are --- calculated, 1000 before. getModelHeight: (Renderable) -> number, --- How far its animation lifts it: for an animated loc's renderable (a --- `DynamicObject`) the vertical offset of the sequence it plays now, read when asked --- (the client's own answer, which its draw takes off the loc's height); 0 for a model --- or a static loc's renderable, and while nothing plays. A model outline subtracts it --- from a loc's `getZ()`. getAnimationHeightOffset: (Renderable) -> number, --- How the client draws it (`Renderable.RENDERMODE_*`), its own answer: 0 --- (`RENDERMODE_DEFAULT`) for a model, an animated or static loc's renderable; for a --- scene renderable that is an NPC or a player, theirs (`Actor:getRenderMode()`). getRenderMode: (Renderable) -> number, } export type RenderableClass = { --- `Renderable.RENDERMODE_DEFAULT`: 0. RENDERMODE_DEFAULT: number, --- `Renderable.RENDERMODE_SORTED`: 1. RENDERMODE_SORTED: number, --- `Renderable.RENDERMODE_SORTED_NO_DEPTH`: 2, what a player answers. RENDERMODE_SORTED_NO_DEPTH: number, --- `Renderable.RENDERMODE_UNSORTED`: 3. RENDERMODE_UNSORTED: number, --- `Renderable.RENDERMODE_UNSORTED_NO_DEPTH`: 4. RENDERMODE_UNSORTED_NO_DEPTH: number, } --- `Renderable`'s static functions and constants. declare Renderable: RenderableClass --- A triangle mesh: vertices and faces, `y` vertical (negative up). export type Mesh = Renderable & { --- How many vertices the mesh has. getVerticesCount: (Mesh) -> number, --- The vertices' x (east), model units. getVerticesX: (Mesh) -> {number}, --- The vertices' y (vertical, negative up). getVerticesY: (Mesh) -> {number}, --- The vertices' z (north). getVerticesZ: (Mesh) -> {number}, --- How many faces (triangles) the mesh has. getFaceCount: (Mesh) -> number, --- Each face's first vertex index (0-based). getFaceIndices1: (Mesh) -> {number}, --- Each face's second vertex index. getFaceIndices2: (Mesh) -> {number}, --- Each face's third vertex index. getFaceIndices3: (Mesh) -> {number}, --- Each face's alpha as a signed byte (`bit32.band(a, 255)` is the alpha; 254 and 255 --- are fully transparent), or `nil` when the mesh has none. getFaceTransparencies: (Mesh) -> {number}?, --- Each face's texture id, -1 for none, or `nil` when the mesh has no textures. getFaceTextures: (Mesh) -> {number}?, } --- A model: its mesh, colours and bounds, copied from the client when it was asked for --- (the client rebuilds an actor's model every frame, so each `getModel()` call hands out --- its own copy). export type Model = Mesh & { --- Each face's first lit colour (HSL). getFaceColors1: (Model) -> {number}, --- Each face's second lit colour. getFaceColors2: (Model) -> {number}, --- Each face's third lit colour: -1 for a flat-shaded face, -2 for a hidden one. getFaceColors3: (Model) -> {number}, --- Each face's render priority (signed bytes), or `nil` when the model has none. getFaceRenderPriorities: (Model) -> {number}?, --- The lowest point (largest y) once the bounds are calculated. getBottomY: (Model) -> number, --- The bounding sphere's radius once the bounds are calculated. getRadius: (Model) -> number, --- The bounding cylinder's diameter once the bounds are calculated. getDiameter: (Model) -> number, --- The radius in the horizontal plane once the bounds are calculated. getXYZMag: (Model) -> number, --- Calculate the height, bottom, radii and diameter, as the client does, if they are --- not already (on this copy: the client's model is not written). calculateBoundsCylinder: (Model) -> (), --- The bounding box at `orientation` (0-2047), as the client computes it: extents --- at least 32 across, 8 more on a single-tile model. Raises outside 0-2047. getAABB: (Model, number) -> AABB, --- Whether a clickbox of this model is its bounding box alone (a single-tile NPC's --- is): the model's single-tile flag. useBoundingBox: (Model) -> boolean, --- Each face's texture triangle as a signed byte (`bit32.band(t, 255)` indexes --- `getTexIndices1/2/3()`), -1 for a face with no texture mapping, or `nil` when the --- model has no texture coordinates. getTextureFaces: (Model) -> {number}?, --- Each texture triangle's first vertex (0-based): with the second and third, the --- triangle a textured face's mapping is taken from; `nil` when `getTextureFaces()` is. getTexIndices1: (Model) -> {number}?, --- Each texture triangle's second vertex; `nil` when `getTextureFaces()` is. getTexIndices2: (Model) -> {number}?, --- Each texture triangle's third vertex; `nil` when `getTextureFaces()` is. getTexIndices3: (Model) -> {number}?, --- Each face's depth bias as a signed byte (how much nearer the face sorts), or `nil` --- when the model has none (in a model the client merged from parts, a part with no --- bias reads -1 per face). getFaceBias: (Model) -> {number}?, --- The model's transparency as a signed byte: an actor's fade now, 0 for opaque --- (`bit32.band(t, 255)` of 255 is fully clear). getTransparency: (Model) -> number, --- How far the colour override pulls the model's colours (127 full), 0 for none: an --- actor's recolour or a highlighted NPC's tint. getOverrideAmount: (Model) -> number, --- The colour override's hue (HSL, as `JagexColor` packs it), 0 when there is none. getOverrideHue: (Model) -> number, --- The colour override's saturation, 0 when there is none. getOverrideSaturation: (Model) -> number, --- The colour override's luminance, 0 when there is none. getOverrideLuminance: (Model) -> number, } --- An animated loc's renderable: what a loc whose type animates hands out from --- `getRenderable()` (a wall's `getRenderable1()`/`2()`, a decoration's and a ground --- object's likewise) where a static loc hands out its model. `typeof(r) == "DynamicObject"` --- tells one apart, and `r:getAnimation()` reads it. Held by address and read when asked, --- as a `Renderable` is; its `getModel()` builds the model it poses for the current cycle --- (where the table has that read on, in HD too). export type DynamicObject = Renderable & { --- The animation it plays now, read when asked; `nil` when it plays none, or once --- its loc is gone. `getAnimation():getId()` is the id `GameObject:getAnimationId()` --- answers in one call. getAnimation: (DynamicObject) -> Animation?, --- Its model without the animation: `nil` while it plays a sequence; else its loc type's --- model for its shape, orientation --- and place (the type its multiloc chooses now, contoured to the ground when the type --- is), a copy, as a static loc's renderable is (the SD model in HD). Also `nil` when its --- multiloc chooses no loc, once its loc no longer holds it, and off the client thread, --- where the client cannot build it. getModelZbuf: (DynamicObject) -> Model?, } --- A model's bounding box at one orientation: its centre and half-extents, model --- units, `y` vertical. export type AABB = { --- The centre's x. getCenterX: (AABB) -> number, --- The centre's y (vertical). getCenterY: (AABB) -> number, --- The centre's z. getCenterZ: (AABB) -> number, --- The half-extent along x. getExtremeX: (AABB) -> number, --- The half-extent along y. getExtremeY: (AABB) -> number, --- The half-extent along z. getExtremeZ: (AABB) -> number, } --- An animation, a sequence definition: what a `DynamicObject` plays and --- `client:loadAnimation(id)` loads. It carries its id (`AnimationID` names the ids); its --- timing getters read the definition through the client on the game thread (once per --- animation, then kept) and raise off it, or where the client has no definition to read. --- Not here: `setRestartMode` (a write to the definition every holder shares). export type Animation = { --- The animation's id, numbered as `Actor:getAnimation()` and `AnimationID` number --- them. getId: (Animation) -> number, --- Whether it is a skeletal ("maya") animation, whose frame is a count of client --- ticks, not a keyframe. isMayaAnim: (Animation) -> boolean, --- How many frames it has: a skeletal animation's length in client ticks, else how --- many keyframes (not its length in ticks: sum `getFrameLengths()` for that). getNumFrames: (Animation) -> number, --- How many frames it lasts: a skeletal animation's length in client ticks, else how --- many frame lengths it has (1 for one with none). getDuration: (Animation) -> number, --- How many frames it goes back when it loops; -1 for one that does not loop. getFrameStep: (Animation) -> number, --- What starting the animation again while it plays does: 1 starts it over, 2 (the --- value of an animation that sets none) only starts its loop count over --- (`Actor:getAnimationLoopCount()`), anything else changes nothing. getRestartMode: (Animation) -> number, --- The item (`ItemID`) the animation puts in the left hand while it plays; -1 when --- it puts none there (it leaves the hand alone, or empties it). getLeftHandItem: (Animation) -> number, --- The item (`ItemID`) the animation puts in the right hand while it plays; -1 when --- it puts none there. getRightHandItem: (Animation) -> number, --- How many client ticks each keyframe lasts, in frame order (a copy); `nil` for a --- skeletal animation. getFrameLengths: (Animation) -> {number}?, } --- Projection helpers: local points to canvas points and tile polygons, the ground height, the minimap. The arithmetic is the GPU projection, since the client draws its scene on the GPU from float camera angles; the camera, viewport and scene are read from the client once per client cycle. Every member takes the `client` global first. Only the top-level world view projects: a point in a world entity's own view (a boat) answers `nil`. With no scene to read (logged out, loading) a point or polygon answers `nil` and a height 0. export type Perspective = { } export type PerspectiveClass = { --- Bits of a local coordinate below the tile: 7. LOCAL_COORD_BITS: number, --- A tile in local units: 128. LOCAL_TILE_SIZE: number, --- Half a tile in local units: 64. LOCAL_HALF_TILE_SIZE: number, --- The scene's size in tiles: 104. The live world view's size is `client:getTopLevelWorldView():getSizeX()`. SCENE_SIZE: number, --- Radians per 2048th of a turn (about pi / 1024). UNIT: number, --- Radians per 16384th of a turn (about pi / 8192). UNIT14: number, --- The sine of each 2048th of a turn times 65536, truncated: a frozen 1-based array (the sine of angle `a` is `Perspective.SINE[a + 1]`). SINE: {number}, --- The cosine of each 2048th of a turn times 65536, truncated (1-based, as `SINE`). COSINE: {number}, --- The sine of each 16384th of a turn times 65536, truncated (1-based, as `SINE`). SINE14: {number}, --- The cosine of each 16384th of a turn times 65536, truncated (1-based, as `SINE`). COSINE14: {number}, --- The sine of each 2048th of a turn as a 32-bit float (1-based, as `SINE`). SINEF: {number}, --- The cosine of each 2048th of a turn as a 32-bit float (1-based, as `SINE`). COSINEF: {number}, --- The sine of each 16384th of a turn as a 32-bit float (1-based, as `SINE`). SINEF14: {number}, --- The cosine of each 16384th of a turn as a 32-bit float (1-based, as `SINE`). COSINEF14: {number}, --- `(Client, LocalPoint, number) -> Point?`: --- The canvas point of a ground point on `plane`, or `nil` behind the camera or outside the scene. --- --- `(Client, LocalPoint, number, number) -> Point?`: --- The canvas point `heightOffset` above a ground point on `plane`. --- --- `(Client, number, number, number) -> Point?`: --- The canvas point of a top-level local point at height `z` (negative is up), or `nil` behind the camera or outside the extended scene. --- --- `(Client, number, number, number, number) -> Point?`: --- As the four-argument form, for a point in world view `worldId`; another world view than the top level answers `nil`. localToCanvas: ((Client, LocalPoint, number) -> Point?) & ((Client, LocalPoint, number, number) -> Point?) & ((Client, number, number, number) -> Point?) & ((Client, number, number, number, number) -> Point?), --- Alternative to `Geometry.filterPath` keeping the lines whose ends both project, then `Geometry.transformPath` moving each point to its `localToCanvas`, an overlay's projection of a path of local points: the same canvas path, in one Rust pass with each point projected once and no Luau function per point. A lone move to a point that does not project is left out (it draws nothing). With no scene (logged out, loading) nothing projects and the path is empty. localPathToCanvas: (Client, GeneralPath, number) -> GeneralPath, --- Alternative to `Geometry.transformPath` moving each point to its `LocalPoint.fromWorld` less `LOCAL_TILE_SIZE / 2` on each axis, a plugin's conversion of a path of world tiles to local units (after a `clipPath` to the scene): the same path in one Rust pass, with no Luau function per point. A point outside the scene raises `NullPointerException`. worldPathToLocal: (Client, GeneralPath) -> GeneralPath, --- `(Client, LocalPoint) -> Polygon?`: --- The tile's outline on the canvas (south-west, then clockwise), or `nil` when a corner does not project. --- --- `(Client, LocalPoint, number) -> Polygon?`: --- The tile's outline raised by `zOffset`. getCanvasTilePoly: ((Client, LocalPoint) -> Polygon?) & ((Client, LocalPoint, number) -> Polygon?), --- `(Client, LocalPoint, number) -> Polygon?`: --- The outline of a `size` by `size` area centred on the point (a 3x3 area is size 3). --- --- `(Client, LocalPoint, number, number, number, number) -> Polygon?`: --- The outline of a `sizeX` by `sizeY` area centred on the point, on `level` (-1: the world view's plane), raised by `heightOffset`. getCanvasTileAreaPoly: ((Client, LocalPoint, number) -> Polygon?) & ((Client, LocalPoint, number, number, number, number) -> Polygon?), --- The ground height (negative up) at the point, interpolated from its tile's corners; a bridge tile reads the level above; 0 outside the scene. getTileHeight: (Client, LocalPoint, number) -> number, --- The lowest ground height under a square footprint `footprintSize` local units across, centred on the point. getFootprintTileHeight: (Client, LocalPoint, number, number) -> number, --- Where to draw `text` (its baseline's left end) so it is centred over the point, `zOffset` up, measured in `graphics`' font; `nil` for a `nil` text or a point that does not project. getCanvasTextLocation: (Client, Graphics2D, LocalPoint, string?, number) -> Point?, --- The top-left corner that centres `image` over the point, `zOffset` up. getCanvasImageLocation: (Client, LocalPoint, BufferedImage, number) -> Point?, --- The top-left corner that centres `sprite` over the point, `zOffset` up. getCanvasSpriteLocation: (Client, LocalPoint, SpritePixels, number) -> Point?, --- `(Client, LocalPoint) -> Point?`: --- The canvas point of a local point on the minimap, or `nil` past the cut-off (20 tiles at the default zoom) or with the minimap hidden. --- --- `(Client, LocalPoint, number) -> Point?`: --- As the two-argument form, within `distance` local units of the camera focus. localToMinimap: ((Client, LocalPoint) -> Point?) & ((Client, LocalPoint, number) -> Point?), --- The top-left corner that centres `image` on the point's minimap position. getMiniMapImageLocation: (Client, LocalPoint, BufferedImage) -> Point?, --- Where to draw `text` (its baseline's left end) so it is centred on the point's minimap position, measured in `graphics`' font; `nil` off the minimap. getCanvasTextMiniMapLocation: (Client, Graphics2D, LocalPoint, string) -> Point?, } --- `Perspective`'s static functions and constants. declare Perspective: PerspectiveClass --- Path utilities: clip a path to a shape, drop or move its points, cut its lines into equal pieces. Each takes a `GeneralPath` and returns a new one. A point handed to your function is a 1-based array `{x, y}` (`coords[1]` is x, `coords[2]` is y, and index 0 raises), which the function may change. To project a path of local points onto the canvas, as an overlay's `filterPath` + `transformPath` over `localToCanvas` does, `Perspective.localPathToCanvas` does both in one pass with no Luau per point; to convert a path of world tiles to local units (`LocalPoint.fromWorld` per point, less half a tile), `Perspective.worldPathToLocal` does. export type Geometry = { } export type GeometryClass = { --- The parts of `path` inside `shape`: lines outside it dropped, lines crossing its edge cut there. clipPath: (GeneralPath, Shape) -> GeneralPath, --- `path` without the lines `method(from, to)` answers false for. Each end is a 1-based array `{x, y}` (`from[1]`, `from[2]`), and index 0 raises. filterPath: (GeneralPath, ({number}, {number}) -> boolean) -> GeneralPath, --- `path` with every line cut into pieces `segmentLength` long (the last one what is left). A result of more than 1048576 segments raises `OutOfMemoryError` before it is built. splitIntoSegments: (GeneralPath, number) -> GeneralPath, --- `path` with every point moved by `method(coords)`, which changes the 1-based array `{x, y}` it is handed (`coords[1] = x`); index 0 raises. A function that converts world tiles to local units (`LocalPoint.fromWorld` less half a tile) is `Perspective.worldPathToLocal(client, path)`, in one pass with no Luau per point. transformPath: (GeneralPath, ({number}) -> ()) -> GeneralPath, } --- `Geometry`'s static functions and constants. declare Geometry: GeometryClass --- Draws an outline around an entity's model, `outlineWidth` pixels wide (at most 50), the last `feather` (0-4) of them fading, into the overlay being rendered. Call it from an overlay's `render`. An animated loc's model is the one it poses for the current cycle; in HD the SD model is outlined. export type ModelOutlineRenderer = { --- `(ModelOutlineRenderer, Actor, number, Color, number) -> ()`: --- Outline an NPC or player's current model. --- --- `(ModelOutlineRenderer, TileObject, number, Color, number) -> ()`: --- Outline a game, ground, wall or decorative object's model(s): a static loc's model, or an animated loc's posed for the current cycle and lifted by its animation's height offset (an animated loc where the table has that read on, in HD too). --- --- `(ModelOutlineRenderer, ItemLayer, TileItem, number, Color, number) -> ()`: --- Outline a ground item's model (`tileItem:getModel()`: its item's model for its quantity, as the client builds it) at its pile's position, for any item of the pile; in HD its SD model, built as the client builds its interface item models. Draws nothing on a client whose table has the item model off, in HD where it has the HD model off, or in HD for an item carrying a customisation. drawOutline: ((ModelOutlineRenderer, Actor, number, Color, number) -> ()) & ((ModelOutlineRenderer, TileObject, number, Color, number) -> ()) & ((ModelOutlineRenderer, ItemLayer, TileItem, number, Color, number) -> ()), } --- How `npcOverlayService` draws one NPC: an immutable value made with `HighlightedNpc.builder()`. `npc` and `highlightColor` are required; `fillColor` defaults to `Color.new(0, 0, 0, 50)` and `borderWidth` to 2. export type HighlightedNpc = { --- The NPC. getNpc: (HighlightedNpc) -> NPC, --- The border (and name) colour. getHighlightColor: (HighlightedNpc) -> Color, --- The fill colour. getFillColor: (HighlightedNpc) -> Color, --- Draw the model's convex hull. isHull: (HighlightedNpc) -> boolean, --- Draw the tiles under the NPC where it is drawn. isTile: (HighlightedNpc) -> boolean, --- Draw the tiles it occupies on the server. isTrueTile: (HighlightedNpc) -> boolean, --- Draw its south-west tile where it is drawn. isSwTile: (HighlightedNpc) -> boolean, --- Draw its south-west tile on the server. isSwTrueTile: (HighlightedNpc) -> boolean, --- Draw a model outline. isOutline: (HighlightedNpc) -> boolean, --- Draw its name above it. isName: (HighlightedNpc) -> boolean, --- Draw its name on the minimap. isNameOnMinimap: (HighlightedNpc) -> boolean, --- The border (and outline) width. getBorderWidth: (HighlightedNpc) -> number, --- The outline's feather, 0-4. getOutlineFeather: (HighlightedNpc) -> number, --- The per-frame predicate deciding whether to draw it, if any. getRender: (HighlightedNpc) -> ((NPC) -> boolean)?, --- Equal when every field is equal. equals: (HighlightedNpc, any) -> boolean, --- `HighlightedNpc(npc=…, …)`. toString: (HighlightedNpc) -> string, } export type HighlightedNpcClass = { --- A builder with every field at its default. builder: () -> HighlightedNpcBuilder, } --- `HighlightedNpc`'s static functions and constants. declare HighlightedNpc: HighlightedNpcClass --- Builds a `HighlightedNpc`: each setter returns the builder. export type HighlightedNpcBuilder = { --- The NPC (required; `nil` raises). npc: (HighlightedNpcBuilder, NPC) -> HighlightedNpcBuilder, --- The border colour (required). highlightColor: (HighlightedNpcBuilder, Color) -> HighlightedNpcBuilder, --- The fill colour. fillColor: (HighlightedNpcBuilder, Color) -> HighlightedNpcBuilder, --- Draw the hull. hull: (HighlightedNpcBuilder, boolean) -> HighlightedNpcBuilder, --- Draw the tiles under it. tile: (HighlightedNpcBuilder, boolean) -> HighlightedNpcBuilder, --- Draw its server tiles. trueTile: (HighlightedNpcBuilder, boolean) -> HighlightedNpcBuilder, --- Draw its south-west tile. swTile: (HighlightedNpcBuilder, boolean) -> HighlightedNpcBuilder, --- Draw its south-west server tile. swTrueTile: (HighlightedNpcBuilder, boolean) -> HighlightedNpcBuilder, --- Draw a model outline. outline: (HighlightedNpcBuilder, boolean) -> HighlightedNpcBuilder, --- Draw its name. name: (HighlightedNpcBuilder, boolean) -> HighlightedNpcBuilder, --- Draw its name on the minimap. nameOnMinimap: (HighlightedNpcBuilder, boolean) -> HighlightedNpcBuilder, --- The border width. borderWidth: (HighlightedNpcBuilder, number) -> HighlightedNpcBuilder, --- The outline feather. outlineFeather: (HighlightedNpcBuilder, number) -> HighlightedNpcBuilder, --- A predicate asked every frame whether to draw it. render: (HighlightedNpcBuilder, (NPC) -> boolean) -> HighlightedNpcBuilder, --- The `HighlightedNpc`; raises when `npc` or `highlightColor` is unset. build: (HighlightedNpcBuilder) -> HighlightedNpc, } --- Highlights NPCs: register a function from an NPC to its `HighlightedNpc` (or `nil`), and every NPC it highlights is drawn (hull, tiles, outline, name, minimap dot) by the service's own overlays. Highlighters are asked when an NPC spawns or changes and on `rebuild()`, not every frame: at the NPC events when the plugin takes them, else when the service's overlay first sees the NPC (or its new id) in the scene. One service per plugin: two plugins highlighting one NPC both draw it, so its fill is laid down twice and looks darker. export type NpcOverlayService = { --- Add a highlighter and rebuild the highlighted NPCs. registerHighlighter: (NpcOverlayService, (NPC) -> HighlightedNpc?) -> (), --- Remove a highlighter (the same function) and rebuild. unregisterHighlighter: (NpcOverlayService, (NPC) -> HighlightedNpc?) -> (), --- Ask every highlighter again about every NPC in the scene (after a config change). rebuild: (NpcOverlayService) -> (), } --- The client hooks plugins use: renderable draw listeners. A listener is asked about every NPC, player, projectile and spot animation each frame (at `BeforeRender` when the plugin takes it, else from an overlay of its own, a frame later), once for the scene (`drawingUI` false) and, for actors, once for their 2D elements (`true`); answering `false` hides it: not added to the scene (so not drawn and not clickable), or its health bar, hitsplats and overhead text not drawn. A listener that raises counts as drawing. export type Hooks = { --- Add a listener. registerRenderableDrawListener: (Hooks, (Renderable, boolean) -> boolean) -> (), --- Remove a listener (the same function); with none left, nothing is hidden. unregisterRenderableDrawListener: (Hooks, (Renderable, boolean) -> boolean) -> (), } --- What the scene draws for a client-side entity: a position, a world view, a level and an --- orientation (the base of `ClientObject`). Getters and setters of the object's own --- fields. Only `ClientObject` extends it: a subclass of your own (its `getModel()` and --- `tick()` overridden) is not supported. export type ClientObjectController = { --- The id of the world view it is drawn in: -1 until `setLocation` places it (the top --- level), then the point's (`WorldView.TOPLEVEL`, 0, or a world entity's). getWorldView: (ClientObjectController) -> number, --- Its local (fine) x. getX: (ClientObjectController) -> number, --- Its local (fine) y. getY: (ClientObjectController) -> number, --- Its height (negative up): the ground's under it after `setLocation`. getZ: (ClientObjectController) -> number, --- Set its height (negative up), drawn from the next frame. setZ: (ClientObjectController, number) -> (), --- Its level (plane), 0-3. getLevel: (ClientObjectController) -> number, --- The way it faces, 0-2047. getOrientation: (ClientObjectController) -> number, --- Face `orientation` (0-2047), drawn from the next frame. setOrientation: (ClientObjectController, number) -> (), --- Where it is: its x and y in its world view (-1 until placed). getLocation: (ClientObjectController) -> LocalPoint, } --- A client-side scene entity: a model (posed by an animation, if it has one) the scene --- draws at a location, with depth, until it is despawned. Made by --- `client:createClientObject()`, spawned by --- `setActive(true)`. Drawn in SD and in HD alike (in HD by the client's HD renderer, as --- its spot animations are). A `ClientObjectController` subclass of your own is not --- supported. export type ClientObject = ClientObjectController & { --- Spawn it (`true`: drawn from the next frame, in its world view) or despawn it. An --- object left inactive is kept until its plugin leaves 4096 newer ones inactive; then --- using it raises. setActive: (ClientObject, boolean) -> (), --- Whether it is spawned. An animation that ends with `setShouldLoop(false)` despawns --- it. isActive: (ClientObject) -> boolean, --- Place it at `point` on `level`, at the ground's height there --- (`Perspective.getTileHeight`); a point in another world view moves it there. Raises --- for a level outside 0-3. setLocation: (ClientObject, LocalPoint, number) -> (), --- Pose its model with `animation` from frame 0, looping when it ends (or despawning, --- after `setShouldLoop(false)`); `nil` for a static model. setAnimation: (ClientObject, Animation?) -> (), --- Whether its animation loops (`true`) or despawns it when it ends (`false`). setShouldLoop: (ClientObject, boolean) -> (), --- The model to draw, `nil` for none. It must be one the client loaded --- (`client:loadModel`, `ModelData:light`), named by its content; a model copied out of --- the scene (an actor's, a loc's) raises. setModel: (ClientObject, Model?) -> (), } --- A cache model's data, to recolour and light into a `Model` the client draws --- (`client:loadModelData(id)`). Each `client:loadModelData` call makes a new one, so a --- recolour never reaches another. Its mesh getters are not bound. export type ModelData = { --- This model data, its colours its own (they already are: see the class doc). cloneColors: (ModelData) -> ModelData, --- Replace face colour `colorToReplace` with `colorToReplaceWith` (HSL, a signed 16-bit --- value or its unsigned form), after the recolours before it; this model data. recolor: (ModelData, number, number) -> ModelData, --- `(ModelData, number, number, number, number, number) -> Model?`: --- The model, lit with `ambient`, `contrast` and light direction `x`, `y`, `z`, as the --- client lights it (the SD model in either mode). --- --- `(ModelData) -> Model?`: --- The model lit with the defaults (`DEFAULT_AMBIENT`, ...). light: ((ModelData, number, number, number, number, number) -> Model?) & ((ModelData) -> Model?), } export type ModelDataClass = { --- The ambient light `light()` uses. DEFAULT_AMBIENT: number, --- The contrast `light()` uses. DEFAULT_CONTRAST: number, --- The light direction's x `light()` uses. DEFAULT_X: number, --- The light direction's y `light()` uses. DEFAULT_Y: number, --- The light direction's z `light()` uses. DEFAULT_Z: number, } --- `ModelData`'s static functions and constants. declare ModelData: ModelDataClass --- A unit of time, `NANOS` to `FOREVER`, each one userdata per VM; `toString()` is the unit's name (`Seconds`). --- --- `__tostring`: `tostring(c)`: `toString()`. export type ChronoUnit = { --- The constant's name as declared. name: (ChronoUnit) -> string, --- The constant's 0-based position in `values()`. ordinal: (ChronoUnit) -> number, --- The constant's printed name; `tostring(c)` answers the same. toString: (ChronoUnit) -> string, --- This ordinal less `other`'s. compareTo: (ChronoUnit, ChronoUnit) -> number, --- Whether `other` is this constant. `==` answers the same. equals: (ChronoUnit, any) -> boolean, --- The unit's duration (estimated from `DAYS` on: a month is 31,556,952 s / 12). getDuration: (ChronoUnit) -> Duration, --- Whether the duration is an estimate: `DAYS` and longer. isDurationEstimated: (ChronoUnit) -> boolean, --- Whether it is a date unit: `DAYS` to `ERAS`. isDateBased: (ChronoUnit) -> boolean, --- Whether it is a time unit: shorter than `DAYS`. isTimeBased: (ChronoUnit) -> boolean, --- Whole units from the first to the second (`first:until(second, unit)`). between: (ChronoUnit, Instant | LocalTime | LocalDate | LocalDateTime | ZonedDateTime, Instant | LocalTime | LocalDate | LocalDateTime | ZonedDateTime) -> number, } export type ChronoUnitClass = { --- Every constant in ordinal order, as a new 1-based array. values: () -> {ChronoUnit}, --- The constant named `name`; any other name is an error. valueOf: (string) -> ChronoUnit, --- `ChronoUnit.NANOS`. NANOS: ChronoUnit, --- `ChronoUnit.MICROS`. MICROS: ChronoUnit, --- `ChronoUnit.MILLIS`. MILLIS: ChronoUnit, --- `ChronoUnit.SECONDS`. SECONDS: ChronoUnit, --- `ChronoUnit.MINUTES`. MINUTES: ChronoUnit, --- `ChronoUnit.HOURS`. HOURS: ChronoUnit, --- `ChronoUnit.HALF_DAYS`. HALF_DAYS: ChronoUnit, --- `ChronoUnit.DAYS`. DAYS: ChronoUnit, --- `ChronoUnit.WEEKS`. WEEKS: ChronoUnit, --- `ChronoUnit.MONTHS`. MONTHS: ChronoUnit, --- `ChronoUnit.YEARS`. YEARS: ChronoUnit, --- `ChronoUnit.DECADES`. DECADES: ChronoUnit, --- `ChronoUnit.CENTURIES`. CENTURIES: ChronoUnit, --- `ChronoUnit.MILLENNIA`. MILLENNIA: ChronoUnit, --- `ChronoUnit.ERAS`. ERAS: ChronoUnit, --- `ChronoUnit.FOREVER`. FOREVER: ChronoUnit, } --- `ChronoUnit`'s static functions and constants. declare ChronoUnit: ChronoUnitClass --- A day of the week, `MONDAY` (1) to `SUNDAY` (7), each one userdata per VM. --- --- `__tostring`: `tostring(c)`: `toString()`. export type DayOfWeek = { --- The constant's name as declared. name: (DayOfWeek) -> string, --- The constant's 0-based position in `values()`. ordinal: (DayOfWeek) -> number, --- The constant's printed name; `tostring(c)` answers the same. toString: (DayOfWeek) -> string, --- This ordinal less `other`'s. compareTo: (DayOfWeek, DayOfWeek) -> number, --- Whether `other` is this constant. `==` answers the same. equals: (DayOfWeek, any) -> boolean, --- 1 for `MONDAY` to 7 for `SUNDAY`. getValue: (DayOfWeek) -> number, --- The day `days` later, wrapping around the week. plus: (DayOfWeek, number) -> DayOfWeek, --- The day `days` earlier, wrapping around the week. minus: (DayOfWeek, number) -> DayOfWeek, --- The English name in `style` (`Monday`, `Mon`, `M`). There is no `Locale`: this is always English. getEnglishName: (DayOfWeek, TextStyle) -> string, } export type DayOfWeekClass = { --- Every constant in ordinal order, as a new 1-based array. values: () -> {DayOfWeek}, --- The constant named `name`; any other name is an error. valueOf: (string) -> DayOfWeek, --- The day numbered `dayOfWeek`, 1 (Monday) to 7. of: (number) -> DayOfWeek, --- `DayOfWeek.MONDAY`. MONDAY: DayOfWeek, --- `DayOfWeek.TUESDAY`. TUESDAY: DayOfWeek, --- `DayOfWeek.WEDNESDAY`. WEDNESDAY: DayOfWeek, --- `DayOfWeek.THURSDAY`. THURSDAY: DayOfWeek, --- `DayOfWeek.FRIDAY`. FRIDAY: DayOfWeek, --- `DayOfWeek.SATURDAY`. SATURDAY: DayOfWeek, --- `DayOfWeek.SUNDAY`. SUNDAY: DayOfWeek, } --- `DayOfWeek`'s static functions and constants. declare DayOfWeek: DayOfWeekClass --- How long a name is printed. --- --- `__tostring`: `tostring(c)`: `toString()`. export type TextStyle = { --- The constant's name as declared. name: (TextStyle) -> string, --- The constant's 0-based position in `values()`. ordinal: (TextStyle) -> number, --- The constant's printed name; `tostring(c)` answers the same. toString: (TextStyle) -> string, --- This ordinal less `other`'s. compareTo: (TextStyle, TextStyle) -> number, --- Whether `other` is this constant. `==` answers the same. equals: (TextStyle, any) -> boolean, --- Whether this is a stand-alone style. isStandalone: (TextStyle) -> boolean, --- The stand-alone style of the same size. asStandalone: (TextStyle) -> TextStyle, --- The normal style of the same size. asNormal: (TextStyle) -> TextStyle, } export type TextStyleClass = { --- Every constant in ordinal order, as a new 1-based array. values: () -> {TextStyle}, --- The constant named `name`; any other name is an error. valueOf: (string) -> TextStyle, --- `TextStyle.FULL`. FULL: TextStyle, --- `TextStyle.FULL_STANDALONE`. FULL_STANDALONE: TextStyle, --- `TextStyle.SHORT`. SHORT: TextStyle, --- `TextStyle.SHORT_STANDALONE`. SHORT_STANDALONE: TextStyle, --- `TextStyle.NARROW`. NARROW: TextStyle, --- `TextStyle.NARROW_STANDALONE`. NARROW_STANDALONE: TextStyle, } --- `TextStyle`'s static functions and constants. declare TextStyle: TextStyleClass --- How long a formatted time is, for `DateTimeFormatter.ofLocalizedTime`. --- --- `__tostring`: `tostring(c)`: `toString()`. export type FormatStyle = { --- The constant's name as declared. name: (FormatStyle) -> string, --- The constant's 0-based position in `values()`. ordinal: (FormatStyle) -> number, --- The constant's printed name; `tostring(c)` answers the same. toString: (FormatStyle) -> string, --- This ordinal less `other`'s. compareTo: (FormatStyle, FormatStyle) -> number, --- Whether `other` is this constant. `==` answers the same. equals: (FormatStyle, any) -> boolean, } export type FormatStyleClass = { --- Every constant in ordinal order, as a new 1-based array. values: () -> {FormatStyle}, --- The constant named `name`; any other name is an error. valueOf: (string) -> FormatStyle, --- `FormatStyle.FULL`. FULL: FormatStyle, --- `FormatStyle.LONG`. LONG: FormatStyle, --- `FormatStyle.MEDIUM`. MEDIUM: FormatStyle, --- `FormatStyle.SHORT`. SHORT: FormatStyle, } --- `FormatStyle`'s static functions and constants. declare FormatStyle: FormatStyleClass --- A point on the time line, to the nanosecond. `Instant.now()` reads the wall --- clock. `==`, `<` and `<=` compare by value, and `tostring` is `toString()`. --- --- `__eq`: `a == b`: equal instants. --- `__lt`: `a < b`: `isBefore`. --- `__le`: `a <= b`. --- `__tostring`: `tostring(i)`: `toString()`. export type Instant = { --- Milliseconds since the epoch; `ArithmeticException` past a `long`. toEpochMilli: (Instant) -> number, --- Whole seconds since the epoch (floored). getEpochSecond: (Instant) -> number, --- The nano-of-second, 0 to 999,999,999. getNano: (Instant) -> number, --- `(Instant, Duration) -> Instant`: --- This instant plus a `Duration`. --- --- `(Instant, number, ChronoUnit | RSTimeUnit) -> Instant`: --- This instant plus `amountToAdd` of `unit` (`NANOS` to `DAYS`; a longer unit is --- unsupported, and an `RSTimeUnit` overflows the stack). plus: ((Instant, Duration) -> Instant) & ((Instant, number, ChronoUnit | RSTimeUnit) -> Instant), --- `(Instant, Duration) -> Instant`: --- This instant less a `Duration`. --- --- `(Instant, number, ChronoUnit | RSTimeUnit) -> Instant`: --- This instant less `amountToSubtract` of `unit`. minus: ((Instant, Duration) -> Instant) & ((Instant, number, ChronoUnit | RSTimeUnit) -> Instant), --- Plus `millisToAdd` ms. plusMillis: (Instant, number) -> Instant, --- Plus `secondsToAdd` s. plusSeconds: (Instant, number) -> Instant, --- Plus `nanosToAdd` ns. plusNanos: (Instant, number) -> Instant, --- Less `millisToSubtract` ms. minusMillis: (Instant, number) -> Instant, --- Less `secondsToSubtract` s. minusSeconds: (Instant, number) -> Instant, --- Less `nanosToSubtract` ns. minusNanos: (Instant, number) -> Instant, --- Whether this is after `otherInstant`. isAfter: (Instant, Instant) -> boolean, --- Whether this is before `otherInstant`. isBefore: (Instant, Instant) -> boolean, --- The seconds compared, then the nanos subtracted (which can answer other than --- -1, 0 and 1). compareTo: (Instant, Instant) -> number, --- The amount of `unit` until `endExclusive` (an `Instant` or `ZonedDateTime`), --- truncated. --- --- Luau reserves `until`, so this member is spelled `until_`; it behaves exactly as `until`. until_: (Instant, Instant | LocalTime | LocalDate | LocalDateTime | ZonedDateTime, ChronoUnit | RSTimeUnit) -> number, --- This instant truncated to `unit` (which must divide a day). truncatedTo: (Instant, ChronoUnit | RSTimeUnit) -> Instant, --- This instant in `zone`. atZone: (Instant, ZoneId) -> ZonedDateTime, --- Whether `other` is an equal `Instant`. equals: (Instant, any) -> boolean, --- The value's hash. hashCode: (Instant) -> number, --- ISO-8601 in UTC, `2025-09-21T14:13:20.007Z`. toString: (Instant) -> string, } export type InstantClass = { --- The wall clock now. now: () -> Instant, --- The instant `epochMilli` ms after 1970-01-01T00:00Z. ofEpochMilli: (number) -> Instant, --- `(number) -> Instant`: --- The instant `epochSecond` s after 1970-01-01T00:00Z. --- --- `(number, number) -> Instant`: --- The instant `epochSecond` s plus `nanoAdjustment` ns after the epoch. ofEpochSecond: ((number) -> Instant) & ((number, number) -> Instant), --- `DateTimeFormatter.ISO_INSTANT`'s text (`2007-12-03T10:15:30.00Z`, or an offset). parse: (string) -> Instant, --- 1970-01-01T00:00:00Z. EPOCH: Instant, --- The earliest instant, -1000000000-01-01T00:00Z. MIN: Instant, --- The latest instant, 1000000000-12-31T23:59:59.999999999Z. MAX: Instant, } --- `Instant`'s static functions and constants. declare Instant: InstantClass --- An amount of time in seconds and nanoseconds (negative durations, `toString`, --- `parse`). `==`, `<` and `<=` compare by value, and `tostring` is `toString()`. --- --- `__eq`: `a == b`: equal durations. --- `__lt`: `a < b`. --- `__le`: `a <= b`. --- `__tostring`: `tostring(d)`: `toString()`. export type Duration = { --- Whole seconds (floored: `PT-0.5S` is -1). getSeconds: (Duration) -> number, --- The nanos within the second, 0 to 999,999,999. getNano: (Duration) -> number, --- Whether it is zero long. isZero: (Duration) -> boolean, --- Whether it is negative. isNegative: (Duration) -> boolean, --- `(Duration, Duration) -> Duration`: --- This plus `duration`. --- --- `(Duration, number, ChronoUnit | RSTimeUnit) -> Duration`: --- This plus `amountToAdd` of `unit`. plus: ((Duration, Duration) -> Duration) & ((Duration, number, ChronoUnit | RSTimeUnit) -> Duration), --- `(Duration, Duration) -> Duration`: --- This less `duration`. --- --- `(Duration, number, ChronoUnit | RSTimeUnit) -> Duration`: --- This less `amountToSubtract` of `unit`. minus: ((Duration, Duration) -> Duration) & ((Duration, number, ChronoUnit | RSTimeUnit) -> Duration), --- Plus `daysToAdd` days. plusDays: (Duration, number) -> Duration, --- Plus `hoursToAdd` hours. plusHours: (Duration, number) -> Duration, --- Plus `minutesToAdd` minutes. plusMinutes: (Duration, number) -> Duration, --- Plus `secondsToAdd` seconds. plusSeconds: (Duration, number) -> Duration, --- Plus `millisToAdd` ms. plusMillis: (Duration, number) -> Duration, --- Plus `nanosToAdd` ns. plusNanos: (Duration, number) -> Duration, --- Less `daysToSubtract` days. minusDays: (Duration, number) -> Duration, --- Less `hoursToSubtract` hours. minusHours: (Duration, number) -> Duration, --- Less `minutesToSubtract` minutes. minusMinutes: (Duration, number) -> Duration, --- Less `secondsToSubtract` seconds. minusSeconds: (Duration, number) -> Duration, --- Less `millisToSubtract` ms. minusMillis: (Duration, number) -> Duration, --- Less `nanosToSubtract` ns. minusNanos: (Duration, number) -> Duration, --- This × `multiplicand`. multipliedBy: (Duration, number) -> Duration, --- `(Duration, number) -> Duration`: --- This ÷ `divisor`, truncated toward zero. --- --- `(Duration, Duration) -> number`: --- How many whole `divisor`s fit in this. dividedBy: ((Duration, number) -> Duration) & ((Duration, Duration) -> number), --- This negated. negated: (Duration) -> Duration, --- This without its sign. abs: (Duration) -> Duration, --- Whole days (`getSeconds() / 86400`). toDays: (Duration) -> number, --- Whole hours. toHours: (Duration) -> number, --- Whole minutes. toMinutes: (Duration) -> number, --- Whole seconds (`getSeconds()`). toSeconds: (Duration) -> number, --- Total milliseconds; a negative fraction counts toward zero (`PT-0.0005S` is 0). toMillis: (Duration) -> number, --- Total nanoseconds. toNanos: (Duration) -> number, --- The days part. toDaysPart: (Duration) -> number, --- The hours part, 0 to 23 (negative for a negative duration). toHoursPart: (Duration) -> number, --- The minutes part, 0 to 59. toMinutesPart: (Duration) -> number, --- The seconds part, 0 to 59. toSecondsPart: (Duration) -> number, --- The milliseconds part, 0 to 999. toMillisPart: (Duration) -> number, --- The nanoseconds part. toNanosPart: (Duration) -> number, --- The same nanos with `seconds` seconds. withSeconds: (Duration, number) -> Duration, --- The same seconds with `nanoOfSecond` nanos. withNanos: (Duration, number) -> Duration, --- Truncated to `unit` (the unit must divide a day). truncatedTo: (Duration, ChronoUnit | RSTimeUnit) -> Duration, --- The seconds compared, then the nanos subtracted. compareTo: (Duration, Duration) -> number, --- Whether `other` is an equal `Duration`. equals: (Duration, any) -> boolean, --- The value's hash. hashCode: (Duration) -> number, --- ISO-8601, `PT8H6M12.345S`. toString: (Duration) -> string, } export type DurationClass = { --- `days` × 86,400 s. ofDays: (number) -> Duration, --- `hours` × 3,600 s. ofHours: (number) -> Duration, --- `minutes` × 60 s. ofMinutes: (number) -> Duration, --- `(number) -> Duration`: --- `seconds` s. --- --- `(number, number) -> Duration`: --- `seconds` s plus `nanoAdjustment` ns. ofSeconds: ((number) -> Duration) & ((number, number) -> Duration), --- `millis` ms. ofMillis: (number) -> Duration, --- `nanos` ns. ofNanos: (number) -> Duration, --- `amount` of `unit`: a `ChronoUnit` with an exact duration (or `DAYS`), or an --- `RSTimeUnit` (`Duration.of(5, RSTimeUnit.GAME_TICKS)` is 3 s). of: (number, ChronoUnit | RSTimeUnit) -> Duration, --- The duration from `startInclusive` to `endExclusive`, negative when the end is --- earlier: two `Instant`s, two `LocalTime`s, two `LocalDateTime`s, ... (the end is --- converted to the start's type). between: (Instant | LocalTime | LocalDate | LocalDateTime | ZonedDateTime, Instant | LocalTime | LocalDate | LocalDateTime | ZonedDateTime) -> Duration, --- ISO-8601 `PnDTnHnMn.nS`, as `toString` writes it. parse: (string) -> Duration, --- The zero duration, `PT0S`. ZERO: Duration, } --- `Duration`'s static functions and constants. declare Duration: DurationClass --- A time of day without a date or zone. `LocalTime.now()` is the system zone's. --- `==`, `<` and `<=` compare by value. --- --- `__eq`: `a == b`. --- `__lt`: `a < b`. --- `__le`: `a <= b`. --- `__tostring`: `tostring(t)`: `toString()`. export type LocalTime = { --- The hour, 0 to 23. getHour: (LocalTime) -> number, --- The minute, 0 to 59. getMinute: (LocalTime) -> number, --- The second, 0 to 59. getSecond: (LocalTime) -> number, --- The nano-of-second. getNano: (LocalTime) -> number, --- Seconds since midnight. toSecondOfDay: (LocalTime) -> number, --- Nanoseconds since midnight. toNanoOfDay: (LocalTime) -> number, --- Plus `hoursToAdd` hours, wrapping around midnight. plusHours: (LocalTime, number) -> LocalTime, --- Plus `minutesToAdd` minutes, wrapping. plusMinutes: (LocalTime, number) -> LocalTime, --- Plus `secondstoAdd` seconds, wrapping. plusSeconds: (LocalTime, number) -> LocalTime, --- Plus `nanosToAdd` ns, wrapping. plusNanos: (LocalTime, number) -> LocalTime, --- Less `hoursToSubtract` hours, wrapping. minusHours: (LocalTime, number) -> LocalTime, --- Less `minutesToSubtract` minutes, wrapping. minusMinutes: (LocalTime, number) -> LocalTime, --- Less `secondsToSubtract` seconds, wrapping. minusSeconds: (LocalTime, number) -> LocalTime, --- The same time with `hour`. withHour: (LocalTime, number) -> LocalTime, --- The same time with `minute`. withMinute: (LocalTime, number) -> LocalTime, --- The same time with `second`. withSecond: (LocalTime, number) -> LocalTime, --- The same time with `nanoOfSecond`. withNano: (LocalTime, number) -> LocalTime, --- Whether this is after `other`. isAfter: (LocalTime, LocalTime) -> boolean, --- Whether this is before `other`. isBefore: (LocalTime, LocalTime) -> boolean, --- -1, 0 or 1 by hour, then minute, second and nano. compareTo: (LocalTime, LocalTime) -> number, --- `formatter`'s text for this time. format: (LocalTime, DateTimeFormatter) -> string, --- Whether `other` is an equal `LocalTime`. equals: (LocalTime, any) -> boolean, --- The value's hash. hashCode: (LocalTime) -> number, --- `HH:mm`, then `:ss` and a fraction when present. toString: (LocalTime) -> string, } export type LocalTimeClass = { --- `() -> LocalTime`: --- The time now in the system zone. --- --- `(ZoneId) -> LocalTime`: --- The time now in `zone`. now: (() -> LocalTime) & ((ZoneId) -> LocalTime), --- `(number, number) -> LocalTime`: --- `hour:minute`. --- --- `(number, number, number) -> LocalTime`: --- `hour:minute:second`. --- --- `(number, number, number, number) -> LocalTime`: --- `hour:minute:second.nanoOfSecond`. of: ((number, number) -> LocalTime) & ((number, number, number) -> LocalTime) & ((number, number, number, number) -> LocalTime), --- The time `secondOfDay` seconds after midnight (0 to 86,399). ofSecondOfDay: (number) -> LocalTime, --- The time `nanoOfDay` ns after midnight. ofNanoOfDay: (number) -> LocalTime, --- 00:00. MIDNIGHT: LocalTime, --- 12:00. NOON: LocalTime, --- 00:00. MIN: LocalTime, --- 23:59:59.999999999. MAX: LocalTime, } --- `LocalTime`'s static functions and constants. declare LocalTime: LocalTimeClass --- A date without a time or zone. `LocalDate.now()` is the system zone's. `==`, --- `<` and `<=` compare by value. --- --- `__eq`: `a == b`. --- `__lt`: `a < b`. --- `__le`: `a <= b`. --- `__tostring`: `tostring(d)`: `toString()`. export type LocalDate = { --- The year. getYear: (LocalDate) -> number, --- The month, 1 to 12. getMonthValue: (LocalDate) -> number, --- The day of the month. getDayOfMonth: (LocalDate) -> number, --- The day of the year, 1 to 366. getDayOfYear: (LocalDate) -> number, --- The day of the week. getDayOfWeek: (LocalDate) -> DayOfWeek, --- The days in this date's month. lengthOfMonth: (LocalDate) -> number, --- 365 or 366. lengthOfYear: (LocalDate) -> number, --- Whether the year is a leap year. isLeapYear: (LocalDate) -> boolean, --- Days since 1970-01-01. toEpochDay: (LocalDate) -> number, --- Plus `daysToAdd` days. plusDays: (LocalDate, number) -> LocalDate, --- Plus `weeksToAdd` weeks. plusWeeks: (LocalDate, number) -> LocalDate, --- Plus `monthsToAdd` months; the day is clamped to the new month's length. plusMonths: (LocalDate, number) -> LocalDate, --- Plus `yearsToAdd` years; 29 February becomes 28 in a common year. plusYears: (LocalDate, number) -> LocalDate, --- Less `daysToSubtract` days. minusDays: (LocalDate, number) -> LocalDate, --- Less `weeksToSubtract` weeks. minusWeeks: (LocalDate, number) -> LocalDate, --- Less `monthsToSubtract` months. minusMonths: (LocalDate, number) -> LocalDate, --- Less `yearsToSubtract` years. minusYears: (LocalDate, number) -> LocalDate, --- Midnight at the start of this date. atStartOfDay: (LocalDate) -> LocalDateTime, --- `(LocalDate, number, number) -> LocalDateTime`: --- This date at `hour:minute`. --- --- `(LocalDate, LocalTime) -> LocalDateTime`: --- This date at `time`. atTime: ((LocalDate, number, number) -> LocalDateTime) & ((LocalDate, LocalTime) -> LocalDateTime), --- Whether this is after `other`. isAfter: (LocalDate, LocalDate) -> boolean, --- Whether this is before `other`. isBefore: (LocalDate, LocalDate) -> boolean, --- Whether this is `other`'s date. isEqual: (LocalDate, LocalDate) -> boolean, --- The year, month and day differences in turn. compareTo: (LocalDate, LocalDate) -> number, --- `formatter`'s text for this date. format: (LocalDate, DateTimeFormatter) -> string, --- Whether `other` is an equal `LocalDate`. equals: (LocalDate, any) -> boolean, --- The value's hash. hashCode: (LocalDate) -> number, --- `yyyy-MM-dd`. toString: (LocalDate) -> string, } export type LocalDateClass = { --- `() -> LocalDate`: --- Today in the system zone. --- --- `(ZoneId) -> LocalDate`: --- Today in `zone`. now: (() -> LocalDate) & ((ZoneId) -> LocalDate), --- `year-month-dayOfMonth`. of: (number, number, number) -> LocalDate, --- The date `epochDay` days after 1970-01-01. ofEpochDay: (number) -> LocalDate, } --- `LocalDate`'s static functions and constants. declare LocalDate: LocalDateClass --- A date and time without a zone. `LocalDateTime.now()` is the system zone's. `==`, --- `<` and `<=` compare by value. --- --- `__eq`: `a == b`. --- `__lt`: `a < b`. --- `__le`: `a <= b`. --- `__tostring`: `tostring(dt)`: `toString()`. export type LocalDateTime = { --- The date. toLocalDate: (LocalDateTime) -> LocalDate, --- The time. toLocalTime: (LocalDateTime) -> LocalTime, --- The year. getYear: (LocalDateTime) -> number, --- The month, 1 to 12. getMonthValue: (LocalDateTime) -> number, --- The day of the month. getDayOfMonth: (LocalDateTime) -> number, --- The day of the year. getDayOfYear: (LocalDateTime) -> number, --- The day of the week. getDayOfWeek: (LocalDateTime) -> DayOfWeek, --- The hour. getHour: (LocalDateTime) -> number, --- The minute. getMinute: (LocalDateTime) -> number, --- The second. getSecond: (LocalDateTime) -> number, --- The nano-of-second. getNano: (LocalDateTime) -> number, --- `(LocalDateTime, number, ChronoUnit | RSTimeUnit) -> LocalDateTime`: --- Plus `amountToAdd` of `unit`: time units carry into the date; `DAYS` to --- `MILLENNIA` move the date, clamping the day of the month. --- --- `(LocalDateTime, Duration) -> LocalDateTime`: --- Plus a `Duration`. plus: ((LocalDateTime, number, ChronoUnit | RSTimeUnit) -> LocalDateTime) & ((LocalDateTime, Duration) -> LocalDateTime), --- Less `amountToSubtract` of `unit`. minus: (LocalDateTime, number, ChronoUnit | RSTimeUnit) -> LocalDateTime, --- Plus `days` days. plusDays: (LocalDateTime, number) -> LocalDateTime, --- Plus `hours` hours. plusHours: (LocalDateTime, number) -> LocalDateTime, --- Plus `minutes` minutes. plusMinutes: (LocalDateTime, number) -> LocalDateTime, --- Plus `seconds` seconds. plusSeconds: (LocalDateTime, number) -> LocalDateTime, --- Plus `weeks` weeks. plusWeeks: (LocalDateTime, number) -> LocalDateTime, --- Plus `months` months. plusMonths: (LocalDateTime, number) -> LocalDateTime, --- Plus `years` years. plusYears: (LocalDateTime, number) -> LocalDateTime, --- Less `days` days. minusDays: (LocalDateTime, number) -> LocalDateTime, --- Less `hours` hours. minusHours: (LocalDateTime, number) -> LocalDateTime, --- Less `minutes` minutes. minusMinutes: (LocalDateTime, number) -> LocalDateTime, --- This date and time in `zone` (a time a gap skips moves forward by the gap; an --- overlap takes the earlier offset). atZone: (LocalDateTime, ZoneId) -> ZonedDateTime, --- Whether this is after `other`. isAfter: (LocalDateTime, LocalDateTime) -> boolean, --- Whether this is before `other`. isBefore: (LocalDateTime, LocalDateTime) -> boolean, --- Whether this is `other`'s date and time. isEqual: (LocalDateTime, LocalDateTime) -> boolean, --- The date compared, then the time. compareTo: (LocalDateTime, LocalDateTime) -> number, --- `formatter`'s text for this date and time. format: (LocalDateTime, DateTimeFormatter) -> string, --- Whether `other` is an equal `LocalDateTime`. equals: (LocalDateTime, any) -> boolean, --- `yyyy-MM-ddTHH:mm[:ss[.fraction]]`. toString: (LocalDateTime) -> string, } export type LocalDateTimeClass = { --- `() -> LocalDateTime`: --- The date and time now in the system zone. --- --- `(ZoneId) -> LocalDateTime`: --- The date and time now in `zone`. now: (() -> LocalDateTime) & ((ZoneId) -> LocalDateTime), --- `(LocalDate, LocalTime) -> LocalDateTime`: --- `date` at `time`. --- --- `(number, number, number, number, number) -> LocalDateTime`: --- `year-month-dayOfMonth hour:minute`. --- --- `(number, number, number, number, number, number) -> LocalDateTime`: --- `year-month-dayOfMonth hour:minute:second`. of: ((LocalDate, LocalTime) -> LocalDateTime) & ((number, number, number, number, number) -> LocalDateTime) & ((number, number, number, number, number, number) -> LocalDateTime), } --- `LocalDateTime`'s static functions and constants. declare LocalDateTime: LocalDateTimeClass --- A time zone, a region (`Europe/London`, with its daylight saving rules) or a fixed --- offset (`+02:00`). The rules are the IANA database bundled with the client, and --- `systemDefault()` maps the Windows zone. --- --- `__tostring`: `tostring(z)`: the id. export type ZoneId = { --- The id. getId: (ZoneId) -> string, --- Whether `other` is a zone of the same id. equals: (ZoneId, any) -> boolean, --- The id's `String#hashCode`. hashCode: (ZoneId) -> number, --- The id. toString: (ZoneId) -> string, } export type ZoneIdClass = { --- The system's zone. systemDefault: () -> ZoneId, --- The zone named `zoneId`: a region id, `Z`, an offset (`+02:00`) or one prefixed --- with `UTC`/`GMT`/`UT`. An unknown region is `ZoneRulesException`. of: (string) -> ZoneId, } --- `ZoneId`'s static functions and constants. declare ZoneId: ZoneIdClass --- The base of `ZonedDateTime`. export type ChronoZonedDateTime = { --- The instant. toInstant: (ChronoZonedDateTime) -> Instant, --- Seconds since the epoch. toEpochSecond: (ChronoZonedDateTime) -> number, --- Whether this instant is after `other`'s. isAfter: (ChronoZonedDateTime, ChronoZonedDateTime) -> boolean, --- Whether this instant is before `other`'s. isBefore: (ChronoZonedDateTime, ChronoZonedDateTime) -> boolean, } --- An instant in a zone, with that zone's local date and time. --- --- `__tostring`: `tostring(z)`: `toString()`. export type ZonedDateTime = ChronoZonedDateTime & { --- The zone. getZone: (ZonedDateTime) -> ZoneId, --- The local date there. toLocalDate: (ZonedDateTime) -> LocalDate, --- The local time there. toLocalTime: (ZonedDateTime) -> LocalTime, --- The local date and time there. toLocalDateTime: (ZonedDateTime) -> LocalDateTime, --- The year there. getYear: (ZonedDateTime) -> number, --- The month there, 1 to 12. getMonthValue: (ZonedDateTime) -> number, --- The day of the month there. getDayOfMonth: (ZonedDateTime) -> number, --- The day of the year there. getDayOfYear: (ZonedDateTime) -> number, --- The day of the week there. getDayOfWeek: (ZonedDateTime) -> DayOfWeek, --- The hour there. getHour: (ZonedDateTime) -> number, --- The minute there. getMinute: (ZonedDateTime) -> number, --- The second there. getSecond: (ZonedDateTime) -> number, --- The nano-of-second. getNano: (ZonedDateTime) -> number, --- The same instant in `zone`. withZoneSameInstant: (ZonedDateTime, ZoneId) -> ZonedDateTime, --- `formatter`'s text. format: (ZonedDateTime, DateTimeFormatter) -> string, --- Whether `other` is the same instant in the same zone. equals: (ZonedDateTime, any) -> boolean, --- `2007-12-03T10:15:30+01:00[Europe/Paris]`. toString: (ZonedDateTime) -> string, } export type ZonedDateTimeClass = { --- `() -> ZonedDateTime`: --- Now in the system zone. --- --- `(ZoneId) -> ZonedDateTime`: --- Now in `zone`. now: (() -> ZonedDateTime) & ((ZoneId) -> ZonedDateTime), --- `instant` in `zone`. ofInstant: (Instant, ZoneId) -> ZonedDateTime, } --- `ZonedDateTime`'s static functions and constants. declare ZonedDateTime: ZonedDateTimeClass --- How a number rounds, for `DecimalFormat#setRoundingMode`. --- --- `__tostring`: `tostring(c)`: `toString()`. export type RoundingMode = { --- The constant's name as declared. name: (RoundingMode) -> string, --- The constant's 0-based position in `values()`. ordinal: (RoundingMode) -> number, --- The constant's printed name; `tostring(c)` answers the same. toString: (RoundingMode) -> string, --- This ordinal less `other`'s. compareTo: (RoundingMode, RoundingMode) -> number, --- Whether `other` is this constant. `==` answers the same. equals: (RoundingMode, any) -> boolean, } export type RoundingModeClass = { --- Every constant in ordinal order, as a new 1-based array. values: () -> {RoundingMode}, --- The constant named `name`; any other name is an error. valueOf: (string) -> RoundingMode, --- `RoundingMode.UP`. UP: RoundingMode, --- `RoundingMode.DOWN`. DOWN: RoundingMode, --- `RoundingMode.CEILING`. CEILING: RoundingMode, --- `RoundingMode.FLOOR`. FLOOR: RoundingMode, --- `RoundingMode.HALF_UP`. HALF_UP: RoundingMode, --- `RoundingMode.HALF_DOWN`. HALF_DOWN: RoundingMode, --- `RoundingMode.HALF_EVEN`. HALF_EVEN: RoundingMode, --- `RoundingMode.UNNECESSARY`. UNNECESSARY: RoundingMode, } --- `RoundingMode`'s static functions and constants. declare RoundingMode: RoundingModeClass --- Milliseconds since the epoch, as `DateFormat#format` takes it. `Date.new()` --- reads the wall clock. --- --- `__tostring`: `tostring(d)`: `toString()`. export type Date = { --- Milliseconds since the epoch. getTime: (Date) -> number, --- Whether this is before `when`. before: (Date, Date) -> boolean, --- Whether this is after `when`. after: (Date, Date) -> boolean, --- -1, 0 or 1. compareTo: (Date, Date) -> number, --- Whether `obj` is a `Date` of the same time. equals: (Date, any) -> boolean, --- `Date#toInstant()`. toInstant: (Date) -> Instant, --- `EEE MMM dd HH:mm:ss zzz yyyy` in the system zone. toString: (Date) -> string, } export type DateClass = { --- `() -> Date`: --- Now. --- --- `(number) -> Date`: --- `date` ms after the epoch. new: (() -> Date) & ((number) -> Date), } --- `Date`'s static functions and constants. declare Date: DateClass --- Formatting (not parsing) in English. Every standard pattern letter, optional --- sections and literals; `withZone` shows a value with an instant in that zone. export type DateTimeFormatter = { --- This formatter showing a value's instant in `zone`. withZone: (DateTimeFormatter, ZoneId) -> DateTimeFormatter, --- `temporal` formatted. A field the value does not have (`yyyy` of a `LocalTime`) --- is `UnsupportedTemporalTypeException`. format: (DateTimeFormatter, Instant | LocalTime | LocalDate | LocalDateTime | ZonedDateTime) -> string, } export type DateTimeFormatterClass = { --- A formatter for `pattern`; an invalid pattern is `IllegalArgumentException`. ofPattern: (string) -> DateTimeFormatter, --- The localized time formatter in `style`, under the default (English, US) --- locale: `h:mm:ss a` for `MEDIUM`. ofLocalizedTime: (FormatStyle) -> DateTimeFormatter, } --- `DateTimeFormatter`'s static functions and constants. declare DateTimeFormatter: DateTimeFormatterClass --- The base of `SimpleDateFormat`. export type DateFormat = { --- `date` formatted in the formatter's time zone. format: (DateFormat, Date) -> string, } --- Date formatting in English, in the system time zone: `GregorianCalendar`'s fields --- (Julian before 1582-10-15), every pattern letter. export type SimpleDateFormat = DateFormat export type SimpleDateFormatClass = { --- A formatter for `pattern`; an invalid pattern is `IllegalArgumentException`. new: (string) -> SimpleDateFormat, } --- `SimpleDateFormat`'s static functions and constants. declare SimpleDateFormat: SimpleDateFormatClass --- The base of `DecimalFormat`. `NumberFormat.getInstance()` and friends are --- `DecimalFormat`s in the default (English) locale. export type NumberFormat = { --- `(NumberFormat, number) -> string`: --- `number` formatted (a Luau integer takes this overload). --- --- `(NumberFormat, number) -> string`: --- `number` formatted, rounding by the rounding mode (`HALF_EVEN` by default). format: (NumberFormat, number) -> string, --- At most `newValue` fraction digits. setMaximumFractionDigits: (NumberFormat, number) -> (), --- At least `newValue` fraction digits. setMinimumFractionDigits: (NumberFormat, number) -> (), --- At most `newValue` integer digits. setMaximumIntegerDigits: (NumberFormat, number) -> (), --- At least `newValue` integer digits. setMinimumIntegerDigits: (NumberFormat, number) -> (), --- The most fraction digits. getMaximumFractionDigits: (NumberFormat) -> number, --- The fewest fraction digits. getMinimumFractionDigits: (NumberFormat) -> number, --- The most integer digits. getMaximumIntegerDigits: (NumberFormat) -> number, --- The fewest integer digits. getMinimumIntegerDigits: (NumberFormat) -> number, --- Whether digits are grouped. setGroupingUsed: (NumberFormat, boolean) -> (), --- Whether digits are grouped. isGroupingUsed: (NumberFormat) -> boolean, } export type NumberFormatClass = { --- `#,##0.###` in the default locale. getInstance: () -> DecimalFormat, --- `#,##0.###` in the default locale. getNumberInstance: () -> DecimalFormat, --- `#,##0` rounding `HALF_EVEN`, parsing integers only. getIntegerInstance: () -> DecimalFormat, --- `#,##0%`. getPercentInstance: () -> DecimalFormat, } --- `NumberFormat`'s static functions and constants. declare NumberFormat: NumberFormatClass --- Number formatting with English symbols (grouping `,`, decimal `.`), rounding --- `HALF_EVEN` by default. A scientific (`0.0E0`) or currency (`¤`) pattern is refused. export type DecimalFormat = NumberFormat & { --- Replace the pattern. applyPattern: (DecimalFormat, string) -> (), --- The rounding mode. setRoundingMode: (DecimalFormat, RoundingMode) -> (), --- The rounding mode. getRoundingMode: (DecimalFormat) -> RoundingMode, --- The digits per group. setGroupingSize: (DecimalFormat, number) -> (), --- The digits per group. getGroupingSize: (DecimalFormat) -> number, --- Whether a whole number still shows the decimal separator. setDecimalSeparatorAlwaysShown: (DecimalFormat, boolean) -> (), --- The multiplier (100 for percent). setMultiplier: (DecimalFormat, number) -> (), --- The positive prefix. setPositivePrefix: (DecimalFormat, string) -> (), --- The positive suffix. setPositiveSuffix: (DecimalFormat, string) -> (), --- The negative prefix. setNegativePrefix: (DecimalFormat, string) -> (), --- The negative suffix. setNegativeSuffix: (DecimalFormat, string) -> (), } export type DecimalFormatClass = { --- `() -> DecimalFormat`: --- `#,##0.###`. --- --- `(string) -> DecimalFormat`: --- A format for `pattern`; an invalid pattern is `IllegalArgumentException`. new: (() -> DecimalFormat) & ((string) -> DecimalFormat), } --- `DecimalFormat`'s static functions and constants. declare DecimalFormat: DecimalFormatClass --- A duration in ms through a `d H m s S` pattern, each unit taking what the larger --- ones left. export type DurationFormatUtils = { } export type DurationFormatUtilsClass = { --- `(number, string) -> string`: --- `durationMillis` through `format`, zero-padded; a negative duration is --- `IllegalArgumentException`. --- --- `(number, string, boolean) -> string`: --- `durationMillis` through `format`, padded when `padWithZeros`. formatDuration: ((number, string) -> string) & ((number, string, boolean) -> string), --- `HH:mm:ss.SSS`. formatDurationHMS: (number) -> string, } --- `DurationFormatUtils`'s static functions and constants. declare DurationFormatUtils: DurationFormatUtilsClass --- The `clientThread` global. Plugin code already runs on the client thread; these schedule work at fixed points in the cycle: `invokeLater` right after `GameTick`, `invokeAtTickEnd` before `PostClientTick`. A job returning `false` runs again at the next point; one that raises is logged and dropped. When the plugin stops, what it queued while running is dropped; what its `shutDown` queues runs once. export type ClientThread = { --- Run `r` now (plugin code is on the client thread); if it returns `false`, run it again at every later invoke point until it returns anything else. Called from the main chunk (off the client thread) it is queued, as `invokeLater`. An error in `r` run now is raised here. invoke: (ClientThread, (() -> ()) | (() -> boolean?)) -> (), --- Run `r` at the next invoke point (right after the cycle's `GameTick`), even when already on the client thread; if it returns `false`, again at each later point until it returns anything else. A job queued by a job runs in the same drain unless the queuing job was the last one (so `invokeLater` from inside the last job waits for the next invoke point). invokeLater: (ClientThread, (() -> ()) | (() -> boolean?)) -> (), --- Run `r` once at the end of this cycle, after every event of it and before `PostClientTick`. invokeAtTickEnd: (ClientThread, () -> ()) -> (), } --- A unit of time: 7 constants, each one userdata per VM. Conversions truncate toward zero and saturate at the limits of a `long` (a result beyond 2^53 is refused, as every `long` is). --- --- `__tostring`: `tostring(c)`: `toString()`. export type TimeUnit = { --- The constant's name as declared. name: (TimeUnit) -> string, --- The constant's 0-based position in `values()`. ordinal: (TimeUnit) -> number, --- The constant's printed name; `tostring(c)` answers the same. toString: (TimeUnit) -> string, --- This ordinal less `other`'s. compareTo: (TimeUnit, TimeUnit) -> number, --- Whether `other` is this constant. `==` answers the same. equals: (TimeUnit, any) -> boolean, --- `duration` of this unit in nanoseconds. toNanos: (TimeUnit, number) -> number, --- `duration` of this unit in microseconds. toMicros: (TimeUnit, number) -> number, --- `duration` of this unit in milliseconds. toMillis: (TimeUnit, number) -> number, --- `duration` of this unit in seconds. toSeconds: (TimeUnit, number) -> number, --- `duration` of this unit in minutes. toMinutes: (TimeUnit, number) -> number, --- `duration` of this unit in hours. toHours: (TimeUnit, number) -> number, --- `duration` of this unit in days. toDays: (TimeUnit, number) -> number, --- `sourceDuration` of `sourceUnit` in this unit. convert: (TimeUnit, number, TimeUnit) -> number, --- The `ChronoUnit` of the same length. toChronoUnit: (TimeUnit) -> ChronoUnit, } export type TimeUnitClass = { --- Every constant in ordinal order, as a new 1-based array. values: () -> {TimeUnit}, --- The constant named `name`; any other name is an error. valueOf: (string) -> TimeUnit, --- `TimeUnit.NANOSECONDS`. NANOSECONDS: TimeUnit, --- `TimeUnit.MICROSECONDS`. MICROSECONDS: TimeUnit, --- `TimeUnit.MILLISECONDS`. MILLISECONDS: TimeUnit, --- `TimeUnit.SECONDS`. SECONDS: TimeUnit, --- `TimeUnit.MINUTES`. MINUTES: TimeUnit, --- `TimeUnit.HOURS`. HOURS: TimeUnit, --- `TimeUnit.DAYS`. DAYS: TimeUnit, } --- `TimeUnit`'s static functions and constants. declare TimeUnit: TimeUnitClass --- The `timer` global: tasks run on the client thread at the first invoke point --- (each 20 ms cycle, right after `GameTick`) at or after they are due, by due --- time then creation, with delays in milliseconds, server ticks or client --- cycles. The `executor` global (`ScheduledExecutorService`) schedules the --- same way. export type TimerService = { --- Run `task` once, `delay` milliseconds from now, on the client thread (at the --- first cycle at or after it is due). after: (TimerService, number, () -> ()) -> ScheduledFuture, --- Run `task` every `period` milliseconds, first after `initialDelay` (default one --- period), on the client thread. Runs missed while the game stalled are made up back --- to back, at most 16 per cycle. every: (TimerService, number, () -> (), number?) -> ScheduledFuture, --- Run `task` once, `ticks` server ticks from now, right after that tick's --- `GameTick`. afterTicks: (TimerService, number, () -> ()) -> ScheduledFuture, --- Run `task` every `ticks` server ticks, first `ticks` from now. everyTicks: (TimerService, number, () -> ()) -> ScheduledFuture, --- Cancel `future`: `future:cancel(false)`. cancel: (TimerService, ScheduledFuture) -> boolean, } --- A task's handle (every one is a `ScheduledFuture`). export type Future = { --- Cancel the task: it will not run again. `false` when it had already run (a --- one-shot) or was cancelled. A task runs on the client thread, never beside this --- call, so there is nothing to interrupt. cancel: (Future, boolean) -> boolean, --- Whether it was cancelled before it completed. isCancelled: (Future) -> boolean, --- Whether it completed: a one-shot that ran, or any task cancelled. isDone: (Future) -> boolean, } --- What has a delay left. Every one here is a `ScheduledFuture`; a class has one --- base here, so `Delayed` sits on `Future` and a `Delayed` value answers `Future`'s --- members too. export type Delayed = Future & { --- The time until the task is next due, in `unit`, truncated; negative once it is --- overdue, and for a task that ran or was cancelled, the time since its trigger --- time. A task counted in server ticks (`timer:afterTicks`) converts them at 600 --- ms each, one counted in client cycles at 20 ms. getDelay: (Delayed, TimeUnit) -> number, } --- A task `timer` or an executor scheduled. export type ScheduledFuture = Delayed --- A timer with start, stop, restart, repeat and coalesce rules, its listener run on the --- client thread at the first cycle it is due. Between two cycles the client thread is --- busy: a coalescing timer runs once for the expiries a cycle collected, a --- non-coalescing one runs each of them, and a zero delay expires once a cycle. export type SwingTimer = { --- Start it: the listener first runs the initial delay from now. Nothing when --- already running. start: (SwingTimer) -> (), --- Stop it: the listener does not run again until it is started, and a run it posted --- that has not started yet does not run. stop: (SwingTimer) -> (), --- Stop it and start it again: the next run is the initial delay from now. Called from --- the action, it lets the next expiry post another run even while this one waits on a --- dialog. restart: (SwingTimer) -> (), --- Whether it is running. isRunning: (SwingTimer) -> boolean, --- `false`: run once and stop. Set from the action of a repeating timer, the expiry --- already scheduled still runs. setRepeats: (SwingTimer, boolean) -> (), --- Whether it repeats (the default). isRepeats: (SwingTimer) -> boolean, --- The delay between runs, ms, from the next rescheduling on: set from the action, it --- reaches the expiry after the next one. Negative is an error. setDelay: (SwingTimer, number) -> (), --- The delay between runs, ms. getDelay: (SwingTimer) -> number, --- The delay before the first run after `start`, ms. Negative is an error. setInitialDelay: (SwingTimer, number) -> (), --- The delay before the first run, ms. getInitialDelay: (SwingTimer) -> number, --- Whether expiries coalesce (the default): while a run it posted has not returned --- (it waits on a dialog, or has not started), an expiry posts nothing. `false` posts --- every expiry: runs stack up behind a busy cycle, and start while an earlier one --- waits on a dialog. An action that raises leaves a coalescing timer with a run that --- never returned, so it posts nothing more until `stop()` or `restart()`. setCoalesce: (SwingTimer, boolean) -> (), --- The coalesce flag. isCoalesce: (SwingTimer) -> boolean, } export type SwingTimerClass = { --- A stopped timer that, once started, calls `listener` `delay` ms later and then every `delay` ms (the initial delay and the delay are both `delay`, it repeats and coalesces). `listener` is an `ActionListener`: a function, or a table whose `actionPerformed(self, event)` is called; either gets the `ActionEvent`, whose `getSource()` is this timer. A negative delay is `IllegalArgumentException`. new: (number, any) -> SwingTimer, } --- `SwingTimer`'s static functions and constants. declare SwingTimer: SwingTimerClass --- Runs a task, on the client thread at the next invoke point (each 20 ms cycle, --- right after `GameTick`). export type Executor = { --- Run `command` at the next invoke point, on the client thread. An error it raises --- is logged. After `shutdown()` it is `RejectedExecutionException`. execute: (Executor, () -> ()) -> (), } --- An executor that can be shut down. export type ExecutorService = Executor & { --- Run `task` at the next invoke point; the future answers `isDone()` once it ran --- and `cancel(...)` before. After `shutdown()` it is `RejectedExecutionException`. submit: (ExecutorService, () -> ()) -> ScheduledFuture, --- Refuse new tasks and cancel the periodic ones; delayed one-shots still run, as --- `ScheduledThreadPoolExecutor`'s do by default. shutdown: (ExecutorService) -> (), --- Whether `shutdown()` (or `shutdownNow()`) was called. isShutdown: (ExecutorService) -> boolean, --- Whether it is shut down and no task of it is left to run. isTerminated: (ExecutorService) -> boolean, } --- The `executor` global, and what `Executors.newSingleThreadExecutor()` and friends --- return: tasks run on the client thread at the first invoke point (each 20 ms --- cycle) at or after they are due. export type ScheduledExecutorService = ExecutorService & { --- Run `command` once, `delay` (in `unit`) from now. A negative delay is none. schedule: (ScheduledExecutorService, () -> (), number, TimeUnit) -> ScheduledFuture, --- Run `command` every `period` (in `unit`), first `initialDelay` from now; runs the --- game stalled through are made up back to back. A period must be positive --- (`IllegalArgumentException`); the task is not run again after it raises. scheduleAtFixedRate: (ScheduledExecutorService, () -> (), number, number, TimeUnit) -> ScheduledFuture, --- Run `command` again `delay` (in `unit`) after each run ends, first `initialDelay` --- from now. A delay must be positive; the task is not run again after it raises. scheduleWithFixedDelay: (ScheduledExecutorService, () -> (), number, number, TimeUnit) -> ScheduledFuture, --- Shut down and cancel every task not yet run, periodic ones included; the one-shot tasks that never ran, as an array of their functions. shutdownNow: (ScheduledExecutorService) -> {() -> ()}, } --- New executors, each its own `shutdown` state over the plugin's client-thread --- scheduling. A thread factory is accepted and unused (there is no thread to make). export type Executors = { } export type ExecutorsClass = { --- A new scheduled executor (one thread or many is the same here). newScheduledThreadPool: (number) -> ScheduledExecutorService, --- A new executor (cached or not is the same here). newCachedThreadPool: () -> ScheduledExecutorService, --- A new executor (`nThreads` is unused). newFixedThreadPool: (number) -> ScheduledExecutorService, --- A new executor. newSingleThreadExecutor: () -> ScheduledExecutorService, --- A new scheduled executor. newSingleThreadScheduledExecutor: () -> ScheduledExecutorService, } --- `Executors`'s static functions and constants. declare Executors: ExecutorsClass --- A `Content-Type`. `toString()` is the text it was made from. --- --- `__tostring`: `tostring(m)`: `toString()`. export type MediaType = { --- The top-level type, lowercase (`application`). type: (MediaType) -> string, --- The subtype, lowercase (`json`). subtype: (MediaType) -> string, --- The `charset` parameter as a canonical charset name (`UTF-8`), or nil. charset: (MediaType) -> string?, --- Whether `other` is a media type of the same text. equals: (MediaType, any) -> boolean, --- The text it was made from. toString: (MediaType) -> string, } export type MediaTypeClass = { --- The media type `string` names; a malformed one is `IllegalArgumentException`. get: (string) -> MediaType, --- The media type `string` names, or nil when it is malformed. parse: (string) -> MediaType?, } --- `MediaType`'s static functions and constants. declare MediaType: MediaTypeClass --- An `http` or `https` URL in canonical form. --- --- `__tostring`: `tostring(u)`: `toString()`. export type HttpUrl = { --- A builder holding this URL. newBuilder: (HttpUrl) -> HttpUrlBuilder, --- `http` or `https`. scheme: (HttpUrl) -> string, --- Whether it is `https`. isHttps: (HttpUrl) -> boolean, --- The host: lowercase, IDN in ASCII, an IP literal canonical. host: (HttpUrl) -> string, --- The port (the scheme's default when the URL names none). port: (HttpUrl) -> number, --- The decoded user name. username: (HttpUrl) -> string, --- The decoded password. password: (HttpUrl) -> string, --- The path, encoded (`/a%20b/c`). encodedPath: (HttpUrl) -> string, --- The path segments, decoded. pathSegments: (HttpUrl) -> {string}, --- The path segments, encoded. encodedPathSegments: (HttpUrl) -> {string}, --- The query, encoded, or nil without one. encodedQuery: (HttpUrl) -> string?, --- The query, decoded, or nil. query: (HttpUrl) -> string?, --- The first value of query parameter `name`, decoded, or nil. queryParameter: (HttpUrl, string) -> string?, --- Every value of `name`, decoded (nil for one without `=`). queryParameterValues: (HttpUrl, string) -> { n: number, [number]: string? }, --- How many query parameters. querySize: (HttpUrl) -> number, --- The fragment, decoded, or nil. fragment: (HttpUrl) -> string?, --- Whether `other` is the same URL. equals: (HttpUrl, any) -> boolean, --- The URL, as OkHttp writes it. toString: (HttpUrl) -> string, } export type HttpUrlClass = { --- The URL `url` names; anything but an `http`/`https` URL is --- `IllegalArgumentException`. get: (string) -> HttpUrl, --- The URL `url` names, or nil. parse: (string) -> HttpUrl?, --- `HttpUrl.Builder`: the nested class `HttpUrlBuilder`. Builder: HttpUrlBuilderClass, } --- `HttpUrl`'s static functions and constants. declare HttpUrl: HttpUrlClass --- Builds an `HttpUrl`, percent-encoding each piece. Its setters return the --- builder. export type HttpUrlBuilder = { --- `http` or `https`; anything else is `IllegalArgumentException`. scheme: (HttpUrlBuilder, string) -> HttpUrlBuilder, --- The host; one OkHttp cannot canonicalize is `IllegalArgumentException`. host: (HttpUrlBuilder, string) -> HttpUrlBuilder, --- The port, 1 to 65535. port: (HttpUrlBuilder, number) -> HttpUrlBuilder, --- The user name. username: (HttpUrlBuilder, string) -> HttpUrlBuilder, --- The password. password: (HttpUrlBuilder, string) -> HttpUrlBuilder, --- One path segment (a `/` in it is encoded); `..` removes the last. addPathSegment: (HttpUrlBuilder, string) -> HttpUrlBuilder, --- `/`-separated path segments. addPathSegments: (HttpUrlBuilder, string) -> HttpUrlBuilder, --- One path segment, already encoded. addEncodedPathSegment: (HttpUrlBuilder, string) -> HttpUrlBuilder, --- Path segments, already encoded. addEncodedPathSegments: (HttpUrlBuilder, string) -> HttpUrlBuilder, --- The whole path, encoded, starting with `/`. encodedPath: (HttpUrlBuilder, string) -> HttpUrlBuilder, --- The whole query (nil for none). query: (HttpUrlBuilder, string?) -> HttpUrlBuilder, --- One more query parameter (`value` nil for a bare name). addQueryParameter: (HttpUrlBuilder, string, string?) -> HttpUrlBuilder, --- One more query parameter, already encoded. addEncodedQueryParameter: (HttpUrlBuilder, string, string?) -> HttpUrlBuilder, --- Replace every value of `name` with this one, at the end. setQueryParameter: (HttpUrlBuilder, string, string?) -> HttpUrlBuilder, --- Remove every value of `name`. removeAllQueryParameters: (HttpUrlBuilder, string) -> HttpUrlBuilder, --- The fragment (nil for none). fragment: (HttpUrlBuilder, string?) -> HttpUrlBuilder, --- The URL; without a scheme or host it is `IllegalStateException`. build: (HttpUrlBuilder) -> HttpUrl, } export type HttpUrlBuilderClass = { --- An empty builder. new: () -> HttpUrlBuilder, } --- `HttpUrlBuilder`'s static functions and constants. declare HttpUrlBuilder: HttpUrlBuilderClass --- What a `POST`/`PUT`/`PATCH` sends. export type RequestBody = { --- The content type, or nil. contentType: (RequestBody) -> MediaType?, --- The length in bytes. contentLength: (RequestBody) -> number, } export type RequestBodyClass = { --- `content` in `contentType`'s charset; a type with no charset gets --- `; charset=utf-8` added, as OkHttp does. (A Luau string is the text.) create: (MediaType?, string) -> RequestBody, } --- `RequestBody`'s static functions and constants. declare RequestBody: RequestBodyClass --- An `application/x-www-form-urlencoded` body. export type FormBody = RequestBody & { --- How many pairs. size: (FormBody) -> number, --- Name `index` (0-based), decoded. name: (FormBody, number) -> string, --- Value `index`, decoded. value: (FormBody, number) -> string, --- Name `index`, encoded. encodedName: (FormBody, number) -> string, --- Value `index`, encoded. encodedValue: (FormBody, number) -> string, } --- Builds a `FormBody`. Its setters return the builder. export type FormBodyBuilder = { --- One pair, encoded as a form encodes it. add: (FormBodyBuilder, string, string) -> FormBodyBuilder, --- One pair, already encoded. addEncoded: (FormBodyBuilder, string, string) -> FormBodyBuilder, --- The form. build: (FormBodyBuilder) -> FormBody, } export type FormBodyBuilderClass = { --- An empty form. new: () -> FormBodyBuilder, } --- `FormBodyBuilder`'s static functions and constants. declare FormBodyBuilder: FormBodyBuilderClass --- An HTTP request, what `okHttpClient:newCall` takes. --- --- `__tostring`: `tostring(r)`: `toString()`. export type Request = { --- The URL. url: (Request) -> HttpUrl, --- The method. method: (Request) -> string, --- The last value of header `name`, or nil. header: (Request, string) -> string?, --- Every value of header `name`. headers: (Request, string) -> {string}, --- The body, or nil. body: (Request) -> RequestBody?, --- Whether the URL is `https`. isHttps: (Request) -> boolean, --- A builder holding this request. newBuilder: (Request) -> RequestBuilder, --- `Request{method=GET, url=..., tags={}}`. toString: (Request) -> string, } --- Builds a `Request`, checking header characters and which methods take a body. --- Its setters return the builder. export type RequestBuilder = { --- `(RequestBuilder, string) -> RequestBuilder`: --- The URL (`ws:`/`wss:` become `http:`/`https:`); a bad one is --- `IllegalArgumentException`. --- --- `(RequestBuilder, HttpUrl) -> RequestBuilder`: --- The URL. url: ((RequestBuilder, string) -> RequestBuilder) & ((RequestBuilder, HttpUrl) -> RequestBuilder), --- Set header `name` to `value`, replacing its values. header: (RequestBuilder, string, string) -> RequestBuilder, --- Add a value to header `name`. addHeader: (RequestBuilder, string, string) -> RequestBuilder, --- Remove header `name`. removeHeader: (RequestBuilder, string) -> RequestBuilder, --- `GET`. get: (RequestBuilder) -> RequestBuilder, --- `HEAD`. head: (RequestBuilder) -> RequestBuilder, --- `POST` with `body`. post: (RequestBuilder, RequestBody) -> RequestBuilder, --- `PUT` with `body`. put: (RequestBuilder, RequestBody) -> RequestBuilder, --- `PATCH` with `body`. patch: (RequestBuilder, RequestBody) -> RequestBuilder, --- `(RequestBuilder) -> RequestBuilder`: --- `DELETE` with an empty body. --- --- `(RequestBuilder, RequestBody) -> RequestBuilder`: --- `DELETE` with `body`. delete: ((RequestBuilder) -> RequestBuilder) & ((RequestBuilder, RequestBody) -> RequestBuilder), --- `method` with `body` (nil for none), with OkHttp's checks: `POST`, `PUT` and --- `PATCH` need a body, `GET` and `HEAD` take none. method: (RequestBuilder, string, RequestBody?) -> RequestBuilder, --- The request; without a URL it is `IllegalStateException`. build: (RequestBuilder) -> Request, } export type RequestBuilderClass = { --- A `GET` with no URL yet. new: () -> RequestBuilder, } --- `RequestBuilder`'s static functions and constants. declare RequestBuilder: RequestBuilderClass --- One request, run once. `enqueue(callback)` starts it. export type Call = { --- Cancel it: one in flight completes with `onFailure(call, "Canceled")`, one not --- started yet fails so when it is enqueued. cancel: (Call) -> (), --- Whether it was cancelled. isCanceled: (Call) -> boolean, --- Whether it was enqueued. isExecuted: (Call) -> boolean, --- The request. request: (Call) -> Request, --- A new call for the same request, not yet started. clone: (Call) -> Call, --- Start the request; `responseCallback:onResponse(call, response)` or `:onFailure(call, e)` runs on the client thread when it finishes (a table with the two methods). A call runs once: a second `enqueue` is `IllegalStateException: Already Executed`. enqueue: (Call, any) -> (), } --- The status, headers and whole body of a finished request. A 4xx or 5xx is a --- response. --- --- `__tostring`: `tostring(r)`: `toString()`. export type Response = { --- The status code. code: (Response) -> number, --- The reason phrase. message: (Response) -> string, --- Whether the code is 200 to 299. isSuccessful: (Response) -> boolean, --- Whether the code is a redirect (300, 301, 302, 303, 307, 308): one OkHttp did not --- follow. isRedirect: (Response) -> boolean, --- `(Response, string) -> string?`: --- The last value of header `name`, any case, or nil. --- --- `(Response, string, string?) -> string?`: --- The last value of header `name`, or `defaultValue`. header: (Response, string, string?) -> string?, --- Every value of header `name`, in order. headers: (Response, string) -> {string}, --- The body (readable once). body: (Response) -> ResponseBody?, --- The request that answered (after redirects, its URL is the final one). request: (Response) -> Request, --- Close the body: it cannot be read after. close: (Response) -> (), --- `Response{protocol=http/1.1, code=200, message=OK, url=...}`. toString: (Response) -> string, } --- A response's body, in memory whole. It reads once: a second `string()` or --- `bytes()` (or one after `close()`) is `IllegalStateException: closed`. export type ResponseBody = { --- The body as text: a byte order mark decides the charset, then the --- `Content-Type` charset, then UTF-8. string: (ResponseBody) -> string, --- The body's length in bytes (decompressed: it is all in memory). contentLength: (ResponseBody) -> number, --- The `Content-Type`, or nil. contentType: (ResponseBody) -> MediaType?, --- Close it: it cannot be read after. close: (ResponseBody) -> (), --- The body's bytes, as a Luau string (a Luau string holds any bytes, so `ImageUtil.fromBytes(body:bytes())` reads an image). Reads once, as `string()` does. bytes: (ResponseBody) -> string, } --- The base of an `onFailure` exception. --- --- `__tostring`: `tostring(e)`: `toString()`. export type Throwable = { --- The message, or nil when it was made without one. getMessage: (Throwable) -> string?, --- The message (no localization). getLocalizedMessage: (Throwable) -> string?, --- The exception it was made with as its cause, or nil. getCause: (Throwable) -> Throwable?, --- The exception's full class name, then `: message` (no `: message` --- without one). toString: (Throwable) -> string, } --- What `onFailure` is handed: `Canceled`, `timeout`, a connect or TLS error, --- or a host the plugin may not reach. --- --- `__tostring`: `tostring(e)`: `toString()`. export type IOException = Throwable export type IOExceptionClass = { --- `(string?) -> IOException`: --- A new `IOException` with `message` (nil for none), to hand to a --- `Callback`'s `onFailure`. --- --- `(string?, Throwable?) -> IOException`: --- A new `IOException` with `message` and `cause`. new: (string?, Throwable?) -> IOException, } --- `IOException`'s static functions and constants. declare IOException: IOExceptionClass --- The `okHttpClient` global: requests run off the game thread and call back on --- it. A marketplace plugin reaches only the OSRS Wiki's API: --- `https://oldschool.runescape.wiki/api.php` and --- `https://prices.runescape.wiki/api/v1/osrs/...`, by `GET`, with no header but --- `User-Agent` and `Accept`. Any other call of its fails (`onFailure`) before anything --- is sent. Bento's own services, such as `hiscoreClient`, answer it through their own --- members. A request to the wiki, from any plugin, must set the plugin's own --- `User-Agent` (printable ASCII, at most 256 characters), which is sent exactly as --- written; without one, `enqueue` raises. Wiki requests go one at a time across every --- plugin, `maxlag=5` is added to an `api.php` request without one, and while the wiki --- has asked for a pause (a 429, or its servers lagging) they fail at once. export type OkHttpClient = { --- A call for `request`, not yet started: `enqueue` starts it. newCall: (OkHttpClient, Request) -> Call, } --- Bento's HTTP shorthand, the `http` global: one call for a `GET` or `POST`, its --- callback `fn(response, err)` on the client thread (`response` nil and `err` the --- message on failure). The full OkHttp shape is `okHttpClient`. export type HttpService = { --- `GET url`, then `callback(response, nil)` or `callback(nil, message)`. Returns the --- call, for `cancel()`. get: (HttpService, string, (Response?, string?) -> ()) -> Call, --- `POST url` with `body` of `contentType`, then `callback(response, err)`. post: (HttpService, string, string, string, (Response?, string?) -> ()) -> Call, } --- One of `StandardCharsets`' (US-ASCII, ISO-8859-1, UTF-8, UTF-16BE, UTF-16LE, --- UTF-16). `==` is identity: each charset is one instance. --- --- `__tostring`: `tostring(c)`: the canonical name. --- `__eq`: `a == b`: the same charset (each charset is one instance). export type Charset = { --- The canonical name (`UTF-8`). name: (Charset) -> string, --- The canonical name. displayName: (Charset) -> string, --- The canonical name. toString: (Charset) -> string, --- Whether `ob` is the same charset. equals: (Charset, any) -> boolean, } export type CharsetClass = { --- The charset `charsetName` names (common aliases accepted); one this has not is --- `UnsupportedCharsetException`. forName: (string) -> Charset, --- UTF-8, the default charset Bento's text is in. defaultCharset: () -> Charset, } --- `Charset`'s static functions and constants. declare Charset: CharsetClass --- The charsets: `UTF_8`, `ISO_8859_1`, `US_ASCII`, `UTF_16BE`, `UTF_16LE`, `UTF_16`. export type StandardCharsets = { } export type StandardCharsetsClass = { --- The US_ASCII charset. US_ASCII: Charset, --- The ISO_8859_1 charset. ISO_8859_1: Charset, --- The UTF_8 charset. UTF_8: Charset, --- The UTF_16BE charset. UTF_16BE: Charset, --- The UTF_16LE charset. UTF_16LE: Charset, --- The UTF_16 charset. UTF_16: Charset, } --- `StandardCharsets`'s static functions and constants. declare StandardCharsets: StandardCharsetsClass --- Encodes `application/x-www-form-urlencoded` text. export type URLEncoder = { } export type URLEncoderClass = { --- `(string, Charset) -> string`: --- `s` encoded: letters, digits and `.-*_` stay, a space is `+`, everything else --- is its bytes in `charset` as `%XY`. --- --- `(string, string) -> string`: --- `s` encoded in the charset `enc` names; an unknown one is --- `UnsupportedEncodingException`. --- --- `(string) -> string`: --- `s` encoded in UTF-8. encode: ((string, Charset) -> string) & ((string, string) -> string) & ((string) -> string), } --- `URLEncoder`'s static functions and constants. declare URLEncoder: URLEncoderClass --- The reverse of `URLEncoder`. export type URLDecoder = { } export type URLDecoderClass = { --- `(string, Charset) -> string`: --- `s` decoded: `+` is a space, `%XY` a byte of `charset`'s encoding. --- --- `(string, string) -> string`: --- `s` decoded in the charset `enc` names. decode: ((string, Charset) -> string) & ((string, string) -> string), } --- `URLDecoder`'s static functions and constants. declare URLDecoder: URLDecoderClass --- A file inside the plugin's own directory (`ClientPaths.CLIENT_DIR`, shown as the --- client's directory, `.bentobox`). Paths are relative to it; a plugin cannot name a --- file outside it. A `File` is a path: nothing is read until a method asks, and I/O is --- available once the plugin has started. --- --- `__tostring`: `tostring(f)`: `toString()`. export type File = { --- Whether a file or directory is there. exists: (File) -> boolean, --- Whether it is a file. isFile: (File) -> boolean, --- Whether it is a directory (the plugin's directory always is). isDirectory: (File) -> boolean, --- Create the directory and its parents; `true` when it was created. mkdirs: (File) -> boolean, --- Create the directory when its parent exists; `true` when it was created. mkdir: (File) -> boolean, --- Delete the file, or the directory when it is empty; `true` when it went. delete: (File) -> boolean, --- The file's size in bytes, 0 when there is none. length: (File) -> number, --- When it last changed, ms since the epoch; 0 when there is none. lastModified: (File) -> number, --- Move the file to `dest`; `true` when it moved. renameTo: (File, File) -> boolean, --- The names directly in this directory, or nil when it is not one. list: (File) -> {string}?, --- The files directly in this directory, or nil when it is not one. listFiles: (File) -> {File}?, --- The last component (`.bentobox` for the plugin's directory). getName: (File) -> string, --- The path as text, `.bentobox\...`. getPath: (File) -> string, --- The parent's path as text, or nil for the plugin's directory. getParent: (File) -> string?, --- The parent, or nil for the plugin's directory. getParentFile: (File) -> File?, --- Whether `obj` is a `File` of the same path. equals: (File, any) -> boolean, --- The path as text, `.bentobox\...`. toString: (File) -> string, --- The whole file as text (UTF-8, a byte order mark dropped). A missing file --- is `FileNotFoundException`. readText: (File) -> string, --- Replace the file with `text` (UTF-8) at once, atomically, under the plugin's --- quota; parent directories are made. writeText: (File, string) -> (), --- The whole file's bytes, as a Luau string (any bytes). A missing file is `FileNotFoundException`. readBytes: (File) -> string, --- Replace the file with `bytes` (a Luau string, any bytes) at once, atomically, under the plugin's quota; parent directories are made. writeBytes: (File, string) -> (), } export type FileClass = { --- `(File?, string) -> File`: --- `child` inside `parent` (nil `parent`: `child` alone). --- --- `(string) -> File`: --- The file at `pathname`, relative to the plugin's directory (`/` or `\`; a --- `.bentobox\...` text a `File` printed is accepted). --- --- `(string?, string) -> File`: --- `child` inside the directory `parent` names. new: ((File?, string) -> File) & ((string) -> File) & ((string?, string) -> File), } --- `File`'s static functions and constants. declare File: FileClass --- The plugin's directories. Each is a `File` in the plugin's own directory: `CLIENT_DIR` is the directory itself (shown as the client's directory, `.bentobox`), `CACHE_DIR` its `cache`, `NOTIFICATIONS_DIR` its `notifications`, `SCREENSHOT_DIR` its `screenshots` (the screenshots `imageCapture` takes go to Bento's own folder, which `LinkBrowser.open(SCREENSHOT_DIR:toString())` opens). export type ClientPaths = { } export type ClientPathsClass = { --- The plugin's directory, shown as the client's directory, `.bentobox`. CLIENT_DIR: File, --- `cache` in the plugin's directory. CACHE_DIR: File, --- `notifications` in the plugin's directory. NOTIFICATIONS_DIR: File, --- `screenshots` in the plugin's directory; `LinkBrowser.open` of it opens the screenshot folder `imageCapture` saves to. SCREENSHOT_DIR: File, } --- `ClientPaths`'s static functions and constants. declare ClientPaths: ClientPathsClass --- The `audioPlayer` global: plays a WAV (PCM or float samples) with a gain in --- decibels, beside the game's own sound. A gain outside -80 to 6.02 dB plays the --- sound unscaled. export type AudioPlayer = { --- Play `file` (in the plugin's directory) at `gain` dB, now, beside anything playing. --- A file that is not a WAV this reads is `UnsupportedAudioFileException`. play: (AudioPlayer, File, number) -> (), --- Stop playback `id` (or drop it from the queue). cancel: (AudioPlayer, number) -> (), --- Whether playback `id` is queued or playing. isPlaying: (AudioPlayer, number) -> boolean, --- Stop every sound this plugin plays or queued. stopAll: (AudioPlayer) -> (), --- Play `wav`'s bytes (a Luau string, e.g. `Asset.bytes("sound.wav")`) at `gain` dB, now, beside anything playing. Returns the playback's id. playBytes: (AudioPlayer, string, number) -> number, --- Play `wav` (a Luau string of a WAV's bytes) after every sound this plugin queued before it. Returns the playback's id. enqueue: (AudioPlayer, string, number) -> number, } --- The `notifier` global: `notify(message)` with the user's notification defaults, `notify(notification, message)` with a `Notification` config value. A `FORCE` focus request raises the window only when Windows allows; the title is Bento's. export type Notifier = { --- `(Notifier, string) -> ()`: --- Notify with the user's notification defaults. --- --- `(Notifier, Notification, string) -> ()`: --- Notify as `notification` (a `Notification` config value) says: nothing when it is disabled, the user's defaults when it is not an initialised override. --- --- `(Notifier, string, TrayIconMessageType) -> ()`: --- Notify with the user's defaults and a tray message of `type` (`TrayIcon.MessageType.WARNING`, ...). notify: ((Notifier, string) -> ()) & ((Notifier, Notification, string) -> ()) & ((Notifier, string, TrayIconMessageType) -> ()), } --- The toolkit, for its clipboard: `Toolkit.getDefaultToolkit():getSystemClipboard()`. export type Toolkit = { --- The system clipboard. getSystemClipboard: (Toolkit) -> Clipboard, --- The system beep. beep: (Toolkit) -> (), } export type ToolkitClass = { --- The toolkit. getDefaultToolkit: () -> Toolkit, } --- `Toolkit`'s static functions and constants. declare Toolkit: ToolkitClass --- The system clipboard, text only. export type Clipboard = { --- Put `contents`'s text on the clipboard. `owner` is never told it lost ownership. setContents: (Clipboard, StringSelection, nil) -> (), --- The clipboard's text for `flavor` (`DataFlavor.stringFlavor`); no text is --- `UnsupportedFlavorException`. Any plugin reads it at any time. getData: (Clipboard, DataFlavor) -> string, --- Whether the clipboard holds text. isDataFlavorAvailable: (Clipboard, DataFlavor) -> boolean, --- The clipboard's text as a `StringSelection`, or nil when it holds none. Any --- plugin reads it at any time. getContents: (Clipboard, any) -> StringSelection?, } --- What a clipboard's contents are: only `DataFlavor.stringFlavor`, text. export type DataFlavor = { --- The flavor's MIME type, one fixed string. getMimeType: (DataFlavor) -> string, --- `Unicode String`. getHumanPresentableName: (DataFlavor) -> string, --- Whether `o` is a flavor (there is one). equals: (DataFlavor, any) -> boolean, } export type DataFlavorClass = { --- Text: the one flavor. stringFlavor: DataFlavor, } --- `DataFlavor`'s static functions and constants. declare DataFlavor: DataFlavorClass --- Text to put on the clipboard. export type StringSelection = { --- The text, for `DataFlavor.stringFlavor`. getTransferData: (StringSelection, DataFlavor) -> string, } export type StringSelectionClass = { --- A selection of `data`. new: (string) -> StringSelection, } --- `StringSelection`'s static functions and constants. declare StringSelection: StringSelectionClass --- Opens links in the user's browser, and folders in the system's file browser. export type LinkBrowser = { } export type LinkBrowserClass = { --- Open `url` in the user's browser; nothing for an empty or non-`http(s)` one. A --- marketplace plugin opens only an `https` link to oldschool.runescape.wiki, --- runescape.wiki or runescape.com (or a subdomain of one), at once, and raises for any --- other. browse: (string) -> (), --- Open a folder of the plugin's own directory (a `File`'s `toString()`, a --- `.bentobox\...` path) in the system's file browser. `ClientPaths.SCREENSHOT_DIR` --- (and a folder in it) opens the screenshot folder `imageCapture` saves to. Nothing --- outside the two opens: a drive or root path raises, and a path that is not a --- folder in them (`..` or a drive in it included) opens nothing. open: (string) -> (), } --- `LinkBrowser`'s static functions and constants. declare LinkBrowser: LinkBrowserClass --- Gson's `JsonNull`: `JsonNull.INSTANCE` is the sentinel `Json.parse` turns a JSON `null` into (an array keeps its place with it) and `Json.encode` writes as `null`. export type JsonNull = { } export type JsonNullClass = { --- JSON `null`, as `Json.parse` makes it. INSTANCE: any, } --- `JsonNull`'s static functions and constants. declare JsonNull: JsonNullClass --- A line-oriented connection (`LineSocket.connect`). Lines arrive at the --- listener on the client thread; `send` writes one. export type LineSocket = { --- Send `line` with `\r\n` appended (queued until connected). A closed socket is --- `SocketException`; a line holding CR or LF is refused. send: (LineSocket, string) -> (), --- Close it: `isClosed()` is true at once, and `onClose(socket, nil)` follows at --- the next invoke point. Closing a closed socket does nothing. close: (LineSocket) -> (), --- Whether it was connected: still true after it closed. isConnected: (LineSocket) -> boolean, --- Whether it is closed (by `close()`, the peer or an error). isClosed: (LineSocket) -> boolean, --- The host it was opened to. getHost: (LineSocket) -> string, --- The remote port, or 0 until it is connected. getPort: (LineSocket) -> number, } export type LineSocketClass = { --- Open a line-by-line connection to `host:port` (TLS when `tls`), through the account's proxy. `listener` is a table whose `onConnect(socket)`, `onLine(socket, line)` and `onClose(socket, reason)` run on the client thread (`reason` nil for a normal close, else the exception text). A marketplace plugin reaches no host: its connection is refused before anything is sent. connect: (string, number, boolean, any) -> LineSocket, } --- `LineSocket`'s static functions and constants. declare LineSocket: LineSocketClass --- Messages between the client tabs on this machine, the `clientBus` global: Bento's --- alternative to a plugin's own `ServerSocketChannel` hub with `SocketChannel` --- followers. One loopback hub is elected among the tabs of a launcher session, every --- connection proving the session's key; channels are per plugin. Off (nothing --- listens, `publish` raises) in a client the launcher gave no key. export type ClientBus = { --- Call `listener(data, senderTabId)` for each message another tab publishes on this --- plugin's `channel`, on the client thread at the invoke point; replaces an earlier --- listener for it. subscribe: (ClientBus, string, (string, number) -> ()) -> (), --- Stop listening on `channel`. unsubscribe: (ClientBus, string) -> (), --- Whether this tab is the hub. isHub: (ClientBus) -> boolean, --- Whether this tab has joined the bus (as the hub, or connected to it). isJoined: (ClientBus) -> boolean, --- How many tabs this one is linked to (the hub counts its members; a member, 1). links: (ClientBus) -> number, --- This tab's id on the bus, as a listener's `senderTabId` names it. tabId: (ClientBus) -> number, --- Send `data` (a Luau string, any bytes) on this plugin's `channel` to every other client tab: each one's `subscribe` listener for the channel gets it at its next invoke point. A tab never hears its own messages; one not on the bus yet (it joins within a second of first use) drops the message. A client the launcher gave no bus key has the bus off, and this raises. publish: (ClientBus, string, string) -> (), } --- What `updatePresence` shows. export type DiscordPresence = { --- A builder holding this presence's fields. toBuilder: (DiscordPresence) -> DiscordPresenceBuilder, --- Whether `o` is a presence with equal fields. equals: (DiscordPresence, any) -> boolean, --- The state line. getState: (DiscordPresence) -> string?, --- The details line. getDetails: (DiscordPresence) -> string?, --- When the activity started. getStartTimestamp: (DiscordPresence) -> Instant?, --- When the activity ends. getEndTimestamp: (DiscordPresence) -> Instant?, --- The large image's asset key. getLargeImageKey: (DiscordPresence) -> string?, --- The large image's hover text. getLargeImageText: (DiscordPresence) -> string?, --- The small image's asset key. getSmallImageKey: (DiscordPresence) -> string?, --- The small image's hover text. getSmallImageText: (DiscordPresence) -> string?, --- The party id. getPartyId: (DiscordPresence) -> string?, --- The party's size. getPartySize: (DiscordPresence) -> number, --- The party's largest size. getPartyMax: (DiscordPresence) -> number, --- The match secret. getMatchSecret: (DiscordPresence) -> string?, --- The join secret. getJoinSecret: (DiscordPresence) -> string?, --- The spectate secret. getSpectateSecret: (DiscordPresence) -> string?, --- Whether it is an instance. isInstance: (DiscordPresence) -> boolean, } export type DiscordPresenceClass = { --- A builder with every field unset. builder: () -> DiscordPresenceBuilder, } --- `DiscordPresence`'s static functions and constants. declare DiscordPresence: DiscordPresenceClass --- Builds a `DiscordPresence`: each setter returns the builder. export type DiscordPresenceBuilder = { --- The state line. state: (DiscordPresenceBuilder, string?) -> DiscordPresenceBuilder, --- The details line. details: (DiscordPresenceBuilder, string?) -> DiscordPresenceBuilder, --- When the activity started. startTimestamp: (DiscordPresenceBuilder, Instant?) -> DiscordPresenceBuilder, --- When the activity ends. endTimestamp: (DiscordPresenceBuilder, Instant?) -> DiscordPresenceBuilder, --- The large image's asset key (`default` when unset). largeImageKey: (DiscordPresenceBuilder, string?) -> DiscordPresenceBuilder, --- The large image's hover text. largeImageText: (DiscordPresenceBuilder, string?) -> DiscordPresenceBuilder, --- The small image's asset key. smallImageKey: (DiscordPresenceBuilder, string?) -> DiscordPresenceBuilder, --- The small image's hover text. smallImageText: (DiscordPresenceBuilder, string?) -> DiscordPresenceBuilder, --- The party id. partyId: (DiscordPresenceBuilder, string?) -> DiscordPresenceBuilder, --- The party's size. partySize: (DiscordPresenceBuilder, number) -> DiscordPresenceBuilder, --- The party's largest size. partyMax: (DiscordPresenceBuilder, number) -> DiscordPresenceBuilder, --- The match secret. matchSecret: (DiscordPresenceBuilder, string?) -> DiscordPresenceBuilder, --- The join secret. joinSecret: (DiscordPresenceBuilder, string?) -> DiscordPresenceBuilder, --- The spectate secret. spectateSecret: (DiscordPresenceBuilder, string?) -> DiscordPresenceBuilder, --- Whether it is an instance. instance: (DiscordPresenceBuilder, boolean) -> DiscordPresenceBuilder, --- The presence. build: (DiscordPresenceBuilder) -> DiscordPresence, } --- Who Discord says is logged in. export type DiscordUser = { --- The user's id. userId: string, --- The user's name. username: string, --- The discriminator (`0` for a unique name). discriminator: string, --- The avatar's hash. avatar: string, } --- The `discordService` global: Rich Presence through the running Discord client, --- for the host's Discord application. Without one it is off: updates do nothing and --- there is no current user. export type DiscordService = { --- Show `discordPresence` (Discord itself shows at most one update per 15 s). updatePresence: (DiscordService, DiscordPresence) -> (), --- Clear the presence. clearPresence: (DiscordService) -> (), --- The user Discord's last `READY` named, or nil (not connected, or off). getCurrentUser: (DiscordService) -> DiscordUser?, } --- The `imageCapture` global: screenshots into Bento's screenshot folder --- (`~/.bentobox/screenshots`). export type ImageCapture = { --- Save `screenshot` as a PNG: in the player's folder (`[-]`, --- then `subDir`), named `fileName` plus the local time, `(n)` while taken; nothing --- on the login screen. With `saveToClipboard` the image also goes on the clipboard; --- with `notify` a notification says where it went (at the next invoke point: the --- file is written off the client thread). saveScreenshot: (ImageCapture, BufferedImage, string, string?, boolean, boolean) -> (), --- Take the next composited game frame and save it as `saveScreenshot` does. The --- client frame (Bento's window chrome) is never part of it. takeScreenshot: (ImageCapture, string?, string, boolean, boolean) -> (), --- Call `listener(image)` with the next composited game frame as a `BufferedImage`, --- at the invoke point after it was drawn, or with nil when no frame could be read --- back. Any plugin may ask at any time. requestNextFrame: (ImageCapture, (BufferedImage?) -> ()) -> (), } --- Guava's `Hashing`: the hash functions. `Hashing.sha256()` is the one bound. export type Hashing = { } export type HashingClass = { --- SHA-256 (256 bits), the same function on every call. sha256: () -> HashFunction, } --- `Hashing`'s static functions and constants. declare Hashing: HashingClass --- Guava's `HashFunction`: `newHasher()` for a hash built up piece by piece, or a one-shot --- `hashBytes`/`hashString`/`hashUnencodedChars`/`hashInt`/`hashLong`. `==` and `equals` --- are true for the same function, as Guava hands out one instance of each. --- --- `__tostring`: `tostring(f)`: `toString()`. --- `__eq`: `a == b`: the same function. export type HashFunction = { --- `(HashFunction) -> Hasher`: --- A new `Hasher`, empty. --- --- `(HashFunction, number) -> Hasher`: --- A new `Hasher`; `expectedInputSize` is a hint, and a negative one is --- `IllegalArgumentException`. newHasher: ((HashFunction) -> Hasher) & ((HashFunction, number) -> Hasher), --- The hash of `input`'s bytes in `charset` (`input.getBytes(charset)`). hashString: (HashFunction, string, Charset) -> HashCode, --- The hash of `input`'s UTF-16 code units, each little-endian (no charset). hashUnencodedChars: (HashFunction, string) -> HashCode, --- The hash of `input`'s four bytes, little-endian. hashInt: (HashFunction, number) -> HashCode, --- The hash of `input`'s eight bytes, little-endian (exact below 2^53, as every Luau --- number is). hashLong: (HashFunction, number) -> HashCode, --- The number of bits a hash has: 256. bits: (HashFunction) -> number, --- `Hashing.sha256()`, as Guava names the function. toString: (HashFunction) -> string, --- Whether `other` equals this HashFunction, as `==` answers it (`false` for a value of another class). equals: (HashFunction, any) -> boolean, --- `(HashFunction, string | {number}) -> HashCode`: --- The hash of `input`'s bytes (a Luau string of them, or an array of byte numbers): `Hashing.sha256():hashBytes(file:readBytes())` is Guava's `Files.asByteSource(file).hash(Hashing.sha256())`. --- --- `(HashFunction, string | {number}, number, number) -> HashCode`: --- The hash of `len` bytes of `input` from index `off` (0-based); a range outside it is `IndexOutOfBoundsException`. hashBytes: ((HashFunction, string | {number}) -> HashCode) & ((HashFunction, string | {number}, number, number) -> HashCode), } --- Guava's `Hasher`: a hash being built. Each `put` feeds bytes and returns the hasher, so --- calls chain (`hasher:putInt(1):putLong(2)`); `hash()` ends it, and any use after that is --- `IllegalStateException`, as Guava's. --- --- `__eq`: `a == b`: the same hasher (`h:putInt(1) == h`). export type Hasher = { --- Feed one byte: the low 8 bits of `b`. putByte: (Hasher, number) -> Hasher, --- Feed a `short`: the low 16 bits of `s`, little-endian. putShort: (Hasher, number) -> Hasher, --- Feed an `int`, little-endian. putInt: (Hasher, number) -> Hasher, --- Feed a `long`, little-endian (exact below 2^53, as every Luau number is). putLong: (Hasher, number) -> Hasher, --- Feed a `float`: `f` rounded to single precision, its raw bits little-endian. putFloat: (Hasher, number) -> Hasher, --- Feed a `double`: its raw bits, little-endian. putDouble: (Hasher, number) -> Hasher, --- Feed a `boolean`: one byte, 1 or 0. putBoolean: (Hasher, boolean) -> Hasher, --- Feed `charSequence`'s UTF-16 code units, each little-endian (no charset). putUnencodedChars: (Hasher, string) -> Hasher, --- Feed `charSequence`'s bytes in `charset`. putString: (Hasher, string, Charset) -> Hasher, --- The hash of everything fed. Once: a second `hash()`, or a `put` after it, is --- `IllegalStateException`. hash: (Hasher) -> HashCode, --- Whether `other` equals this Hasher, as `==` answers it (`false` for a value of another class). equals: (Hasher, any) -> boolean, --- `(Hasher, string | {number}) -> Hasher`: --- Feed `bytes` (a Luau string of them, or an array of byte numbers). Returns the hasher. --- --- `(Hasher, string | {number}, number, number) -> Hasher`: --- Feed `len` bytes of `bytes` from index `off` (0-based); a range outside it is `IndexOutOfBoundsException`. Returns the hasher. putBytes: ((Hasher, string | {number}) -> Hasher) & ((Hasher, string | {number}, number, number) -> Hasher), } --- Guava's `HashCode`: a hash's bytes. `toString()` is them in lower-case hex; `==` and --- `equals` compare the bytes, as Guava's `equals` does. --- --- `__tostring`: `tostring(c)`: `toString()`. --- `__eq`: `a == b`: the same bytes. export type HashCode = { --- The bytes in lower-case hex, two digits each, in order. toString: (HashCode) -> string, --- How many bits the hash has (8 per byte). bits: (HashCode) -> number, --- The first four bytes as an `int`, little-endian; fewer than four is --- `IllegalStateException`. asInt: (HashCode) -> number, --- Whether `other` equals this HashCode, as `==` answers it (`false` for a value of another class). equals: (HashCode, any) -> boolean, --- The hash's bytes, as a Luau string (any bytes). asBytes: (HashCode) -> string, } export type HashCodeClass = { --- The hash `string` spells in lower-case hex (Guava refuses upper case): fewer than --- two characters, an odd count or another character is `IllegalArgumentException`. fromString: (string) -> HashCode, --- A 32-bit hash: `hash`'s four bytes, little-endian. fromInt: (number) -> HashCode, --- A hash of `bytes` (a Luau string, or an array of byte numbers), copied; none at all is `IllegalArgumentException`. fromBytes: (string | {number}) -> HashCode, } --- `HashCode`'s static functions and constants. declare HashCode: HashCodeClass --- The type of the `log` global, an SLF4J-style logger: `log:debug("x {}", v)`. `trace`, `debug`, `info`, `warn` and `error` format `{}` as SLF4J 1.7.25 does and write to the host log, each line under the plugin's id. One level holds for every plugin: INFO by default, so `debug` and `trace` write nothing and `isDebugEnabled()` is `false`; the host's `BENTO_DEBUG=1` or `log:setLevel("DEBUG")` raises it. An argument no `{}` took is the error and is written on the next line (SLF4J does that for a Throwable only, and a Luau error value is a string or a table). export type Logger = { --- Write a trace line: `format` with each `{}` replaced by the next argument, SLF4J's way (a `{}` after a backslash is written as it is; an argument is written as `tostring` writes it, `nil` as `null`). An argument no `{}` took is the error: the last one is written on the next line, as SLF4J writes a Throwable (`log:warn("Unable to load", err)`). trace: (Logger, string?, ...any) -> (), --- Write a debug line: `format` with each `{}` replaced by the next argument, SLF4J's way (a `{}` after a backslash is written as it is; an argument is written as `tostring` writes it, `nil` as `null`). An argument no `{}` took is the error: the last one is written on the next line, as SLF4J writes a Throwable (`log:warn("Unable to load", err)`). debug: (Logger, string?, ...any) -> (), --- Write an info line: `format` with each `{}` replaced by the next argument, SLF4J's way (a `{}` after a backslash is written as it is; an argument is written as `tostring` writes it, `nil` as `null`). An argument no `{}` took is the error: the last one is written on the next line, as SLF4J writes a Throwable (`log:warn("Unable to load", err)`). info: (Logger, string?, ...any) -> (), --- Write a warning line: `format` with each `{}` replaced by the next argument, SLF4J's way (a `{}` after a backslash is written as it is; an argument is written as `tostring` writes it, `nil` as `null`). An argument no `{}` took is the error: the last one is written on the next line, as SLF4J writes a Throwable (`log:warn("Unable to load", err)`). warn: (Logger, string?, ...any) -> (), --- Write an error line: `format` with each `{}` replaced by the next argument, SLF4J's way (a `{}` after a backslash is written as it is; an argument is written as `tostring` writes it, `nil` as `null`). An argument no `{}` took is the error: the last one is written on the next line, as SLF4J writes a Throwable (`log:warn("Unable to load", err)`). error: (Logger, string?, ...any) -> (), --- Whether trace lines are written: the level (`log:getLevel()`) is trace or below. `false` by default: the level starts at INFO. isTraceEnabled: (Logger) -> boolean, --- Whether debug lines are written: the level (`log:getLevel()`) is debug or below. `false` by default: the level starts at INFO. isDebugEnabled: (Logger) -> boolean, --- Whether info lines are written: the level (`log:getLevel()`) is info or below. `true` by default: the level starts at INFO. isInfoEnabled: (Logger) -> boolean, --- Whether warning lines are written: the level (`log:getLevel()`) is warning or below. `true` by default: the level starts at INFO. isWarnEnabled: (Logger) -> boolean, --- Whether error lines are written: the level (`log:getLevel()`) is error or below. `true` by default: the level starts at INFO. isErrorEnabled: (Logger) -> boolean, --- The level every plugin's `log` writes at and above, by name (`"INFO"` by default; `"DEBUG"` under the host's `BENTO_DEBUG=1`). getLevel: (Logger) -> string, --- Set the level every plugin's `log` writes at and above to the one `level` names (`ALL`, `TRACE`, `DEBUG`, `INFO`, `WARN`, `ERROR`, `OFF`, any case), or keep it for any other name or `nil`; answers the level now set. It holds for the process until set again. setLevel: (Logger, string?) -> string, } --- `*` wildcard matching. export type WildcardMatcher = { } export type WildcardMatcherClass = { --- Whether all of `text` matches `pattern`, where `*` stands for any run of characters (not across a line break). Letters compare ignoring ASCII case; every other character, regex metacharacters included, matches itself. matches: (string, string) -> boolean, } --- `WildcardMatcher`'s static functions and constants. declare WildcardMatcher: WildcardMatcherClass --- How good a stat change (or a set of them) is. 5 constants, each one userdata per VM, so `==` is identity and a constant is a table key; `values()`, `valueOf(name)`, and on a constant `name()`, `ordinal()` (0-based), `toString()`, `compareTo()` and `equals()`. --- --- `__tostring`: `tostring` is the name. export type Positivity = { --- The constant's name as declared. name: (Positivity) -> string, --- The constant's 0-based position in `values()`. ordinal: (Positivity) -> number, --- `name()`; `tostring(c)` answers the same. toString: (Positivity) -> string, --- This ordinal less `other`'s. compareTo: (Positivity, Positivity) -> number, --- Whether `other` is this constant. `==` answers the same. equals: (Positivity, any) -> boolean, } export type PositivityClass = { --- Every constant in ordinal order, as a new 1-based array. values: () -> {Positivity}, --- The constant named `name`; any other name is an error. valueOf: (string) -> Positivity, --- `WORSE`: ordinal 0, the stat goes down. WORSE: Positivity, --- `NO_CHANGE`: ordinal 1. NO_CHANGE: Positivity, --- `BETTER_CAPPED`: ordinal 2, better, and every boost is at its cap. BETTER_CAPPED: Positivity, --- `BETTER_SOMECAPPED`: ordinal 3, better, some boosts capped. BETTER_SOMECAPPED: Positivity, --- `BETTER_UNCAPPED`: ordinal 4, better, nothing capped. BETTER_UNCAPPED: Positivity, } --- `Positivity`'s static functions and constants. declare Positivity: PositivityClass --- One stat's change from using an item: `Effect#calculate(client)` answers a set of --- them (`StatsChanges`). A value: settable. --- --- `__eq`: `==` compares the fields. export type StatChange = { --- The stat changed, or `nil` before one is set. getStat: (StatChange) -> Stat?, --- The change if the item is used now. getRelative: (StatChange) -> number, --- The change before the boost cap is applied. getTheoretical: (StatChange) -> number, --- The stat's value after the change. getAbsolute: (StatChange) -> number, --- How good the change is, or `nil` before one is set. getPositivity: (StatChange) -> Positivity?, --- The relative change as `"+n"`/`"-n"` (a range: `"+min~max"`, `"±n"`, ...). getFormattedRelative: (StatChange) -> string, --- The theoretical change, formatted as `getFormattedRelative()`. getFormattedTheoretical: (StatChange) -> string, --- Set the stat. setStat: (StatChange, Stat) -> (), --- Set the relative change. setRelative: (StatChange, number) -> (), --- Set the theoretical change. setTheoretical: (StatChange, number) -> (), --- Set the value after the change. setAbsolute: (StatChange, number) -> (), --- Set how good the change is (`nil`: none). setPositivity: (StatChange, Positivity?) -> (), --- `StatChange(stat=…, relative=…, theoretical=…, absolute=…, positivity=…)`, --- or `RangeStatChange(minRelative=…, minTheoretical=…, minAbsolute=…)` for --- a range change. toString: (StatChange) -> string, --- Whether `other` equals this StatChange, as `==` answers it (`false` for a value of another class). equals: (StatChange, any) -> boolean, } --- A stat change by one of two amounts (a food that heals 5 to 7): its own getters --- are the maximum, the `min` ones the minimum. --- --- `__eq`: `==` compares the fields. export type RangeStatChange = StatChange & { --- The smallest relative change. getMinRelative: (RangeStatChange) -> number, --- The smallest theoretical change. getMinTheoretical: (RangeStatChange) -> number, --- The smallest value after the change. getMinAbsolute: (RangeStatChange) -> number, --- Set the smallest relative change. setMinRelative: (RangeStatChange, number) -> (), --- Set the smallest theoretical change. setMinTheoretical: (RangeStatChange, number) -> (), --- Set the smallest value after the change. setMinAbsolute: (RangeStatChange, number) -> (), } export type RangeStatChangeClass = { --- `RangeStatChange.new()`: every field zero, no stat, no positivity. new: () -> RangeStatChange, } --- `RangeStatChange`'s static functions and constants. declare RangeStatChange: RangeStatChangeClass --- What using an item does: a change per stat, and how good the set is. export type StatsChanges = { --- The changes, 1-based. Copies: setting one does not change this set. The empty --- slots of a `StatsChanges.new(len)` not yet set are left out; every effect fills --- all of its own. getStatChanges: (StatsChanges) -> {StatChange}, --- Replace the changes (at most 32). setStatChanges: (StatsChanges, {StatChange}) -> (), --- How good the set is overall, or `nil` when set to none. getPositivity: (StatsChanges) -> Positivity?, --- Set how good the set is overall (`nil`: none). setPositivity: (StatsChanges, Positivity?) -> (), } export type StatsChangesClass = { --- `StatsChanges.new(len)`: `len` empty slots (at most 32), `NO_CHANGE`. new: (number) -> StatsChanges, } --- `StatsChanges`'s static functions and constants. declare StatsChanges: StatsChangesClass --- An item id and quantity: what loot events and `lootManager:getItemSpawns` carry. --- --- `__eq`: `==` compares id and quantity. export type ItemStack = { --- The item id. getId: (ItemStack) -> number, --- The quantity. getQuantity: (ItemStack) -> number, --- `ItemStack(id=…, quantity=…)`. toString: (ItemStack) -> string, --- Whether `other` equals this ItemStack, as `==` answers it (`false` for a value of another class). equals: (ItemStack, any) -> boolean, } export type ItemStackClass = { --- `ItemStack.new(id, quantity)`. new: (number, number) -> ItemStack, } --- `ItemStack`'s static functions and constants. declare ItemStack: ItemStackClass --- One hiscore entry: a skill's rank, level and experience, or an activity's rank and --- score (its level; experience -1). export type HiscoreEntry = { --- The rank, -1 for unranked. getRank: (HiscoreEntry) -> number, --- The level, or an activity's score. getLevel: (HiscoreEntry) -> number, --- The experience, -1 for an activity. getExperience: (HiscoreEntry) -> number, } --- A world as the world list describes it. --- --- `__eq`: `==` compares every field. export type HttpWorld = { --- The world number. getId: (HttpWorld) -> number, --- Its types, as a set. getTypes: (HttpWorld) -> {[HttpWorldType]: boolean}, --- The hostname. getAddress: (HttpWorld) -> string, --- The activity label. getActivity: (HttpWorld) -> string, --- The location code (`getRegion()` names it). getLocation: (HttpWorld) -> number, --- The player count the list reported. getPlayers: (HttpWorld) -> number, --- `WorldRegion.valueOf(location)`: the region, `nil` for an unknown location. getRegion: (HttpWorld) -> WorldRegion?, --- Whether `other` equals this HttpWorld, as `==` answers it (`false` for a value of another class). equals: (HttpWorld, any) -> boolean, } --- One fetch of the world list. export type WorldResult = { --- The worlds, by id. A result older than the last eight fetches reads the newest. getWorlds: (WorldResult) -> {HttpWorld}, --- The world numbered `worldId`, or `nil`. findWorld: (WorldResult, number) -> HttpWorld?, } --- A slayer task as the chat API stores it (`!task`). export type ChatTask = { --- The task's name. getTask: (ChatTask) -> string, --- How many are left. getAmount: (ChatTask) -> number, --- How many were assigned. getInitialAmount: (ChatTask) -> number, --- Where. getLocation: (ChatTask) -> string, } --- A player's duel arena record as the chat API stores it. export type Duels = { --- Duels won. getWins: (Duels) -> number, --- Duels lost. getLosses: (Duels) -> number, --- The current winning streak. getWinningStreak: (Duels) -> number, --- The current losing streak. getLosingStreak: (Duels) -> number, } --- A value that arrives later, here a `HiscoreResult` (`hiscoreClient:lookupAsync` hands --- one out). Register what to do with it with --- `whenCompleteAsync(function(result, ex) ... end)`: it runs on the client thread at --- the first invoke point after the future completes, with `result` and `nil`, or `nil` --- and the `IOException` it failed with. The outcomes of the last 1024 futures to --- complete are kept; an action registered on an older one never runs (it is dropped, --- and logged). Only `hiscoreClient:lookupAsync` hands futures out: there is no --- constructor, `complete`, `get` or `thenApply`. export type CompletableFuture = { --- Run `action(result, ex)` when the future completes: `ex` is `nil` unless it --- failed. On the client thread at the first invoke point after it completes, even --- when it has already completed; an error `action` raises is logged. Answers this --- future. whenComplete: (CompletableFuture, (HiscoreResult?, IOException?) -> ()) -> CompletableFuture, --- Run `action(result, ex)` when the future completes, on the client thread at the --- first invoke point after. An error `action` raises is logged. Answers this future. whenCompleteAsync: (CompletableFuture, (HiscoreResult?, IOException?) -> ()) -> CompletableFuture, --- Whether it has completed, with a result or with an exception. isDone: (CompletableFuture) -> boolean, --- Whether it completed with an exception. isCompletedExceptionally: (CompletableFuture) -> boolean, } --- What using an item does to the player's stats: `itemStatChanges:get(itemId)` answers one. `==` compares which effect it is. --- --- `__eq`: Whether both are the same effect. export type Effect = { --- The changes using the item now would make, from the player's current and real levels, run energy, worn items and the league relic varbits. Pass the `client` global. calculate: (Effect, Client) -> StatsChanges, --- Whether `other` is the same effect (`==` answers the same); `false` for anything else. equals: (Effect, any) -> boolean, } --- A stat an item can change: a skill, or run energy. The constants are `Stats.*`, one userdata per VM each, so `==` is identity (`change:getStat() == Stats.HITPOINTS`) and a constant is a table key. export type Stat = { --- The skill's name (`Skill#getName()`), or `"Run Energy"`. getName: (Stat) -> string, --- The current (boosted or drained) level, or run energy in whole percent. Pass the `client` global. getValue: (Stat, Client) -> number, --- The real level, or 100 for run energy. Pass the `client` global. getMaximum: (Stat, Client) -> number, } --- Every stat an item can change, as `Stat` constants: each skill, and `RUN_ENERGY`. export type Stats = { } export type StatsClass = { --- `Stats.ATTACK`. ATTACK: Stat, --- `Stats.DEFENCE`. DEFENCE: Stat, --- `Stats.STRENGTH`. STRENGTH: Stat, --- `Stats.HITPOINTS`. HITPOINTS: Stat, --- `Stats.RANGED`. RANGED: Stat, --- `Stats.PRAYER`. PRAYER: Stat, --- `Stats.MAGIC`. MAGIC: Stat, --- `Stats.COOKING`. COOKING: Stat, --- `Stats.WOODCUTTING`. WOODCUTTING: Stat, --- `Stats.FLETCHING`. FLETCHING: Stat, --- `Stats.FISHING`. FISHING: Stat, --- `Stats.FIREMAKING`. FIREMAKING: Stat, --- `Stats.CRAFTING`. CRAFTING: Stat, --- `Stats.SMITHING`. SMITHING: Stat, --- `Stats.MINING`. MINING: Stat, --- `Stats.HERBLORE`. HERBLORE: Stat, --- `Stats.AGILITY`. AGILITY: Stat, --- `Stats.THIEVING`. THIEVING: Stat, --- `Stats.SLAYER`. SLAYER: Stat, --- `Stats.FARMING`. FARMING: Stat, --- `Stats.RUNECRAFT`. RUNECRAFT: Stat, --- `Stats.HUNTER`. HUNTER: Stat, --- `Stats.CONSTRUCTION`. CONSTRUCTION: Stat, --- `Stats.SAILING`. SAILING: Stat, --- `Stats.RUN_ENERGY`. RUN_ENERGY: Stat, } --- `Stats`'s static functions and constants. declare Stats: StatsClass --- The table of what eating, drinking or using an item does: the `itemStatChanges` global. export type ItemStatChanges = { --- The item's effect, or `nil` for an item with none. get: (ItemStatChanges, number) -> Effect?, } export type ItemStatChangesClass = { --- `ItemStatChanges.ATTACK_POT`: the potion's effect. ATTACK_POT: Effect, --- `ItemStatChanges.STRENGTH_POT`: the potion's effect. STRENGTH_POT: Effect, --- `ItemStatChanges.DEFENCE_POT`: the potion's effect. DEFENCE_POT: Effect, --- `ItemStatChanges.SUPER_ATTACK_POT`: the potion's effect. SUPER_ATTACK_POT: Effect, --- `ItemStatChanges.SUPER_STRENGTH_POT`: the potion's effect. SUPER_STRENGTH_POT: Effect, --- `ItemStatChanges.SUPER_DEFENCE_POT`: the potion's effect. SUPER_DEFENCE_POT: Effect, } --- `ItemStatChanges`'s static functions and constants. declare ItemStatChanges: ItemStatChangesClass --- The XP tracker's session: actions, rates and goals per skill since login (or the --- last reset), fed from every stat change, the XP-drop goal varps and a one-second --- clock. The `xpTrackerService` global; always running. export type XpTrackerService = { --- Actions (XP drops) this session. getActions: (XpTrackerService, Skill) -> number, --- Actions per hour. getActionsHr: (XpTrackerService, Skill) -> number, --- Actions left to the goal, from the last ten actions' average; `2147483647` before --- any action. getActionsLeft: (XpTrackerService, Skill) -> number, --- XP per hour. getXpHr: (XpTrackerService, Skill) -> number, --- The goal's start XP: the XP-drops start goal, or the current level's XP. getStartGoalXp: (XpTrackerService, Skill) -> number, --- The goal's end XP: the XP-drops end goal, or the next level's XP. getEndGoalXp: (XpTrackerService, Skill) -> number, --- Time to the goal, `hh:mm:ss` or `mm:ss`; `"∞"` before any XP. getTimeTilGoal: (XpTrackerService, Skill) -> string, } --- The item effect table behind an interface. The `itemStatChangesService` global. export type ItemStatChangesService = { --- The item's effect, or `nil`. getItemStatChanges: (ItemStatChangesService, number) -> Effect?, } --- Bank tags, kept in the `banktags` config group, and the tags other plugins --- register. The `tagManager` global. export type TagManager = { --- The item's tags as stored: comma-separated (`variation`: its base item's). getTagString: (TagManager, number, boolean) -> string, --- The item's tags, lower-cased, in order. getTags: (TagManager, number, boolean) -> {string}, --- Replace the item's tags with a comma-separated string (empty removes them). setTagString: (TagManager, number, string, boolean) -> (), --- Add tags to the item, as given (no standardizing). addTags: (TagManager, number, {string}, boolean) -> (), --- Add one tag to the item, standardized. addTag: (TagManager, number, string, boolean) -> (), --- Whether any of the item's tags (or its variation's) starts with `search`. Answered --- from the group parsed once per change (a bank search asks once per bank item per --- keystroke): two map probes and a prefix scan. findTag: (TagManager, number, string) -> boolean, --- Every item carrying `tag` (by id; a variation's base item as its negative id), in --- id order. getItemsForTag: (TagManager, string) -> {number}, --- `(TagManager, string) -> ()`: --- Remove `tag` from every item, and unhide it. --- --- `(TagManager, number, string) -> ()`: --- Remove `tag` from one item (and its variation). removeTag: ((TagManager, string) -> ()) & ((TagManager, number, string) -> ()), --- Rename a tag on every item carrying it. renameTag: (TagManager, string, string) -> (), --- Whether `tag` is hidden. isHidden: (TagManager, string) -> boolean, --- Hide or unhide `tag`. setHidden: (TagManager, string, boolean) -> (), --- Register a tag as the set of item ids it contains, since a tag object's `contains` --- would run in another plugin's VM, once per bank item, called from another plugin's --- callback (plugin VMs are kept apart). Register again whenever the set changes. It --- stays registered until `unregisterTag`, so unregister it in `shutDown`. registerTagItems: (TagManager, string, {number}) -> (), --- Remove a registered tag. unregisterTag: (TagManager, string) -> (), --- A registered tag's items, or `nil`. A new array on every call: per bank item, ask --- `registeredTagContains` instead. getRegisteredTag: (TagManager, string) -> {number}?, --- Whether the registered tag `name` contains `itemId`, `nil` for no such tag. --- Nothing is allocated. registeredTagContains: (TagManager, string, number) -> boolean?, --- The registered tags' names, in order. getRegisteredTags: (TagManager) -> {string}, } --- Which ground items spawned this tick, and where. Loot events --- (`PlayerLootReceived`, `ServerNpcLoot`) are raised from the same state. The --- `lootManager` global. export type LootManager = { --- The stacks that spawned at `worldPoint` this tick, in spawn order. getItemSpawns: (LootManager, WorldPoint) -> {ItemStack}, } --- NPC data: hitpoints by NPC id, loaded once in the background. The `npcManager` --- global. export type NPCManager = { --- The NPC's hitpoints, or `nil` (unknown NPC, or the table not loaded yet). getHealth: (NPCManager, number) -> number?, } --- Whether an NPC is dying, and the dead flags its handlers set (`NpcChanged`, --- `AnimationChanged`), which `Actor#isDead()` answers. The `npcUtil` global. export type NpcUtil = { --- Whether `npc` is dying: never for the NPCs that reach 0 hitpoints without dying --- (gargoyles, the Kalphite Queen's first form, ...), always for the ones that die --- without a health bar reaching 0, else an NPC whose `isDead()` is set and whose --- shown composition has an "Attack" option and no death-hider exclusion (the game --- cache's param 1799). An alive NPC costs its id and one dead-flag read; a --- despawned one answers `false`. isDying: (NpcUtil, NPC) -> boolean, } --- The current slayer task and the NPCs that are its targets, always running. The task --- is read from the slayer varps and the game's slayer task tables when they change; --- the targets are the top-level NPCs whose composition's name matches one of the --- task's target names (`Task`) and that can be attacked (or picked, for zygomite --- fungi), in the order they were found. The `slayerPluginService` global. export type SlayerPluginService = { --- The current task's targets: the same `NPC` handles every other getter answers. getTargets: (SlayerPluginService) -> {NPC}, --- The task's name as the game spells it (`"Abyssal demons"`); `""` once a task is --- done, `nil` before any task was seen. getTask: (SlayerPluginService) -> string?, --- Where the task is to be done, or `nil` (no location given). getTaskLocation: (SlayerPluginService) -> string?, --- How many the task was for (with the task modifier's change). getInitialAmount: (SlayerPluginService) -> number, --- How many are left. getRemainingAmount: (SlayerPluginService) -> number, } --- Lay the bank out again through the game's own build script, start a bank search, or --- reset one. Game thread only (every callback is). The `bankSearch` global. export type BankSearch = { --- Run the bank item container's inventory-transmit listener (the bank build script --- with its own arguments); nothing when the bank is not open. layoutBank: (BankSearch) -> (), --- Reset any search, then open the bank's search input (the search toggle script); --- nothing when the bank is not shown. initSearch: (BankSearch) -> (), --- Clear the search: close the chatbox input (`closeChat`, the message layer close --- script) or just clear its mode and text, then lay the bank out again. reset: (BankSearch, boolean) -> (), } --- The world list (the game's own world directory, fetched every ten minutes). The --- `worldService` global. export type WorldService = { --- The last fetched list, sorted by world id, or `nil` before the first fetch --- lands. Asking starts the fetch when there is no list yet; the runtime also --- fetches every ten minutes while logged in. This never waits. getWorlds: (WorldService) -> WorldResult?, --- Fetch the list again, in the background. refresh: (WorldService) -> (), } --- Hiscore lookups, cached an hour per player and endpoint. The `hiscoreManager` --- global. export type HiscoreManager = { --- The cached result, or `nil` while it is being looked up (or the player has none): --- the lookup runs in the background, so ask again later (each frame or tick). lookupAsync: (HiscoreManager, string, HiscoreEndpoint) -> HiscoreResult?, --- The cached result, else `nil` while the lookup (started by this first call, --- unlike `lookupAsync`'s) runs in the background. Never blocks, so it can run on --- the game thread. Ask again later. lookupCached: (HiscoreManager, string, HiscoreEndpoint) -> HiscoreResult?, } --- The `hiscoreClient` global's class: `lookupAsync` answers a future (uncached), and --- `lookupCached` answers a cached result to poll. export type HiscoreLookup = { --- The lookup, started now, as a future: it completes with the player's result, with --- `nil` for a player the hiscores do not list (a 404), or exceptionally with an --- `IOException` (any other failure: an error status other than 404, a body that does --- not parse, a failed request). Read it with --- `whenCompleteAsync(function(result, ex) ... end)`, which runs on the client thread. --- Every call is a request (a miss is never remembered); `hiscoreManager:lookupAsync` --- is the cached lookup. These lookups have a budget of their own, shared by every --- plugin's: 32 in flight, 4 at a time; past it a lookup waits in a queue, oldest --- first, and never holds up `hiscoreManager`, `chatClient` or the NPC table. Only a --- lookup that can never be sent (no HTTP service) fails at once. lookupAsync: (HiscoreLookup, string, HiscoreEndpoint) -> CompletableFuture, --- The result once it has been fetched, `nil` until then (poll it); the first call --- starts the lookup. Never blocks, so it can run on the game thread. Shares --- `hiscoreManager`'s cache, so a player with no entry stays `nil` for an hour --- (`lookupAsync` is the uncached call). lookupCached: (HiscoreLookup, string, HiscoreEndpoint) -> HiscoreResult?, } --- The player menu items, written into the client's own player-option slots --- through its live menu, and the managed widget menus (`addManagedCustomMenu`, --- `WidgetMenuOption`). One record for every plugin. The `menuManager` global. export type MenuManager = { --- `menuText` takes the first free of the client's player-option slots 5 to 8 (none --- free, nothing happens), low priority, so every player's menu shows it as an entry of --- type `CLIENT_PLAYER` (identifier the player's index, deprioritized, announced by --- `MenuEntryAdded` like the game's own player options): a click on it posts --- `MenuOptionClicked` and sends nothing to the server, and `interactPlayer` never --- clicks it as a game option. When the game's `SET_PLAYER_OP` takes its slot, it moves --- to the next free one. After a client reset (a world hop, a logout) the item is --- written back on the next client cycle. The text is kept as the client keeps it: NUL --- characters removed, at most 256 bytes; an empty text adds nothing (the client shows --- no option for an empty slot). Called before the client's first cycle (a `startUp`), --- it is written at that cycle. --- --- Only a client whose menu Bento hooks can be written: on another nothing is shown, and --- the first call from each plugin logs a warning saying so. There, show the item from --- `onMenuEntryAdded(event)`: for a player option entry (`event:getType()` from --- `MenuAction.PLAYER_FIRST_OPTION:getId()` to `PLAYER_EIGHTH_OPTION:getId()`), once per --- player, --- `client:getMenu():createMenuEntry(-1):setOption(menuText) :setTarget(event:getTarget()):setType(MenuAction.CLIENT_PLAYER) :setIdentifier(event:getIdentifier()):setDeprioritized(true)`, --- then `onClick(fn)`. addPlayerMenuItem: (MenuManager, string) -> (), --- Take the first player menu item of that text (any case) back out of the menu --- (its slot emptied); a text no plugin added does nothing. Shown nowhere on a --- client whose menu Bento does not hook, as `addPlayerMenuItem` is not. removePlayerMenuItem: (MenuManager, string) -> (), --- Manage `customMenuOption` on each of its widgets. From now on every right-click --- menu with a `CC_OP` entry of one of them (no widget selected) also shows the --- option: an entry of type `CLIENT`, param1 the widget, added once per menu after --- every `MenuEntryAdded` subscriber above priority 0 and before every one at 0, the --- oldest option on top. Clicking it runs `callback(entry)` after every --- `MenuOptionClicked` subscriber, and sends nothing to the server. Adding an option --- again replaces its callback and keeps its place. A plugin that stops takes its --- options out. Shown only on a client whose menu Bento hooks. addManagedCustomMenu: (MenuManager, WidgetMenuOption, ((MenuEntry) -> ())?) -> (), --- Stop managing `customMenuOption` (menus built from now on leave it out). removeManagedCustomMenu: (MenuManager, WidgetMenuOption) -> (), } --- The chat API: the kill counts, personal bests and the rest that `!kc`-style chat --- commands show. Each lookup is cached a minute and answers `nil` until it has been --- fetched; each submission is sent in the background. Local plugins only. The --- `chatClient` global. export type ChatApi = { --- The kill count, `nil` until fetched. This never blocks: ask again later. getKcAsync: (ChatApi, string, string) -> number?, --- Submit the kill count, sent in the background; `true` when it was queued, whether --- or not the server takes it. submitKcAsync: (ChatApi, string, string, number) -> boolean, --- Quest points, `nil` until fetched. getQpAsync: (ChatApi, string) -> number?, --- Submit quest points, sent in the background. submitQpAsync: (ChatApi, string, number) -> boolean, --- The gamble count, `nil` until fetched. getGcAsync: (ChatApi, string) -> number?, --- Submit the gamble count, sent in the background. submitGcAsync: (ChatApi, string, number) -> boolean, --- The personal best in seconds, `nil` until fetched. getPbAsync: (ChatApi, string, string) -> number?, --- Submit the personal best, sent in the background. submitPbAsync: (ChatApi, string, string, number) -> boolean, --- The slayer task, `nil` until fetched. getTaskAsync: (ChatApi, string) -> ChatTask?, --- Submit the slayer task, sent in the background. `location` may be `nil` (a task --- with none): the parameter is sent with no value. submitTaskAsync: (ChatApi, string, string, number, number, string?) -> boolean, --- The duel record, `nil` until fetched. getDuelsAsync: (ChatApi, string) -> Duels?, --- Submit the duel record, sent in the background. submitDuelsAsync: (ChatApi, string, number, number, number, number) -> boolean, --- The raid layout, `nil` until fetched. getLayoutAsync: (ChatApi, string) -> {LayoutRoom}?, --- Submit the raid layout, sent in the background. submitLayoutAsync: (ChatApi, string, {LayoutRoom}) -> boolean, --- The pets' item ids, `nil` until fetched. getPetListAsync: (ChatApi, string) -> {number}?, --- Submit the pet list, sent in the background. submitPetListAsync: (ChatApi, string, {number}) -> boolean, } --- Data plugins publish for each other, by topic, as JSON text, so one plugin can read --- another's state (a current quest step, a list of offers). A plugin publishes only --- under its own id (`"/"`), up to 64 topics of 256 KiB each, and its --- topics go when its VM does (unloaded, reloaded); a reader polls `version` and --- decodes the text with `Json.parse`. Every plugin reads every topic. The `pluginData` --- global. export type PluginData = { --- Publish `json` under `topic`, replacing what was there; the new version. `topic` --- is `"/"`; anything else, more than 256 KiB, or a 65th --- topic, is an error. publish: (PluginData, string, string) -> number, --- The JSON last published under `topic`, or `nil`. get: (PluginData, string) -> string?, --- The version of `topic` (0 when nothing is published): changes on every publish. version: (PluginData, string) -> number, --- The id of the plugin that published `topic`, or `nil`. publisher: (PluginData, string) -> string?, --- Remove `topic`, if this plugin published it. clear: (PluginData, string) -> boolean, --- Every topic, sorted. topics: (PluginData) -> {string}, } --- `WorldUtil`: world type conversions. export type WorldUtil = { } export type WorldUtilClass = { --- The client's `WorldType`s of the world list's ones (`TOURNAMENT` is the client's --- `TOURNAMENT_WORLD`). toWorldTypes: ({[HttpWorldType]: boolean}) -> {[WorldType]: boolean}, } --- `WorldUtil`'s static functions and constants. declare WorldUtil: WorldUtilClass --- Links to the OSRS Wiki's pages, built by the client: `ui:openUrl` and `LinkBrowser` --- open them for a published plugin too. Building a link sends nothing. A plugin that wants --- data from the wiki asks its API itself, with `okHttpClient` and its own `User-Agent`; --- the DPS calculator's link, which is not the API, it asks for with `dpsCalculatorLink`. The --- `wiki` global. export type Wiki = { --- The link to the wiki page titled `title`: `wiki:pageUrl("Abyssal whip")` is --- `"https://oldschool.runescape.wiki/w/Abyssal%20whip"`. pageUrl: (Wiki, string) -> string, --- The link to the wiki's search for `text`: the page of that title, else the results. searchUrl: (Wiki, string) -> string, --- The link to an item's wiki page, found by `itemId`, else by `name`. itemUrl: (Wiki, number, string?) -> string, --- The link to an NPC's wiki page, found by `npcId`, else by `name`. npcUrl: (Wiki, number, string?) -> string, --- The wiki's DPS calculator, loaded with the logged-in player's worn items, combat --- levels and buffs (the Wilderness, the Kandarin hard diary, a slayer task, Charge), --- for any plugin, published ones included. The request is the plugin's own: it goes --- out under `userAgent`, which is required like any wiki request's (printable ASCII, --- at most 256 characters, sent exactly as written; an unusable one raises). The client --- builds its body from the game, so it carries nothing of the plugin's but its name. --- `callback(link, nil)` runs on the client thread with the calculator's link, to open --- with `ui:openUrl`, or `callback(nil, why)`, as when no player is logged in or the --- wiki has asked for a pause. The loadout and the player's name go to the calculator, --- which keeps them under the link. Each call is one request, one wiki request at a --- time across every plugin. dpsCalculatorLink: (Wiki, string, (string?, string?) -> ()) -> (), } --- One player's hiscores from one endpoint: `hiscoreManager:lookupAsync` answers it. export type HiscoreResult = { --- The player's name, as it was looked up. getPlayer: (HiscoreResult) -> string, --- The entry for a skill, boss or activity, or `nil` when the hiscores do not list --- it for this player. getSkill: (HiscoreResult, HiscoreSkill) -> HiscoreEntry?, } --- How long a world takes to answer. export type Ping = { } export type PingClass = { --- The round trip to `world` that the host last measured, in milliseconds, or -1 --- while none has landed or when the last attempt failed. Never blocks, so it can --- run on the game thread. A call starts a measurement in the background when the --- last is a second old or more and none is running, so poll it (a loop that polls --- every few seconds reads a result one period old). The host times a TCP connect --- to the world's game port, 43594, which is one round trip. `world:ping(id)` and --- `world:requestPing(id)` are the same service by world number. pingCached: (HttpWorld) -> number, } --- `Ping`'s static functions and constants. declare Ping: PingClass --- An entry `menuManager:addManagedCustomMenu` adds to the right-click menu of some --- widgets (a `CC_OP` entry's widget, by packed id). `==` is identity: the same --- option. --- --- `__eq`: `a == b`: the same option. export type WidgetMenuOption = { --- The option text ("Export" of "Export Ground Markers"). getMenuOption: (WidgetMenuOption) -> string, --- Set the option text; menus built from now on show it. setMenuOption: (WidgetMenuOption, string) -> (), --- The target text, with its colour tag (`Ground Markers`). getMenuTarget: (WidgetMenuOption) -> string, --- Set the target text, wrapped in the option's colour as it is now. setMenuTarget: (WidgetMenuOption, string) -> (), --- The colour the next `setMenuTarget` wraps the target in. getColor: (WidgetMenuOption) -> Color, --- Set the colour; the target already set keeps its old colour until --- `setMenuTarget` is called again. setColor: (WidgetMenuOption, Color) -> (), --- Whether `other` equals this WidgetMenuOption, as `==` answers it (`false` for a value of another class). equals: (WidgetMenuOption, any) -> boolean, } export type WidgetMenuOptionClass = { --- `WidgetMenuOption.new(menuOption, menuTarget, widgetId, ...)`: option text, target --- text (wrapped in the option's colour, `JagexColors.MENU_TARGET` until `setColor`), --- and the packed ids of the widgets whose menus show it (pass them as arguments, or --- one array). new: (string, string, {number}) -> WidgetMenuOption, } --- `WidgetMenuOption`'s static functions and constants. declare WidgetMenuOption: WidgetMenuOptionClass --- The client's right-click menu (`client:getMenu()`), or the submenu of one entry. Its --- first entry is at the bottom, its last on top (the left-click entry). `==` holds --- between two handles of the same menu (the root menu is one object for the client's --- life). --- --- `__eq`: The same menu. export type Menu = { --- Create a new entry at `idx` (a negative index counts from the end: -1 puts it --- on top) and return it: option and target empty, type `MenuAction.CLIENT`, identifier --- and params 0, item id -1. It is not announced by `MenuEntryAdded`. Raises for an --- index past the end or a full menu. Made before the client's last sort (in --- `MenuEntryAdded`), it then moves as that sort moves it: a type over 1000 (`CLIENT`, --- the default) sinks below every entry under 1000; made at `PostMenuSort` or --- `MenuOpened`, `idx` is where it stays. createMenuEntry: (Menu, number) -> MenuEntry, --- The menu's entries, bottom first: a 1-based array whose last element is the --- top entry. getMenuEntries: (Menu) -> {MenuEntry}, --- Make the menu exactly `entries`, in that order (bottom first): what is left --- out is removed, what is listed again after a removal comes back. Most useful --- in `MenuOpened` and `PostMenuSort`, after the client's last sort (before it, --- that sort still sinks every entry over 1000 below the others). Raises for an entry --- of another menu or one listed twice. setMenuEntries: (Menu, {MenuEntry}) -> (), --- Remove `entry`. Raises for an entry of another menu. removeMenuEntry: (Menu, MenuEntry) -> (), --- The open menu's left edge, in canvas pixels; the last open menu's after it --- closed (0 before one opened). getMenuX: (Menu) -> number, --- The open menu's top edge, in canvas pixels. getMenuY: (Menu) -> number, --- The open menu's width. getMenuWidth: (Menu) -> number, --- The open menu's height. getMenuHeight: (Menu) -> number, --- Whether `other` equals this Menu, as `==` answers it (`false` for a value of another class). equals: (Menu, any) -> boolean, } --- One entry of the client's menu. A live handle: getters read the client's entry, --- setters write it at once and return the entry, for chaining. An entry of a menu since --- rebuilt answers its last values and ignores setters. `==` is identity (the same entry --- of the same menu); a handle is not interned, so as a table key it does not find --- another handle of the same entry. `tostring` lists its fields, as --- `MenuEntryImpl(getOption=..., ...)`. --- --- `__eq`: The same entry of the same menu. --- `__tostring`: The entry's fields, as `MenuEntryImpl(getOption=..., getTarget=..., ...)`. export type MenuEntry = { --- The option text: "Walk here", "Attack", ... getOption: (MenuEntry) -> string, --- Set the option text. setOption: (MenuEntry, string) -> MenuEntry, --- The target text, with its colour tags (`Goblin (level-2)`); --- empty when the option has no target. getTarget: (MenuEntry) -> string, --- Set the target text. setTarget: (MenuEntry, string) -> MenuEntry, --- The identifier: the loc, NPC index, item, player index or widget op the action --- targets, depending on its type. getIdentifier: (MenuEntry) -> number, --- Set the identifier. On a client entry it is what the action then uses. setIdentifier: (MenuEntry, number) -> MenuEntry, --- The action, without the deprioritize offset (`isDeprioritized()` says that). getType: (MenuEntry) -> MenuAction, --- Set the action, keeping the deprioritize state. Within the entry's own action --- (an NPC op for another NPC op) the client's own action runs the new op; any --- other type runs through Bento's intent for it when the entry is clicked --- (a `CLIENT` type runs nothing but `onClick`; `WALK` walks to the hovered --- tile, whatever the params). setType: (MenuEntry, MenuAction) -> MenuEntry, --- The first parameter: a scene x, a widget child index, ... getParam0: (MenuEntry) -> number, --- Set the first parameter. setParam0: (MenuEntry, number) -> MenuEntry, --- The second parameter: a scene y, a packed widget id, ... getParam1: (MenuEntry) -> number, --- Set the second parameter. setParam1: (MenuEntry, number) -> MenuEntry, --- Whether a left click runs it even where the client would open the menu (shift --- click). isForceLeftClick: (MenuEntry) -> boolean, --- Set whether a left click runs it even where the client would open the menu. setForceLeftClick: (MenuEntry, boolean) -> MenuEntry, --- The world view the entry belongs to; -1 for none. getWorldViewId: (MenuEntry) -> number, --- Set the world view id. setWorldViewId: (MenuEntry, number) -> MenuEntry, --- Whether it is deprioritized (+2000 on its opcode): an "Attack" the --- attack-option setting demotes, a low-priority follower op, a player option with --- a priority, or one a plugin deprioritized. A type that is low by itself (loc op --- 5, Examine, `CC_OP_LOW_PRIORITY`) is not. isDeprioritized: (MenuEntry) -> boolean, --- Deprioritize it (or stop): it sorts below every entry that is not. A change made --- before the client's last sort places it. setDeprioritized: (MenuEntry, boolean) -> MenuEntry, --- Run `callback(entry)` when the entry is clicked: after every --- `MenuOptionClicked` subscriber, whether or not one consumed the click. --- Replaces an earlier callback; returns the entry. onClick: (MenuEntry, (MenuEntry) -> ()) -> MenuEntry, --- Copy `from`'s `onClick` callback onto this entry: `clone:copyOnClick(entry)`. A --- member cannot hand back a Luau function, so `onClick` has no getter to read it --- with. The callback still runs in the plugin that put it on `from`; a `from` with --- none takes this entry's off. Returns this entry. copyOnClick: (MenuEntry, MenuEntry) -> MenuEntry, --- Whether it is an inventory item op ("Use" and "Examine" are not). isItemOp: (MenuEntry) -> boolean, --- The item op 1-5 of an inventory item op, else -1. The shift-click op --- (identifier 1) is the op of the item in the widget slot the entry names. getItemOp: (MenuEntry) -> number, --- The item id, or -1. getItemId: (MenuEntry) -> number, --- Set the item id. setItemId: (MenuEntry, number) -> MenuEntry, --- The widget the entry acts on (a `CC_OP`, `WIDGET_TARGET`, `WIDGET_CONTINUE`, ...): --- `client:getWidget(getParam1())`, or its dynamic child `getParam0()` when that is --- not -1. `nil` for other types, an interface that is not loaded, or an empty slot. getWidget: (MenuEntry) -> Widget?, --- The NPC the entry targets (an NPC option, a use on an NPC, Examine), by index --- `getIdentifier()` in the entry's world view, or `nil`. getNpc: (MenuEntry) -> NPC?, --- The player the entry targets (a player option, a use on a player, a --- `CLIENT_PLAYER` entry) by index `getIdentifier()`; for `WALK`, the hovered player --- at `getIdentifier() - 1`. `nil` when there is none. getPlayer: (MenuEntry) -> Player?, --- `getNpc()`, else `getPlayer()`. getActor: (MenuEntry) -> Actor?, --- The entry's submenu, or `nil` when it has none. getSubMenu: (MenuEntry) -> Menu?, --- A new, empty submenu for the entry, replacing any. Raises where the client's --- menu cannot hold one. createSubMenu: (MenuEntry) -> Menu, --- Remove the entry's submenu. deleteSubMenu: (MenuEntry) -> (), --- Whether `other` is this same MenuEntry, as `==` answers it (`false` for a value of another class). equals: (MenuEntry, any) -> boolean, } --- The base of the key and mouse events a listener is handed (with `AWTEvent`'s --- `getID`). Named `AwtInputEvent` because the `InputEvent` name is the --- constant table here (`InputEvent.SHIFT_DOWN_MASK`); an event object answers --- every `InputEvent` method, and `getSource()` and `getComponent()`. export type AwtInputEvent = { --- Consumes the event: no listener after this one sees it, and the game --- does not either. consume: (AwtInputEvent) -> (), --- Whether a listener consumed the event. isConsumed: (AwtInputEvent) -> boolean, --- The extended modifier mask: `InputEvent.SHIFT_DOWN_MASK`, --- `CTRL_DOWN_MASK`, `ALT_DOWN_MASK`, `META_DOWN_MASK` and the --- `BUTTONn_DOWN_MASK`s of the buttons held. getModifiersEx: (AwtInputEvent) -> number, --- The old-style modifier mask (`InputEvent.SHIFT_MASK`, ..., --- `BUTTON1_MASK`): for an event the client made, what AWT's constructor --- derives from the extended one; for one made with `AwtMouseEvent.create`, --- what that constructor kept. getModifiers: (AwtInputEvent) -> number, --- Whether Shift was down. isShiftDown: (AwtInputEvent) -> boolean, --- Whether Control was down. isControlDown: (AwtInputEvent) -> boolean, --- Whether Alt was down. isAltDown: (AwtInputEvent) -> boolean, --- Whether Meta was down. On Windows no key is Meta (AWT reports the --- Windows key as `KeyEvent.VK_WINDOWS` with no modifier), so this is --- `false` for an event the client made. isMetaDown: (AwtInputEvent) -> boolean, --- Whether AltGraph was down. The client reports AltGr as Control and Alt, --- so this is always `false`. isAltGraphDown: (AwtInputEvent) -> boolean, --- When the event happened, in milliseconds since the Unix epoch. getWhen: (AwtInputEvent) -> number, --- The event id: `KeyEvent.KEY_PRESSED`, `MouseEvent.MOUSE_CLICKED`, --- `MouseEvent.MOUSE_WHEEL`, ... getID: (AwtInputEvent) -> number, --- The component the event is about, for an event a Swing listener is --- handed (a panel's mouse, wheel or key listener): the component the --- listener was added to, or, for an event passed on with `dispatchEvent`, --- the one it first went to. `nil` for an event of the game canvas (a --- `keyManager` or `mouseManager` listener's: the canvas has no object --- here), and for a kept event whose component was collected since. getSource: (AwtInputEvent) -> Component?, --- The component, as `getSource()`. getComponent: (AwtInputEvent) -> Component?, } --- A key event, as a `KeyListener` is handed it. Named `AwtKeyEvent` because --- the `KeyEvent` name is the constant table here (`KeyEvent.VK_A`): this --- object answers every `KeyEvent` method a listener calls. Key codes are AWT's --- (`KeyEvent.VK_*`), translated from the client's own key codes; a key the --- client has no code for (F13-F24, the context-menu key) never reaches a --- listener. export type AwtKeyEvent = AwtInputEvent & { --- The AWT key code (`KeyEvent.VK_*`); `KeyEvent.VK_UNDEFINED` (0) for --- a `KEY_TYPED` event. getKeyCode: (AwtKeyEvent) -> number, --- Makes the event this key instead: the game sees the new key, or, for a --- key the client has no code for, nothing. setKeyCode: (AwtKeyEvent, number) -> (), --- The key code with no keyboard-layout extension: on the layouts the --- client maps, the key code itself (what `Keybind` compares). getExtendedKeyCode: (AwtKeyEvent) -> number, --- The character, a one-character string: what was typed, for a `KEY_TYPED` --- event; for a press or release, the character the key makes on a US --- layout, or `KeyEvent.CHAR_UNDEFINED`. A typed character is the one the --- client's own keyboard handler made: it maps `WM_CHAR` through a --- 256-entry table on the low byte, so a character above U+00FF is not the --- one AWT would report. getKeyChar: (AwtKeyEvent) -> string, --- Set the character, as a one-character string (Luau has no `char`). On a --- `KEY_TYPED` event the game types the new character instead; --- `KeyEvent.CHAR_UNDEFINED` types nothing. Raises for a string that is not --- one UTF-16 unit. setKeyCharacter: (AwtKeyEvent, string) -> (), --- Where the key is: `KeyEvent.KEY_LOCATION_STANDARD`, `_LEFT` (the --- modifiers: the client does not tell left from right), `_NUMPAD`, or --- `_UNKNOWN` for a `KEY_TYPED` event. getKeyLocation: (AwtKeyEvent) -> number, --- Whether the key types no character: arrows, F1..F24, Home/End, Page --- Up/Down, Insert, the lock keys, ... isActionKey: (AwtKeyEvent) -> boolean, } export type AwtKeyEventClass = { --- The key code for the character `c` (a code point, e.g. --- `utf8.codepoint(s)`), whatever the layout, reached through this class --- because the `KeyEvent` name is the constant table here. A letter of --- either case is its `KeyEvent.VK_A`..`VK_Z`, a digit its `VK_0`..`VK_9`; --- a symbol with a code of its own is that (`!` is `VK_EXCLAMATION_MARK`, --- not the `1` key); a character with a key on some layout is --- `0x01000000 + c`; anything else `KeyEvent.VK_UNDEFINED`. getExtendedKeyCodeForChar: (number) -> number, } --- `AwtKeyEvent`'s static functions and constants. declare AwtKeyEvent: AwtKeyEventClass --- A mouse event, as a `MouseListener` is handed it. Named `AwtMouseEvent` --- because the `MouseEvent` name is the constant table here --- (`MouseEvent.BUTTON1`). Positions are canvas pixels; buttons are AWT's --- (`BUTTON1` left, `BUTTON2` middle, `BUTTON3` right). A listener returns the --- event, this one or a new one (`AwtMouseEvent.create`), and the game sees --- what the last listener returned. export type AwtMouseEvent = AwtInputEvent & { --- The x position on the canvas. getX: (AwtMouseEvent) -> number, --- The y position on the canvas. getY: (AwtMouseEvent) -> number, --- The position on the canvas, as a `Point`. getPoint: (AwtMouseEvent) -> Point, --- Moves the event by (`x`, `y`): the game sees it there. translatePoint: (AwtMouseEvent, number, number) -> (), --- The button that changed (`MouseEvent.BUTTON1`..`BUTTON3`), or --- `MouseEvent.NOBUTTON` for a move or drag. getButton: (AwtMouseEvent) -> number, --- How many quick clicks this press, release or click is part of; 0 for --- a move or drag. getClickCount: (AwtMouseEvent) -> number, --- Whether this is the platform's popup-menu trigger: on Windows, the --- release of the right button. isPopupTrigger: (AwtMouseEvent) -> boolean, } export type AwtMouseEventClass = { --- `(number, number, number, number, number, number, boolean, number) -> AwtMouseEvent`: --- A new event, for a listener that returns a rewritten one, with no source --- component (the canvas is the only one). `modifiers` are converted: --- old-style alone become extended (an old 8 is both Alt and the middle --- button, a 4 both Meta and the right one, as `ALT_MASK == BUTTON2_MASK`), --- and for a press, release or click with `NOBUTTON` name the button; --- extended alone gain their old-style bits. Raises for a button below --- `NOBUTTON`. --- --- `(number, number, number, number, number, number, boolean) -> AwtMouseEvent`: --- A new event with no button and no source component (a button may still --- come from old-style modifiers, as above). create: ((number, number, number, number, number, number, boolean, number) -> AwtMouseEvent) & ((number, number, number, number, number, number, boolean) -> AwtMouseEvent), } --- `AwtMouseEvent`'s static functions and constants. declare AwtMouseEvent: AwtMouseEventClass --- A wheel event, as a `MouseWheelListener` is handed it. A listener may --- consume it, or return another with a different rotation: the game turns by --- the sum of the rotations of the poll's unconsumed wheel events as their --- listeners returned them (nothing changes while no listener changed --- anything). export type MouseWheelEvent = AwtMouseEvent & { --- The detents turned: negative away from the user (the game zooms --- in), positive toward. getWheelRotation: (MouseWheelEvent) -> number, --- The detents as a double: whole detents here (Windows reports no finer --- steps for a notched wheel through the client). getPreciseWheelRotation: (MouseWheelEvent) -> number, --- Lines per detent: Windows' default, 3. getScrollAmount: (MouseWheelEvent) -> number, --- `WHEEL_UNIT_SCROLL`. getScrollType: (MouseWheelEvent) -> number, --- Lines to scroll: the scroll amount times the rotation. getUnitsToScroll: (MouseWheelEvent) -> number, } export type MouseWheelEventClass = { --- `MouseWheelEvent.WHEEL_UNIT_SCROLL`: scroll by units (lines). WHEEL_UNIT_SCROLL: number, --- `MouseWheelEvent.WHEEL_BLOCK_SCROLL`: scroll by blocks (pages). WHEEL_BLOCK_SCROLL: number, --- A new wheel event, with no source component. create: (number, number, number, number, number, number, boolean, number, number, number) -> MouseWheelEvent, } --- `MouseWheelEvent`'s static functions and constants. declare MouseWheelEvent: MouseWheelEventClass --- Mouse-button tests on the events a listener is handed. The rest of --- `SwingUtilities` (threading, the component tree) is not offered: Bento's --- panels do not have them. export type SwingUtilities = { } export type SwingUtilitiesClass = { --- Whether `anEvent` is about the left button: it is held --- (`InputEvent.BUTTON1_DOWN_MASK`) or it is the button that changed --- (`MouseEvent.BUTTON1`). isLeftMouseButton: (AwtMouseEvent) -> boolean, --- Whether `anEvent` is about the middle button (`BUTTON2_DOWN_MASK` held, --- or `MouseEvent.BUTTON2`). isMiddleMouseButton: (AwtMouseEvent) -> boolean, --- Whether `anEvent` is about the right button (`BUTTON3_DOWN_MASK` held, --- or `MouseEvent.BUTTON3`). isRightMouseButton: (AwtMouseEvent) -> boolean, --- During a Swing delivery, a follow-up that runs after the current event; anywhere else, the client thread's next invoke point. `r` (a function, or a table with `run`) runs in a coroutine, so it may block on a dialog. invokeLater: (r: any) -> (), --- Runs `r` now (plugin code is always on the Swing thread here). invokeAndWait: (r: any) -> (), --- `true`: plugin code is always on the Swing thread here. isEventDispatchThread: () -> boolean, --- The first window above `c` (a `JFrame` or `JDialog` it is in; a window's owner); `nil` for a side panel's components (the sidebar is not a window), so `frame:setLocationRelativeTo(SwingUtilities.getWindowAncestor(panel))` centres the frame. An ownerless `JDialog` answers `nil`. getWindowAncestor: (c: any) -> any, } --- `SwingUtilities`'s static functions and constants. declare SwingUtilities: SwingUtilitiesClass --- An AWT key code and a modifier mask, what a `Keybind` config item holds. The --- class is the prelude's (`Keybind.new(keyCode, modifiers)`, --- `Keybind.NOT_SET`, `Keybind.CTRL`, ...), which replaces this table when the --- VM is built; this declares it. In `matches`, a modifier-only keybind --- (`Keybind.CTRL`) matches the modifier's own press, and on release matches --- while its modifiers are still part of the event. export type Keybind = { --- Whether `e` is this keybind being pressed (or, for a --- `KEY_RELEASED` event, released). matches: (Keybind, AwtKeyEvent) -> boolean, --- The AWT key code; `KeyEvent.VK_UNDEFINED` for a modifier-only keybind. getKeyCode: (Keybind) -> number, --- The extended modifier mask. getModifiers: (Keybind) -> number, --- `Not set`, `Ctrl`, `Ctrl+Shift+F1`. toString: (Keybind) -> string, } export type KeybindClass = { --- `(number, number) -> Keybind`: --- A keybind of AWT key code `keyCode` and extended modifiers `modifiers`, --- normalised (a modifier key as the code becomes a modifier-only keybind). --- --- `(AwtKeyEvent) -> Keybind`: --- The keybind of the key event `e`: its key code and modifiers. new: ((number, number) -> Keybind) & ((AwtKeyEvent) -> Keybind), --- The modifier mask a modifier key's code is (`KeyEvent.VK_SHIFT` is --- `InputEvent.SHIFT_DOWN_MASK`), or `nil` for any other key. getModifierForKeyCode: (number) -> number?, } --- `Keybind`'s static functions and constants. declare Keybind: KeybindClass --- A `Keybind` that matches its key whatever modifiers are held. The prelude's --- class, declared here. export type ModifierlessKeybind = Keybind export type ModifierlessKeybindClass = { --- `(number, number) -> ModifierlessKeybind`: --- A keybind of `keyCode`; `modifiers` count only for a modifier-only one. --- --- `(AwtKeyEvent) -> ModifierlessKeybind`: --- The keybind of the key event `e`. new: ((number, number) -> ModifierlessKeybind) & ((AwtKeyEvent) -> ModifierlessKeybind), } --- `ModifierlessKeybind`'s static functions and constants. declare ModifierlessKeybind: ModifierlessKeybindClass --- A key listener: any table with `keyPressed`, `keyReleased` and `keyTyped` --- (each optional), registered with `keyManager:registerKeyListener`. Each --- method gets the `AwtKeyEvent`; `e:consume()` stops the listeners after it --- and the game from seeing the key. export type KeyListener = { --- A key went down (and again for each auto-repeat). keyPressed: (KeyListener, AwtKeyEvent) -> (), --- A key came up. keyReleased: (KeyListener, AwtKeyEvent) -> (), --- A character was typed. keyTyped: (KeyListener, AwtKeyEvent) -> (), --- Whether the listener runs on the login screen; `false` unless the table --- answers `true`. isEnabledOnLoginScreen: (KeyListener) -> boolean, --- The game window lost keyboard focus: a key held now will not report --- its release. focusLost: (KeyListener) -> (), } --- A key listener for one `Keybind`, read from `keybind` (a function, usually --- `function() return config:hotkey() end`) on every key. Override --- `hotkeyPressed` and `hotkeyReleased`, on the instance or in a --- `class(HotkeyListener)` subclass. A matching key that is not itself a --- modifier is consumed, as is the character it types. export type HotkeyListener = KeyListener & { --- Whether the hotkey also works on the login screen. setEnabledOnLoginScreen: (HotkeyListener, boolean) -> (), --- Override: the hotkey went down. hotkeyPressed: (HotkeyListener) -> (), --- Override: the hotkey came up. hotkeyReleased: (HotkeyListener) -> (), } export type HotkeyListenerClass = { --- A listener for the keybind `keybind()` returns. A subclass with an --- `init` of its own passes it on: --- `X.super.init(self, function() return config:hotkey() end)`. new: (() -> Keybind) -> HotkeyListener, } --- `HotkeyListener`'s static functions and constants. declare HotkeyListener: HotkeyListenerClass --- A mouse listener: any table with `mousePressed`, `mouseReleased`, --- `mouseClicked`, `mouseMoved`, `mouseDragged`, `mouseEntered` and --- `mouseExited` (each optional), registered with --- `mouseManager:registerMouseListener`. Each method returns the event the next --- listener and the game get, the one it was handed or a new one; returning --- nothing hands on the one it was handed. export type MouseListener = { --- A button went down. mousePressed: (MouseListener, AwtMouseEvent) -> AwtMouseEvent, --- A button came up. mouseReleased: (MouseListener, AwtMouseEvent) -> AwtMouseEvent, --- A press and release with no drag between them (after the release). mouseClicked: (MouseListener, AwtMouseEvent) -> AwtMouseEvent, --- The pointer moved with no button held. mouseMoved: (MouseListener, AwtMouseEvent) -> AwtMouseEvent, --- The pointer moved with a button held. mouseDragged: (MouseListener, AwtMouseEvent) -> AwtMouseEvent, --- The pointer came back over the game. mouseEntered: (MouseListener, AwtMouseEvent) -> AwtMouseEvent, --- The pointer left the game. mouseExited: (MouseListener, AwtMouseEvent) -> AwtMouseEvent, } --- A `MouseListener` whose every method returns the event it was handed, to --- extend with `class(MouseAdapter)` and override what it needs. export type MouseAdapter = MouseListener export type MouseAdapterClass = { --- A listener that hands every event on unchanged. new: () -> MouseAdapter, } --- `MouseAdapter`'s static functions and constants. declare MouseAdapter: MouseAdapterClass --- A wheel listener: any table with `mouseWheelMoved`, registered with --- `mouseManager:registerMouseWheelListener`. The method returns the event to --- hand on. export type MouseWheelListener = { --- The wheel turned. mouseWheelMoved: (MouseWheelListener, MouseWheelEvent) -> MouseWheelEvent, } --- The `keyManager` global: the key listeners of every plugin, in the order they were registered. Each key event goes to them in that order, on the client thread, before the game sees it, until one consumes it (`e:consume()`); then neither the later listeners nor the game get it. On the login screen a listener runs only if its `isEnabledOnLoginScreen()` answers `true`. A listener of a plugin that is not running gets nothing. export type KeyManager = { --- Adds `keyListener` (a table with `keyPressed`/`keyReleased`/`keyTyped`) at the end of the list, unless it is already in it. Register in `startUp` and unregister in `shutDown`: a listener left registered gets nothing while its plugin is stopped. registerKeyListener: (KeyManager, KeyListener) -> (), --- Removes `keyListener` from the list. unregisterKeyListener: (KeyManager, KeyListener) -> (), } --- The `mouseManager` global: the mouse listeners and the wheel listeners of every plugin, each list in registration order. Each event goes to them in order, on the client thread, before the game sees it; each listener returns the event the next one gets, and one that comes back consumed stops the rest and the game. A listener of a plugin that is not running gets nothing. export type MouseManager = { --- `(MouseManager, MouseListener) -> ()`: --- Adds `mouseListener` at the end of the list, unless it is already in it. --- --- `(MouseManager, number, MouseListener) -> ()`: --- Inserts `mouseListener` at `position` (0 is first) of the list, even when it is in the list already. Raises for a position past the end. registerMouseListener: ((MouseManager, MouseListener) -> ()) & ((MouseManager, number, MouseListener) -> ()), --- Removes `mouseListener` from the list. unregisterMouseListener: (MouseManager, MouseListener) -> (), --- `(MouseManager, MouseWheelListener) -> ()`: --- Adds `mouseWheelListener` at the end of the wheel list, unless it is already in it. --- --- `(MouseManager, number, MouseWheelListener) -> ()`: --- Inserts `mouseWheelListener` at `position` of the wheel list. registerMouseWheelListener: ((MouseManager, MouseWheelListener) -> ()) & ((MouseManager, number, MouseWheelListener) -> ()), --- Removes `mouseWheelListener` from the wheel list. unregisterMouseWheelListener: (MouseManager, MouseWheelListener) -> (), } --- The `clientUI` global: the cursor over the game canvas. The client's frame --- (tray, sidebar, frame bounds) is the host's. export type ClientUI = { --- Shows `image` as the cursor over the game canvas until `resetCursor`, --- its hotspot at the top-left pixel, scaled to the system cursor size by --- pixel replication, each pixel either transparent (alpha 0) or opaque --- (its colour over black). The image's pixels are read now; drawing on it --- later changes nothing. `name` names the cursor. It takes over from the --- next client tick, when the pointer next moves over the canvas; egui's --- own windows keep their cursors. setCursor: (ClientUI, BufferedImage, string?) -> (), --- Puts back the game's own cursor. resetCursor: (ClientUI) -> (), } --- The virtual mouse's gestures beyond a click: a move, a right click, a middle --- click, the wheel, a widget drag, the middle-mouse camera drag. Each moves --- the cursor there first, then performs the gesture as the game's own input. --- Each answers `true` when the gesture was queued, `false` when the plugin may --- not act here, the target is not on the canvas, or the game would take the --- gesture as a left click (which nothing would consume). export type VirtualMouse = { } export type VirtualMouseClass = { --- Move the cursor to the canvas point `point`, through the virtual mouse, --- and leave it there, pressing nothing (the game shows what is under it). moveMouse: (Point) -> boolean, --- Move to the canvas point `point` and right-click there, through the --- virtual mouse, which opens the game's menu for what is under it. rightClick: (Point) -> boolean, --- Move to the canvas point `point` and middle-click there. `false`, and --- nothing pressed, while the game's "Middle mouse button controls the --- camera" option is off: the game would take the press as a left click. middleClick: (Point) -> boolean, --- Move to the canvas point `point` and turn the wheel `wheelRotation` --- detents (positive toward the user: over the scene the game zooms out; --- negative zooms in). One wheel event per detent, as a turned wheel sends --- them; at most 20. scrollWheel: (Point, number) -> boolean, --- Rotate the camera by dragging with the middle button by (`deltaX`, --- `deltaY`) canvas pixels from near the canvas centre. The game turns the --- camera from a middle drag only with its "Middle mouse button controls --- the camera" option on; with it off this answers `false` and presses --- nothing. cameraDrag: (number, number) -> boolean, --- Camera drags one after another, each as `cameraDrag`, with a pause --- between two. `false`, and nothing queued, when the arrays differ in --- length or are empty, the canvas is unknown, or the camera option is off. --- Should a later drag fail to queue for another reason, the earlier ones --- stay queued and this answers `false`. cameraDragSequence: ({number}, {number}) -> boolean, --- Drag the widget `sourceId` (a packed component id; `sourceSlot` its --- dynamic child, or -1 for the component itself) onto `targetId` / --- `targetSlot`, to rearrange an inventory or bank item. The --- game performs the move (onDrag, onDragComplete, IF_BUTTOND) with its --- own checks; the button is held past the widget's drag dead time. --- `false`, and nothing pressed, for a source the game would not drag (no --- drag parent, not on screen) or a drop within its drag dead zone: the --- release would then click the item. dragWidget: (number, number, number, number) -> boolean, } --- `VirtualMouse`'s static functions and constants. declare VirtualMouse: VirtualMouseClass --- The root of every Swing component here. An instance is a --- table, so a `class(JPanel)` subclass is a component with fields of its own, and a --- getter (`getParent()`, `getComponents()`) hands back that very object. A method a --- plugin class defines with one of the overridable names (`getPreferredSize`, --- `paintComponent`, `addNotify`, ...) is what Rust calls; one defined --- on the class table after its first instance was built, or assigned on an instance --- after it was added to a parent, is not seen. export type Component = { --- The container this component is in, or `nil`: the very object the plugin --- built, with its fields. getParent: (Component) -> Container?, --- Whether the component is laid out (`validate()` ran since anything changed). isValid: (Component) -> boolean, --- Marks the component, and its ancestors up to the first invalid one, as needing --- a layout. Requests nothing. invalidate: (Component) -> (), --- Lays the component out now, if it is displayable: every invalid container at --- and under it, top down. A component that is not displayable lays out nothing. validate: (Component) -> (), --- Invalidates the component and queues its validate root to be laid out at the --- next slot. revalidate: (Component) -> (), --- `(Component) -> ()`: --- Asks for the component to be painted again. --- --- `(Component, number, number, number, number) -> ()`: --- Asks for a rectangle of the component, in its own coordinates, to be painted --- again. --- --- `(Component, number, number, number, number, number) -> ()`: --- Asks for a rectangle to be painted again within `tm` milliseconds (it is now). repaint: ((Component) -> ()) & ((Component, number, number, number, number) -> ()) & ((Component, number, number, number, number, number) -> ()), --- Whether the component's surface is attached (a registered panel, an open popup): --- what Swing calls having a peer. isDisplayable: (Component) -> boolean, --- Whether the component is on screen: displayable, and it and every ancestor --- visible. isShowing: (Component) -> boolean, --- Runs when the component becomes displayable; an override calls --- `X.super.addNotify(self)` to reach the children. addNotify: (Component) -> (), --- Runs when the component stops being displayable; an override calls --- `X.super.removeNotify(self)` to reach the children. removeNotify: (Component) -> (), --- Whether the component is visible (its own flag; see `isShowing`). isVisible: (Component) -> boolean, --- Shows or hides the component; a layout skips a hidden one. setVisible: (Component, boolean) -> (), --- Whether the component is enabled. A disabled component still receives mouse --- events (its listeners run; its look ignores them) and no keys. isEnabled: (Component) -> boolean, --- Enables or disables the component (not its children). setEnabled: (Component, boolean) -> (), --- The background: the component's own, else its nearest ancestor's, else `nil`. getBackground: (Component) -> Color?, --- Sets the background; `nil` inherits the parent's again. setBackground: (Component, Color?) -> (), --- The foreground: the component's own, else its nearest ancestor's, else `nil`. getForeground: (Component) -> Color?, --- Sets the foreground; `nil` inherits the parent's again. setForeground: (Component, Color?) -> (), --- The font: the component's own, else its nearest ancestor's, else `nil`. getFont: (Component) -> Font?, --- Sets the font; `nil` inherits the parent's again. setFont: (Component, Font?) -> (), --- Sets the mouse cursor shown over the component (`Cursor.new(type)`, --- `Cursor.getPredefinedCursor(type)`); `nil` inherits the parent's. setCursor: (Component, Cursor?) -> (), --- The cursor `setCursor` set, or `nil` (inherited). getCursor: (Component) -> Cursor?, --- The component's name, or `nil`. getName: (Component) -> string?, --- Names the component. setName: (Component, string?) -> (), --- Whether the component can take focus. isFocusable: (Component) -> boolean, --- Lets the component take focus, or not; a focus owner made unfocusable passes --- focus on. setFocusable: (Component, boolean) -> (), --- Whether Tab and Shift+Tab traverse focus from the component (else they reach --- its key listeners). getFocusTraversalKeysEnabled: (Component) -> boolean, --- Whether Tab and Shift+Tab traverse focus from the component. setFocusTraversalKeysEnabled: (Component, boolean) -> (), --- Asks for focus within the component's window; the focus events are posted. --- `false` when it cannot take focus or already has it. requestFocusInWindow: (Component) -> boolean, --- Asks for focus, the window's included; the focus events are posted. requestFocus: (Component) -> (), --- Whether the component owns focus. hasFocus: (Component) -> boolean, --- Whether the component owns focus (`hasFocus()`). isFocusOwner: (Component) -> boolean, --- The x position in the parent. getX: (Component) -> number, --- The y position in the parent. getY: (Component) -> number, --- The width. getWidth: (Component) -> number, --- The height. getHeight: (Component) -> number, --- The bounds in the parent, as a new `Rectangle`. getBounds: (Component) -> Rectangle, --- `(Component, number, number, number, number) -> ()`: --- Moves and resizes the component (a layout may change it again). --- --- `(Component, Rectangle) -> ()`: --- Moves and resizes the component to `r`. setBounds: ((Component, number, number, number, number) -> ()) & ((Component, Rectangle) -> ()), --- The size, as a new `Dimension`. getSize: (Component) -> Dimension, --- `(Component, number, number) -> ()`: --- Resizes the component. --- --- `(Component, Dimension) -> ()`: --- Resizes the component to `d`. setSize: ((Component, number, number) -> ()) & ((Component, Dimension) -> ()), --- The position in the parent, as a new `Point`. getLocation: (Component) -> Point, --- `(Component, number, number) -> ()`: --- Moves the component. --- --- `(Component, Point) -> ()`: --- Moves the component to `p`. setLocation: ((Component, number, number) -> ()) & ((Component, Point) -> ()), --- The preferred size: the size set with `setPreferredSize`, else the look's or the --- layout's, else `Component`'s default. The native member: an --- override's `X.super.getPreferredSize(self)` reaches it. getPreferredSize: (Component) -> Dimension, --- Sets the preferred size; `nil` computes it again. Invalidates nothing and --- requests nothing: a parent's cached size stays until something else invalidates --- it. setPreferredSize: (Component, Dimension?) -> (), --- Whether a preferred size was set. isPreferredSizeSet: (Component) -> boolean, --- The minimum size (the native member). getMinimumSize: (Component) -> Dimension, --- Sets the minimum size; `nil` computes it again. setMinimumSize: (Component, Dimension?) -> (), --- The maximum size (the native member). getMaximumSize: (Component) -> Dimension, --- Sets the maximum size; `nil` computes it again. setMaximumSize: (Component, Dimension?) -> (), --- Adds a `MouseListener` (a `MouseAdapter` subclass, or any table with the methods --- it needs): it runs on presses, releases, clicks, enters and exits, in --- registration order, and makes the component take the mouse from its parent. addMouseListener: (Component, MouseListener) -> (), --- Removes a `MouseListener`, by identity. removeMouseListener: (Component, any) -> (), --- A copy of the `MouseListener`s, in registration order. getMouseListeners: (Component) -> {any}, --- Adds a `MouseMotionListener`: it runs on moves and drags. addMouseMotionListener: (Component, any) -> (), --- Removes a `MouseMotionListener`, by identity. removeMouseMotionListener: (Component, any) -> (), --- A copy of the `MouseMotionListener`s, in registration order. getMouseMotionListeners: (Component) -> {any}, --- Adds a `MouseWheelListener` (a table, or a function of the event). addMouseWheelListener: (Component, any) -> (), --- Removes a `MouseWheelListener`, by identity. removeMouseWheelListener: (Component, any) -> (), --- Adds a `KeyListener`: it runs on the keys the component receives as focus owner, --- before the key's bindings and the editor. addKeyListener: (Component, KeyListener) -> (), --- Removes a `KeyListener`, by identity. removeKeyListener: (Component, any) -> (), --- A copy of the `KeyListener`s, in registration order. getKeyListeners: (Component) -> {any}, --- Adds a `FocusListener` (`focusGained`, `focusLost`). addFocusListener: (Component, any) -> (), --- Removes a `FocusListener`, by identity. removeFocusListener: (Component, any) -> (), --- A copy of the `FocusListener`s, in registration order. getFocusListeners: (Component) -> {any}, --- Adds a `ComponentListener`: resized, moved, shown, hidden, posted after the --- change. addComponentListener: (Component, any) -> (), --- Removes a `ComponentListener`, by identity. removeComponentListener: (Component, any) -> (), --- Delivers an AWT mouse, key, focus or component event to this component's listeners of its kind, now, as the same object; the look's own behaviour (a button's press, say) is not run. dispatchEvent: (Component, any) -> (), } --- `Component`'s class table: the metatable of its instances, which are tables a `class(Component)` subclass may extend; its instance methods, `new`, `init` (the constructor, for `Sub.super.init(self, ...)`) and `super`. export type ComponentClass = Component & { --- `Component.TOP_ALIGNMENT`: 0. TOP_ALIGNMENT: number, --- `Component.CENTER_ALIGNMENT`: 0.5. CENTER_ALIGNMENT: number, --- `Component.BOTTOM_ALIGNMENT`: 1. BOTTOM_ALIGNMENT: number, --- `Component.LEFT_ALIGNMENT`: 0. LEFT_ALIGNMENT: number, --- `Component.RIGHT_ALIGNMENT`: 1. RIGHT_ALIGNMENT: number, --- The implicit no-argument constructor: the fresh state a node of this kind starts with, and nothing more. Construction runs it as every native base's `super()`; `new` does not take it. init: (Component) -> (), --- Whether `obj` is a `Component` object, a `class(Component)` subclass's included. isInstance: (any) -> boolean, } --- `Component`'s class table: `new`, the constructors and the static functions. declare Component: ComponentClass --- A component that holds others, laid out by its layout manager. export type Container = Component & { --- `(Container, Component) -> Component`: --- Adds `comp` last (taking it from any container it was in), and answers it. --- Invalidates this container; schedules no layout (call `revalidate()` for one). --- --- `(Container, string, Component) -> Component`: --- Adds `comp` under the layout's constraint `name` (`BorderLayout.NORTH`, a card's --- name), and answers it. --- --- `(Container, Component, number) -> Component`: --- Adds `comp` at child index `index` (-1: last), and answers it. --- --- `(Container, Component, T) -> ()`: --- Adds `comp` with the layout's constraints: a `BorderLayout` region, a --- `GridBagConstraints` (copied), a card's name, a layer, or `nil`. --- --- `(Container, Component, any, number) -> ()`: --- Adds `comp` with constraints at child index `index`. add: ((Container, Component) -> Component) & ((Container, string, Component) -> Component) & ((Container, Component, T) -> ()) & ((Container, Component, any, number) -> ()), --- `(Container, Component) -> ()`: --- Removes `comp` if it is a child. Requests nothing: the plugin repaints. --- --- `(Container, number) -> ()`: --- Removes the child at index `index`. remove: ((Container, Component) -> ()) & ((Container, number) -> ()), --- Removes every child, the last first. removeAll: (Container) -> (), --- The child at index `n` (from 0). getComponent: (Container, number) -> Component, --- How many children. getComponentCount: (Container) -> number, --- The children, in index order (array index 1 is child index 0: the top-most). getComponents: (Container) -> {Component}, --- Moves `comp` to child index `index` (from another container, it is moved here). --- Requests nothing. setComponentZOrder: (Container, Component, number) -> (), --- `comp`'s child index, or -1. getComponentZOrder: (Container, Component) -> number, --- Whether `comp` is inside this container, at any depth. isAncestorOf: (Container, Component) -> boolean, --- Where the pointer is, in this container's coordinates, while the container is --- showing under it, else `nil`. With `allowChildren` false, only where none of its --- children is under the pointer. The pointer is where the last pointer record over --- the sidebar left it. getMousePosition: (Container, boolean) -> Point?, --- Sets the layout manager: one of the prelude's (`BorderLayout.new()`, --- `FlowLayout.new(...)`, `DynamicGridLayout.new(...)`, ...), a Luau `LayoutManager` --- (any table with `layoutContainer`), or `nil` for absolute positions. The --- constraints of children added under the old layout are lost. setLayout: (Container, any) -> (), --- The layout manager: the very table `setLayout` was given, else the one the --- component was built with (a `JPanel`'s `FlowLayout`, a `Box`'s `BoxLayout`, a --- `PluginPanel`'s `DynamicGridLayout`), made the first time it is asked for and the --- same table after that, its setters changing the container's layout. `nil` for the --- null layout, and for a layout the prelude has no class of (a scroll pane's). getLayout: (Container) -> any, --- Lays the children out now with the layout manager (the native member: an --- override's `X.super.doLayout(self)` reaches it). doLayout: (Container) -> (), --- The insets: the border's, else zero (the native member). getInsets: (Container) -> Insets, } --- `Container`'s class table: the metatable of its instances, which are tables a `class(Container)` subclass may extend; its instance methods, `new`, `init` (the constructor, for `Sub.super.init(self, ...)`) and `super`. export type ContainerClass = Container & { --- A new container with the null layout. new: () -> Container, --- A new container with the null layout. init: (Container) -> (), --- `Component`'s class table: the base class. super: ComponentClass, --- Whether `obj` is a `Container` object, a `class(Container)` subclass's included. isInstance: (any) -> boolean, } --- `Container`'s class table: `new`, the constructors and the static functions. declare Container: ContainerClass --- The base of the Swing components, a lightweight with no look of its own: a --- `class(JComponent)` subclass with a `paintComponent` draws what it shows. export type JComponent = Container & { --- The native `paintComponent(g)`: the look's paint of the component (its background --- when opaque, then the kind's content; a bare `JComponent` paints nothing), with no --- override consulted. A plugin class's own `paintComponent(g)` is what Rust calls --- when the component is painted (on a repaint, never per frame), with a `Graphics2D` --- translated to the component, clipped to it, its colour and font the component's, --- valid only during the call; it reaches this through --- `X.super.paintComponent(self, g)`. An error in an override ends --- that repaint where it happened, and is logged. paintComponent: (JComponent, Graphics2D) -> (), --- Sets the border: one of the prelude's (`EmptyBorder.new(...)`, --- `BorderFactory.createMatteBorder(...)`, ...), a Luau `Border` (any table with --- `paintBorder` and `getBorderInsets`), or `nil`, which removes even the look's --- border. The insets become the border's. setBorder: (JComponent, Border?) -> (), --- The border `setBorder` was given (the very table), or `nil`. getBorder: (JComponent) -> Border?, --- Whether the component paints every pixel of its bounds (its background first). isOpaque: (JComponent) -> boolean, --- Makes the component paint its background, or not. setOpaque: (JComponent, boolean) -> (), --- Sets the tooltip text (plain or ``); a component with one takes the mouse --- from its parent's listeners. `nil` removes it. setToolTipText: (JComponent, string?) -> (), --- The tooltip text `setToolTipText` set, or `nil`. getToolTipText: (JComponent) -> string?, --- Stores a client property (any key but `nil`); `"html.disable"`, --- `"FlatLaf.style"`, `"FlatLaf.styleClass"` and `"JButton.buttonType"` also change --- the look. putClientProperty: (JComponent, any, any) -> (), --- The client property under `key`, the very value stored, or `nil`. getClientProperty: (JComponent, any) -> any, --- Sets the horizontal alignment a `BoxLayout` reads, clamped to 0..1. setAlignmentX: (JComponent, number) -> (), --- Sets the vertical alignment a `BoxLayout` reads, clamped to 0..1. setAlignmentY: (JComponent, number) -> (), --- Whether a press may give the component focus. isRequestFocusEnabled: (JComponent) -> boolean, --- Whether a press may give the component focus. setRequestFocusEnabled: (JComponent, boolean) -> (), --- Whether a child with no popup menu of its own shows this one. getInheritsPopupMenu: (JComponent) -> boolean, --- Whether the component shows its parent's popup menu when it has none. setInheritsPopupMenu: (JComponent, boolean) -> (), --- The metrics `font` measures with in a component: the look's text rendering --- (the fonts antialiased as their `gasp` table says), so a width computed --- here is the one the label lays out with. getFontMetrics: (JComponent, Font) -> FontMetrics, --- The popup menu shown on a popup trigger (a right click) over it: its own, or --- with `setInheritsPopupMenu(true)` its parent's. getComponentPopupMenu: (JComponent) -> Component?, --- Shows `popup` on a popup trigger (a right click) over it, at the pointer; --- `nil` removes it. The component keeps the menu alive. setComponentPopupMenu: (JComponent, JPopupMenu?) -> (), --- Re-installs the look's defaults the plugin has not set, then lays out and --- repaints as the kind's look does. updateUI: (JComponent) -> (), --- The component's `InputMap` for `WHEN_FOCUSED` (or the condition given), the same one each call. getInputMap: (JComponent, condition: number?) -> InputMap, --- The component's `ActionMap`, the same one each call. getActionMap: (JComponent) -> ActionMap, } --- `JComponent`'s class table: the metatable of its instances, which are tables a `class(JComponent)` subclass may extend; its instance methods, `new`, `init` (the constructor, for `Sub.super.init(self, ...)`) and `super`. export type JComponentClass = JComponent & { --- `JComponent.WHEN_FOCUSED`: 0. WHEN_FOCUSED: number, --- `JComponent.WHEN_ANCESTOR_OF_FOCUSED_COMPONENT`: 1. WHEN_ANCESTOR_OF_FOCUSED_COMPONENT: number, --- `JComponent.WHEN_IN_FOCUSED_WINDOW`: 2. WHEN_IN_FOCUSED_WINDOW: number, --- A new lightweight component. new: () -> JComponent, --- A new lightweight component. init: (JComponent) -> (), --- `Container`'s class table: the base class. super: ContainerClass, --- Whether `obj` is a `JComponent` object, a `class(JComponent)` subclass's included. isInstance: (any) -> boolean, } --- `JComponent`'s class table: `new`, the constructors and the static functions. declare JComponent: JComponentClass --- A container with the look's background, a `FlowLayout` by default. export type JPanel = JComponent --- `JPanel`'s class table: the metatable of its instances, which are tables a `class(JPanel)` subclass may extend; its instance methods, `new`, `init` (the constructor, for `Sub.super.init(self, ...)`) and `super`. export type JPanelClass = JPanel & { --- `() -> JPanel`: --- A new panel with a `FlowLayout`. --- --- `(any) -> JPanel`: --- A new panel with the layout manager `layout`. --- --- `(boolean) -> JPanel`: --- A new panel; double buffering is the painter's, so the flag changes nothing. --- --- `(any, boolean) -> JPanel`: --- A new panel with the layout manager `layout`; the flag changes nothing. new: ((any) -> JPanel) & ((any, boolean) -> JPanel), --- `(JPanel) -> ()`: --- A new panel with a `FlowLayout`. --- --- `(JPanel, any) -> ()`: --- A new panel with the layout manager `layout`. --- --- `(JPanel, boolean) -> ()`: --- A new panel; double buffering is the painter's, so the flag changes nothing. --- --- `(JPanel, any, boolean) -> ()`: --- A new panel with the layout manager `layout`; the flag changes nothing. init: ((JPanel, any) -> ()) & ((JPanel, any, boolean) -> ()), --- `JComponent`'s class table: the base class. super: JComponentClass, --- Whether `obj` is a `JPanel` object, a `class(JPanel)` subclass's included. isInstance: (any) -> boolean, } --- `JPanel`'s class table: `new`, the constructors and the static functions. declare JPanel: JPanelClass --- Children kept by layer, then position, with the null layout. export type JLayeredPane = JComponent & { --- The layer of child `comp`. getLayer: (JLayeredPane, Component) -> number, --- `(JLayeredPane, Component, number) -> ()`: --- Moves child `comp` to `layer`, last in it. --- --- `(JLayeredPane, Component, number, number) -> ()`: --- Moves child `comp` to `layer`, at `position` within it. setLayer: ((JLayeredPane, Component, number) -> ()) & ((JLayeredPane, Component, number, number) -> ()), --- Child `comp`'s position within its layer (0 is the top-most). getPosition: (JLayeredPane, Component) -> number, --- Moves child `comp` within its layer. setPosition: (JLayeredPane, Component, number) -> (), --- Moves child `comp` to the top of its layer. moveToFront: (JLayeredPane, Component) -> (), --- Moves child `comp` to the bottom of its layer. moveToBack: (JLayeredPane, Component) -> (), } --- `JLayeredPane`'s class table: the metatable of its instances, which are tables a `class(JLayeredPane)` subclass may extend; its instance methods, `new`, `init` (the constructor, for `Sub.super.init(self, ...)`) and `super`. export type JLayeredPaneClass = JLayeredPane & { --- `JLayeredPane.DEFAULT_LAYER`: 0. DEFAULT_LAYER: number, --- `JLayeredPane.PALETTE_LAYER`: 100. PALETTE_LAYER: number, --- `JLayeredPane.MODAL_LAYER`: 200. MODAL_LAYER: number, --- `JLayeredPane.POPUP_LAYER`: 300. POPUP_LAYER: number, --- `JLayeredPane.DRAG_LAYER`: 400. DRAG_LAYER: number, --- A new layered pane. new: () -> JLayeredPane, --- A new layered pane. init: (JLayeredPane) -> (), --- `JComponent`'s class table: the base class. super: JComponentClass, --- Whether `obj` is a `JLayeredPane` object, a `class(JLayeredPane)` subclass's included. isInstance: (any) -> boolean, } --- `JLayeredPane`'s class table: `new`, the constructors and the static functions. declare JLayeredPane: JLayeredPaneClass --- A container with a `BoxLayout` (`Box.createHorizontalBox()`, --- `Box.createVerticalBox()`; the struts, glue and rigid areas are `Box.Filler`s). export type Box = JComponent --- `Box`'s class table: the metatable of its instances, which are tables a `class(Box)` subclass may extend; its instance methods, `new`, `init` (the constructor, for `Sub.super.init(self, ...)`) and `super`. export type BoxClass = Box & { --- A new box laid out along `axis` (`BoxLayout.X_AXIS`, `Y_AXIS`, `LINE_AXIS`, --- `PAGE_AXIS`). new: (number) -> Box, --- A filler that grows both ways. createGlue: () -> Component, --- A filler that grows horizontally. createHorizontalGlue: () -> Component, --- A filler that grows vertically. createVerticalGlue: () -> Component, --- A fixed-width filler. createHorizontalStrut: (width: number) -> Component, --- A fixed-height filler. createVerticalStrut: (height: number) -> Component, --- A fixed-size filler. createRigidArea: (size: Dimension) -> Component, --- `(Box) -> ()`: --- The implicit no-argument constructor: the fresh state a node of this kind starts with, and nothing more. Construction runs it as every native base's `super()`; `new` does not take it. --- --- `(Box, number) -> ()`: --- A new box laid out along `axis` (`BoxLayout.X_AXIS`, `Y_AXIS`, `LINE_AXIS`, --- `PAGE_AXIS`). init: ((Box) -> ()) & ((Box, number) -> ()), --- `JComponent`'s class table: the base class. super: JComponentClass, --- Whether `obj` is a `Box` object, a `class(Box)` subclass's included. isInstance: (any) -> boolean, } --- `Box`'s class table: `new`, the constructors and the static functions. declare Box: BoxClass --- An invisible component with fixed minimum, preferred and maximum sizes --- (`Box.createRigidArea`, `createHorizontalStrut`, `createGlue`, ...), reached as --- `BoxFiller` and as `Box.Filler`. export type BoxFiller = JComponent --- `BoxFiller`'s class table: the metatable of its instances, which are tables a `class(BoxFiller)` subclass may extend; its instance methods, `new`, `init` (the constructor, for `Sub.super.init(self, ...)`) and `super`. export type BoxFillerClass = BoxFiller & { --- A filler of the three sizes. new: (Dimension, Dimension, Dimension) -> BoxFiller, --- `(BoxFiller) -> ()`: --- The implicit no-argument constructor: the fresh state a node of this kind starts with, and nothing more. Construction runs it as every native base's `super()`; `new` does not take it. --- --- `(BoxFiller, Dimension, Dimension, Dimension) -> ()`: --- A filler of the three sizes. init: ((BoxFiller) -> ()) & ((BoxFiller, Dimension, Dimension, Dimension) -> ()), --- `JComponent`'s class table: the base class. super: JComponentClass, --- Whether `obj` is a `BoxFiller` object, a `class(BoxFiller)` subclass's included. isInstance: (any) -> boolean, } --- `BoxFiller`'s class table: `new`, the constructors and the static functions. declare BoxFiller: BoxFillerClass --- A line between groups of controls. export type JSeparator = JComponent --- `JSeparator`'s class table: the metatable of its instances, which are tables a `class(JSeparator)` subclass may extend; its instance methods, `new`, `init` (the constructor, for `Sub.super.init(self, ...)`) and `super`. export type JSeparatorClass = JSeparator & { --- A horizontal separator. new: () -> JSeparator, --- A horizontal separator. init: (JSeparator) -> (), --- `JComponent`'s class table: the base class. super: JComponentClass, --- Whether `obj` is a `JSeparator` object, a `class(JSeparator)` subclass's included. isInstance: (any) -> boolean, } --- `JSeparator`'s class table: `new`, the constructors and the static functions. declare JSeparator: JSeparatorClass --- A viewport onto a view, with scroll bars as the policies say. Its constructor makes --- the viewport and both bars, each with its object. export type JScrollPane = JComponent & { --- The viewport (its child 0). getViewport: (JScrollPane) -> JViewport?, --- The vertical scroll bar. getVerticalScrollBar: (JScrollPane) -> JScrollBar?, --- The horizontal scroll bar. getHorizontalScrollBar: (JScrollPane) -> JScrollBar?, --- When the vertical bar shows (`VERTICAL_SCROLLBAR_AS_NEEDED`, `_NEVER`, --- `_ALWAYS`); any other value raises. setVerticalScrollBarPolicy: (JScrollPane, number) -> (), --- When the horizontal bar shows (`HORIZONTAL_SCROLLBAR_AS_NEEDED`, `_NEVER`, --- `_ALWAYS`); any other value raises. setHorizontalScrollBarPolicy: (JScrollPane, number) -> (), --- The vertical bar's policy. getVerticalScrollBarPolicy: (JScrollPane) -> number, --- The horizontal bar's policy. getHorizontalScrollBarPolicy: (JScrollPane) -> number, --- Makes `view` the viewport's view (taking it from any container it was in). setViewportView: (JScrollPane, Component?) -> (), --- Scrolls with the mouse wheel, or not. setWheelScrollingEnabled: (JScrollPane, boolean) -> (), } --- `JScrollPane`'s class table: the metatable of its instances, which are tables a `class(JScrollPane)` subclass may extend; its instance methods, `new`, `init` (the constructor, for `Sub.super.init(self, ...)`) and `super`. export type JScrollPaneClass = JScrollPane & { --- `ScrollPaneConstants.VERTICAL_SCROLLBAR_AS_NEEDED`: 20. VERTICAL_SCROLLBAR_AS_NEEDED: number, --- `ScrollPaneConstants.VERTICAL_SCROLLBAR_NEVER`: 21. VERTICAL_SCROLLBAR_NEVER: number, --- `ScrollPaneConstants.VERTICAL_SCROLLBAR_ALWAYS`: 22. VERTICAL_SCROLLBAR_ALWAYS: number, --- `ScrollPaneConstants.HORIZONTAL_SCROLLBAR_AS_NEEDED`: 30. HORIZONTAL_SCROLLBAR_AS_NEEDED: number, --- `ScrollPaneConstants.HORIZONTAL_SCROLLBAR_NEVER`: 31. HORIZONTAL_SCROLLBAR_NEVER: number, --- `ScrollPaneConstants.HORIZONTAL_SCROLLBAR_ALWAYS`: 32. HORIZONTAL_SCROLLBAR_ALWAYS: number, --- `() -> JScrollPane`: --- An empty scroll pane, both bars as needed. --- --- `(Component) -> JScrollPane`: --- A scroll pane onto `view`, both bars as needed. --- --- `(Component, number, number) -> JScrollPane`: --- A scroll pane onto `view` with the two policies. --- --- `(number, number) -> JScrollPane`: --- An empty scroll pane with the two policies. new: (() -> JScrollPane) & ((Component) -> JScrollPane) & ((Component, number, number) -> JScrollPane) & ((number, number) -> JScrollPane), --- `(JScrollPane) -> ()`: --- An empty scroll pane, both bars as needed. --- --- `(JScrollPane, Component) -> ()`: --- A scroll pane onto `view`, both bars as needed. --- --- `(JScrollPane, Component, number, number) -> ()`: --- A scroll pane onto `view` with the two policies. --- --- `(JScrollPane, number, number) -> ()`: --- An empty scroll pane with the two policies. init: ((JScrollPane) -> ()) & ((JScrollPane, Component) -> ()) & ((JScrollPane, Component, number, number) -> ()) & ((JScrollPane, number, number) -> ()), --- `JComponent`'s class table: the base class. super: JComponentClass, --- Whether `obj` is a `JScrollPane` object, a `class(JScrollPane)` subclass's included. isInstance: (any) -> boolean, } --- `JScrollPane`'s class table: `new`, the constructors and the static functions. declare JScrollPane: JScrollPaneClass --- The window onto a scroll pane's view. export type JViewport = JComponent & { --- The view, or `nil`. getView: (JViewport) -> Component?, --- Makes `view` the view (the old one is removed). setView: (JViewport, Component?) -> (), --- Where the view's top-left shows, in view coordinates. getViewPosition: (JViewport) -> Point, --- Scrolls the view so `p` shows at the top-left. setViewPosition: (JViewport, Point) -> (), --- The visible part's size. getExtentSize: (JViewport) -> Dimension, --- The visible part of the view, in view coordinates. getViewRect: (JViewport) -> Rectangle, } --- `JViewport`'s class table: the metatable of its instances, which are tables a `class(JViewport)` subclass may extend; its instance methods, `new`, `init` (the constructor, for `Sub.super.init(self, ...)`) and `super`. export type JViewportClass = JViewport & { --- A viewport with no view. new: () -> JViewport, --- A viewport with no view. init: (JViewport) -> (), --- `JComponent`'s class table: the base class. super: JComponentClass, --- Whether `obj` is a `JViewport` object, a `class(JViewport)` subclass's included. isInstance: (any) -> boolean, } --- `JViewport`'s class table: `new`, the constructors and the static functions. declare JViewport: JViewportClass --- A scroll pane's bar, with a 7 px look and a unit increment of 16. export type JScrollBar = JComponent & { --- The orientation. getOrientation: (JScrollBar) -> number, --- How far one arrow step or wheel line scrolls (the look sets 16). setUnitIncrement: (JScrollBar, number) -> (), --- The unit increment. getUnitIncrement: (JScrollBar) -> number, --- How far a page step scrolls. setBlockIncrement: (JScrollBar, number) -> (), --- The block increment. getBlockIncrement: (JScrollBar) -> number, --- The value: where the visible part starts. getValue: (JScrollBar) -> number, --- Scrolls to `value` (clamped to the range); the scroll pane's view follows. setValue: (JScrollBar, number) -> (), --- The range's minimum. getMinimum: (JScrollBar) -> number, --- The range's maximum. getMaximum: (JScrollBar) -> number, --- The visible amount (the model's extent). getVisibleAmount: (JScrollBar) -> number, } --- `JScrollBar`'s class table: the metatable of its instances, which are tables a `class(JScrollBar)` subclass may extend; its instance methods, `new`, `init` (the constructor, for `Sub.super.init(self, ...)`) and `super`. export type JScrollBarClass = JScrollBar & { --- `Adjustable.HORIZONTAL`: 0. HORIZONTAL: number, --- `Adjustable.VERTICAL`: 1. VERTICAL: number, --- `() -> JScrollBar`: --- A vertical scroll bar. --- --- `(number) -> JScrollBar`: --- A scroll bar along `orientation` (`JScrollBar.HORIZONTAL`, `VERTICAL`). new: (() -> JScrollBar) & ((number) -> JScrollBar), --- `(JScrollBar) -> ()`: --- A vertical scroll bar. --- --- `(JScrollBar, number) -> ()`: --- A scroll bar along `orientation` (`JScrollBar.HORIZONTAL`, `VERTICAL`). init: ((JScrollBar) -> ()) & ((JScrollBar, number) -> ()), --- `JComponent`'s class table: the base class. super: JComponentClass, --- Whether `obj` is a `JScrollBar` object, a `class(JScrollBar)` subclass's included. isInstance: (any) -> boolean, } --- `JScrollBar`'s class table: `new`, the constructors and the static functions. declare JScrollBar: JScrollBarClass --- A side panel's `JPanel`. `PluginPanel()` builds its wrap eagerly (6 px border, --- `DynamicGridLayout(0, 1, 0, 3)`, the `northPanel` it sits in, the scroll pane, the --- 242 px `wrappedPanel`), so a subclass's `init` already has it: `getParent()` is --- `northPanel`, and its own layout, border and background replace the wrap's. --- `PluginPanel.super.init(self, false)` resets and builds no wrap. export type PluginPanel = JPanel & { --- The panel the sidebar shows: the wrap's outermost panel, or this panel when it --- was built with `PluginPanel(false)`. getWrappedPanel: (PluginPanel) -> JPanel, --- The wrap's scroll pane, or `nil` for `PluginPanel(false)`. getScrollPane: (PluginPanel) -> JScrollPane?, } --- `PluginPanel`'s class table: the metatable of its instances, which are tables a `class(PluginPanel)` subclass may extend; its instance methods, `new`, `init` (the constructor, for `Sub.super.init(self, ...)`) and `super`. export type PluginPanelClass = PluginPanel & { --- `PluginPanel.PANEL_WIDTH`: 225. PANEL_WIDTH: number, --- `PluginPanel.SCROLLBAR_WIDTH`: 17. SCROLLBAR_WIDTH: number, --- `PluginPanel.BORDER_OFFSET`: 6. BORDER_OFFSET: number, --- `() -> PluginPanel`: --- `PluginPanel(true)`: the wrap built now. --- --- `(boolean) -> PluginPanel`: --- The wrap only when `wrap`. new: (() -> PluginPanel) & ((boolean) -> PluginPanel), --- `(PluginPanel) -> ()`: --- `PluginPanel(true)`: the wrap built now. --- --- `(PluginPanel, boolean) -> ()`: --- The wrap only when `wrap`. init: ((PluginPanel) -> ()) & ((PluginPanel, boolean) -> ()), --- `JPanel`'s class table: the base class. super: JPanelClass, --- Whether `obj` is a `PluginPanel` object, a `class(PluginPanel)` subclass's included. isInstance: (any) -> boolean, } --- `PluginPanel`'s class table: `new`, the constructors and the static functions. declare PluginPanel: PluginPanelClass --- Text and an icon. Text starting with `` is shown as a subset of HTML: the --- elements `html`, `head`, `body`, `p`, `div`, `br`, `span`, `font`, `b`, `strong`, `i`, --- `em`, `u`, `center`, `a`, `ul`, `ol` and `li`, with `style=` CSS. export type JLabel = JComponent & { --- The icon: an `ImageIcon` or the plugin's own `Icon` table, or `nil`. getIcon: (JLabel) -> Icon?, --- Shows `icon` (an `ImageIcon`, or a table with `getIconWidth`, `getIconHeight` --- and `paintIcon`) beside the text; `nil` removes it. setIcon: (JLabel, any) -> (), --- The text, or `nil`. getText: (JLabel) -> string?, --- Sets the text (plain, or `...`); a changed text lays the label out again --- and repaints it. setText: (JLabel, string?) -> (), --- The horizontal alignment. getHorizontalAlignment: (JLabel) -> number, --- Aligns the label's contents horizontally (`JLabel.LEFT`, `CENTER`, `RIGHT`, --- `LEADING`, `TRAILING`). setHorizontalAlignment: (JLabel, number) -> (), --- The vertical alignment. getVerticalAlignment: (JLabel) -> number, --- Aligns the label's contents vertically (`JLabel.TOP`, `CENTER`, `BOTTOM`). setVerticalAlignment: (JLabel, number) -> (), --- Where the text sits beside the icon, horizontally. setHorizontalTextPosition: (JLabel, number) -> (), --- Where the text sits beside the icon, vertically. setVerticalTextPosition: (JLabel, number) -> (), --- The gap between the icon and the text. getIconTextGap: (JLabel) -> number, --- Sets the gap between the icon and the text. setIconTextGap: (JLabel, number) -> (), --- The component this label labels, or `nil`. getLabelFor: (JLabel) -> Component?, --- Names the component this label labels. setLabelFor: (JLabel, Component?) -> (), } --- `JLabel`'s class table: the metatable of its instances, which are tables a `class(JLabel)` subclass may extend; its instance methods, `new`, `init` (the constructor, for `Sub.super.init(self, ...)`) and `super`. export type JLabelClass = JLabel & { --- `SwingConstants.CENTER`: 0. CENTER: number, --- `SwingConstants.TOP`: 1. TOP: number, --- `SwingConstants.LEFT`: 2. LEFT: number, --- `SwingConstants.BOTTOM`: 3. BOTTOM: number, --- `SwingConstants.RIGHT`: 4. RIGHT: number, --- `SwingConstants.LEADING`: 10. LEADING: number, --- `SwingConstants.TRAILING`: 11. TRAILING: number, --- `() -> JLabel`: --- An empty label. --- --- `(string?) -> JLabel`: --- A label showing `text`, leading-aligned. --- --- `(string?, number) -> JLabel`: --- A label showing `text`, aligned by `horizontalAlignment` (`JLabel.LEFT`, --- `CENTER`, `RIGHT`, `LEADING`, `TRAILING`). --- --- `(any) -> JLabel`: --- A label showing `image`, centred. --- --- `(string?, any, number) -> JLabel`: --- A label showing `text` and `icon`, aligned by `horizontalAlignment`. new: ((string?, number) -> JLabel) & ((any) -> JLabel) & ((string?, any, number) -> JLabel), --- `(JLabel) -> ()`: --- An empty label. --- --- `(JLabel, string?) -> ()`: --- A label showing `text`, leading-aligned. --- --- `(JLabel, string?, number) -> ()`: --- A label showing `text`, aligned by `horizontalAlignment` (`JLabel.LEFT`, --- `CENTER`, `RIGHT`, `LEADING`, `TRAILING`). --- --- `(JLabel, any) -> ()`: --- A label showing `image`, centred. --- --- `(JLabel, string?, any, number) -> ()`: --- A label showing `text` and `icon`, aligned by `horizontalAlignment`. init: ((JLabel, string?, number) -> ()) & ((JLabel, any) -> ()) & ((JLabel, string?, any, number) -> ()), --- `JComponent`'s class table: the base class. super: JComponentClass, --- Whether `obj` is a `JLabel` object, a `class(JLabel)` subclass's included. isInstance: (any) -> boolean, } --- `JLabel`'s class table: `new`, the constructors and the static functions. declare JLabel: JLabelClass --- A button's state, as `getModel()` hands it. Its change --- listeners are the button's (a `ChangeEvent`'s source is the button). export type ButtonModel = { --- Whether it is pressed (the mouse is down on it). isPressed: (ButtonModel) -> boolean, --- Whether the pointer is over it. isRollover: (ButtonModel) -> boolean, --- Whether a release now would click it. isArmed: (ButtonModel) -> boolean, --- Whether it is selected. isSelected: (ButtonModel) -> boolean, --- Adds a `ChangeListener`: it hears every change of the state, as the button's --- own `ChangeListener`s do. addChangeListener: (ButtonModel, any) -> (), } --- The buttons' base: its text, icons, selection, model and listeners. export type AbstractButton = JComponent & { --- Adds an `ActionListener` (a table with `actionPerformed`, or a function of the --- event): it runs when the button is clicked, the last added first. addActionListener: (AbstractButton, any) -> (), --- Removes an `ActionListener`, by identity. removeActionListener: (AbstractButton, any) -> (), --- A copy of the `ActionListener`s, in registration order. getActionListeners: (AbstractButton) -> {any}, --- Adds a `ChangeListener` (the button's model changed), the last added first. addChangeListener: (AbstractButton, any) -> (), --- Removes a `ChangeListener`, by identity. removeChangeListener: (AbstractButton, any) -> (), --- The text, or `nil`. getText: (AbstractButton) -> string?, --- Sets the text; a changed text lays the button out again. setText: (AbstractButton, string?) -> (), --- Whether a toggle, check box or radio button is selected. isSelected: (AbstractButton) -> boolean, --- Selects or deselects it: when that changes, its `ChangeListener`s, then its --- `ItemListener`s, before this returns (they may not block on a dialog). setSelected: (AbstractButton, boolean) -> (), --- Clicks it now: pressed, released and its action, as a click does (its --- listeners run before this returns). doClick: (AbstractButton) -> (), --- The model's state (`isPressed`, `isRollover`, ...) and its change listeners. getModel: (AbstractButton) -> ButtonModel, --- The command its `ActionEvent`s carry (the text, when none is set). getActionCommand: (AbstractButton) -> string?, --- Sets the command its `ActionEvent`s carry. setActionCommand: (AbstractButton, string?) -> (), --- The icon, or `nil`. getIcon: (AbstractButton) -> Icon?, --- Shows `icon` (an `ImageIcon` or the plugin's own `Icon` table); `nil` removes it. setIcon: (AbstractButton, any) -> (), --- The icon shown while the pointer is over it. setRolloverIcon: (AbstractButton, any) -> (), --- The icon shown while it is selected. setSelectedIcon: (AbstractButton, any) -> (), --- The icon shown while it is selected and the pointer is over it. setRolloverSelectedIcon: (AbstractButton, any) -> (), --- The icon shown while it is pressed. setPressedIcon: (AbstractButton, any) -> (), --- The icon shown while it is disabled; `nil` lets the look grey the icon. setDisabledIcon: (AbstractButton, any) -> (), --- The gap between the icon and the text. setIconTextGap: (AbstractButton, number) -> (), --- Aligns the icon and text horizontally (`SwingConstants.LEFT`, `CENTER`, `RIGHT`, --- `LEADING`, `TRAILING`). setHorizontalAlignment: (AbstractButton, number) -> (), --- Whether the look paints the focus ring. setFocusPainted: (AbstractButton, boolean) -> (), --- Whether the look paints the border. setBorderPainted: (AbstractButton, boolean) -> (), --- Whether the look fills the background. setContentAreaFilled: (AbstractButton, boolean) -> (), --- Whether the pointer over it shows the rollover look and icon. setRolloverEnabled: (AbstractButton, boolean) -> (), --- Adds an `ItemListener` (selected or deselected), the last added first. addItemListener: (AbstractButton, any) -> (), --- Removes an `ItemListener`, by identity. removeItemListener: (AbstractButton, any) -> (), --- `BasicButtonUI.new()` or `BasicToggleButtonUI.new()` installs Swing's basic look on the button; any other delegate is kept and changes nothing. setUI: (AbstractButton, any) -> (), } --- `AbstractButton`'s class table: the metatable of its instances, which are tables a `class(AbstractButton)` subclass may extend; its instance methods, `new`, `init` (the constructor, for `Sub.super.init(self, ...)`) and `super`. export type AbstractButtonClass = AbstractButton & { --- The implicit no-argument constructor: the fresh state a node of this kind starts with, and nothing more. Construction runs it as every native base's `super()`; `new` does not take it. init: (AbstractButton) -> (), --- `JComponent`'s class table: the base class. super: JComponentClass, --- Whether `obj` is a `AbstractButton` object, a `class(AbstractButton)` subclass's included. isInstance: (any) -> boolean, } --- `AbstractButton`'s class table: `new`, the constructors and the static functions. declare AbstractButton: AbstractButtonClass --- A push button: its `ActionListener`s run when it is clicked. export type JButton = AbstractButton --- `JButton`'s class table: the metatable of its instances, which are tables a `class(JButton)` subclass may extend; its instance methods, `new`, `init` (the constructor, for `Sub.super.init(self, ...)`) and `super`. export type JButtonClass = JButton & { --- `() -> JButton`: --- A button with no text. --- --- `(string?) -> JButton`: --- A button showing `text`. --- --- `(any) -> JButton`: --- A button showing `icon`. --- --- `(string?, T) -> JButton`: --- A button showing `text` and `icon`. new: ((any) -> JButton) & ((string?, T) -> JButton), --- `(JButton) -> ()`: --- A button with no text. --- --- `(JButton, string?) -> ()`: --- A button showing `text`. --- --- `(JButton, any) -> ()`: --- A button showing `icon`. --- --- `(JButton, string?, T) -> ()`: --- A button showing `text` and `icon`. init: ((JButton, any) -> ()) & ((JButton, string?, T) -> ()), --- `AbstractButton`'s class table: the base class. super: AbstractButtonClass, --- Whether `obj` is a `JButton` object, a `class(JButton)` subclass's included. isInstance: (any) -> boolean, } --- `JButton`'s class table: `new`, the constructors and the static functions. declare JButton: JButtonClass --- A button that a click selects or unselects, and that shows which. export type JToggleButton = AbstractButton --- `JToggleButton`'s class table: the metatable of its instances, which are tables a `class(JToggleButton)` subclass may extend; its instance methods, `new`, `init` (the constructor, for `Sub.super.init(self, ...)`) and `super`. export type JToggleButtonClass = JToggleButton & { --- `() -> JToggleButton`: --- A toggle button with no text, not selected. --- --- `(string?) -> JToggleButton`: --- A toggle button showing `text`, not selected. --- --- `(any) -> JToggleButton`: --- A toggle button showing `icon`, not selected. new: (any) -> JToggleButton, --- `(JToggleButton) -> ()`: --- A toggle button with no text, not selected. --- --- `(JToggleButton, string?) -> ()`: --- A toggle button showing `text`, not selected. --- --- `(JToggleButton, any) -> ()`: --- A toggle button showing `icon`, not selected. init: (JToggleButton, any) -> (), --- `AbstractButton`'s class table: the base class. super: AbstractButtonClass, --- Whether `obj` is a `JToggleButton` object, a `class(JToggleButton)` subclass's included. isInstance: (any) -> boolean, } --- `JToggleButton`'s class table: `new`, the constructors and the static functions. declare JToggleButton: JToggleButtonClass --- A toggle button drawn as a box that shows its selection. export type JCheckBox = JToggleButton --- `JCheckBox`'s class table: the metatable of its instances, which are tables a `class(JCheckBox)` subclass may extend; its instance methods, `new`, `init` (the constructor, for `Sub.super.init(self, ...)`) and `super`. export type JCheckBoxClass = JCheckBox & { --- `() -> JCheckBox`: --- A check box with no text, not selected. --- --- `(string?) -> JCheckBox`: --- A check box showing `text`, not selected. new: (string?) -> JCheckBox, --- `(JCheckBox) -> ()`: --- A check box with no text, not selected. --- --- `(JCheckBox, string?) -> ()`: --- A check box showing `text`, not selected. init: (JCheckBox, string?) -> (), --- `JToggleButton`'s class table: the base class. super: JToggleButtonClass, --- Whether `obj` is a `JCheckBox` object, a `class(JCheckBox)` subclass's included. isInstance: (any) -> boolean, } --- `JCheckBox`'s class table: `new`, the constructors and the static functions. declare JCheckBox: JCheckBoxClass --- A toggle button drawn as a round mark; a `ButtonGroup` makes one of several selected. export type JRadioButton = JToggleButton --- `JRadioButton`'s class table: the metatable of its instances, which are tables a `class(JRadioButton)` subclass may extend; its instance methods, `new`, `init` (the constructor, for `Sub.super.init(self, ...)`) and `super`. export type JRadioButtonClass = JRadioButton & { --- A radio button with no text, not selected. new: () -> JRadioButton, --- A radio button with no text, not selected. init: (JRadioButton) -> (), --- `JToggleButton`'s class table: the base class. super: JToggleButtonClass, --- Whether `obj` is a `JRadioButton` object, a `class(JRadioButton)` subclass's included. isInstance: (any) -> boolean, } --- `JRadioButton`'s class table: `new`, the constructors and the static functions. declare JRadioButton: JRadioButtonClass --- An item of a popup menu. export type JMenuItem = AbstractButton --- `JMenuItem`'s class table: the metatable of its instances, which are tables a `class(JMenuItem)` subclass may extend; its instance methods, `new`, `init` (the constructor, for `Sub.super.init(self, ...)`) and `super`. export type JMenuItemClass = JMenuItem & { --- `() -> JMenuItem`: --- An item with no text. --- --- `(string?) -> JMenuItem`: --- An item showing `text`. new: (string?) -> JMenuItem, --- `(JMenuItem) -> ()`: --- An item with no text. --- --- `(JMenuItem, string?) -> ()`: --- An item showing `text`. init: (JMenuItem, string?) -> (), --- `AbstractButton`'s class table: the base class. super: AbstractButtonClass, --- Whether `obj` is a `JMenuItem` object, a `class(JMenuItem)` subclass's included. isInstance: (any) -> boolean, } --- `JMenuItem`'s class table: `new`, the constructors and the static functions. declare JMenuItem: JMenuItemClass --- A menu of `JMenuItem`s shown over the side panel, clamped inside the sidebar window. export type JPopupMenu = JComponent & { --- Shows it at `(x, y)` in `invoker`'s coordinates: its --- `popupMenuWillBecomeVisible` listeners run inside the call, then it opens. The --- invoker keeps it alive while it may show. `invoker` must be showing. show: (JPopupMenu, Component?, number, number) -> (), --- Adds a `PopupMenuListener` (`popupMenuWillBecomeVisible`, --- `popupMenuWillBecomeInvisible`, `popupMenuCanceled`), the last added first. addPopupMenuListener: (JPopupMenu, any) -> (), --- Removes a `PopupMenuListener`, by identity. removePopupMenuListener: (JPopupMenu, any) -> (), } --- `JPopupMenu`'s class table: the metatable of its instances, which are tables a `class(JPopupMenu)` subclass may extend; its instance methods, `new`, `init` (the constructor, for `Sub.super.init(self, ...)`) and `super`. export type JPopupMenuClass = JPopupMenu & { --- An empty popup menu. new: () -> JPopupMenu, --- An empty popup menu. init: (JPopupMenu) -> (), --- `JComponent`'s class table: the base class. super: JComponentClass, --- Whether `obj` is a `JPopupMenu` object, a `class(JPopupMenu)` subclass's included. isInstance: (any) -> boolean, } --- `JPopupMenu`'s class table: `new`, the constructors and the static functions. declare JPopupMenu: JPopupMenuClass --- What a tooltip shows. No API hands one out; the class --- exists so the hierarchy names every kind. export type JToolTip = JComponent --- `JToolTip`'s class table: the metatable of its instances, which are tables a `class(JToolTip)` subclass may extend; its instance methods, `new`, `init` (the constructor, for `Sub.super.init(self, ...)`) and `super`. export type JToolTipClass = JToolTip & { --- The implicit no-argument constructor: the fresh state a node of this kind starts with, and nothing more. Construction runs it as every native base's `super()`; `new` does not take it. init: (JToolTip) -> (), --- `JComponent`'s class table: the base class. super: JComponentClass, --- Whether `obj` is a `JToolTip` object, a `class(JToolTip)` subclass's included. isInstance: (any) -> boolean, } --- `JToolTip`'s class table: `new`, the constructors and the static functions. declare JToolTip: JToolTipClass --- The base of the text components, editing one document through the native editor. Its --- document's listeners run synchronously inside `setText`, `insertString` and `remove`: --- they may not block on a dialog. export type JTextComponent = JComponent & { --- `(JTextComponent) -> string`: --- The whole text (`""` when empty). --- --- `(JTextComponent, number, number) -> string`: --- `length` characters (UTF-16 units) from `offset`; a range outside the text --- raises `BadLocationException`. getText: ((JTextComponent) -> string) & ((JTextComponent, number, number) -> string), --- Replaces the text: the old text's removal, then the new text's insertion, each --- heard by the document's listeners before this returns. `nil` or `""` empties it. setText: (JTextComponent, string?) -> (), --- Whether the user may edit the text. isEditable: (JTextComponent) -> boolean, --- Lets the user edit the text, or not (the look greys a read-only one's --- background). setEditable: (JTextComponent, boolean) -> (), --- Where the selection starts (the caret, without one). getSelectionStart: (JTextComponent) -> number, --- Where the selection ends (the caret, without one). getSelectionEnd: (JTextComponent) -> number, --- The selected text, or `nil` without a selection. getSelectedText: (JTextComponent) -> string?, --- Selects from `selectionStart` to `selectionEnd`, clamped to the text. select: (JTextComponent, number, number) -> (), --- Selects the whole text. selectAll: (JTextComponent) -> (), --- The caret's offset. getCaretPosition: (JTextComponent) -> number, --- Moves the caret (and empties the selection); outside the text raises --- `IllegalArgumentException: bad position`. setCaretPosition: (JTextComponent, number) -> (), --- Moves the caret, extending the selection from where it was set. moveCaretPosition: (JTextComponent, number) -> (), --- Replaces the selection with `content` (inserts it at the caret without one); --- nothing in a read-only component. replaceSelection: (JTextComponent, string?) -> (), --- The caret's colour; `nil` gives the look's back. setCaretColor: (JTextComponent, Color?) -> (), --- The selection's background; `nil` gives the look's back. setSelectionColor: (JTextComponent, Color?) -> (), --- The selected text's colour; `nil` gives the look's back. setSelectedTextColor: (JTextComponent, Color?) -> (), --- `setHighlighter(nil)` stops painting the selection; any highlighter paints it --- again. setHighlighter: (JTextComponent, any) -> (), --- The component's `Document`, the same one each call. getDocument: (JTextComponent) -> Document, } --- `JTextComponent`'s class table: the metatable of its instances, which are tables a `class(JTextComponent)` subclass may extend; its instance methods, `new`, `init` (the constructor, for `Sub.super.init(self, ...)`) and `super`. export type JTextComponentClass = JTextComponent & { --- The implicit no-argument constructor: the fresh state a node of this kind starts with, and nothing more. Construction runs it as every native base's `super()`; `new` does not take it. init: (JTextComponent) -> (), --- `JComponent`'s class table: the base class. super: JComponentClass, --- Whether `obj` is a `JTextComponent` object, a `class(JTextComponent)` subclass's included. isInstance: (any) -> boolean, } --- `JTextComponent`'s class table: `new`, the constructors and the static functions. declare JTextComponent: JTextComponentClass --- One line of text. Enter fires its `ActionListener`s. export type JTextField = JTextComponent & { --- Adds an `ActionListener` (a table with `actionPerformed`, or a function of the --- event): Enter in the field runs it, the last added first. addActionListener: (JTextField, any) -> (), --- Removes an `ActionListener`, by identity. removeActionListener: (JTextField, any) -> (), --- A copy of the `ActionListener`s, in registration order. getActionListeners: (JTextField) -> {any}, --- The command its `ActionEvent`s carry (the text, when none is set). setActionCommand: (JTextField, string?) -> (), --- The width in columns (0: as wide as the text). getColumns: (JTextField) -> number, --- Sets the width in columns; the field is laid out again. setColumns: (JTextField, number) -> (), --- The text's horizontal alignment. getHorizontalAlignment: (JTextField) -> number, --- Aligns the text (`JTextField.LEFT`, `CENTER`, `RIGHT`, `LEADING`, `TRAILING`). setHorizontalAlignment: (JTextField, number) -> (), } --- `JTextField`'s class table: the metatable of its instances, which are tables a `class(JTextField)` subclass may extend; its instance methods, `new`, `init` (the constructor, for `Sub.super.init(self, ...)`) and `super`. export type JTextFieldClass = JTextField & { --- `() -> JTextField`: --- An empty field. --- --- `(string?) -> JTextField`: --- A field showing `text`. --- --- `(number) -> JTextField`: --- An empty field `columns` wide. --- --- `(string?, number) -> JTextField`: --- A field showing `text`, `columns` wide. new: ((string?) -> JTextField) & ((number) -> JTextField) & ((string?, number) -> JTextField), --- `(JTextField) -> ()`: --- An empty field. --- --- `(JTextField, string?) -> ()`: --- A field showing `text`. --- --- `(JTextField, number) -> ()`: --- An empty field `columns` wide. --- --- `(JTextField, string?, number) -> ()`: --- A field showing `text`, `columns` wide. init: ((JTextField, string?) -> ()) & ((JTextField, number) -> ()) & ((JTextField, string?, number) -> ()), --- `JTextComponent`'s class table: the base class. super: JTextComponentClass, --- Whether `obj` is a `JTextField` object, a `class(JTextField)` subclass's included. isInstance: (any) -> boolean, } --- `JTextField`'s class table: `new`, the constructors and the static functions. declare JTextField: JTextFieldClass --- A field that shows its echo character. export type JPasswordField = JTextField --- `JPasswordField`'s class table: the metatable of its instances, which are tables a `class(JPasswordField)` subclass may extend; its instance methods, `new`, `init` (the constructor, for `Sub.super.init(self, ...)`) and `super`. export type JPasswordFieldClass = JPasswordField & { --- An empty password field. new: () -> JPasswordField, --- An empty password field. init: (JPasswordField) -> (), --- `JTextField`'s class table: the base class. super: JTextFieldClass, --- Whether `obj` is a `JPasswordField` object, a `class(JPasswordField)` subclass's included. isInstance: (any) -> boolean, } --- `JPasswordField`'s class table: `new`, the constructors and the static functions. declare JPasswordField: JPasswordFieldClass --- Several lines of text, wrapped as `setLineWrap` and --- `setWrapStyleWord` say. export type JTextArea = JTextComponent & { --- Whether long lines wrap. getLineWrap: (JTextArea) -> boolean, --- Wraps long lines, or not. setLineWrap: (JTextArea, boolean) -> (), --- Whether wrapping breaks at words. getWrapStyleWord: (JTextArea) -> boolean, --- Breaks wrapped lines at words (`true`) or anywhere (`false`). setWrapStyleWord: (JTextArea, boolean) -> (), --- The tab width in spaces. getTabSize: (JTextArea) -> number, --- Sets the tab width in spaces. setTabSize: (JTextArea, number) -> (), --- The rows it asks for (0: as many as the text has). getRows: (JTextArea) -> number, --- Sets the rows it asks for. setRows: (JTextArea, number) -> (), --- The columns it asks for (0: as wide as the text). getColumns: (JTextArea) -> number, --- Sets the columns it asks for. setColumns: (JTextArea, number) -> (), --- The number of lines (paragraphs, not wrapped rows). getLineCount: (JTextArea) -> number, --- Appends `str` to the text (an insertion at the end, heard by the document's --- listeners). append: (JTextArea, string?) -> (), } --- `JTextArea`'s class table: the metatable of its instances, which are tables a `class(JTextArea)` subclass may extend; its instance methods, `new`, `init` (the constructor, for `Sub.super.init(self, ...)`) and `super`. export type JTextAreaClass = JTextArea & { --- `() -> JTextArea`: --- An empty text area. --- --- `(string?) -> JTextArea`: --- A text area showing `text`. --- --- `(number, number) -> JTextArea`: --- An empty text area of `rows` and `columns` (its preferred size). --- --- `(string?, number, number) -> JTextArea`: --- A text area showing `text`, of `rows` and `columns`. new: ((string?) -> JTextArea) & ((number, number) -> JTextArea) & ((string?, number, number) -> JTextArea), --- `(JTextArea) -> ()`: --- An empty text area. --- --- `(JTextArea, string?) -> ()`: --- A text area showing `text`. --- --- `(JTextArea, number, number) -> ()`: --- An empty text area of `rows` and `columns` (its preferred size). --- --- `(JTextArea, string?, number, number) -> ()`: --- A text area showing `text`, of `rows` and `columns`. init: ((JTextArea, string?) -> ()) & ((JTextArea, number, number) -> ()) & ((JTextArea, string?, number, number) -> ()), --- `JTextComponent`'s class table: the base class. super: JTextComponentClass, --- Whether `obj` is a `JTextArea` object, a `class(JTextArea)` subclass's included. isInstance: (any) -> boolean, } --- `JTextArea`'s class table: `new`, the constructors and the static functions. declare JTextArea: JTextAreaClass --- The base of the Swing-only event objects, as a Swing listener reads them. export type SwingEvent = { --- The component the event is about, or `nil` when its source is not a component --- (a model) or was collected since. getSource: (SwingEvent) -> Component?, --- The event id (`FocusEvent.FOCUS_GAINED`, `ActionEvent.ACTION_PERFORMED`, ...). getID: (SwingEvent) -> number, } --- An action: a button pressed, Enter in a text field, a key binding's action, a --- timer firing. export type ActionEvent = SwingEvent & { --- The modifier keys held (`ActionEvent.SHIFT_MASK`, ...). getModifiers: (ActionEvent) -> number, --- When it happened, in milliseconds since the epoch. getWhen: (ActionEvent) -> number, } export type ActionEventClass = { --- `ActionEvent.ACTION_PERFORMED`: 1001. ACTION_PERFORMED: number, } --- `ActionEvent`'s static functions and constants. declare ActionEvent: ActionEventClass --- An item selected or deselected (a toggle button, a check box, a combo box's choice). export type ItemEvent = SwingEvent & { --- `ItemEvent.SELECTED` or `ItemEvent.DESELECTED`. getStateChange: (ItemEvent) -> number, } export type ItemEventClass = { --- `ItemEvent.SELECTED`: 1. SELECTED: number, --- `ItemEvent.DESELECTED`: 2. DESELECTED: number, --- `ItemEvent.ITEM_STATE_CHANGED`: 701. ITEM_STATE_CHANGED: number, } --- `ItemEvent`'s static functions and constants. declare ItemEvent: ItemEventClass --- A state changed (a button's model, a spinner's value, a scroll bar's model). export type ChangeEvent = SwingEvent --- A component was resized, moved, shown or hidden: what a `ComponentListener` hears, --- posted after the layout that caused it. export type ComponentEvent = SwingEvent & { --- The component, as `getSource()`. getComponent: (ComponentEvent) -> Component?, } export type ComponentEventClass = { --- `ComponentEvent.COMPONENT_MOVED`: 100. COMPONENT_MOVED: number, --- `ComponentEvent.COMPONENT_RESIZED`: 101. COMPONENT_RESIZED: number, --- `ComponentEvent.COMPONENT_SHOWN`: 102. COMPONENT_SHOWN: number, --- `ComponentEvent.COMPONENT_HIDDEN`: 103. COMPONENT_HIDDEN: number, } --- `ComponentEvent`'s static functions and constants. declare ComponentEvent: ComponentEventClass --- Focus gained or lost. export type FocusEvent = ComponentEvent & { --- Whether the change is temporary: focus went to another window and comes back --- with it. isTemporary: (FocusEvent) -> boolean, --- The other component in the change, or `nil` (another window, the game). getOppositeComponent: (FocusEvent) -> Component?, } export type FocusEventClass = { --- `FocusEvent.FOCUS_GAINED`: 1004. FOCUS_GAINED: number, --- `FocusEvent.FOCUS_LOST`: 1005. FOCUS_LOST: number, } --- `FocusEvent`'s static functions and constants. declare FocusEvent: FocusEventClass --- A document changed: an insertion or a removal. Its source is the --- text component whose document it is. export type DocumentEvent = SwingEvent & { --- Where the change starts, a UTF-16 offset. getOffset: (DocumentEvent) -> number, --- How many UTF-16 units changed. getLength: (DocumentEvent) -> number, } --- A list selection changed. export type ListSelectionEvent = SwingEvent & { --- The first row that may have changed. getFirstIndex: (ListSelectionEvent) -> number, --- The last row that may have changed. getLastIndex: (ListSelectionEvent) -> number, --- Whether more changes of the same gesture follow. getValueIsAdjusting: (ListSelectionEvent) -> boolean, } --- A popup menu is becoming visible or invisible, or was cancelled. export type PopupMenuEvent = SwingEvent --- One document edit (an insertion or a removal), as --- an `UndoableEditEvent` hands it. Give it to an `UndoManager`. export type UndoableEdit = { --- `"addition"` or `"deletion"`. getPresentationName: (UndoableEdit) -> string, --- `"Undo addition"`, `"Undo deletion"`. getUndoPresentationName: (UndoableEdit) -> string, --- `"Redo addition"`, `"Redo deletion"`. getRedoPresentationName: (UndoableEdit) -> string, } --- A document edit, as its --- `UndoableEditListener`s hear it (after its `DocumentListener`s). export type UndoableEditEvent = { --- The edit, for an `UndoManager`'s `addEdit`. getEdit: (UndoableEditEvent) -> UndoableEdit, } --- The edits a document made, undone and redone in --- order. Its limit is 100 edits until `setLimit`. export type UndoManager = { --- Adds `anEdit` after the done edits (the undone ones are dropped, then the list --- is trimmed to the limit). Always `true`. addEdit: (UndoManager, UndoableEdit) -> boolean, --- An `UndoableEditListener` that adds every edit it hears --- (`document:addUndoableEditListener(undoManager)`). undoableEditHappened: (UndoManager, UndoableEditEvent) -> (), --- Whether there is an edit to undo. canUndo: (UndoManager) -> boolean, --- Whether there is an edit to redo. canRedo: (UndoManager) -> boolean, --- Undoes the last done edit: its inverse applied to the document, heard by its --- `DocumentListener`s. Nothing to undo raises `CannotUndoException`. undo: (UndoManager) -> (), --- Redoes the last undone edit. Nothing to redo raises `CannotRedoException`. redo: (UndoManager) -> (), --- The most edits it keeps, as last set (100 until then); below 0, any number. getLimit: (UndoManager) -> number, --- Keeps at most `l` edits; below 0, any number. setLimit: (UndoManager, number) -> (), --- Forgets every edit. discardAllEdits: (UndoManager) -> (), --- `"Undo addition"`, ...; `"Undo"` with nothing to undo. getUndoPresentationName: (UndoManager) -> string, --- `"Redo addition"`, ...; `"Redo"` with nothing to redo. getRedoPresentationName: (UndoManager) -> string, } export type UndoManagerClass = { --- An empty manager. new: () -> UndoManager, } --- `UndoManager`'s static functions and constants. declare UndoManager: UndoManagerClass --- Transparent edges of fixed widths. `==` compares identity (the same object); its fields are read-only. `class(EmptyBorder)` makes a subclass. export type EmptyBorder = { --- `(EmptyBorder) -> Insets`: --- A new `Insets` of the four edges. --- --- `(EmptyBorder, Component) -> Insets`: --- A new `Insets` of the four edges, whatever the component. getBorderInsets: ((EmptyBorder) -> Insets) & ((EmptyBorder, Component) -> Insets), --- `false`: an empty border paints nothing. isBorderOpaque: (EmptyBorder) -> boolean, --- The top edge, read-only. top: number, --- The left edge, read-only. left: number, --- The bottom edge, read-only. bottom: number, --- The right edge, read-only. right: number, } export type EmptyBorderClass = { --- `(number, number, number, number) -> EmptyBorder`: --- A border of these edge widths (a fractional width is truncated, as the prelude's constructors take an `int`). --- --- `(Insets) -> EmptyBorder`: --- A border of `borderInsets`' four edges, read once: a later change to the `Insets` does not reach the border. new: ((number, number, number, number) -> EmptyBorder) & ((Insets) -> EmptyBorder), } --- `EmptyBorder`'s static functions and constants. declare EmptyBorder: EmptyBorderClass --- Five regions and their gaps. `==` compares identity (the same object). A setter changes every container using the layout at its next layout, invalidating nothing. `class(BorderLayout)` makes a subclass. export type BorderLayout = { --- The horizontal gap between the regions. getHgap: (BorderLayout) -> number, --- Sets the horizontal gap, for every container using the layout at its next layout. setHgap: (BorderLayout, number) -> (), --- The vertical gap between the regions. getVgap: (BorderLayout) -> number, --- Sets the vertical gap, for every container using the layout at its next layout. setVgap: (BorderLayout, number) -> (), --- The text `java.awt.BorderLayout[hgap=h,vgap=v]`. toString: (BorderLayout) -> string, } export type BorderLayoutClass = { --- The top region. NORTH: string, --- The bottom region. SOUTH: string, --- The right region. EAST: string, --- The left region. WEST: string, --- The middle region, which takes the space left. CENTER: string, --- `PAGE_START`'s older name. BEFORE_FIRST_LINE: string, --- `PAGE_END`'s older name. AFTER_LAST_LINE: string, --- `LINE_START`'s older name. BEFORE_LINE_BEGINS: string, --- `LINE_END`'s older name. AFTER_LINE_ENDS: string, --- Above everything else (left to right: the top). PAGE_START: string, --- Below everything else (left to right: the bottom). PAGE_END: string, --- Where lines begin (left to right: the left). LINE_START: string, --- Where lines end (left to right: the right). LINE_END: string, --- `() -> BorderLayout`: --- A layout with no gaps. --- --- `(number, number) -> BorderLayout`: --- A layout with these gaps between the regions (a fraction is truncated). new: (() -> BorderLayout) & ((number, number) -> BorderLayout), } --- `BorderLayout`'s static functions and constants. declare BorderLayout: BorderLayoutClass --- A `GridLayout` whose rows and columns each take their biggest component's size. `GridLayout.isInstance` answers `true` for one. `==` compares identity (the same object). export type DynamicGridLayout = { --- The rows (0: as many as needed). getRows: (DynamicGridLayout) -> number, --- Sets the rows; rows and columns both 0 raises `IllegalArgumentException`. setRows: (DynamicGridLayout, number) -> (), --- The columns (0: as many as needed). getColumns: (DynamicGridLayout) -> number, --- Sets the columns; rows and columns both 0 raises `IllegalArgumentException`. setColumns: (DynamicGridLayout, number) -> (), --- The gap between columns. getHgap: (DynamicGridLayout) -> number, --- Sets the gap between columns. setHgap: (DynamicGridLayout, number) -> (), --- The gap between rows. getVgap: (DynamicGridLayout) -> number, --- Sets the gap between rows. setVgap: (DynamicGridLayout, number) -> (), } export type DynamicGridLayoutClass = { --- `() -> DynamicGridLayout`: --- One row, a column a component. --- --- `(number, number) -> DynamicGridLayout`: --- `rows` by `cols` cells, each row and column as big as its biggest component (one of them 0: as many as needed). --- --- `(number, number, number, number) -> DynamicGridLayout`: --- As `new(rows, cols)`, with these gaps. new: (() -> DynamicGridLayout) & ((number, number) -> DynamicGridLayout) & ((number, number, number, number) -> DynamicGridLayout), } --- `DynamicGridLayout`'s static functions and constants. declare DynamicGridLayout: DynamicGridLayoutClass --- Components in rows, each at its preferred size. `==` compares identity (the same object). A setter changes every container using the layout at its next layout. `class(FlowLayout)` makes a subclass. export type FlowLayout = { --- The alignment (`LEFT`, `CENTER`, ...). getAlignment: (FlowLayout) -> number, --- Sets the alignment, for every container using the layout at its next layout. setAlignment: (FlowLayout, number) -> (), --- The gap between components and around the rows. getHgap: (FlowLayout) -> number, --- Sets the horizontal gap. setHgap: (FlowLayout, number) -> (), --- The gap between rows and around them. getVgap: (FlowLayout) -> number, --- Sets the vertical gap. setVgap: (FlowLayout, number) -> (), } export type FlowLayoutClass = { --- Rows start at the left. LEFT: number, --- Rows are centred. CENTER: number, --- Rows end at the right. RIGHT: number, --- Rows start where lines begin. LEADING: number, --- Rows end where lines end. TRAILING: number, --- `() -> FlowLayout`: --- Centred rows, gaps of 5. --- --- `(number) -> FlowLayout`: --- Rows aligned as `align`, gaps of 5. --- --- `(number, number, number) -> FlowLayout`: --- Rows aligned as `align`, with these gaps. new: (() -> FlowLayout) & ((number) -> FlowLayout) & ((number, number, number) -> FlowLayout), } --- `FlowLayout`'s static functions and constants. declare FlowLayout: FlowLayoutClass --- Equal cells in rows and columns. `==` compares identity (the same object). A setter changes every container using the layout at its next layout. `class(GridLayout)` makes a subclass. export type GridLayout = { --- The rows (0: as many as needed). getRows: (GridLayout) -> number, --- Sets the rows; rows and columns both 0 raises `IllegalArgumentException`. setRows: (GridLayout, number) -> (), --- The columns (0: as many as needed). getColumns: (GridLayout) -> number, --- Sets the columns; rows and columns both 0 raises `IllegalArgumentException`. setColumns: (GridLayout, number) -> (), --- The gap between columns. getHgap: (GridLayout) -> number, --- Sets the gap between columns. setHgap: (GridLayout, number) -> (), --- The gap between rows. getVgap: (GridLayout) -> number, --- Sets the gap between rows. setVgap: (GridLayout, number) -> (), } export type GridLayoutClass = { --- `() -> GridLayout`: --- One row, a column a component. --- --- `(number, number) -> GridLayout`: --- `rows` by `cols` equal cells (one of them 0: as many as needed; both 0 raises `IllegalArgumentException`). --- --- `(number, number, number, number) -> GridLayout`: --- As `new(rows, cols)`, with these gaps. new: (() -> GridLayout) & ((number, number) -> GridLayout) & ((number, number, number, number) -> GridLayout), } --- `GridLayout`'s static functions and constants. declare GridLayout: GridLayoutClass --- One component shown at a time, chosen by name or in order. `==` compares identity (the same object). `class(CardLayout)` makes a subclass. export type CardLayout = { --- The gap at the card's left and right. getHgap: (CardLayout) -> number, --- Sets the horizontal gap. setHgap: (CardLayout, number) -> (), --- The gap above and below the card. getVgap: (CardLayout) -> number, --- Sets the vertical gap. setVgap: (CardLayout, number) -> (), --- Shows the card added under `name`, and validates `parent`; a name no card has changes nothing. A `parent` whose layout is not this one raises `IllegalArgumentException`. show: (CardLayout, Container, string) -> (), --- Shows the first card. first: (CardLayout, Container) -> (), --- Shows the next card, the first after the last. next: (CardLayout, Container) -> (), --- Shows the previous card, the last before the first. previous: (CardLayout, Container) -> (), --- Shows the last card. last: (CardLayout, Container) -> (), } export type CardLayoutClass = { --- `() -> CardLayout`: --- A layout with no gaps. --- --- `(number, number) -> CardLayout`: --- A layout with these gaps around the card. new: (() -> CardLayout) & ((number, number) -> CardLayout), } --- `CardLayout`'s static functions and constants. declare CardLayout: CardLayoutClass --- An `Icon` showing an image. It shows the image's pixels as --- they are when painted, so drawing into the `BufferedImage` later updates it. export type ImageIcon = { --- The image, or `nil` for an empty icon. getImage: (ImageIcon) -> Image?, --- The width: the image's, or -1 without one. getIconWidth: (ImageIcon) -> number, --- The height: the image's, or -1 without one. getIconHeight: (ImageIcon) -> number, } export type ImageIconClass = { --- `() -> ImageIcon`: --- An icon with no image (0 by 0). --- --- `(Image) -> ImageIcon`: --- An icon showing `image`. new: (() -> ImageIcon) & ((Image) -> ImageIcon), } --- `ImageIcon`'s static functions and constants. declare ImageIcon: ImageIconClass --- A `JLabel` whose plain text is drawn over a shadow, in the shadow colour (black) offset --- by the shadow size (one pixel right and down). HTML text has no shadow. export type JShadowedLabel = JLabel & { --- The shadow's colour (`Color.BLACK` unless set). getShadow: (JShadowedLabel) -> Color, --- Sets the shadow's colour and repaints. setShadow: (JShadowedLabel, Color) -> (), --- The shadow's offset from the text, as a new `Point` (1, 1 unless set). getShadowSize: (JShadowedLabel) -> Point, --- Sets the shadow's offset from the text; lays the label out again and repaints. setShadowSize: (JShadowedLabel, Point) -> (), } --- `JShadowedLabel`'s class table: the metatable of its instances, which are tables a `class(JShadowedLabel)` subclass may extend; its instance methods, `new`, `init` (the constructor, for `Sub.super.init(self, ...)`) and `super`. export type JShadowedLabelClass = JShadowedLabel & { --- `() -> JShadowedLabel`: --- An empty shadowed label: its text is the empty string. --- --- `(string?) -> JShadowedLabel`: --- A shadowed label showing `text`. new: (string?) -> JShadowedLabel, --- `(JShadowedLabel) -> ()`: --- An empty shadowed label: its text is the empty string. --- --- `(JShadowedLabel, string?) -> ()`: --- A shadowed label showing `text`. init: (JShadowedLabel, string?) -> (), --- `JLabel`'s class table: the base class. super: JLabelClass, --- Whether `obj` is a `JShadowedLabel` object, a `class(JShadowedLabel)` subclass's included. isInstance: (any) -> boolean, } --- `JShadowedLabel`'s class table: `new`, the constructors and the static functions. declare JShadowedLabel: JShadowedLabelClass --- A panel that can be dimmed, which darkens its colours --- (each `Color.darker()`) and restores them when undimmed. The getters answer the --- colour shown, dimmed or not; a fresh panel's are `nil` until set. export type DimmableJPanel = JPanel & { --- Whether the panel is dimmed. isDimmed: (DimmableJPanel) -> boolean, --- Dims the panel (its colours darker) or restores the colours it had. setDimmed: (DimmableJPanel, boolean) -> (), } --- `DimmableJPanel`'s class table: the metatable of its instances, which are tables a `class(DimmableJPanel)` subclass may extend; its instance methods, `new`, `init` (the constructor, for `Sub.super.init(self, ...)`) and `super`. export type DimmableJPanelClass = DimmableJPanel & { --- A panel, not dimmed, with a `FlowLayout`. new: () -> DimmableJPanel, --- A panel, not dimmed, with a `FlowLayout`. init: (DimmableJPanel) -> (), --- `JPanel`'s class table: the base class. super: JPanelClass, --- Whether `obj` is a `DimmableJPanel` object, a `class(DimmableJPanel)` subclass's included. isInstance: (any) -> boolean, } --- `DimmableJPanel`'s class table: `new`, the constructors and the static functions. declare DimmableJPanel: DimmableJPanelClass --- A dimmable bar, 100x16 by default, filled in the foreground --- colour to its percentage with a mark at each position past it, and three labels --- (left, centre, right) drawn over it in RuneScape Small. export type ProgressBar = DimmableJPanel & { --- Sets the left label's text. setLeftLabel: (ProgressBar, string?) -> (), --- Sets the right label's text. setRightLabel: (ProgressBar, string?) -> (), --- Sets the centre label's text, shown unless the bar is dimmed. setCenterLabel: (ProgressBar, string?) -> (), --- Sets the text the centre label shows while the bar is dimmed. setDimmedText: (ProgressBar, string?) -> (), --- The value as a whole percentage of the maximum (`value * 100 / maximum`, in 32-bit --- integers, truncated); 0 when the maximum is 0. getPercentage: (ProgressBar) -> number, --- Sets the maximum and repaints. setMaximumValue: (ProgressBar, number) -> (), --- Sets the value and repaints. setValue: (ProgressBar, number) -> (), --- Sets the positions (values on the maximum's scale) marked past the bar, and --- repaints. The list is copied. setPositions: (ProgressBar, {number}?) -> (), } --- `ProgressBar`'s class table: the metatable of its instances, which are tables a `class(ProgressBar)` subclass may extend; its instance methods, `new`, `init` (the constructor, for `Sub.super.init(self, ...)`) and `super`. export type ProgressBarClass = ProgressBar & { --- A green bar (`Color.GREEN.darker()` behind `Color.GREEN.brighter()`), empty. new: () -> ProgressBar, --- A green bar (`Color.GREEN.darker()` behind `Color.GREEN.brighter()`), empty. init: (ProgressBar) -> (), --- `DimmableJPanel`'s class table: the base class. super: DimmableJPanelClass, --- Whether `obj` is a `ProgressBar` object, a `class(ProgressBar)` subclass's included. isInstance: (any) -> boolean, } --- `ProgressBar`'s class table: `new`, the constructors and the static functions. declare ProgressBar: ProgressBarClass --- A 4-pixel bar, filled in the foreground colour to the --- value's share of its width, the rest in the foreground's darker darker colour. export type ThinProgressBar = JPanel & { --- The maximum (at least 1). getMaximumValue: (ThinProgressBar) -> number, --- The value. getValue: (ThinProgressBar) -> number, --- The value as a whole percentage of the maximum (`value * 100 / maximum`, in 32-bit --- integers, truncated), as a number. getPercentage: (ThinProgressBar) -> number, --- Sets the maximum (below 1 is 1) and repaints. setMaximumValue: (ThinProgressBar, number) -> (), --- Sets the value and repaints. setValue: (ThinProgressBar, number) -> (), } --- `ThinProgressBar`'s class table: the metatable of its instances, which are tables a `class(ThinProgressBar)` subclass may extend; its instance methods, `new`, `init` (the constructor, for `Sub.super.init(self, ...)`) and `super`. export type ThinProgressBarClass = ThinProgressBar & { --- A green bar, maximum 1, value 0. new: () -> ThinProgressBar, --- A green bar, maximum 1, value 0. init: (ThinProgressBar) -> (), --- `JPanel`'s class table: the base class. super: JPanelClass, --- Whether `obj` is a `ThinProgressBar` object, a `class(ThinProgressBar)` subclass's included. isInstance: (any) -> boolean, } --- `ThinProgressBar`'s class table: `new`, the constructors and the static functions. declare ThinProgressBar: ThinProgressBarClass --- A button whose background is a colour swatch (over a --- checkerboard when translucent), its text black or white for contrast. export type ColorJButton = JButton & { --- The swatch colour. getColor: (ColorJButton) -> Color?, --- Sets the swatch colour and the text colour that reads on it. Raises for `nil`. setColor: (ColorJButton, Color?) -> (), } --- `ColorJButton`'s class table: the metatable of its instances, which are tables a `class(ColorJButton)` subclass may extend; its instance methods, `new`, `init` (the constructor, for `Sub.super.init(self, ...)`) and `super`. export type ColorJButtonClass = ColorJButton & { --- A swatch button showing `text` in `color`. new: (string?, Color?) -> ColorJButton, --- A swatch button showing `text` in `color`. init: (ColorJButton, string?, Color?) -> (), --- `JButton`'s class table: the base class. super: JButtonClass, --- Whether `obj` is a `ColorJButton` object, a `class(ColorJButton)` subclass's included. isInstance: (any) -> boolean, } --- `ColorJButton`'s class table: `new`, the constructors and the static functions. declare ColorJButton: ColorJButtonClass --- A layered pane whose children, laid out top to --- bottom, are reordered by dragging them with the left button. `addDragListener`'s --- listeners hear of each child dropped. export type DragAndDropReorderPane = JLayeredPane & { --- A `DragListener` (a function of the dropped component, or a table with `onDrag`) told after each drop. addDragListener: (DragAndDropReorderPane, any) -> (), } --- `DragAndDropReorderPane`'s class table: the metatable of its instances, which are tables a `class(DragAndDropReorderPane)` subclass may extend; its instance methods, `new`, `init` (the constructor, for `Sub.super.init(self, ...)`) and `super`. export type DragAndDropReorderPaneClass = DragAndDropReorderPane & { --- An empty pane. new: () -> DragAndDropReorderPane, --- An empty pane. init: (DragAndDropReorderPane) -> (), --- `JLayeredPane`'s class table: the base class. super: JLayeredPaneClass, --- Whether `obj` is a `DragAndDropReorderPane` object, a `class(DragAndDropReorderPane)` subclass's included. isInstance: (any) -> boolean, } --- `DragAndDropReorderPane`'s class table: `new`, the constructors and the static functions. declare DragAndDropReorderPane: DragAndDropReorderPaneClass --- Rows a renderer paints, one stamp a cell, and a --- selection the mouse and the keys change. Its model is a `DefaultListModel` or a --- plugin's own `AbstractListModel` subclass (`getSize`, `getElementAt`). export type JList = JComponent & { --- The first selected row, or -1. getSelectedIndex: (JList) -> number, --- Selects that row alone; a row at or past the model's size, or -1, does nothing. --- Below -1 raises. setSelectedIndex: (JList, number) -> (), --- The selected rows, in increasing order (0-based). getSelectedIndices: (JList) -> {number}, --- Selects these rows (those at or past the model's size are ignored). setSelectedIndices: (JList, {number}) -> (), --- Whether `index` is selected. isSelectedIndex: (JList, number) -> boolean, --- Whether nothing is selected. isSelectionEmpty: (JList) -> boolean, --- Selects nothing; the lead and anchor stay. clearSelection: (JList) -> (), --- The smallest selected row, or -1. getMinSelectionIndex: (JList) -> number, --- The largest selected row, or -1. getMaxSelectionIndex: (JList) -> number, --- The row the last selection change ended at, or -1. getLeadSelectionIndex: (JList) -> number, --- The row the last selection change started from, or -1. getAnchorSelectionIndex: (JList) -> number, --- Selects the rows `index0` to `index1` (only `index1` in `SINGLE_SELECTION`). setSelectionInterval: (JList, number, number) -> (), --- Adds the rows `index0` to `index1` to the selection. addSelectionInterval: (JList, number, number) -> (), --- Removes the rows `index0` to `index1` from the selection. removeSelectionInterval: (JList, number, number) -> (), --- `ListSelectionModel.SINGLE_SELECTION` (0), `SINGLE_INTERVAL_SELECTION` (1) or --- `MULTIPLE_INTERVAL_SELECTION` (2, a new list's); any other raises. setSelectionMode: (JList, number) -> (), --- The selection mode. getSelectionMode: (JList) -> number, --- Starts (`true`) or ends (`false`) one gesture of selection changes: its events say --- they are adjusting, and the end fires once more over every row it changed. setValueIsAdjusting: (JList, boolean) -> (), --- Whether a gesture is in progress. getValueIsAdjusting: (JList) -> boolean, --- Every cell this tall (-1: each row's renderer decides). setFixedCellHeight: (JList, number) -> (), --- The fixed cell height, or -1. getFixedCellHeight: (JList) -> number, --- Every cell this wide (-1: the widest row's renderer decides). setFixedCellWidth: (JList, number) -> (), --- The fixed cell width, or -1. getFixedCellWidth: (JList) -> number, --- `JList.VERTICAL` (0), `VERTICAL_WRAP` (1) or `HORIZONTAL_WRAP` (2); any other --- raises. The wrapping orientations lay out as `VERTICAL` in Bento. setLayoutOrientation: (JList, number) -> (), --- The orientation. getLayoutOrientation: (JList) -> number, --- How many rows a scroll pane shows of it by default (8). setVisibleRowCount: (JList, number) -> (), --- The visible row count. getVisibleRowCount: (JList) -> number, --- The row closest to `location` (in the list's coordinates), or -1 when the model is --- empty; compare with `getCellBounds` to know whether the row holds it. locationToIndex: (JList, Point) -> number, --- The origin of row `index`'s cell, or `nil` outside the model. indexToLocation: (JList, number) -> Point?, --- The bounds of the cells of rows `index0` to `index1` (their union), or `nil` when --- either row is outside the model. getCellBounds: (JList, number, number) -> Rectangle?, --- Scrolls the enclosing scroll pane so row `index`'s cell shows. ensureIndexIsVisible: (JList, number) -> (), --- The first row showing, or -1. getFirstVisibleIndex: (JList) -> number, --- The last row showing, or -1. getLastVisibleIndex: (JList) -> number, --- Paints each cell with `cellRenderer` (a `ListCellRenderer`: a table with --- `getListCellRendererComponent(list, value, index, isSelected, cellHasFocus)`, or --- that function), asked again when the list repaints or measures its cells, never per --- frame; `nil` is the default renderer (a label of the value's text). setCellRenderer: (JList, any) -> (), --- The renderer `setCellRenderer` was given, or `nil` for the default one. getCellRenderer: (JList) -> ListCellRenderer?, --- Adds a `ListSelectionListener` (a table with `valueChanged`, or that function): it --- hears each selection change, the last added first; its events' source is the list. addListSelectionListener: (JList, any) -> (), --- Removes a `ListSelectionListener`, by identity. removeListSelectionListener: (JList, any) -> (), --- The `ListSelectionListener`s, in registration order. getListSelectionListeners: (JList) -> {any}, --- The model given, or `JList()`'s empty one. getModel: (JList) -> any, --- The model's element at the first selected row, or `nil`. getSelectedValue: (JList) -> any, --- Shows `model` and clears the selection; `nil` raises. setModel: (JList, any) -> (), } --- `JList`'s class table: the metatable of its instances, which are tables a `class(JList)` subclass may extend; its instance methods, `new`, `init` (the constructor, for `Sub.super.init(self, ...)`) and `super`. export type JListClass = JList & { --- `JList.VERTICAL`: the vertical orientation, one column of rows (0). VERTICAL: number, --- `JList.VERTICAL_WRAP` (1): laid out as `VERTICAL`. VERTICAL_WRAP: number, --- `JList.HORIZONTAL_WRAP` (2): laid out as `VERTICAL`. HORIZONTAL_WRAP: number, --- `() -> JList`: --- An empty list (its model `getModel()` answers, empty and read-only). --- --- `(any) -> JList`: --- A list showing `dataModel`: a `DefaultListModel`, or a plugin's model (an --- `AbstractListModel` subclass with `getSize` and `getElementAt`). `nil` is refused. new: (any) -> JList, --- `(JList) -> ()`: --- An empty list (its model `getModel()` answers, empty and read-only). --- --- `(JList, any) -> ()`: --- A list showing `dataModel`: a `DefaultListModel`, or a plugin's model (an --- `AbstractListModel` subclass with `getSize` and `getElementAt`). `nil` is refused. init: (JList, any) -> (), --- `JComponent`'s class table: the base class. super: JComponentClass, --- Whether `obj` is a `JList` object, a `class(JList)` subclass's included. isInstance: (any) -> boolean, } --- `JList`'s class table: `new`, the constructors and the static functions. declare JList: JListClass --- A selected item shown in a box, and a popup list to choose another from. Its model is --- a `DefaultComboBoxModel` (built from the constructor's items) or a plugin's own. export type JComboBox = JComponent & { --- How many rows the popup shows before it scrolls (the look's 15 until set). getMaximumRowCount: (JComboBox) -> number, --- Sets how many rows the popup shows before it scrolls. setMaximumRowCount: (JComboBox, number) -> (), --- Whether the popup is open. isPopupVisible: (JComboBox) -> boolean, --- Opens or closes the popup (it opens only while the box is showing and has rows). setPopupVisible: (JComboBox, boolean) -> (), --- Opens the popup. showPopup: (JComboBox) -> (), --- Closes the popup. hidePopup: (JComboBox) -> (), --- Adds an `ActionListener` (a table with `actionPerformed`, or that function): it --- hears every `setSelectedItem` and every choice, the last added first; the command --- is `"comboBoxChanged"`. addActionListener: (JComboBox, any) -> (), --- Removes an `ActionListener`, by identity. removeActionListener: (JComboBox, any) -> (), --- The `ActionListener`s, in registration order. getActionListeners: (JComboBox) -> {any}, --- Adds an `ItemListener` (a table with `itemStateChanged`, or that function): when --- the selected item changes it hears the old one `DESELECTED`, then the new one --- `SELECTED`, the last added first. addItemListener: (JComboBox, any) -> (), --- Removes an `ItemListener`, by identity. removeItemListener: (JComboBox, any) -> (), --- The `ItemListener`s, in registration order. getItemListeners: (JComboBox) -> {any}, --- Appends to the model (a `MutableComboBoxModel`). addItem: (JComboBox, any) -> (), --- The row's item, `nil` outside the rows. getItemAt: (JComboBox, number) -> any, --- How many rows. getItemCount: (JComboBox) -> number, --- The model's selected item. getSelectedItem: (JComboBox) -> any, --- Empties the model. removeAllItems: (JComboBox) -> (), --- Shows `model`; `nil` raises. setModel: (JComboBox, any) -> (), --- A `ListCellRenderer` for the box's value (index -1) and the popup's rows; `nil` restores the default. setRenderer: (JComboBox, ListCellRenderer) -> (), --- `o` becomes the selected item when it is one of the rows (or `nil`); the action fires either way. setSelectedItem: (JComboBox, any) -> (), } --- `JComboBox`'s class table: the metatable of its instances, which are tables a `class(JComboBox)` subclass may extend; its instance methods, `new`, `init` (the constructor, for `Sub.super.init(self, ...)`) and `super`. export type JComboBoxClass = JComboBox & { --- `() -> JComboBox`: --- An empty combo box (its model an empty `DefaultComboBoxModel`). --- --- `({ n: number, [number]: any? }) -> JComboBox`: --- A combo box over `items` (an array, its first element selected), or over a --- `ComboBoxModel` given in its place (a table with `getSize`, `getElementAt`, --- `getSelectedItem` and `setSelectedItem`, as `new JComboBox(model)` takes it). new: (() -> JComboBox) & (({ n: number, [number]: any? }) -> JComboBox), --- `(JComboBox) -> ()`: --- An empty combo box (its model an empty `DefaultComboBoxModel`). --- --- `(JComboBox, { n: number, [number]: any? }) -> ()`: --- A combo box over `items` (an array, its first element selected), or over a --- `ComboBoxModel` given in its place (a table with `getSize`, `getElementAt`, --- `getSelectedItem` and `setSelectedItem`, as `new JComboBox(model)` takes it). init: ((JComboBox) -> ()) & ((JComboBox, { n: number, [number]: any? }) -> ()), --- `JComponent`'s class table: the base class. super: JComponentClass, --- Whether `obj` is a `JComboBox` object, a `class(JComboBox)` subclass's included. isInstance: (any) -> boolean, } --- `JComboBox`'s class table: `new`, the constructors and the static functions. declare JComboBox: JComboBoxClass --- Text shown as its content type says, HTML (`text/html`, the subset `JLabel` shows) or --- plain (`text/plain`, the default). A pane that is --- not editable fires `HyperlinkEvent`s for its HTML's links. export type JEditorPane = JTextComponent & { --- Shows the text as `type` from now on (`"text/html"` or `"text/plain"`); the --- document is a new empty one. setContentType: (JEditorPane, string) -> (), --- The content type (`"text/plain"` until set). getContentType: (JEditorPane) -> string, --- Adds a `HyperlinkListener` (a table with `hyperlinkUpdate`, or that function): it --- hears `ENTERED`, `EXITED` and `ACTIVATED` for the links of a pane showing HTML that --- is not editable, the last added first. addHyperlinkListener: (JEditorPane, any) -> (), --- Removes a `HyperlinkListener`, by identity. removeHyperlinkListener: (JEditorPane, any) -> (), --- The `HyperlinkListener`s, in registration order. getHyperlinkListeners: (JEditorPane) -> {any}, --- The pane's kit for `type`, one per type (`text/html` an `HTMLEditorKit` whose style sheet styles this pane). getEditorKitForContentType: (JEditorPane, string) -> any, } --- `JEditorPane`'s class table: the metatable of its instances, which are tables a `class(JEditorPane)` subclass may extend; its instance methods, `new`, `init` (the constructor, for `Sub.super.init(self, ...)`) and `super`. export type JEditorPaneClass = JEditorPane & { --- An empty editor pane (`text/plain`). new: () -> JEditorPane, --- An empty editor pane (`text/plain`). init: (JEditorPane) -> (), --- `JTextComponent`'s class table: the base class. super: JTextComponentClass, --- Whether `obj` is a `JEditorPane` object, a `class(JEditorPane)` subclass's included. isInstance: (any) -> boolean, } --- `JEditorPane`'s class table: `new`, the constructors and the static functions. declare JEditorPane: JEditorPaneClass --- A field with a value, shown and parsed by a --- formatter. The value, the formatter factory and the formatter are the --- prelude's (`getValue`, `setValue`, `commitEdit`, `getFormatter`, --- `getFormatterFactory`, `setFormatterFactory`); `Enter` and a focus loss commit the edit --- through them. export type JFormattedTextField = JTextField & { --- The formatter its factory gives it now. getFormatter: (JFormattedTextField) -> any, --- Its formatter factory. getFormatterFactory: (JFormattedTextField) -> any, --- Sets the factory; its formatter shows the value. setFormatterFactory: (JFormattedTextField, any) -> (), --- The value, shown through the formatter (a factory for its type is made when the field has none). setValue: (JFormattedTextField, any) -> (), } --- `JFormattedTextField`'s class table: the metatable of its instances, which are tables a `class(JFormattedTextField)` subclass may extend; its instance methods, `new`, `init` (the constructor, for `Sub.super.init(self, ...)`) and `super`. export type JFormattedTextFieldClass = JFormattedTextField & { --- `JFormattedTextField.COMMIT`: a focus loss commits a valid edit and keeps an --- invalid one (0). COMMIT: number, --- `JFormattedTextField.COMMIT_OR_REVERT`: a focus loss commits a valid edit and --- reverts an invalid one (1, the default). COMMIT_OR_REVERT: number, --- `JFormattedTextField.REVERT`: a focus loss reverts the edit (2). REVERT: number, --- `JFormattedTextField.PERSIST`: a focus loss keeps the edit as it is (3). PERSIST: number, --- An empty formatted field (no value, no formatter until `setValue` or --- `setFormatterFactory`). new: () -> JFormattedTextField, --- `JFormattedTextField.AbstractFormatter`: the nested class's table (the Swing prelude's). AbstractFormatter: JFormattedTextFieldAbstractFormatterClass, --- `JFormattedTextField.AbstractFormatterFactory`: the nested class's table (the Swing prelude's). AbstractFormatterFactory: JFormattedTextFieldAbstractFormatterFactoryClass, --- An empty formatted field (no value, no formatter until `setValue` or --- `setFormatterFactory`). init: (JFormattedTextField) -> (), --- `JTextField`'s class table: the base class. super: JTextFieldClass, --- Whether `obj` is a `JFormattedTextField` object, a `class(JFormattedTextField)` subclass's included. isInstance: (any) -> boolean, } --- `JFormattedTextField`'s class table: `new`, the constructors and the static functions. declare JFormattedTextField: JFormattedTextFieldClass --- A value its arrows and `Up`/`Down` step --- through its model (a `SpinnerNumberModel`, or a plugin's `SpinnerModel`), shown in its --- editor's formatted field. export type JSpinner = JComponent & { --- The editor: a `JSpinner.DefaultEditor` holding the formatted field --- (`getEditor():getTextField()`). getEditor: (JSpinner) -> Component?, --- Adds a `ChangeListener` (a table with `stateChanged`, or that function): it hears --- each change of the value, the last added first; its events' source is the spinner. addChangeListener: (JSpinner, any) -> (), --- Removes a `ChangeListener`, by identity. removeChangeListener: (JSpinner, any) -> (), --- The `ChangeListener`s, in registration order. getChangeListeners: (JSpinner) -> {any}, --- The model. getModel: (JSpinner) -> SpinnerModel, --- The model's value; a subclass's override is what the field shows. getValue: (JSpinner) -> any, --- The model's value; a change fires the spinner's `ChangeEvent`. setValue: (JSpinner, any) -> (), } --- `JSpinner`'s class table: the metatable of its instances, which are tables a `class(JSpinner)` subclass may extend; its instance methods, `new`, `init` (the constructor, for `Sub.super.init(self, ...)`) and `super`. export type JSpinnerClass = JSpinner & { --- `() -> JSpinner`: --- A spinner over a new `SpinnerNumberModel()`: 0, no bounds, a step of 1. --- --- `(any) -> JSpinner`: --- A spinner over `model`: its arrow buttons, and its editor's field showing the --- model's value. `nil` is refused. new: (any) -> JSpinner, --- `(JSpinner) -> ()`: --- A spinner over a new `SpinnerNumberModel()`: 0, no bounds, a step of 1. --- --- `(JSpinner, any) -> ()`: --- A spinner over `model`: its arrow buttons, and its editor's field showing the --- model's value. `nil` is refused. init: (JSpinner, any) -> (), --- `JComponent`'s class table: the base class. super: JComponentClass, --- Whether `obj` is a `JSpinner` object, a `class(JSpinner)` subclass's included. isInstance: (any) -> boolean, --- `JSpinner.DefaultEditor`: the nested class `JSpinnerDefaultEditor`. DefaultEditor: JSpinnerDefaultEditorClass, } --- `JSpinner`'s class table: `new`, the constructors and the static functions. declare JSpinner: JSpinnerClass --- A spinner's editor, a panel holding its formatted text field, reached as --- `JSpinnerDefaultEditor` and as `JSpinner.DefaultEditor`. export type JSpinnerDefaultEditor = JPanel & { --- The formatted field it shows the value in. getTextField: (JSpinnerDefaultEditor) -> Component?, --- The spinner it edits, or `nil`. getSpinner: (JSpinnerDefaultEditor) -> Component?, } --- `JSpinnerDefaultEditor`'s class table: the metatable of its instances, which are tables a `class(JSpinnerDefaultEditor)` subclass may extend; its instance methods, `new`, `init` (the constructor, for `Sub.super.init(self, ...)`) and `super`. export type JSpinnerDefaultEditorClass = JSpinnerDefaultEditor & { --- The implicit no-argument constructor: the fresh state a node of this kind starts with, and nothing more. Construction runs it as every native base's `super()`; `new` does not take it. init: (JSpinnerDefaultEditor) -> (), --- `JPanel`'s class table: the base class. super: JPanelClass, --- Whether `obj` is a `JSpinnerDefaultEditor` object, a `class(JSpinnerDefaultEditor)` subclass's included. isInstance: (any) -> boolean, } --- `JSpinnerDefaultEditor`'s class table: `new`, the constructors and the static functions. declare JSpinnerDefaultEditor: JSpinnerDefaultEditorClass --- A top-level window, a surface of its own shown as an OS window: `JFrame` and `JDialog`. --- Its size is its OS window's, decorations included; its content pane lies inside its --- insets, the decorations. The name `Window` is the immediate-mode `renderWindows` window --- handle. export type AwtWindow = Container & { --- Sizes the window to fit its content (its preferred size, enlarged to the minimum --- size set), making it and its owner displayable first, then lays it out. pack: (AwtWindow) -> (), --- Releases the window and the windows it owns: hidden and undisplayable, with --- `WINDOW_CLOSED` to its listeners. Its state is kept: `pack` or `setVisible(true)` --- shows it again. dispose: (AwtWindow) -> (), --- Brings a showing window to the front and asks for focus. toFront: (AwtWindow) -> (), --- Keeps the window above other windows, or not. setAlwaysOnTop: (AwtWindow, boolean) -> (), --- Whether the window stays above other windows. isAlwaysOnTop: (AwtWindow) -> boolean, --- Places the window: centred on `c` when it shows, else on the screen's centre, kept --- on screen. Only moves it: called before `pack`, it centres the window's top-left. setLocationRelativeTo: (AwtWindow, Component?) -> (), --- Adds a `WindowListener` (a `WindowAdapter` subclass, or any table with the methods --- it needs): it hears the window opened, closing, closed, iconified, deiconified, --- activated and deactivated, in registration order. addWindowListener: (AwtWindow, any) -> (), --- Removes a `WindowListener`, by identity. removeWindowListener: (AwtWindow, any) -> (), --- A copy of the `WindowListener`s, in registration order. getWindowListeners: (AwtWindow) -> {any}, --- Whether the window's OS window is the active one. isActive: (AwtWindow) -> boolean, --- Whether the window is the focused window (as `isActive()`). isFocused: (AwtWindow) -> boolean, --- The component that has focus in the window while it is focused, else `nil`. getFocusOwner: (AwtWindow) -> Component?, --- The component that gets focus when the window is focused again: the focus owner, --- or the last one. getMostRecentFocusOwner: (AwtWindow) -> Component?, --- The window this one belongs to (a dialog's frame), or `nil`. getOwner: (AwtWindow) -> AwtWindow?, --- Sets the images the window's icon is chosen from, as a copy of `icons`: --- `getIconImages()` answers them in order, and a later change to `icons` is not seen. --- `nil` or `{}` restores the default icon. Bento's OS windows keep the host's icon --- whatever is set. setIconImages: (AwtWindow, {Image}?) -> (), --- A new array of the images `setIconImages` was given, in order; empty before, and --- after `nil` or `{}`. A dialog does not answer its owner's. getIconImages: (AwtWindow) -> {Image}, } --- `AwtWindow`'s class table: the metatable of its instances, which are tables a `class(AwtWindow)` subclass may extend; its instance methods, `new`, `init` (the constructor, for `Sub.super.init(self, ...)`) and `super`. export type AwtWindowClass = AwtWindow & { --- The implicit no-argument constructor: the fresh state a node of this kind starts with, and nothing more. Construction runs it as every native base's `super()`; `new` does not take it. init: (AwtWindow) -> (), --- `Container`'s class table: the base class. super: ContainerClass, --- Whether `obj` is a `AwtWindow` object, a `class(AwtWindow)` subclass's included. isInstance: (any) -> boolean, } --- `AwtWindow`'s class table: `new`, the constructors and the static functions. declare AwtWindow: AwtWindowClass --- A window with a title bar, resizable, that can be maximized and --- iconified. Abstract here: a plugin makes a `JFrame`. export type Frame = AwtWindow & { --- The title: exactly what the plugin set (`""` until then). getTitle: (Frame) -> string, --- Sets the title the OS window shows, exactly as given (`nil`: empty). setTitle: (Frame, string?) -> (), --- Whether the user may resize the window. isResizable: (Frame) -> boolean, --- Lets the user resize the window, or not. setResizable: (Frame, boolean) -> (), --- The window's state: `NORMAL`, or `ICONIFIED` and the `MAXIMIZED_*` bits. getExtendedState: (Frame) -> number, --- Maximizes, iconifies or restores the OS window (`Frame.MAXIMIZED_BOTH`, ...). On a --- showing frame its `WindowListener`s hear `windowIconified` or `windowDeiconified`; --- a frame not showing only keeps the state; `MAXIMIZED_HORIZ` or --- `MAXIMIZED_VERT` alone is not taken (Windows supports neither). setExtendedState: (Frame, number) -> (), } --- `Frame`'s class table: the metatable of its instances, which are tables a `class(Frame)` subclass may extend; its instance methods, `new`, `init` (the constructor, for `Sub.super.init(self, ...)`) and `super`. export type FrameClass = Frame & { --- `Frame.NORMAL`: 0. NORMAL: number, --- `Frame.ICONIFIED`: 1. ICONIFIED: number, --- `Frame.MAXIMIZED_HORIZ`: 2. MAXIMIZED_HORIZ: number, --- `Frame.MAXIMIZED_VERT`: 4. MAXIMIZED_VERT: number, --- `Frame.MAXIMIZED_BOTH`: 6. MAXIMIZED_BOTH: number, --- The implicit no-argument constructor: the fresh state a node of this kind starts with, and nothing more. Construction runs it as every native base's `super()`; `new` does not take it. init: (Frame) -> (), --- `AwtWindow`'s class table: the base class. super: AwtWindowClass, --- Whether `obj` is a `Frame` object, a `class(Frame)` subclass's included. isInstance: (any) -> boolean, } --- `Frame`'s class table: `new`, the constructors and the static functions. declare Frame: FrameClass --- A plugin's top-level window, an OS window beside the game titled exactly as the plugin --- titles it. `add`, `remove` and `setLayout` go to its content pane. export type JFrame = Frame & { --- What the user's close does after the `WindowListener`s: `DO_NOTHING_ON_CLOSE`, --- `HIDE_ON_CLOSE` (the default), `DISPOSE_ON_CLOSE`, or `EXIT_ON_CLOSE` (disposes: --- the labelled alternative). Any other value raises. setDefaultCloseOperation: (JFrame, number) -> (), --- The default close operation. getDefaultCloseOperation: (JFrame) -> number, --- The content pane: what `add`, `remove` and `setLayout` act on. getContentPane: (JFrame) -> Container?, --- Makes `contentPane` the frame's content (from wherever it was); `nil` raises. setContentPane: (JFrame, Container?) -> (), } --- `JFrame`'s class table: the metatable of its instances, which are tables a `class(JFrame)` subclass may extend; its instance methods, `new`, `init` (the constructor, for `Sub.super.init(self, ...)`) and `super`. export type JFrameClass = JFrame & { --- `WindowConstants.DO_NOTHING_ON_CLOSE`: 0. DO_NOTHING_ON_CLOSE: number, --- `WindowConstants.HIDE_ON_CLOSE`: 1 (the default). HIDE_ON_CLOSE: number, --- `WindowConstants.DISPOSE_ON_CLOSE`: 2. DISPOSE_ON_CLOSE: number, --- `WindowConstants.EXIT_ON_CLOSE`: 3. A plugin cannot exit the client: the close --- disposes the frame, as `DISPOSE_ON_CLOSE` does. EXIT_ON_CLOSE: number, --- `() -> JFrame`: --- An invisible frame with an empty title and an empty content pane (a `JPanel` with --- a `BorderLayout`). --- --- `(string?) -> JFrame`: --- An invisible frame titled `title`. new: (string?) -> JFrame, --- `(JFrame) -> ()`: --- An invisible frame with an empty title and an empty content pane (a `JPanel` with --- a `BorderLayout`). --- --- `(JFrame, string?) -> ()`: --- An invisible frame titled `title`. init: (JFrame, string?) -> (), --- `Frame`'s class table: the base class. super: FrameClass, --- Whether `obj` is a `JFrame` object, a `class(JFrame)` subclass's included. isInstance: (any) -> boolean, } --- `JFrame`'s class table: `new`, the constructors and the static functions. declare JFrame: JFrameClass --- A window that belongs to another and can be modal. Abstract here: --- a plugin makes a `JDialog`. export type Dialog = AwtWindow & { --- The title: exactly what the plugin set (`""` until then). getTitle: (Dialog) -> string, --- Sets the title the OS window shows, exactly as given (`nil`: empty). setTitle: (Dialog, string?) -> (), --- Whether the user may resize the dialog. isResizable: (Dialog) -> boolean, --- Lets the user resize the dialog, or not. setResizable: (Dialog, boolean) -> (), --- Whether the dialog is modal. isModal: (Dialog) -> boolean, --- Makes the dialog modal from its next show: while it shows, the plugin's other --- windows and its side panel take no input (`APPLICATION_MODAL` over the plugin's --- own surfaces), and `setVisible(true)` returns once it is hidden or disposed. setModal: (Dialog, boolean) -> (), } --- `Dialog`'s class table: the metatable of its instances, which are tables a `class(Dialog)` subclass may extend; its instance methods, `new`, `init` (the constructor, for `Sub.super.init(self, ...)`) and `super`. export type DialogClass = Dialog & { --- The implicit no-argument constructor: the fresh state a node of this kind starts with, and nothing more. Construction runs it as every native base's `super()`; `new` does not take it. init: (Dialog) -> (), --- `AwtWindow`'s class table: the base class. super: AwtWindowClass, --- Whether `obj` is a `Dialog` object, a `class(Dialog)` subclass's included. isInstance: (any) -> boolean, } --- `Dialog`'s class table: `new`, the constructors and the static functions. declare Dialog: DialogClass --- A window that belongs to a frame (or another dialog), modal or not. `add`, `remove` and --- `setLayout` go to its content pane. export type JDialog = Dialog & { --- What the user's close does after the `WindowListener`s: `DO_NOTHING_ON_CLOSE`, --- `HIDE_ON_CLOSE` (the default) or `DISPOSE_ON_CLOSE`. Any other value raises. setDefaultCloseOperation: (JDialog, number) -> (), --- The default close operation. getDefaultCloseOperation: (JDialog) -> number, --- The content pane: what `add`, `remove` and `setLayout` act on. getContentPane: (JDialog) -> Container?, --- Makes `contentPane` the dialog's content (from wherever it was); `nil` raises. setContentPane: (JDialog, Container?) -> (), } --- `JDialog`'s class table: the metatable of its instances, which are tables a `class(JDialog)` subclass may extend; its instance methods, `new`, `init` (the constructor, for `Sub.super.init(self, ...)`) and `super`. export type JDialogClass = JDialog & { --- `WindowConstants.DO_NOTHING_ON_CLOSE`: 0. DO_NOTHING_ON_CLOSE: number, --- `WindowConstants.HIDE_ON_CLOSE`: 1 (the default). HIDE_ON_CLOSE: number, --- `WindowConstants.DISPOSE_ON_CLOSE`: 2. DISPOSE_ON_CLOSE: number, --- `() -> JDialog`: --- A modeless dialog with no owner and an empty title. --- --- `(AwtWindow?) -> JDialog`: --- A modeless dialog owned by `owner` (a `JFrame` or `JDialog`, or `nil`). --- --- `(Dialog, boolean) -> JDialog`: --- A dialog owned by the dialog `owner`, modal when `modal`. --- --- `(Frame?, boolean) -> JDialog`: --- A dialog owned by the frame `owner` (or none), modal when `modal`. --- --- `(AwtWindow?, string?) -> JDialog`: --- A modeless dialog owned by `owner`, titled `title`. --- --- `(Dialog, string?, boolean) -> JDialog`: --- A dialog owned by the dialog `owner`, titled `title`, modal when `modal`. --- --- `(Frame?, string?, boolean) -> JDialog`: --- A dialog owned by the frame `owner` (or none), titled `title`, modal when --- `modal`. new: ((Dialog, boolean) -> JDialog) & ((Frame?, boolean) -> JDialog) & ((AwtWindow?, string?) -> JDialog) & ((Dialog, string?, boolean) -> JDialog) & ((Frame?, string?, boolean) -> JDialog), --- `(JDialog) -> ()`: --- A modeless dialog with no owner and an empty title. --- --- `(JDialog, AwtWindow?) -> ()`: --- A modeless dialog owned by `owner` (a `JFrame` or `JDialog`, or `nil`). --- --- `(JDialog, Dialog, boolean) -> ()`: --- A dialog owned by the dialog `owner`, modal when `modal`. --- --- `(JDialog, Frame?, boolean) -> ()`: --- A dialog owned by the frame `owner` (or none), modal when `modal`. --- --- `(JDialog, AwtWindow?, string?) -> ()`: --- A modeless dialog owned by `owner`, titled `title`. --- --- `(JDialog, Dialog, string?, boolean) -> ()`: --- A dialog owned by the dialog `owner`, titled `title`, modal when `modal`. --- --- `(JDialog, Frame?, string?, boolean) -> ()`: --- A dialog owned by the frame `owner` (or none), titled `title`, modal when --- `modal`. init: ((JDialog, Dialog, boolean) -> ()) & ((JDialog, Frame?, boolean) -> ()) & ((JDialog, AwtWindow?, string?) -> ()) & ((JDialog, Dialog, string?, boolean) -> ()) & ((JDialog, Frame?, string?, boolean) -> ()), --- `Dialog`'s class table: the base class. super: DialogClass, --- Whether `obj` is a `JDialog` object, a `class(JDialog)` subclass's included. isInstance: (any) -> boolean, } --- `JDialog`'s class table: `new`, the constructors and the static functions. declare JDialog: JDialogClass --- The base of `WindowEvent`: its source, id and component. `AWTEvent` and --- `ComponentEvent` are other classes (the Swing events' base, the input events'). export type WindowEventBase = { --- The window, as `getWindow()`. getSource: (WindowEventBase) -> AwtWindow?, --- The event id (`WindowEvent.WINDOW_CLOSING`, ...). getID: (WindowEventBase) -> number, --- The window, as `getWindow()`. getComponent: (WindowEventBase) -> AwtWindow?, } --- What a `WindowListener` hears. export type WindowEvent = WindowEventBase & { --- The window, or `nil` once it was collected. getWindow: (WindowEvent) -> AwtWindow?, --- The other window of the plugin in an activation change, else `nil`. getOppositeWindow: (WindowEvent) -> AwtWindow?, --- The window's extended state before a state change (`Frame.NORMAL`, ...). getOldState: (WindowEvent) -> number, --- The window's extended state after a state change. getNewState: (WindowEvent) -> number, } export type WindowEventClass = { --- `WindowEvent.WINDOW_OPENED`: 200. WINDOW_OPENED: number, --- `WindowEvent.WINDOW_CLOSING`: 201. WINDOW_CLOSING: number, --- `WindowEvent.WINDOW_CLOSED`: 202. WINDOW_CLOSED: number, --- `WindowEvent.WINDOW_ICONIFIED`: 203. WINDOW_ICONIFIED: number, --- `WindowEvent.WINDOW_DEICONIFIED`: 204. WINDOW_DEICONIFIED: number, --- `WindowEvent.WINDOW_ACTIVATED`: 205. WINDOW_ACTIVATED: number, --- `WindowEvent.WINDOW_DEACTIVATED`: 206. WINDOW_DEACTIVATED: number, --- `WindowEvent.WINDOW_GAINED_FOCUS`: 207. WINDOW_GAINED_FOCUS: number, --- `WindowEvent.WINDOW_LOST_FOCUS`: 208. WINDOW_LOST_FOCUS: number, --- `WindowEvent.WINDOW_STATE_CHANGED`: 209. WINDOW_STATE_CHANGED: number, } --- `WindowEvent`'s static functions and constants. declare WindowEvent: WindowEventClass --- A chat message, as the chatbox holds it. One handle per message per plugin, so `==` --- and table keys work. Its getters read the live message; its setters write it, and the --- chatbox shows a change once it rebuilds (`client:refreshChat()`). A message the game --- has dropped (100 newer lines of its type, or the history cleared at login) answers its --- id and type, an empty name and value, and takes no writes. export type MessageNode = { --- The message's id: what `client:getMessages():get(id)` finds it by, and what the --- chat-build script callbacks pass as its uid. getId: (MessageNode) -> number, --- The message's type: `CLAN_GIM_CHAT` / `CLAN_GIM_MESSAGE` for a line of your --- group-ironman channel (the game stores those as clan lines whose text starts with --- `|`). getType: (MessageNode) -> ChatMessageType, --- The name of the player that sent it, as received: icon tags (``) and --- no-break spaces included; `""` for a game message. getName: (MessageNode) -> string, --- Set the name the chatbox shows; the line's right-click options act on the new --- name too (the game's username is rebuilt from it). setName: (MessageNode, string?) -> (), --- The friends-chat or clan channel it came through, or `nil` outside one. getSender: (MessageNode) -> string?, --- Set the channel the chatbox shows; `nil` clears it. setSender: (MessageNode, string?) -> (), --- The message's text, tags included (a group-ironman line's without the `|` the --- game stores before it). getValue: (MessageNode) -> string, --- Set the message's text (the chatbox's display text is rebuilt from it); a --- group-ironman line keeps its `|`. setValue: (MessageNode, string?) -> (), --- The client format that replaces the text when the chatbox builds the line --- (``, `` resolved for the chat type and the chatbox's --- transparency), or `nil`. Messages queued with `clientFormattedMessage` carry one. getClientFormatMessage: (MessageNode) -> string?, --- Set the client format the chatbox shows in place of the text; `nil` shows the text --- again. setClientFormatMessage: (MessageNode, string?) -> (), --- When it was added, in seconds since the Unix epoch. A message added before --- Bento attached answers the game's own minute stamp. getTimestamp: (MessageNode) -> number, --- Set its timestamp (seconds since the Unix epoch). setTimestamp: (MessageNode, number) -> (), } --- The chat history by message id: what `client:getMessages()` returns. --- `for _, node in table` walks every message, oldest first. --- --- `__iter`: Every message, oldest first. export type ChatMessageTable = { --- The message with id `id`, or `nil`: what the chat-build script callbacks' uid --- names. get: (ChatMessageTable, number) -> MessageNode?, } --- One chat type's lines, newest first (`client:getChatLineMap()[type]`). export type ChatLineBuffer = { --- The lines, newest first. A buffer has 100 slots; this array holds only the --- `getLength()` lines in use, and `lines[k]` past them is `nil` (`#lines` is --- `getLength()`, not 100). Lua arrays start at 1: the newest line is `getLines()[1]`. getLines: (ChatLineBuffer) -> {MessageNode}, --- How many lines it holds. getLength: (ChatLineBuffer) -> number, --- Take `node` out of this buffer: the lines after it move down one, the buffer is one --- shorter, and the message leaves `client:getMessages()` (the "All" tab too). The --- chatbox shows it once it rebuilds (`client:refreshChat()`, or the build script). A --- node that is not one of this buffer's lines (another type's, or one already gone) --- changes nothing. The removed node answers as a dropped message does: its id and type, --- an empty name and value. An error on a client whose table does not place it. removeMessageNode: (ChatLineBuffer, MessageNode) -> (), } --- Adds `QueuedMessage`s to the chatbox. The global `chatMessageManager`. export type ChatMessageManager = { --- Add `message` to the chatbox on the next client tick: its type, name and sender, --- and its client-formatted markup (else its value) as the text. Nothing is added --- on tutorial island. queue: (ChatMessageManager, QueuedMessage) -> (), } --- Run a function when a chat message starts with a command (`!kc`). The global --- `chatCommandManager`. export type ChatCommandManager = { --- `(ChatCommandManager, string, (ChatMessage, string) -> ()) -> ()`: --- Run `execute(chatMessage, message)` for every public, private, friends-chat or --- clan message whose first word is `command` (any case). --- --- `(ChatCommandManager, string, (ChatMessage, string) -> (), ((ChatInput, string) -> boolean)?) -> ()`: --- `registerCommand`, plus `input(chatInput, message)`, run when the player sends a --- line starting with `command`: answer `true` (any value but `nil` and `false`) to --- hold the line back, then call `chatInput:resume()` to send it (see `ChatInput`). registerCommand: (ChatCommandManager, string, (ChatMessage, string) -> (), ((ChatInput, string) -> boolean)?) -> (), --- `(ChatCommandManager, string, (ChatMessage, string) -> ()) -> ()`: --- The same as `registerCommand`: Bento runs Luau only on the client thread, so it runs --- as soon as the message arrives. Use `http` for anything slow. --- --- `(ChatCommandManager, string, (ChatMessage, string) -> (), ((ChatInput, string) -> boolean)?) -> ()`: --- `registerCommandAsync` with an input predicate, as `registerCommand` takes one --- (the predicate runs synchronously). registerCommandAsync: (ChatCommandManager, string, (ChatMessage, string) -> (), ((ChatInput, string) -> boolean)?) -> (), --- Forget `command`. unregisterCommand: (ChatCommandManager, string) -> (), } --- The chat colour settings (config group `textrecolor`): each item is the user's value --- in that group, read when called, through `ColorUtil.fromString` (`nil` for a value --- that does not parse); unset, its default. Outside a callback, or in a host with no --- config, every item answers its default. The global `chatColorConfig`. export type ChatColorConfig = { --- Color of public chat. The user's `textrecolor` value `opaquePublicChat`; unset, `nil` (no recolour). opaquePublicChat: (ChatColorConfig) -> Color?, --- Color of highlights in public chat. The user's `textrecolor` value `opaquePublicChatHighlight`; unset, the default: `Color.decode("#000000")` (`0xFF000000`). opaquePublicChatHighlight: (ChatColorConfig) -> Color?, --- Color of private messages you've sent. The user's `textrecolor` value `opaquePrivateMessageSent`; unset, `nil` (no recolour). opaquePrivateMessageSent: (ChatColorConfig) -> Color?, --- Color of highlights in private messages you've sent. The user's `textrecolor` value `opaquePrivateMessageSentHighlight`; unset, the default: `Color.decode("#002783")` (`0xFF002783`). opaquePrivateMessageSentHighlight: (ChatColorConfig) -> Color?, --- Color of private messages you've received. The user's `textrecolor` value `opaquePrivateMessageReceived`; unset, `nil` (no recolour). opaquePrivateMessageReceived: (ChatColorConfig) -> Color?, --- Color of highlights in private messages you've received. The user's `textrecolor` value `opaquePrivateMessageReceivedHighlight`; unset, the default: `Color.decode("#002783")` (`0xFF002783`). opaquePrivateMessageReceivedHighlight: (ChatColorConfig) -> Color?, --- Friends chat information (eg. when joining a channel). The user's `textrecolor` value `opaqueFriendsChatInfo`; unset, `nil` (no recolour). opaqueFriendsChatInfo: (ChatColorConfig) -> Color?, --- Friends chat information highlight. The user's `textrecolor` value `opaqueClanChatInfoHighlight`; unset, the default: `Color.RED` (`0xFFFF0000`). opaqueFriendsChatInfoHighlight: (ChatColorConfig) -> Color?, --- Color of friends chat messages. The user's `textrecolor` value `opaqueClanChatMessage`; unset, `nil` (no recolour). opaqueFriendsChatMessage: (ChatColorConfig) -> Color?, --- Color of highlights in friends chat messages. The user's `textrecolor` value `opaqueClanChatMessageHighlight`; unset, the default: `Color.decode("#000000")` (`0xFF000000`). opaqueFriendsChatMessageHighlight: (ChatColorConfig) -> Color?, --- Clan chat information (eg. when joining a channel). The user's `textrecolor` value `opaqueClanInfo`; unset, `nil` (no recolour). opaqueClanChatInfo: (ChatColorConfig) -> Color?, --- Clan chat information highlight. The user's `textrecolor` value `opaqueClanInfoHighlight`; unset, the default: `Color.RED` (`0xFFFF0000`). opaqueClanChatInfoHighlight: (ChatColorConfig) -> Color?, --- Color of clan chat messages. The user's `textrecolor` value `opaqueClanMessage`; unset, `nil` (no recolour). opaqueClanChatMessage: (ChatColorConfig) -> Color?, --- Color of highlights in clan chat messages. The user's `textrecolor` value `opaqueClanMessageHighlight`; unset, the default: `Color.decode("#000000")` (`0xFF000000`). opaqueClanChatMessageHighlight: (ChatColorConfig) -> Color?, --- Guest clan chat information (eg. when joining a channel). The user's `textrecolor` value `opaqueClanGuestInfo`; unset, `nil` (no recolour). opaqueClanChatGuestInfo: (ChatColorConfig) -> Color?, --- Guest clan chat information highlight. The user's `textrecolor` value `opaqueClanGuestInfoHighlight`; unset, the default: `Color.RED` (`0xFFFF0000`). opaqueClanChatGuestInfoHighlight: (ChatColorConfig) -> Color?, --- Color of guest clan chat messages. The user's `textrecolor` value `opaqueClanGuestMessage`; unset, `nil` (no recolour). opaqueClanChatGuestMessage: (ChatColorConfig) -> Color?, --- Color of highlights in guest clan chat messages. The user's `textrecolor` value `opaqueClanChatGuestMessageHighlight`; unset, the default: `Color.decode("#000000")` (`0xFF000000`). opaqueClanChatGuestMessageHighlight: (ChatColorConfig) -> Color?, --- Color of autochat messages. The user's `textrecolor` value `opaqueAutochatMessage`; unset, `nil` (no recolour). opaqueAutochatMessage: (ChatColorConfig) -> Color?, --- Color of highlights in autochat messages. The user's `textrecolor` value `opaqueAutochatMessageHighlight`; unset, `nil` (no recolour). opaqueAutochatMessageHighlight: (ChatColorConfig) -> Color?, --- Color of trade chat messages. The user's `textrecolor` value `opaqueTradeChatMessage`; unset, `nil` (no recolour). opaqueTradeChatMessage: (ChatColorConfig) -> Color?, --- Color of highlights in trade chat messages. The user's `textrecolor` value `opaqueTradeChatMessageHighlight`; unset, `nil` (no recolour). opaqueTradeChatMessageHighlight: (ChatColorConfig) -> Color?, --- Color of server messages (eg. 'Welcome to RuneScape'). The user's `textrecolor` value `opaqueServerMessage`; unset, `nil` (no recolour). opaqueServerMessage: (ChatColorConfig) -> Color?, --- Color of highlights in server messages. The user's `textrecolor` value `opaqueServerMessageHighlight`; unset, `nil` (no recolour). opaqueServerMessageHighlight: (ChatColorConfig) -> Color?, --- Color of game messages. The user's `textrecolor` value `opaqueGameMessage`; unset, `nil` (no recolour). opaqueGameMessage: (ChatColorConfig) -> Color?, --- Color of highlights in game messages. The user's `textrecolor` value `opaqueGameMessageHighlight`; unset, the default: `Color.decode("#EF1020")` (`0xFFEF1020`). opaqueGameMessageHighlight: (ChatColorConfig) -> Color?, --- Color of examine text. The user's `textrecolor` value `opaqueExamine`; unset, `nil` (no recolour). opaqueExamine: (ChatColorConfig) -> Color?, --- Color of highlights in examine text. The user's `textrecolor` value `opaqueExamineHighlight`; unset, the default: `Color.decode("#0000FF")` (`0xFF0000FF`). opaqueExamineHighlight: (ChatColorConfig) -> Color?, --- Color of filtered text (messages that aren't shown when game messages are filtered). The user's `textrecolor` value `opaqueFiltered`; unset, `nil` (no recolour). opaqueFiltered: (ChatColorConfig) -> Color?, --- Color of highlights in filtered text. The user's `textrecolor` value `opaqueFilteredHighlight`; unset, `nil` (no recolour). opaqueFilteredHighlight: (ChatColorConfig) -> Color?, --- Color of usernames. The user's `textrecolor` value `opaqueUsername`; unset, `nil` (no recolour). opaqueUsername: (ChatColorConfig) -> Color?, --- Color of usernames in private chat. The user's `textrecolor` value `opaquePrivateUsernames`; unset, `nil` (no recolour). opaquePrivateUsernames: (ChatColorConfig) -> Color?, --- Color of friends chat channel name. The user's `textrecolor` value `opaqueClanChannelName`; unset, `nil` (no recolour). opaqueFriendsChatChannelName: (ChatColorConfig) -> Color?, --- Color of clan chat channel name. The user's `textrecolor` value `opaqueClanChatChannelName`; unset, `nil` (no recolour). opaqueClanChannelName: (ChatColorConfig) -> Color?, --- Color of guest clan chat channel name. The user's `textrecolor` value `opaqueClanChatGuestChannelName`; unset, `nil` (no recolour). opaqueClanGuestChatChannelName: (ChatColorConfig) -> Color?, --- Color of usernames in friends chat. The user's `textrecolor` value `opaqueClanUsernames`; unset, `nil` (no recolour). opaqueFriendsChatUsernames: (ChatColorConfig) -> Color?, --- Color of usernames in clan chat. The user's `textrecolor` value `opaqueClanChatUsernames`; unset, `nil` (no recolour). opaqueClanChatUsernames: (ChatColorConfig) -> Color?, --- Color of usernames in guest clan chat. The user's `textrecolor` value `opaqueClanChatGuestUsernames`; unset, `nil` (no recolour). opaqueClanChatGuestUsernames: (ChatColorConfig) -> Color?, --- Color of friend usernames in public chat. The user's `textrecolor` value `opaquePublicFriendUsernames`; unset, `nil` (no recolour). opaquePublicFriendUsernames: (ChatColorConfig) -> Color?, --- Color of your username. The user's `textrecolor` value `opaquePlayerUsername`; unset, `nil` (no recolour). opaquePlayerUsername: (ChatColorConfig) -> Color?, --- Color of public chat (transparent). The user's `textrecolor` value `transparentPublicChat`; unset, `nil` (no recolour). transparentPublicChat: (ChatColorConfig) -> Color?, --- Color of highlights in public chat (transparent). The user's `textrecolor` value `transparentPublicChatHighlight`; unset, the default: `Color.decode("#FFFFFF")` (`0xFFFFFFFF`). transparentPublicChatHighlight: (ChatColorConfig) -> Color?, --- Color of private messages you've sent (transparent). The user's `textrecolor` value `transparentPrivateMessageSent`; unset, `nil` (no recolour). transparentPrivateMessageSent: (ChatColorConfig) -> Color?, --- Color of highlights in private messages you've sent (transparent). The user's `textrecolor` value `transparentPrivateMessageSentHighlight`; unset, the default: `Color.decode("#FFFFFF")` (`0xFFFFFFFF`). transparentPrivateMessageSentHighlight: (ChatColorConfig) -> Color?, --- Color of private messages you've received (transparent). The user's `textrecolor` value `transparentPrivateMessageReceived`; unset, `nil` (no recolour). transparentPrivateMessageReceived: (ChatColorConfig) -> Color?, --- Color of highlights in private messages you've received (transparent). The user's `textrecolor` value `transparentPrivateMessageReceivedHighlight`; unset, the default: `Color.decode("#FFFFFF")` (`0xFFFFFFFF`). transparentPrivateMessageReceivedHighlight: (ChatColorConfig) -> Color?, --- Friends chat information (eg. when joining a channel) (transparent). The user's `textrecolor` value `transparentFriendsChatInfo`; unset, `nil` (no recolour). transparentFriendsChatInfo: (ChatColorConfig) -> Color?, --- Friends chat information highlight (transparent). The user's `textrecolor` value `transparentClanChatInfoHighlight`; unset, the default: `Color.RED` (`0xFFFF0000`). transparentFriendsChatInfoHighlight: (ChatColorConfig) -> Color?, --- Color of friends chat messages (transparent). The user's `textrecolor` value `transparentClanChatMessage`; unset, `nil` (no recolour). transparentFriendsChatMessage: (ChatColorConfig) -> Color?, --- Color of highlights in friends chat messages (transparent). The user's `textrecolor` value `transparentClanChatMessageHighlight`; unset, the default: `Color.decode("#FFFFFF")` (`0xFFFFFFFF`). transparentFriendsChatMessageHighlight: (ChatColorConfig) -> Color?, --- Clan chat information (eg. when joining a channel) (transparent). The user's `textrecolor` value `transparentClanInfo`; unset, `nil` (no recolour). transparentClanChatInfo: (ChatColorConfig) -> Color?, --- Clan chat information highlight (transparent). The user's `textrecolor` value `transparentClanInfoHighlight`; unset, the default: `Color.RED` (`0xFFFF0000`). transparentClanChatInfoHighlight: (ChatColorConfig) -> Color?, --- Color of clan chat messages (transparent). The user's `textrecolor` value `transparentClanMessage`; unset, `nil` (no recolour). transparentClanChatMessage: (ChatColorConfig) -> Color?, --- Color of highlights in clan chat messages (transparent). The user's `textrecolor` value `transparentClanMessageHighlight`; unset, the default: `Color.decode("#FFFFFF")` (`0xFFFFFFFF`). transparentClanChatMessageHighlight: (ChatColorConfig) -> Color?, --- Guest clan chat information (eg. when joining a channel) (transparent). The user's `textrecolor` value `transparentClanGuestInfo`; unset, `nil` (no recolour). transparentClanChatGuestInfo: (ChatColorConfig) -> Color?, --- Guest clan chat information highlight (transparent). The user's `textrecolor` value `transparentClanGuestInfoHighlight`; unset, the default: `Color.RED` (`0xFFFF0000`). transparentClanChatGuestInfoHighlight: (ChatColorConfig) -> Color?, --- Color of guest clan chat messages (transparent). The user's `textrecolor` value `transparentClanGuestMessage`; unset, `nil` (no recolour). transparentClanChatGuestMessage: (ChatColorConfig) -> Color?, --- Color of highlights in guest clan chat messages (transparent). The user's `textrecolor` value `transparentClanChatGuestMessageHighlight`; unset, the default: `Color.decode("#FFFFFF")` (`0xFFFFFFFF`). transparentClanChatGuestMessageHighlight: (ChatColorConfig) -> Color?, --- Color of autochat messages (transparent). The user's `textrecolor` value `transparentAutochatMessage`; unset, `nil` (no recolour). transparentAutochatMessage: (ChatColorConfig) -> Color?, --- Color of highlights in autochat messages (transparent). The user's `textrecolor` value `transparentAutochatMessageHighlight`; unset, `nil` (no recolour). transparentAutochatMessageHighlight: (ChatColorConfig) -> Color?, --- Color of trade chat messages (transparent). The user's `textrecolor` value `transparentTradeChatMessage`; unset, `nil` (no recolour). transparentTradeChatMessage: (ChatColorConfig) -> Color?, --- Color of highlights in trade chat messages (transparent). The user's `textrecolor` value `transparentTradeChatMessageHighlight`; unset, `nil` (no recolour). transparentTradeChatMessageHighlight: (ChatColorConfig) -> Color?, --- Color of server messages (eg. 'Welcome to RuneScape') (transparent). The user's `textrecolor` value `transparentServerMessage`; unset, `nil` (no recolour). transparentServerMessage: (ChatColorConfig) -> Color?, --- Color of highlights in server messages (transparent). The user's `textrecolor` value `transparentServerMessageHighlight`; unset, `nil` (no recolour). transparentServerMessageHighlight: (ChatColorConfig) -> Color?, --- Color of game messages (transparent). The user's `textrecolor` value `transparentGameMessage`; unset, `nil` (no recolour). transparentGameMessage: (ChatColorConfig) -> Color?, --- Color of highlights in game messages (transparent). The user's `textrecolor` value `transparentGameMessageHighlight`; unset, the default: `Color.decode("#EF1020")` (`0xFFEF1020`). transparentGameMessageHighlight: (ChatColorConfig) -> Color?, --- Color of examine text (transparent). The user's `textrecolor` value `transparentExamine`; unset, `nil` (no recolour). transparentExamine: (ChatColorConfig) -> Color?, --- Color of highlights in examine text (transparent). The user's `textrecolor` value `transparentExamineHighlight`; unset, the default: `Color.GREEN` (`0xFF00FF00`). transparentExamineHighlight: (ChatColorConfig) -> Color?, --- Color of filtered text (messages that aren't shown when game messages are filtered) (transparent). The user's `textrecolor` value `transparentFiltered`; unset, `nil` (no recolour). transparentFiltered: (ChatColorConfig) -> Color?, --- Color of highlights in filtered text (transparent). The user's `textrecolor` value `transparentFilteredHighlight`; unset, `nil` (no recolour). transparentFilteredHighlight: (ChatColorConfig) -> Color?, --- Color of usernames (transparent). The user's `textrecolor` value `transparentUsername`; unset, `nil` (no recolour). transparentUsername: (ChatColorConfig) -> Color?, --- Color of usernames in private chat (transparent). The user's `textrecolor` value `transparentPrivateUsernames`; unset, `nil` (no recolour). transparentPrivateUsernames: (ChatColorConfig) -> Color?, --- Color of friends chat channel name (transparent). The user's `textrecolor` value `transparentClanChannelName`; unset, `nil` (no recolour). transparentFriendsChatChannelName: (ChatColorConfig) -> Color?, --- Color of clan chat channel name (transparent). The user's `textrecolor` value `transparentClanChatChannelName`; unset, `nil` (no recolour). transparentClanChannelName: (ChatColorConfig) -> Color?, --- Color of guest clan chat channel name (transparent). The user's `textrecolor` value `transparentClanChatGuestChannelName`; unset, `nil` (no recolour). transparentClanChannelGuestName: (ChatColorConfig) -> Color?, --- Color of usernames in friends chat (transparent). The user's `textrecolor` value `transparentClanUsernames`; unset, `nil` (no recolour). transparentFriendsChatUsernames: (ChatColorConfig) -> Color?, --- Color of usernames in clan chat (transparent). The user's `textrecolor` value `transparentClanClanUsernames`; unset, `nil` (no recolour). transparentClanChatUsernames: (ChatColorConfig) -> Color?, --- Color of usernames in guest clan chat (transparent). The user's `textrecolor` value `transparentClanClanGuestUsernames`; unset, `nil` (no recolour). transparentClanChatGuestUsernames: (ChatColorConfig) -> Color?, --- Color of friend usernames in public chat (transparent). The user's `textrecolor` value `transparentPublicFriendUsernames`; unset, `nil` (no recolour). transparentPublicFriendUsernames: (ChatColorConfig) -> Color?, --- Color of your username (transparent). The user's `textrecolor` value `transparentPlayerUsername`; unset, `nil` (no recolour). transparentPlayerUsername: (ChatColorConfig) -> Color?, } --- A chat message to add, made with `QueuedMessage.builder()` and handed to --- `chatMessageManager:queue`. export type QueuedMessage = { --- Its type. getType: (QueuedMessage) -> ChatMessageType?, --- Its plain value, or `nil`. getValue: (QueuedMessage) -> string?, --- The sender's name, or `nil`. getName: (QueuedMessage) -> string?, --- Set the sender's name. setName: (QueuedMessage, string?) -> (), --- The channel, or `nil`. getSender: (QueuedMessage) -> string?, --- Set the channel. setSender: (QueuedMessage, string?) -> (), --- The client-formatted markup, or `nil`. getClientFormattedMessage: (QueuedMessage) -> string?, --- Set the client-formatted markup. setClientFormattedMessage: (QueuedMessage, string?) -> (), --- The timestamp to give the message (Unix seconds), 0 for "when it is added". getTimestamp: (QueuedMessage) -> number, --- Set the timestamp to give the message. setTimestamp: (QueuedMessage, number) -> (), } export type QueuedMessageClass = { --- A new builder. builder: () -> QueuedMessageBuilder, } --- `QueuedMessage`'s static functions and constants. declare QueuedMessage: QueuedMessageClass --- What `QueuedMessage.builder()` returns. Every call but `build` returns the builder. export type QueuedMessageBuilder = { --- The chat type (required). `CLAN_GIM_CHAT` / `CLAN_GIM_MESSAGE` add the message to --- your group-ironman channel's lines. type: (QueuedMessageBuilder, ChatMessageType) -> QueuedMessageBuilder, --- The plain text: shown as given when there is no client-formatted markup. value: (QueuedMessageBuilder, string?) -> QueuedMessageBuilder, --- The sender's name. name: (QueuedMessageBuilder, string?) -> QueuedMessageBuilder, --- The friends-chat or clan channel. sender: (QueuedMessageBuilder, string?) -> QueuedMessageBuilder, --- Markup with ``/`` placeholders --- (`ChatMessageBuilder:build()`), resolved for the chat type when the chatbox shows --- it. clientFormattedMessage: (QueuedMessageBuilder, string?) -> QueuedMessageBuilder, --- The timestamp to give the message (Unix seconds). timestamp: (QueuedMessageBuilder, number) -> QueuedMessageBuilder, --- The message. Raises when no type was given. build: (QueuedMessageBuilder) -> QueuedMessage, } --- Builds a chat message's markup. Text appended as a string is escaped (`<` as ``, --- ...); colours and images are tags. export type ChatMessageBuilder = { --- `(ChatMessageBuilder, ChatColorType) -> ChatMessageBuilder`: --- `` or ``: replaced by the chat type's colour when the --- message is queued as a `clientFormattedMessage`. --- --- `(ChatMessageBuilder, string) -> ChatMessageBuilder`: --- `message`, escaped (`Text.escapeJagex`): it shows as written. --- --- `(ChatMessageBuilder, Color, string) -> ChatMessageBuilder`: --- `message` in `color` (`ColorUtil.wrapWithColorTag`), not escaped. append: ((ChatMessageBuilder, ChatColorType) -> ChatMessageBuilder) & ((ChatMessageBuilder, string) -> ChatMessageBuilder) & ((ChatMessageBuilder, Color, string) -> ChatMessageBuilder), --- ``: a chat icon (a mod-icon index). img: (ChatMessageBuilder, number) -> ChatMessageBuilder, --- The markup built so far. build: (ChatMessageBuilder) -> string, } export type ChatMessageBuilderClass = { --- An empty builder. new: () -> ChatMessageBuilder, } --- `ChatMessageBuilder`'s static functions and constants. declare ChatMessageBuilder: ChatMessageBuilderClass --- Something with a display name (a friend, an ignore, a friends-chat or clan-channel --- member). Two handles to one entry are `==`. --- --- `__eq`: The same entry. export type Nameable = { --- The display name. getName: (Nameable) -> string, --- The previous display name, or `nil`. getPrevName: (Nameable) -> string?, --- Whether `other` equals this Nameable, as `==` answers it (`false` for a value of another class). equals: (Nameable, any) -> boolean, } --- A `Nameable` on a world. --- --- `__eq`: The same entry. export type ChatPlayer = Nameable & { --- The world they are on, 0 when offline. getWorld: (ChatPlayer) -> number, } --- A friends-list entry. --- --- `__eq`: The same entry. export type Friend = ChatPlayer --- A friends-chat member. --- --- `__eq`: The same entry. export type FriendsChatMember = ChatPlayer & { --- Their rank in the channel, or `nil` for a value `FriendsChatRank` lacks. getRank: (FriendsChatMember) -> FriendsChatRank?, } --- A clan-channel member. --- --- `__eq`: The same entry. export type ClanChannelMember = ChatPlayer & { --- Their rank in the clan. getRank: (ClanChannelMember) -> ClanRank, } --- An ignore-list entry. --- --- `__eq`: The same entry. export type Ignore = Nameable --- A list of names (the ignore list is one). Read live on every call. export type NameableContainer = { --- How many entries it holds. getCount: (NameableContainer) -> number, --- How many entries it can hold. getSize: (NameableContainer) -> number, --- Its entries, in the game's order. Lua arrays start at 1. getMembers: (NameableContainer) -> {Nameable}, --- The entry called `name` (or, failing that, once called `name`), or `nil`. findByName: (NameableContainer, string) -> Nameable?, } --- The friends list. export type FriendContainer = NameableContainer & { --- The friends' login and logout notifications the client has queued and not posted --- yet (" has logged in." follows five seconds after the world change), oldest --- first: a snapshot array. To drop one, call `pendingLogin:remove()`: removing it --- from the array changes nothing in the client. A world hop's logout and login --- cancel each other and are not listed. Raises on a client whose table does not --- place the list, rather than answer an empty list. getPendingLogins: (FriendContainer) -> {PendingLogin}, } --- A friend's login or logout notification the client has queued and not posted yet --- (`client:getFriendContainer():getPendingLogins()`). export type PendingLogin = { --- The friend's name, as the client keeps it (a no-break space kept as one: --- `Text.toJagexName` cleans it). getName: (PendingLogin) -> string, --- The world the friend logged into, or 0 for a logout. getWorld: (PendingLogin) -> number, --- Drop this notification so the client never posts it: how to hide a friend's --- login while walking `getPendingLogins()`. The client cancels it as it cancels a --- world hop's pair. Nothing happens when it was posted already or removed before. --- Game thread only, as every client write; raises on a client whose table has the --- write off. remove: (PendingLogin) -> (), } --- The friends chat you are in, a container of its members. export type FriendsChatManager = NameableContainer & { --- The channel's owner. getOwner: (FriendsChatManager) -> string, --- The channel's name. getName: (FriendsChatManager) -> string, --- Your rank in the channel (your own entry's), or `nil`. getMyRank: (FriendsChatManager) -> FriendsChatRank?, --- The lowest rank that may kick, or `nil`. getKickRank: (FriendsChatManager) -> FriendsChatRank?, } --- A clan channel. export type ClanChannel = { --- The channel's name. getName: (ClanChannel) -> string, --- Its members. Lua arrays start at 1. getMembers: (ClanChannel) -> {ClanChannelMember}, --- The member called `name`, or `nil`. findMember: (ClanChannel, string) -> ClanChannelMember?, } --- A clan rank, a value (`==` compares ranks). --- --- `__eq`: The same rank. export type ClanRank = { --- The rank's value: -1 a guest, up to 126 the owner and 127 a Jagex moderator. getRank: (ClanRank) -> number, --- Whether `other` equals this ClanRank, as `==` answers it (`false` for a value of another class). equals: (ClanRank, any) -> boolean, } export type ClanRankClass = { --- The rank `rank`. new: (number) -> ClanRank, } --- `ClanRank`'s static functions and constants. declare ClanRank: ClanRankClass --- A clan's settings (`client:getClanSettings()`). Its members are every member, --- online or not. export type ClanSettings = { --- The clan's name. getName: (ClanSettings) -> string, --- Every member. Lua arrays start at 1. getMembers: (ClanSettings) -> {ClanMember}, --- The member called `name` (any case; a space matches the no-break space the game --- stores), or `nil` (also when the settings carry no names). findMember: (ClanSettings, string) -> ClanMember?, --- The title the clan gives `rank`, or `nil` (no title, or settings that are no --- longer the client's). titleForRank: (ClanSettings, ClanRank) -> ClanTitle?, } --- A member of a clan's settings, read from its settings by index. export type ClanMember = { --- Their display name, as the game stores it (a no-break space for a space); `nil` --- when the clan's settings carry no names. getName: (ClanMember) -> string?, --- Their rank in the clan. getRank: (ClanMember) -> ClanRank, } --- A clan rank's title, a value (`==` compares ids). --- --- `__eq`: The same title. export type ClanTitle = { --- The title's id. getId: (ClanTitle) -> number, --- The title's name. getName: (ClanTitle) -> string, --- Whether `other` equals this ClanTitle, as `==` answers it (`false` for a value of another class). equals: (ClanTitle, any) -> boolean, } --- What a chat command's input predicate is handed. Answer `true` from the predicate (or --- call `consume()`) to hold the line back, then call `resume()` once the plugin's work is --- done to send it after all. A line that could not be resent from this plugin (no --- `clientThread`, no game) is not held: it goes as typed. export type ChatInput = { --- Send the held line after all, from the client thread at its next invoke point --- (`clientThread:invokeLater`). Each call sends it once more. resume: (ChatInput) -> (), --- Hold the line back: the script sends nothing. consume: (ChatInput) -> (), --- Whether the line is held back. isConsumed: (ChatInput) -> boolean, } --- A line sent from the chatbox. export type ChatboxInput = ChatInput & { --- What was typed. getValue: (ChatboxInput) -> string, --- Where it goes: 0 public, 1 cheat, 2 friends chat, 3 clan chat, 4 guest clan. getChatType: (ChatboxInput) -> number, } --- A private message sent. export type PrivateMessageInput = ChatInput & { --- Who it is to. getTarget: (PrivateMessageInput) -> string, --- The message. getMessage: (PrivateMessageInput) -> string, } --- A chat filter's per-message censor, over the plugin's own `Pattern`s. export type ChatCensor = { } export type ChatCensorClass = { --- Censors one chat line in a single call, for a chat filter censoring every line the --- chatbox builds, once per `chatFilterCheck` callback. `patterns` and `namePatterns` --- are the plugin's compiled word and name patterns; `filterType` is the plugin's --- `ChatFilterType` constant, or its name (`"CENSOR_WORDS"`, `"CENSOR_MESSAGE"`, --- `"REMOVE_MESSAGE"`). A `username` a name pattern finds (standardized) is censored --- whole; otherwise the message, unescaped and cut to the Jagex printable characters --- (U+00A0 as a space), has every match of each pattern replaced by `*`s, matched on --- the accent-stripped copy when `stripAccents`, and is escaped again; `nil` means --- remove the message. A Luau `Matcher`/`StringBuilder` loop doing the same costs about --- 3 µs a line; this, a fraction of one. `stripAccents` strips the Latin-1 accents, the --- only ones a chat line keeps here. censorMessage: ({Pattern}, {Pattern}, string?, string, any, boolean?) -> string?, } --- `ChatCensor`'s static functions and constants. declare ChatCensor: ChatCensorClass --- A generated id class. --- --- `VarbitID.SOMETHING` is the id and `VarbitID.name(id)` is the name. Nothing is --- materialised: a member is looked up on first read (a constant path in plugin --- code is resolved once, when the chunk loads). A name the class does not have --- raises. --- --- Indexing is typed `any` because the members are generated: tens of thousands --- of them, changing with every cache update. What you get back is a number, or --- a nested class's table (`InterfaceID.Orbs`). export type IdClass = { --- The name of an id. --- @param id The id to look up. --- @returns `nil` when the id has no known name. name: (number) -> string?, --- The id a name holds, for a name read from data: a document, a config value. Index --- the class for a name written in the code, which raises when it is misspelt. --- @param name A member's name, nested classes joined by dots (`Orbs.UNIVERSE`). --- @returns `nil` when the name holds no id, or is not a string. Never raises. find: (any) -> number?, --- Any generated member, e.g. `VarbitID.TROLL_FREED_EADGAR`. [string]: any, } --- Interface ids, which come in two shapes. --- --- `InterfaceID.ORBS` is the interface GROUP id. `InterfaceID.Orbs.UNIVERSE` is a --- packed COMPONENT id within that group, `group << 16 | child`. A SCREAMING --- member is a group, a `Pascal` member is a table of that group's components. export type InterfaceIdClass = { --- The name of an interface group id. --- @param id The group id. --- @returns `nil` when the id has no known name. name: (number) -> string?, --- The name of a packed component id, as `Group.MEMBER`. --- @param packedId The packed component id. --- @returns `nil` when the id has no known name. componentName: (number) -> string?, --- The id a name holds, for a name read from data: a document, a config value. Index --- the class for a name written in the code, which raises when it is misspelt. --- @param name A group's name (`ORBS`) or a component's, dotted (`Orbs.UNIVERSE`). --- @returns `nil` when the name holds no id, or is not a string. Never raises. find: (any) -> number?, --- A group id (`ORBS`), or a group's component table (`Orbs`). [string]: any, } --- `EnumID`: 27 constants, answered lazily from the generated table, so an unread one costs nothing and a constant path in plugin code (`EnumID.NAME`) is resolved once, when the chunk loads. declare EnumID: IdClass --- `FontID`: 16 constants, answered lazily from the generated table, so an unread one costs nothing and a constant path in plugin code (`FontID.NAME`) is resolved once, when the chunk loads. declare FontID: IdClass --- `HitsplatID`: 34 constants, answered lazily from the generated table, so an unread one costs nothing and a constant path in plugin code (`HitsplatID.NAME`) is resolved once, when the chunk loads. declare HitsplatID: IdClass --- `ParamID`: 189 constants, answered lazily from the generated table, so an unread one costs nothing and a constant path in plugin code (`ParamID.NAME`) is resolved once, when the chunk loads. declare ParamID: IdClass --- `ScriptID`: 77 constants, answered lazily from the generated table, so an unread one costs nothing and a constant path in plugin code (`ScriptID.NAME`) is resolved once, when the chunk loads. declare ScriptID: IdClass --- `SettingID`: 4 constants, answered lazily from the generated table, so an unread one costs nothing and a constant path in plugin code (`SettingID.NAME`) is resolved once, when the chunk loads. declare SettingID: IdClass --- `SoundEffectID`: 59 constants, answered lazily from the generated table, so an unread one costs nothing and a constant path in plugin code (`SoundEffectID.NAME`) is resolved once, when the chunk loads. declare SoundEffectID: IdClass --- `VarClientInt`: 10 constants, answered lazily from the generated table, so an unread one costs nothing and a constant path in plugin code (`VarClientInt.NAME`) is resolved once, when the chunk loads. declare VarClientInt: IdClass --- `VarClientStr`: 6 constants, answered lazily from the generated table, so an unread one costs nothing and a constant path in plugin code (`VarClientStr.NAME`) is resolved once, when the chunk loads. declare VarClientStr: IdClass --- `VarPlayer`: 111 constants, answered lazily from the generated table, so an unread one costs nothing and a constant path in plugin code (`VarPlayer.NAME`) is resolved once, when the chunk loads. declare VarPlayer: IdClass --- `Varbits`: 408 constants, answered lazily from the generated table, so an unread one costs nothing and a constant path in plugin code (`Varbits.NAME`) is resolved once, when the chunk loads. declare Varbits: IdClass --- `ClanID`: 2 constants, answered lazily from the generated table, so an unread one costs nothing and a constant path in plugin code (`ClanID.NAME`) is resolved once, when the chunk loads. declare ClanID: IdClass --- `GraphicID`: 35 constants, answered lazily from the generated table, so an unread one costs nothing and a constant path in plugin code (`GraphicID.NAME`) is resolved once, when the chunk loads. declare GraphicID: IdClass --- `NullNpcID`: 2864 constants, answered lazily from the generated table, so an unread one costs nothing and a constant path in plugin code (`NullNpcID.NAME`) is resolved once, when the chunk loads. declare NullNpcID: IdClass --- `ComponentID`: 169 constants, answered lazily from the generated table, so an unread one costs nothing and a constant path in plugin code (`ComponentID.NAME`) is resolved once, when the chunk loads. declare ComponentID: IdClass --- `LegacyAnimationID`: 329 constants, answered lazily from the generated table, so an unread one costs nothing and a constant path in plugin code (`LegacyAnimationID.NAME`) is resolved once, when the chunk loads. The global `AnimationID` is a different class, read from the game's cache, which gives many of the same names other values. declare LegacyAnimationID: IdClass --- `LegacyItemID`: 16960 constants, answered lazily from the generated table, so an unread one costs nothing and a constant path in plugin code (`LegacyItemID.NAME`) is resolved once, when the chunk loads. The global `ItemID` is a different class, read from the game's cache, which gives many of the same names other values. declare LegacyItemID: IdClass --- `LegacyNpcID`: 13968 constants, answered lazily from the generated table, so an unread one costs nothing and a constant path in plugin code (`LegacyNpcID.NAME`) is resolved once, when the chunk loads. The global `NpcID` is a different class, read from the game's cache, which gives many of the same names other values. declare LegacyNpcID: IdClass --- `LegacyObjectID`: 30528 constants, answered lazily from the generated table, so an unread one costs nothing and a constant path in plugin code (`LegacyObjectID.NAME`) is resolved once, when the chunk loads. The global `ObjectID` is a different class, read from the game's cache, which gives many of the same names other values. declare LegacyObjectID: IdClass --- `LegacyInterfaceID`: 93 constants, answered lazily from the generated table, so an unread one costs nothing and a constant path in plugin code (`LegacyInterfaceID.NAME`) is resolved once, when the chunk loads. The global `InterfaceID` is a different class, read from the game's cache, which gives many of the same names other values. declare LegacyInterfaceID: IdClass --- `SpriteID` and its nested classes (`Owner.Nested.NAME`), read from the game's own cache when the client starts, so the ids are this game build's, with a fixed table answering any name the cache does not. A constant path in plugin code (`SpriteID.NAME`) is resolved once, when the chunk loads. A name this build does not have raises. declare SpriteID: IdClass --- `AnimationID`, read from the game's own cache when the client starts, so the ids are this game build's. A constant path in plugin code (`AnimationID.NAME`) is resolved once, when the chunk loads. A name this build does not have raises. declare AnimationID: IdClass --- `DBTableID` and its nested classes (`Owner.Nested.NAME`), read from the game's own cache when the client starts, so the ids are this game build's. A constant path in plugin code (`DBTableID.NAME`) is resolved once, when the chunk loads. A name this build does not have raises. declare DBTableID: IdClass --- `InterfaceID` and its nested classes (`Owner.Nested.NAME`), read from the game's own cache when the client starts, so the ids are this game build's. A constant path in plugin code (`InterfaceID.NAME`) is resolved once, when the chunk loads. A name this build does not have raises. declare InterfaceID: InterfaceIdClass --- `InventoryID`, read from the game's own cache when the client starts, so the ids are this game build's. A constant path in plugin code (`InventoryID.NAME`) is resolved once, when the chunk loads. A name this build does not have raises. declare InventoryID: IdClass --- `ItemID` and its nested classes (`Owner.Nested.NAME`), read from the game's own cache when the client starts, so the ids are this game build's. A constant path in plugin code (`ItemID.NAME`) is resolved once, when the chunk loads. A name this build does not have raises. declare ItemID: IdClass --- `NpcID`, read from the game's own cache when the client starts, so the ids are this game build's. A constant path in plugin code (`NpcID.NAME`) is resolved once, when the chunk loads. A name this build does not have raises. declare NpcID: IdClass --- `ObjectID`, read from the game's own cache when the client starts, so the ids are this game build's. A constant path in plugin code (`ObjectID.NAME`) is resolved once, when the chunk loads. A name this build does not have raises. declare ObjectID: IdClass --- `SpotanimID`, read from the game's own cache when the client starts, so the ids are this game build's. A constant path in plugin code (`SpotanimID.NAME`) is resolved once, when the chunk loads. A name this build does not have raises. declare SpotanimID: IdClass --- `VarClientID`, read from the game's own cache when the client starts, so the ids are this game build's. A constant path in plugin code (`VarClientID.NAME`) is resolved once, when the chunk loads. A name this build does not have raises. declare VarClientID: IdClass --- `VarPlayerID`, read from the game's own cache when the client starts, so the ids are this game build's. A constant path in plugin code (`VarPlayerID.NAME`) is resolved once, when the chunk loads. A name this build does not have raises. declare VarPlayerID: IdClass --- `VarbitID`, read from the game's own cache when the client starts, so the ids are this game build's. A constant path in plugin code (`VarbitID.NAME`) is resolved once, when the chunk loads. A name this build does not have raises. declare VarbitID: IdClass --- Sound-effect ids. declare SoundID: IdClass --- Cache db-row ids. declare DbRowID: IdClass --- A plugin: the object `Plugin.new{...}` builds and `src/main.luau` returns. --- --- Its hooks (`function plugin:onGameTick(event)`) are listed, each with its event's class, --- in `type Plugin`; annotate a hook's parameter with its class (`event: GameTick`) to complete --- on it. The object is not typed `Plugin` itself: that type reaches every event class, and the --- analyzer the marketplace runs gives up ("code is too complex") wherever such an object is --- passed to a typed parameter (`InfoBox.new(image, plugin)`). export type PluginObject = { --- Runs on every enable, before any event. Override it. startUp: (PluginObject) -> (), --- Runs on every disable, after the plugin is unregistered. Override it. shutDown: (PluginObject) -> (), --- Runs on the settings page's Reset. Override it to clear what the plugin keeps outside its config group. resetConfiguration: (PluginObject) -> (), --- The descriptor's name. getName: (PluginObject) -> string?, --- The plugin's id (its package folder's name). getId: (PluginObject) -> string?, --- Any other field it carries. [string]: any, } --- A plugin: the object `Plugin.new{...}` builds and `src/main.luau` returns. --- --- The object's hooks and methods are `type Plugin`'s. export type PluginClass = { --- Builds the plugin object. Its optional table is the plugin's descriptor (see `PluginDescriptor`). Field initialisers and one-time setup belong in the chunk, which runs once at load. new: (descriptor: PluginDescriptorFields?) -> PluginObject, } declare Plugin: PluginClass --- What a plugin says about itself: the table `Plugin.new{...}` takes (`name`, `description`, `tags`, `conflicts`, `enabledByDefault`, `hidden`, `developerPlugin`, ...). Read it back with `pluginManager:getPluginDescriptor(plugin)`, which answers each field through a method of its name; another plugin's answers only `name`, `description`, `tags`, `conflicts`, `enabledByDefault`, `hidden` and `developerPlugin` as declared. `icon` is the side-panel icon (a `BufferedImage`, as `ImageUtil.loadImageResource` returns, or PNG bytes) and `dependencies` the ids of the plugins it needs; neither is read back. export type PluginDescriptor = { --- The name the plugin list shows, as declared: `` markup included. name: (PluginDescriptor) -> string, --- The description the plugin list shows. description: (PluginDescriptor) -> string, --- What the plugin list's search matches. tags: (PluginDescriptor) -> {string}, --- The names of plugins this one cannot run beside. conflicts: (PluginDescriptor) -> {string}, --- Whether it is enabled until the user chooses; true when absent. enabledByDefault: (PluginDescriptor) -> boolean, --- Whether it is left out of the plugin list. hidden: (PluginDescriptor) -> boolean, --- Whether it loads in developer mode only. developerPlugin: (PluginDescriptor) -> boolean, } --- The `pluginManager` global: every plugin, and starting and stopping them. Any plugin starts, stops, enables and disables any other. Every plugin it lists is its real object: fields and methods read as on any object. Where there is none it is a stand-in with `getName()` and `getId()`, which every method here takes: a first-party plugin has none. A marketplace plugin holds a local plugin's object through a view: fields, methods, `#`, `pairs`, `ipairs` and `for k, v in view` read as on the object, an assignment writes to it, and a table or function read through it comes back a view or wrapper too (`next`, `rawget`, `rawset` and the `table` library see a view's own empty table). While its call into the local plugin runs, and in the timers, jobs, tasks and subscriptions that call leaves, the local plugin's code reaches no network host and opens only the links a marketplace plugin may. A function it passes in runs as itself wherever the local plugin calls it. A call through a view cannot yield. export type PluginManager = { --- Every plugin, in load order: this one as itself, each other one as its object (a local plugin's as a view, to a marketplace plugin) or its stand-in. getPlugins: (PluginManager) -> {PluginObject}, --- The saved choice, else `enabledByDefault`. isPluginEnabled: (PluginManager, plugin: PluginObject) -> boolean, --- Running: started, not stopped since. isPluginActive: (PluginManager, plugin: PluginObject) -> boolean, --- Save the plugin's choice (enabling switches its conflicts off), starting or stopping nothing. Any plugin's, this one's or another's. setPluginEnabled: (PluginManager, plugin: PluginObject, enabled: boolean) -> (), --- Start the plugin when it is enabled and not running, its conflicts stopped first. From a callback it runs at the next safe point and answers `true` (queued). Any plugin, this one or another. startPlugin: (PluginManager, plugin: PluginObject) -> boolean, --- Stop the plugin (unregistered, then `shutDown`); it stays enabled, and stopped. As `startPlugin`, from a callback at the next safe point, never inside the plugin's own callback, task or render; answers `true` (queued). Any plugin, this one or another. stopPlugin: (PluginManager, plugin: PluginObject) -> boolean, --- Every other plugin whose name, or any of whose conflicts, is this plugin's name or in its conflicts. conflictsForPlugin: (PluginManager, plugin: PluginObject) -> {PluginObject}, --- The plugin's own config proxy, or nil when it declared none (a first-party plugin has none). Another plugin's proxy reads and writes that plugin's group, as `configManager` does: a `secret` item answers its own plugin only. A marketplace plugin holds a local plugin's proxy through a view. getPluginConfigProxy: (PluginManager, plugin: PluginObject) -> any, --- A plugin's descriptor, its fields as methods (see `PluginDescriptor`). getPluginDescriptor: (PluginManager, plugin: PluginObject) -> PluginDescriptor, } --- The `pluginManager` global: every plugin, and starting and stopping them. Any plugin starts, stops, enables and disables any other. Every plugin it lists is its real object: fields and methods read as on any object. Where there is none it is a stand-in with `getName()` and `getId()`, which every method here takes: a first-party plugin has none. A marketplace plugin holds a local plugin's object through a view: fields, methods, `#`, `pairs`, `ipairs` and `for k, v in view` read as on the object, an assignment writes to it, and a table or function read through it comes back a view or wrapper too (`next`, `rawget`, `rawset` and the `table` library see a view's own empty table). While its call into the local plugin runs, and in the timers, jobs, tasks and subscriptions that call leaves, the local plugin's code reaches no network host and opens only the links a marketplace plugin may. A function it passes in runs as itself wherever the local plugin calls it. A call through a view cannot yield. declare pluginManager: PluginManager --- The `eventBus` global: subscribes functions and objects to events, and posts events to them. export type EventBus = { --- `register(object)`: every `on` method of the object subscribes; `register(EventClass, fn, priority)` returns the subscriber. An object's `eventFilters` table, keyed by handler name, gives a handler the filter `eventBus:subscribe` takes as its fourth argument (`p.eventFilters = { onScriptPostFired = { scriptId = { 750 } } }`); read once, when the object is registered (the plugin object: set it before the chunk returns). `onScriptPreFired` and `onScriptPostFired` need one with `scriptId`. register: (EventBus, objectOrClass: any, ((any) -> ())?, priority: number?) -> EventSubscriber?, --- Undo `register(object)`, or one subscription. unregister: (EventBus, objectOrSubscriber: any) -> (), --- Every subscriber in every plugin, higher priority first, then by plugin, synchronously; a subscriber's field writes are seen by later ones and by the poster. The event is an instance of a class the plugin named (`class(Base, "LootReceived")`); another plugin's VM gets its plain-data fields (functions and handles are left out), as its own class of that name or as an object with a getter per field (`getName()` for `name`). Posting one of the client's own event classes (a fake `VarbitChanged`) is refused: the client raises those itself. post: (EventBus, event: any) -> (), --- Subscribe `fn` to an event class: `subscribe(EventClass, fn, priority)`, higher priority first. Alternative to a handler's first-line early return (`if event:getActor() ~= client:getLocalPlayer() then return end`, `if event:getVarbitId() ~= X then return end`): a fourth argument `filter`, `{ actor = "local" }` (AnimationChanged, InteractingChanged (its source), HitsplatApplied, GraphicChanged, OverheadTextChanged, ActorDeath, SpotAnimationChanged) or `{ varbit = { ids }, varp = { ids } }` (VarbitChanged), is tested in Rust when the event is raised: a raise it refuses never enters the plugin (about 0.07 µs where the early return costs a Luau entry, about 0.8 µs), and what it admits reaches `fn` as before. A raise it cannot judge is admitted. A filter the event cannot test is refused at the call. `{ eventName = "name" }` or `{ eventName = { names } }` (ScriptCallbackEvent) is the alternative to testing `event:getEventName()` first in the handler, for a subscriber that acts on a few of the many callbacks the client's scripts raise: a callback no plugin's subscriber names is not raised at all (the site's lookup, no Luau entry). `{ scriptId = id }`, `{ scriptId = { ids } }` or `{ scriptId = "all" }` (ScriptPreFired, ScriptPostFired) names the scripts a subscription takes, and is required for those two events: a script no subscriber named is not raised at all, and a subscription without it is refused, since every script the client runs would reach it. `"all"` takes every script, on purpose (a script inspector). subscribe: (EventBus, eventClass: any, (any) -> (), priority: number?, filter: { actor: "local"?, varbit: { number }?, varp: { number }?, eventName: Strings?, scriptId: ScriptIds? }?) -> EventSubscriber, } --- The `eventBus` global: subscribes functions and objects to events, and posts events to them. declare eventBus: EventBus --- The `clientToolbar` global: the sidebar rail's buttons. export type ClientToolbar = { --- Add a rail button. addNavigation: (ClientToolbar, button: NavigationButton) -> (), --- Remove a rail button. removeNavigation: (ClientToolbar, button: NavigationButton) -> (), --- Select the button's panel and open the sidebar. openPanel: (ClientToolbar, button: NavigationButton) -> (), } --- The `clientToolbar` global: the sidebar rail's buttons. declare clientToolbar: ClientToolbar --- A button on the sidebar rail, made with `NavigationButton.builder()` and added with `clientToolbar:addNavigation`. Immutable once built. export type NavigationButton = { --- The image or PNG bytes the rail draws. getIcon: (NavigationButton) -> (BufferedImage | string)?, --- The hover text. getTooltip: (NavigationButton) -> string, --- What a panel-less button runs. getOnClick: (NavigationButton) -> (() -> ())?, --- The panel it opens. getPanel: (NavigationButton) -> PluginPanel?, --- Rail order, lower first. getPriority: (NavigationButton) -> number, --- The right-click menu's entries, as given to the builder. getPopup: (NavigationButton) -> any, } --- `NavigationButton`'s static functions and constants. export type NavigationButtonClass = { --- A new builder. builder: () -> NavigationButtonBuilder, } declare NavigationButton: NavigationButtonClass --- Builds a `NavigationButton`: each setter returns the builder. export type NavigationButtonBuilder = { --- The button. build: (NavigationButtonBuilder) -> NavigationButton, --- Hover text. tooltip: (NavigationButtonBuilder, tooltip: string) -> NavigationButtonBuilder, --- Rail order, lower first. priority: (NavigationButtonBuilder, priority: number) -> NavigationButtonBuilder, --- The panel it opens: a `PluginPanel`, a Swing tree the sidebar lays out and paints. panel: (NavigationButtonBuilder, panel: PluginPanel) -> NavigationButtonBuilder, --- What a panel-less button runs. onClick: (NavigationButtonBuilder, onClick: () -> ()) -> NavigationButtonBuilder, --- The right-click menu: `{ {label, fn}, ... }` keeps its order, a `{ [label] = fn }` map is sorted. popup: (NavigationButtonBuilder, entries: {[string]: () -> ()}) -> NavigationButtonBuilder, --- The image the rail draws at its own size (`ImageUtil.loadImageResource(...)`); PNG bytes (`Asset.bytes("icon.png")`) are taken too. icon: (NavigationButtonBuilder, icon: BufferedImage | string) -> NavigationButtonBuilder, } --- A settings group, named by the `name` of its `ConfigGroup(name, items)` call; `getConfigDescriptor(proxy):getGroup()` reads the name back. export type ConfigGroupAnnotation = { --- The group's name. value: (ConfigGroupAnnotation) -> string, } --- One setting: `ConfigItem{ keyName, name, description, position, section, type, default, secret, hidden, warning, method }`; `getConfigDescriptor(proxy):getItems()[i]:getItem()` reads it back. export type ConfigItemAnnotation = { --- The store's key. keyName: (ConfigItemAnnotation) -> string, --- The settings page's label. name: (ConfigItemAnnotation) -> string, --- The settings page's tooltip, which its filter also searches. description: (ConfigItemAnnotation) -> string, --- The `keyName` of the `ConfigSection` it sits in; empty for none. section: (ConfigItemAnnotation) -> string, --- Whether only the plugin that declares it reads it; a text item also shows as a password field. secret: (ConfigItemAnnotation) -> boolean, --- Whether it is left off the settings page; it is stored and read like any other item. hidden: (ConfigItemAnnotation) -> boolean, --- What the settings page asks the user to confirm before it changes the value; empty for nothing. warning: (ConfigItemAnnotation) -> string, } --- A section of the settings page: `ConfigSection{ keyName, name, description, position, closedByDefault }`; `getConfigDescriptor(proxy):getSections()[i]:getSection()` reads it back. export type ConfigSectionAnnotation = { --- The section's label. name: (ConfigSectionAnnotation) -> string, --- The section's tooltip. description: (ConfigSectionAnnotation) -> string, --- Whether it starts collapsed. closedByDefault: (ConfigSectionAnnotation) -> boolean, } --- A number's bounds: `ConfigItem{ ..., range = { min = …, max = … } }`, 0 and 2147483647 when left out; `getRange()` on the item's descriptor reads them back. export type RangeAnnotation = { --- The lowest value. min: (RangeAnnotation) -> number, --- The highest value. max: (RangeAnnotation) -> number, } --- The suffix a number shows: `ConfigItem{ ..., units = Units.X }`; `getUnits()` on the item's descriptor reads it back. export type UnitsAnnotation = { --- The suffix. value: (UnitsAnnotation) -> string, } --- A settings group's declaration: `configManager:getConfigDescriptor(proxy)`. export type ConfigDescriptor = { --- The group. getGroup: (ConfigDescriptor) -> ConfigGroupAnnotation, --- Its items, sorted by position then name. getItems: (ConfigDescriptor) -> {ConfigItemDescriptor}, --- Its sections, sorted by position then name. getSections: (ConfigDescriptor) -> {ConfigSectionDescriptor}, } --- One item of a `ConfigDescriptor`. export type ConfigItemDescriptor = ConfigObject & { --- The fields `ConfigItem{...}` declared, as methods. getItem: (ConfigItemDescriptor) -> ConfigItemAnnotation, --- The `range` it declared, or nil. getRange: (ConfigItemDescriptor) -> RangeAnnotation?, --- Non-nil when it declared `alpha = true`. getAlpha: (ConfigItemDescriptor) -> any, --- The `units` it declared, or nil. getUnits: (ConfigItemDescriptor) -> UnitsAnnotation?, --- The type `ConfigItem{ type = ... }` declared, which `getConfiguration(group, key, type)` takes. getType: (ConfigItemDescriptor) -> any, } --- One section of a `ConfigDescriptor`. export type ConfigSectionDescriptor = ConfigObject & { --- Its `keyName`. getKey: (ConfigSectionDescriptor) -> string, --- The fields `ConfigSection{...}` declared, as methods. getSection: (ConfigSectionDescriptor) -> ConfigSectionAnnotation, } --- What both descriptor kinds answer. export type ConfigObject = { --- Its name. name: (ConfigObject) -> string, --- Its position. position: (ConfigObject) -> number, } --- The `configManager` global (and `ConfigManager`'s constants): reads and writes settings. A group is named as its plugin names it, and any plugin reads and writes any plugin's group, the client's own settings (`client`, `textrecolor`) included, but for two things. An item declared `secret` is read only by a plugin that declares it so. A marketplace plugin's own groups are kept apart from a local install's: the group its settings page shows, one it holds a value in, and one it declares that no other plugin has. Whichever plugin's `configManager` is called, it acts for the plugin calling it. export type ConfigManager = { --- The group's proxy (`ConfigGroup(name, items)` declares the group): `config:keyName()` reads an item, by its `keyName` or the getter name given as `method`; `config:setKeyName(value)` (or the item's `setter`) and `config:keyName(value)` write it, and `nil` unsets it. A read is cached until the group changes. The proxy reads and writes the group of the plugin that made it, whoever holds it; another plugin's calls are held to that plugin's rules (see `ConfigManager`). getConfig: (ConfigManager, group: ConfigGroup) -> any, --- Four forms: `(group, key)` is the stored string (or nil); `(group, key, type)` reads it as `type`, any type a `ConfigItem` takes (`"int"`, `Duration`, `Color`, an enum class, `{ set = SomeEnum }`, ...); `(group, profile, key)` and `(group, profile, key, type)` read an RS profile's value. An unset key with a declared default reads as the default. getConfiguration: ((ConfigManager, group: ConfigGroup | string, key: string) -> string?) & ((ConfigManager, group: ConfigGroup | string, key: string, type: ConfigItemType) -> any) & ((ConfigManager, group: ConfigGroup | string, profile: string, key: string, type: ConfigItemType) -> any), --- `(group, key, value)`, stored as a string (a `Duration` as its milliseconds, an `Instant` as ISO-8601, a `WorldPoint` as `x:y:plane`, ...), or `(group, profile, key, value)` for an RS profile. Writing the value already there changes nothing and posts no `ConfigChanged`; `unsetConfiguration` removes one. setConfiguration: ((ConfigManager, group: ConfigGroup | string, key: string, value: ConfigValue) -> ()) & ((ConfigManager, group: ConfigGroup | string, profile: string, key: string, value: ConfigValue) -> ()), --- `(group, key)` removes a value, `(group, profile, key)` an RS profile's. unsetConfiguration: (ConfigManager, group: ConfigGroup | string, keyOrProfile: string?, key: string?) -> (), --- Whole keys under a prefix. getConfigurationKeys: (ConfigManager, prefix: string) -> {string}, --- The logged-in account's RS profile. getRSProfileKey: (ConfigManager) -> string?, --- A value of the logged-in account's RS profile. getRSProfileConfiguration: (ConfigManager, group: ConfigGroup | string, key: string, type: any?) -> any, --- Write one. setRSProfileConfiguration: (ConfigManager, group: ConfigGroup | string, key: string, value: any) -> (), --- Remove one. unsetRSProfileConfiguration: (ConfigManager, group: ConfigGroup | string, key: string) -> (), --- Keys under a prefix. getRSProfileConfigurationKeys: (ConfigManager, group: ConfigGroup | string, profile: string?, keyPrefix: string?) -> {string}, --- Every RS profile record. getRSProfiles: (ConfigManager) -> {RuneScapeProfile}, --- The group's declaration. getConfigDescriptor: (ConfigManager, config: any) -> ConfigDescriptor, --- Write every change not yet on disk now. sendConfig: (ConfigManager) -> (), --- Per item: with override, each item with a default written back to it (no `ConfigChanged` when it is the stored string already) and each without one unset; without, the default written where the stored value is missing or does not read as the item's type. setDefaultConfiguration: (ConfigManager, config: any, override: boolean) -> (), } --- `ConfigManager`'s static functions and constants. export type ConfigManagerClass = { --- "rsprofile". RSPROFILE_GROUP: string, --- "displayName". RSPROFILE_DISPLAY_NAME: string, --- "type". RSPROFILE_TYPE: string, } declare ConfigManager: ConfigManagerClass --- The `configManager` global (and `ConfigManager`'s constants): reads and writes settings. A group is named as its plugin names it, and any plugin reads and writes any plugin's group, the client's own settings (`client`, `textrecolor`) included, but for two things. An item declared `secret` is read only by a plugin that declares it so. A marketplace plugin's own groups are kept apart from a local install's: the group its settings page shows, one it holds a value in, and one it declares that no other plugin has. Whichever plugin's `configManager` is called, it acts for the plugin calling it. declare configManager: ConfigManager --- One notification's settings, as a `ConfigItem` of type `Notification` holds them. Immutable: each `withX` returns a copy. A disabled notification does nothing; one that is not an initialised override takes the user's notification settings. export type Notification = { --- Whether it does anything. isEnabled: (Notification) -> boolean, --- How it flashes the game frame. getFlash: (Notification) -> FlashNotification?, --- The flash's colour. getFlashColor: (Notification) -> Color?, --- The window focus request it makes. getRequestFocus: (Notification) -> RequestFocusType?, --- The sound it plays. getSound: (Notification) -> NotificationSound?, --- The name of the custom sound it plays, if any. getSoundName: (Notification) -> string?, --- How long it shows, in milliseconds. getTimeout: (Notification) -> number, --- The volume of a custom sound. getVolume: (Notification) -> number, --- Whether it adds a message to the chatbox. isGameMessage: (Notification) -> boolean, --- Whether its settings were filled in: with `isOverride`, what keeps it from taking the user's. isInitialized: (Notification) -> boolean, --- Whether it uses its own settings rather than the user's. isOverride: (Notification) -> boolean, --- Whether it fires even when the client is focused. isSendWhenFocused: (Notification) -> boolean, --- Whether it shows a tray notification. isTray: (Notification) -> boolean, --- The tray notification's icon (`TrayIcon.MessageType`). getTrayIconType: (Notification) -> any, --- A copy with `enabled` changed. withEnabled: (Notification, enabled: boolean) -> Notification, --- A copy with `flash` changed. withFlash: (Notification, flash: FlashNotification?) -> Notification, --- A copy with `flashColor` changed. withFlashColor: (Notification, flashColor: Color?) -> Notification, --- A copy with `gameMessage` changed. withGameMessage: (Notification, gameMessage: boolean) -> Notification, --- A copy with `override` changed. withOverride: (Notification, override: boolean) -> Notification, --- A copy with `requestFocus` changed. withRequestFocus: (Notification, requestFocus: RequestFocusType?) -> Notification, --- A copy with `sendWhenFocused` changed. withSendWhenFocused: (Notification, sendWhenFocused: boolean) -> Notification, --- A copy with `sound` changed. withSound: (Notification, sound: NotificationSound?) -> Notification, --- A copy with `soundName` changed. withSoundName: (Notification, soundName: string?) -> Notification, --- A copy with `timeout` changed. withTimeout: (Notification, timeout: number) -> Notification, --- A copy with `tray` changed. withTray: (Notification, tray: boolean) -> Notification, --- A copy with `volume` changed. withVolume: (Notification, volume: number) -> Notification, --- A copy with `initialized` changed. withInitialized: (Notification, initialized: boolean) -> Notification, --- A copy with `trayIconType` changed. withTrayIconType: (Notification, trayIconType: any) -> Notification, } --- `Notification`'s static functions and constants. export type NotificationClass = { --- Every field, or none. In order: `enabled`, `initialized`, `override`, `tray`, `trayIconType`, `requestFocus`, `sound`, `soundName`, `volume`, `timeout`, `gameMessage`, `flash`, `flashColor`, `sendWhenFocused`. new: (...any) -> Notification, --- Disabled. OFF: Notification, --- Enabled, with the user's notification settings. ON: Notification, } declare Notification: NotificationClass --- An RS profile record: what `configManager:getRSProfiles()` lists. export type RuneScapeProfile = { --- The account's display name, when known. getDisplayName: (RuneScapeProfile) -> string?, --- The profile's key. getKey: (RuneScapeProfile) -> string, --- The profile's type, or nil. getType: (RuneScapeProfile) -> RuneScapeProfileType?, --- The account's hash. getAccountHash: (RuneScapeProfile) -> number, } --- `RuneScapeProfile`'s static functions and constants. export type RuneScapeProfileClass = { --- -1. ACCOUNT_HASH_INVALID: number, } declare RuneScapeProfile: RuneScapeProfileClass --- The `clientConfig` global: the client's own settings (the `client` group). export type ClientConfig = { --- Whether item prices are actively traded prices, sourced from the RuneScape wiki. useWikiItemPrices: (ClientConfig) -> boolean, --- Whether notifications add a message to the chatbox. enableGameMessageNotification: (ClientConfig) -> boolean, --- Whether notifications show in the tray. enableTrayNotifications: (ClientConfig) -> boolean, --- How notifications flash the game frame. flashNotification: (ClientConfig) -> FlashNotification, --- The font for in-game interface overlays. interfaceFont: (ClientConfig) -> FontType, --- The colour of notification flashes. notificationFlashColor: (ClientConfig) -> Color, --- The window focus request a notification makes. notificationRequestFocus: (ClientConfig) -> RequestFocusType, --- The sound notifications play. notificationSound: (ClientConfig) -> NotificationSound, --- How long a notification shows, in milliseconds; 0 uses the system's setting (Linux only). notificationTimeout: (ClientConfig) -> number, --- The volume of custom notification sounds, 0-100 (it does not control the native sound). notificationVolume: (ClientConfig) -> number, --- Whether notifications are sent even when the client is focused. sendNotificationsWhenFocused: (ClientConfig) -> boolean, --- Any other field it carries. [string]: any, } --- The `clientConfig` global: the client's own settings (the `client` group). declare clientConfig: ClientConfig --- Posted when a stored setting changes. The values are the stored strings (see `configManager:setConfiguration`). export type ConfigChanged = { --- The group that changed. getGroup: (ConfigChanged) -> string, --- The RS profile, or nil. getProfile: (ConfigChanged) -> string?, --- The key that changed; nil for a whole group reset. getKey: (ConfigChanged) -> string, --- The stored string before, or nil. getOldValue: (ConfigChanged) -> string?, --- The stored string now, or nil. getNewValue: (ConfigChanged) -> string?, --- `getGroup()`. group: string, --- `getKey()`; nil for a whole group reset. key: string?, --- `getProfile()`: the RS profile, or nil. profile: string?, --- The store scope that changed. scope: string?, --- `getOldValue()`. oldValue: string?, --- `getNewValue()`. newValue: string?, --- Any other field it carries. [string]: any, } --- Posted after a plugin started or stopped. export type PluginChanged = { --- The plugin (this one as itself, another as its handle). getPlugin: (PluginChanged) -> PluginObject, --- Started (`true`) or stopped. isLoaded: (PluginChanged) -> boolean, --- `isLoaded()`. loaded: boolean, --- The plugin's id. plugin: string, --- The plugin's name. name: string, --- Any other field it carries. [string]: any, } --- Posted when a plugin was added or removed since the plugins started (the marketplace delivered one, or it left the library). export type ExternalPluginsChanged = { --- Any other field it carries. [string]: any, } --- Posted when the config profile was switched. export type ProfileChanged = { --- Any other field it carries. [string]: any, } --- Posted when the logged-in account's RS profile changes. export type RuneScapeProfileChanged = { --- The RS profile before. getPreviousProfile: (RuneScapeProfileChanged) -> string?, --- The RS profile now. getNewProfile: (RuneScapeProfileChanged) -> string?, --- `getPreviousProfile()`. previousProfile: string?, --- `getNewProfile()`. newProfile: string?, --- Any other field it carries. [string]: any, } --- Posted when an overlay's shift-right-click entry with no callback was picked. export type OverlayMenuClicked = { --- The entry picked: the overlay's plugin's own object there, an equal copy in another plugin. getEntry: (OverlayMenuClicked) -> OverlayMenuEntry, --- The overlay the entry is on, in the overlay's own plugin; nil in another plugin (no object crosses between plugins). getOverlay: (OverlayMenuClicked) -> Overlay?, --- Any other field it carries. [string]: any, } --- Tasks: `task(fn, ...)`, `sleepTicks(n)`, `waitUntil(pred, timeoutTicks)`: code that waits across game ticks without blocking the game. export type Task = { --- Stop the task where it waits. cancel: (Task) -> (), --- Not finished, failed or cancelled. isAlive: (Task) -> boolean, --- Whether it ran to its end. A failed or cancelled task is not done, and not alive either. isDone: (Task) -> boolean, --- What it failed with, or nil. getError: (Task) -> any, } --- Run `fn` as a task: now, to its first wait, then a step per game tick. declare task: ((...any) -> ...any, ...any) -> Task --- Suspends the calling task for `n` game ticks (default 1); only inside a `task`. `sleepTicks(1)` resumes it once the next game tick has reached every plugin. declare sleepTicks: (ticks: number?) -> () --- Suspend the task until `pred()` is true, checking now and once per game tick, for at most `timeoutTicks` game ticks. Whether it came true. declare waitUntil: (() -> boolean, timeoutTicks: number) -> boolean --- What `eventBus:subscribe(...)` and `eventBus:register(EventClass, fn, priority)` return, --- for `eventBus:unregister`. export type EventSubscriber = {} --- The scripts a `scriptId` filter names: one id, an array of ids, or `"all"`. export type ScriptIds = number | { number } | "all" --- One string, or an array of them. export type Strings = string | { string } --- What a config item's `type` is: a type's name (`"boolean"`, `"int"`, `"long"`, `"double"`, `"String"`), a class the --- item holds (`Color`, `WorldPoint`, `Duration`, ...), an enum class, or `{ set = SomeEnum }` for a set of its constants. export type ConfigItemType = string | EnumClass | ClassTable | ColorClass | KeybindClass | ModifierlessKeybindClass | NotificationClass | WorldPointClass | DurationClass | InstantClass | DimensionClass | PointClass | RectangleClass | { set: EnumClass } --- A value a config item holds. export type ConfigValue = boolean | number | string | Color | Keybind | ModifierlessKeybind | Notification | WorldPoint | Duration | Instant | Dimension | Point | Rectangle | any --- The table `Plugin.new{...}` takes. --- --- What a plugin says about itself: the table `Plugin.new{...}` takes (`name`, `description`, `tags`, `conflicts`, `enabledByDefault`, `hidden`, `developerPlugin`, ...). Read it back with `pluginManager:getPluginDescriptor(plugin)`, which answers each field through a method of its name; another plugin's answers only `name`, `description`, `tags`, `conflicts`, `enabledByDefault`, `hidden` and `developerPlugin` as declared. `icon` is the side-panel icon (a `BufferedImage`, as `ImageUtil.loadImageResource` returns, or PNG bytes) and `dependencies` the ids of the plugins it needs; neither is read back. export type PluginDescriptorFields = { --- The name the plugin list shows. `` (six hex digits) colours the text after --- it and `` ends the colour, as in game text; emoji draw in colour. Search, sorting --- and tooltips use the name without the tags. name: string?, --- The description the plugin list shows. description: string?, --- What the plugin list's search matches. tags: {string}?, --- Names of plugins this one cannot run beside. conflicts: {string}?, --- Whether it is enabled until the user chooses; true when absent. enabledByDefault: boolean?, --- Not shown in the plugin list. hidden: boolean?, --- Loaded in developer mode only. developerPlugin: boolean?, --- The side-panel icon, a `BufferedImage` (`ImageUtil.loadImageResource(...)`) --- or PNG bytes (`Asset.bytes(...)`). icon: (BufferedImage | string)?, --- The plugins this one needs, by plugin id: `Plugin.new{ dependencies = { "x" } }`. The registry registers a dependency before what needs it and refuses a plugin whose dependency it does not have ("Unmet dependency for ..."). Four always-installed services are always met, named by class or package: `XpTrackerPlugin`/`xptracker` (`xpTrackerService`), `SlayerPlugin`/`slayer` (`slayerPluginService`), `ItemStatPlugin`/`itemstats` (`itemStatChangesService`), `BankTagsPlugin`/`banktags` (`tagManager`). The host's own service globals need no entry. dependencies: {string}?, } --- One game setting a plugin recommends: `recommendedSettings` returns a list of these. Give --- the value as one of `on`, `option` and `value`, as the setting's kind takes it, or the values it --- must not hold as `notOption`/`notValue`. A malformed --- entry, an unknown key or a value the setting cannot hold is dropped with a logged warning; --- the rest stand. export type RecommendedSetting = { --- The setting, by its key: `buff_bar`, `level_up_popups`, ... The Game settings reference --- on the docs site lists every key, with its kind and options. setting: string, --- A toggle's value: `false` turns the game's own version off. on: boolean?, --- A dropdown's or keybind's option, by its name in All Settings (any case). option: string?, --- Any other setting's value (a number; a colour's RGB), or an option's value. value: number?, --- Values the setting must not hold, by option name: one name or a list (a dropdown or --- keybind). With it, `option` or `value` is only what the guide suggests; left out, the --- guide suggests the first option not excluded (a number has no options: give --- `value`). A toggle takes `on` instead. notOption: (string | {string})?, --- As `notOption`, by value: one number or a list. notValue: (number | {number})?, --- Why, for the player. reason: string?, } --- What `class(Base, name)` returns: a class table. Define the class's methods on it --- (`function X:render(graphics) ... end`), its constructor as `X:init(...)`, and build --- instances with `X.new(...)`. --- --- A base constructor runs once per `X.new`. A base whose `init` takes no parameters (or a --- framework or Bento class: `Overlay`, `InfoBox`, `PluginPanel`) runs first, with none. A base --- whose own `init` declares parameters runs where `X:init` calls `X.super.init(self, ...)` --- (make it the first statement), with those arguments; a subclass that never calls it gets it --- run after its own `init` with no arguments, keeping the fields that `init` set. export type ClassTable = { --- Builds an instance: the base classes' constructors, then this class's `init`. new: (...any) -> any, --- The base class, for `X.super.method(self, ...)`. super: any, --- Whether `obj` is an instance of `X` or of a class that extends it. isInstance: (obj: any) -> boolean, --- The methods and static fields you define on it. [string]: any, } --- Declares a class: `local Name = class(Base, "Name")` (`Base` nil for none). --- --- Give the name: it keys an `Overlay`'s saved position and an `InfoBox`'s name, and `eventBus` --- delivers a posted event by it. Without one, a class in a local package takes the file name --- of the module that defines it, when that module is not `src/main.luau` and defines only one --- such class; a published (marketplace) plugin's modules have no file names, so there an --- unnamed class falls back to a name that a change of the plugin's code can change (where its --- first method is defined, or the order classes are first named in), and its saved position --- with it: name every `Overlay` and `InfoBox` class. --- --- `init` is always the constructor: give any other method another name (`initPanel`). A second --- `function X:init` raises where it is defined, and calling `obj:init(...)` on a built --- instance raises, both naming the rename. declare function class(base: any?, name: string?): ClassTable --- What `enum(name, constants, init)` returns. A constant is `E.NAME`; it answers `name()`, --- `ordinal()` (0-based), `toString()`, `compareTo(other)` and `equals(other)`. export type EnumClass = { --- Every constant in declaration order, as a new 1-based array. values: () -> {any}, --- The constant named `name`; any other name raises. valueOf: (name: string) -> any, --- The constants, and the static methods you define. [string]: any, } --- Declares an enum: `enum("Name", { "A", { "B", "x", 1 } }, function(self, s, n) ... end)` has --- the constants `Name.A` (built with no arguments) and `Name.B` (built with `"x", 1`). --- --- `init` is the constructor; set fields on `self`. A field may not be named `name`, `ordinal`, --- `toString`, `compareTo` or `equals` (enum() raises): for a field called `name`, use --- `self._name` and `function E:getName() return self._name end`. declare enum: (name: string, constants: {any}, init: ((self: any, ...any) -> ())?) -> EnumClass --- What `ConfigGroup(name, items, constants)` returns: the group, which --- `configManager:getConfig(group)` turns into the config proxy (`config:keyName()` reads an --- item, `config:setKeyName(value)` or `config:keyName(value)` writes one). The constants --- (`ConfigGroup("x", {...}, { GROUP_KEY = "x" })`) are its fields (`XConfig.GROUP_KEY`). export type ConfigGroup = { --- The group's name. name: string, --- The group's constants. [string]: any, } --- The table `ConfigItem{...}` takes: one setting. export type ConfigItemFields = { --- The store's key. keyName: string, --- The settings page's label. name: string, --- The settings page's tooltip, which its filter also searches. description: string?, --- Its place among the section's items, lowest first, then by name; -1 when absent. position: number?, --- The `keyName` of the `ConfigSection` it sits in. section: string?, --- The value's type: "boolean", "int", "long", "double", "String", Color, Keybind, --- ModifierlessKeybind, Notification, WorldPoint, Duration, Instant, Dimension, Point, --- Rectangle, an enum class, or `{ set = SomeEnum }` (a set of its constants). Also --- "startStop": a boolean drawn as Start and Stop buttons that never outlives the session --- (a plugin's run switch); and "loadout": a picker over the loadouts the user saved in the --- Loadouts plugin, stored as the loadout's name and read by the proxy as that loadout's --- `ConfigLoadout`, or nil when none is picked. type: ConfigItemType, --- The value when nothing is stored. default: any?, --- Only the plugin that declares it reads it; a text item also shows as a password field. secret: boolean?, --- Left off the settings page; stored and read like any other item. hidden: boolean?, --- What the settings page asks the user to confirm before it changes the value; answering --- no leaves the value unchanged. warning: string?, --- Whether a `Color` item can set its alpha: `ConfigItem{ ..., alpha = true }`. alpha: boolean?, --- A number's bounds: `ConfigItem{ ..., range = { min = …, max = … } }`, 0 and 2147483647 when left out; `getRange()` on the item's descriptor reads them back. range: { min: number?, max: number? }?, --- The suffix a number shows: `ConfigItem{ ..., units = Units.X }`; `getUnits()` on the item's descriptor reads it back. units: string?, --- Another name the proxy answers as this item's getter (`showName()` for keyName --- `showNpcName`): it answers both. method: string?, --- Another name the proxy answers as a write. `set` + the getter's name --- (`setAlignOrbsVertically` for `alignOrbsVertically`) is answered without it. setter: string?, } --- The table `ConfigSection{...}` takes: one section of the settings page. export type ConfigSectionFields = { --- The section's key, which items name in their `section`. keyName: string, --- The section's label. name: string, --- The section's tooltip. description: string?, --- Its place among the group's sections, lowest first, then by name; 0 when absent. position: number?, --- Whether it starts collapsed. closedByDefault: boolean?, } --- Declares a settings group: `local XConfig = ConfigGroup("name", { ConfigSection{...}, --- ConfigItem{...}, ... })`, then `configManager:getConfig(XConfig)` for the proxy. A constant --- of the group (`GROUP = "x"`) goes in `constants`. --- --- A plugin's settings: `ConfigGroup(name, { ConfigItem{...}, ConfigSection{...} })`; `configManager:getConfig(group)` is the proxy, `config:keyName()` (or the item's `method`) its value. --- --- A settings group, named by the `name` of its `ConfigGroup(name, items)` call; `getConfigDescriptor(proxy):getGroup()` reads the name back. declare ConfigGroup: (name: string, items: {ConfigItemFields | ConfigSectionFields}, constants: {[string]: any}?) -> ConfigGroup --- One setting: `ConfigItem{ keyName, name, description, position, section, type, default, secret, hidden, warning, method }`; `getConfigDescriptor(proxy):getItems()[i]:getItem()` reads it back. declare ConfigItem: (fields: ConfigItemFields) -> ConfigItemFields --- A section of the settings page: `ConfigSection{ keyName, name, description, position, closedByDefault }`; `getConfigDescriptor(proxy):getSections()[i]:getSection()` reads it back. declare ConfigSection: (fields: ConfigSectionFields) -> ConfigSectionFields --- The client's own settings group (`client`), for `configManager:getConfig(ClientConfig)`. declare ClientConfig: ConfigGroup --- A `TrayIcon.MessageType` constant. export type TrayIconMessageType = { --- The constant's name: `ERROR`, `WARNING`, `INFO` or `NONE`. name: (TrayIconMessageType) -> string, --- Its place in `TrayIcon.MessageType.values()`, from 0. ordinal: (TrayIconMessageType) -> number, } --- Holds `TrayIcon.MessageType`, the enum a `Notification`'s `getTrayIconType()` answers. export type TrayIconClass = { --- `ERROR`, `WARNING`, `INFO`, `NONE`. MessageType: EnumClass, } --- `TrayIcon.MessageType`: a tray notification's icon type. declare TrayIcon: TrayIconClass --- The `chatboxPanelManager` global: the modal panel that replaces the chatbox's message layer (`InterfaceID.Chatbox.MES_LAYER`) while it is open. Opening one closes the one open, in any plugin. Loaded in a plugin whose code names a chatbox global (`chatboxPanelManager`, `chatboxItemSearch`, `ChatboxPanelManager`, `ChatboxTextInput`, `ChatboxTextMenuInput`, `ChatboxItemSearch`); a `_G["chatbox" .. x]` lookup does not load it. export type ChatboxPanelManager = { --- Close the open panel at the next invoke point: the game's `MESSAGE_LAYER_CLOSE` runs, then the panel's `onClose`. close: (ChatboxPanelManager) -> (), --- Open `input` (a panel object with `open`/`close`, and key or mouse listener methods if it takes input) at the next invoke point, closing the one open. openInput: (ChatboxPanelManager, any) -> (), --- A new menu panel titled `title`, to fill in with `option` and open with `build`. openTextMenuInput: (ChatboxPanelManager, string) -> ChatboxTextMenuInput, --- A new text input panel prompting `prompt`, to set up and open with `build`. openTextInput: (ChatboxPanelManager, string) -> ChatboxTextInput, --- The panel this plugin has open, or nil. getCurrentInput: (ChatboxPanelManager) -> ChatboxInput?, --- The chatbox's message layer, which a panel builds its widgets in. getContainerWidget: (ChatboxPanelManager) -> Widget?, --- Whether the open panel takes keys now: not while the world map's search box has them, nor once another plugin's panel replaced it. shouldTakeInput: (ChatboxPanelManager) -> boolean, } --- The `chatboxPanelManager` global: the modal panel that replaces the chatbox's message layer (`InterfaceID.Chatbox.MES_LAYER`) while it is open. Opening one closes the one open, in any plugin. Loaded in a plugin whose code names a chatbox global (`chatboxPanelManager`, `chatboxItemSearch`, `ChatboxPanelManager`, `ChatboxTextInput`, `ChatboxTextMenuInput`, `ChatboxItemSearch`); a `_G["chatbox" .. x]` lookup does not load it. declare chatboxPanelManager: ChatboxPanelManager --- A title and numbered options drawn in the chatbox; an option runs when clicked or when its number is typed. export type ChatboxTextMenuInput = { --- Set the title; returns the panel. title: (ChatboxTextMenuInput, string) -> ChatboxTextMenuInput, --- Add an option and the function (or `Runnable`) it runs; returns the panel. option: (ChatboxTextMenuInput, string, () -> ()) -> ChatboxTextMenuInput, --- What runs when the panel closes, however it closes; returns the panel. onClose: (ChatboxTextMenuInput, any) -> ChatboxTextMenuInput, --- The title. getTitle: (ChatboxTextMenuInput) -> string?, --- The options, each `{ text = ..., callback = ... }`. getOptions: (ChatboxTextMenuInput) -> {any}, --- What `onClose` set. getOnClose: (ChatboxTextMenuInput) -> any, --- Open the panel (a title and at least one option first, else `IllegalStateException`); returns it. build: (ChatboxTextMenuInput) -> ChatboxTextMenuInput, --- Escape closes; `1`..`9` run that option. keyTyped: (ChatboxTextMenuInput, AwtKeyEvent) -> (), --- Consumes Escape. keyPressed: (ChatboxTextMenuInput, AwtKeyEvent) -> (), --- Nothing. keyReleased: (ChatboxTextMenuInput, AwtKeyEvent) -> (), } --- A prompt and an editable line of text drawn in the chatbox in the game's font, with a flashing cursor, selection (shift, the mouse, Ctrl+A), Ctrl+X/C/V on the system clipboard, and Enter/Escape. Extend it with `class(ChatboxTextInput)`, calling `X.super.init(self, chatboxPanelManager, clientThread)`; override `update` and `keyPressed` to change what it draws and what the keys do. export type ChatboxTextInput = { --- Also require `validator(c)` (`c` a character's code point) of every character typed, pasted or set; returns the panel. addCharValidator: (ChatboxTextInput, any) -> ChatboxTextInput, --- Replace the validator (nil: printable ASCII); returns the panel. charValidator: (ChatboxTextInput, any) -> ChatboxTextInput, --- Wrap the text over at most `lines` lines (0: as many as it takes); returns the panel. lines: (ChatboxTextInput, number) -> ChatboxTextInput, --- Set the prompt; returns the panel. prompt: (ChatboxTextInput, string) -> ChatboxTextInput, --- Set the text (characters the validator refuses left out), the cursor at its end; returns the panel. value: (ChatboxTextInput, string) -> ChatboxTextInput, --- Put the cursor at `indexA`, or select `indexA`..`indexB`; returns the panel. cursorAt: (ChatboxTextInput, number, number?) -> ChatboxTextInput, --- The text. getValue: (ChatboxTextInput) -> string, --- What runs when the panel closes, however it closes; returns the panel. onClose: (ChatboxTextInput, () -> ()) -> ChatboxTextInput, --- What runs with the text on Enter; only an explicit `false` keeps the panel open. Returns the panel. onDone: (ChatboxTextInput, (string) -> boolean?) -> ChatboxTextInput, --- What runs with the text each time an edit changes it; returns the panel. onChanged: (ChatboxTextInput, (string) -> ()) -> ChatboxTextInput, --- The font (`FontID`, `QUILL_8` unless set); returns the panel. fontID: (ChatboxTextInput, number) -> ChatboxTextInput, --- The prompt. getPrompt: (ChatboxTextInput) -> string?, --- What `lines` set. getLines: (ChatboxTextInput) -> number, --- The cursor, or the selection's start. getCursorStart: (ChatboxTextInput) -> number, --- The cursor, or the selection's end. getCursorEnd: (ChatboxTextInput) -> number, --- The validator. getCharValidator: (ChatboxTextInput) -> any, --- What `onClose` set. getOnClose: (ChatboxTextInput) -> any, --- What `onDone` set. getOnDone: (ChatboxTextInput) -> any, --- What `onChanged` set. getOnChanged: (ChatboxTextInput) -> any, --- The font. getFontID: (ChatboxTextInput) -> number, --- Whether the panel has been opened. isBuilt: (ChatboxTextInput) -> boolean, --- Redraw the panel: the prompt, then `buildEdit(0, 50, width, 0)`. A subclass overrides it to draw its own. update: (ChatboxTextInput) -> (), --- Draw the text, its selection and the cursor at (`x`, `y`) over `w` (centred when `w` > 0), each line `h` high (0: the font's baseline). buildEdit: (ChatboxTextInput, number, number, number, number) -> (), --- Open the panel (a prompt first, else `IllegalStateException`); returns it. build: (ChatboxTextInput) -> ChatboxTextInput, --- Insert the character typed, over the selection. keyTyped: (ChatboxTextInput, AwtKeyEvent) -> (), --- The editing keys: Ctrl+X/C/V/A, Delete, Backspace, the arrows (Shift selects), Home, End, Enter (`onDone`, then close) and Escape. keyPressed: (ChatboxTextInput, AwtKeyEvent) -> (), --- Nothing. keyReleased: (ChatboxTextInput, AwtKeyEvent) -> (), --- A left press on the text moves the cursor there (Shift extends the selection); the event goes on. mousePressed: (ChatboxTextInput, AwtMouseEvent) -> AwtMouseEvent, --- A left drag selects; the event goes on. mouseDragged: (ChatboxTextInput, AwtMouseEvent) -> AwtMouseEvent, } --- `ChatboxTextInput`'s static functions and constants. export type ChatboxTextInputClass = { --- Builds a text input: `ChatboxTextInput.new(chatboxPanelManager, clientThread)`. new: (ChatboxPanelManager?, ClientThread?) -> ChatboxTextInput, } declare ChatboxTextInput: ChatboxTextInputClass --- The `chatboxItemSearch` global: a `ChatboxTextInput` that lists up to 24 items whose name holds the text, as icons in the chatbox; click one, or pick it with Tab/the arrows and Enter. Its `onDone` raises `UnsupportedOperationException`: `onItemSelected` is what runs with the pick. export type ChatboxItemSearch = ChatboxTextInput & { --- What runs with the item id picked; returns the search. onItemSelected: (ChatboxItemSearch, any) -> ChatboxItemSearch, --- What `onItemSelected` set. getOnItemSelected: (ChatboxItemSearch) -> any, --- The op each item icon offers; returns the search. tooltipText: (ChatboxItemSearch, string?) -> ChatboxItemSearch, } --- The `chatboxItemSearch` global: a `ChatboxTextInput` that lists up to 24 items whose name holds the text, as icons in the chatbox; click one, or pick it with Tab/the arrows and Enter. Its `onDone` raises `UnsupportedOperationException`: `onItemSelected` is what runs with the pick. declare chatboxItemSearch: ChatboxItemSearch --- The `ChatboxPanelManager` class, to extend with `class(ChatboxPanelManager)` or test with `ChatboxPanelManager.isInstance(obj)`. declare ChatboxPanelManager: ClassTable --- The `ChatboxTextMenuInput` class, to extend with `class(ChatboxTextMenuInput)` or test with `ChatboxTextMenuInput.isInstance(obj)`. declare ChatboxTextMenuInput: ClassTable --- The `ChatboxItemSearch` class, to extend with `class(ChatboxItemSearch)` or test with `ChatboxItemSearch.isInstance(obj)`. declare ChatboxItemSearch: ClassTable --- A predefined cursor by type, as `Component:setCursor` takes it. export type Cursor = { } --- `Cursor`'s static functions and constants. export type CursorClass = { --- `Cursor.new(type)`: one of the predefined types; any other raises `IllegalArgumentException`. new: (type: number) -> Cursor, --- The shared cursor of a predefined type. getPredefinedCursor: (type: number) -> Cursor, --- 0. DEFAULT_CURSOR: number, --- 12. HAND_CURSOR: number, } declare Cursor: CursorClass --- Children along one axis of the target. export type BoxLayout = { } --- `BoxLayout`'s static functions and constants. export type BoxLayoutClass = { --- `BoxLayout.new(target, axis)`; an axis outside 0..3 raises `AWTError`. new: (target: any, axis: number) -> BoxLayout, --- 0. X_AXIS: number, --- 1. Y_AXIS: number, --- 3. PAGE_AXIS: number, } declare BoxLayout: BoxLayoutClass --- Sequential, parallel and baseline groups per axis, with automatic gaps. export type GroupLayout = { --- A new parallel group: `alignment` is a `GroupLayout.Alignment` (`LEADING` by default; a `BASELINE` group lines its children up on their baselines and belongs on the vertical axis, `setHorizontalGroup` refuses it), `resizable` is `true` by default. createParallelGroup: (GroupLayout, alignment: string?, resizable: boolean?) -> any, --- A new sequential group. createSequentialGroup: (GroupLayout) -> any, --- The horizontal axis's group. setHorizontalGroup: (GroupLayout, any) -> (), --- The vertical axis's group. setVerticalGroup: (GroupLayout, any) -> (), --- `true` (the default): an invisible component takes no space. `false`: it keeps its place and size, so hiding it moves nothing. It applies to the whole layout, not per component. setHonorsVisibility: (GroupLayout, honors: boolean) -> (), --- What `setHonorsVisibility` last set: `true` until then. getHonorsVisibility: (GroupLayout) -> boolean, --- `true`: the preferred gap between components that are siblings in a sequential group, unless an explicit gap sits between them. A hidden component gives its gaps up. `false` (the default): no gap but the ones added. setAutoCreateGaps: (GroupLayout, on: boolean) -> (), --- What `setAutoCreateGaps` last set: `false` until then. getAutoCreateGaps: (GroupLayout) -> boolean, --- `true`: the preferred gap between the container's edges and the components next to them. `false` (the default): none. setAutoCreateContainerGaps: (GroupLayout, on: boolean) -> (), --- What `setAutoCreateContainerGaps` last set: `false` until then. getAutoCreateContainerGaps: (GroupLayout) -> boolean, } --- `GroupLayout`'s static functions and constants. export type GroupLayoutClass = { --- `GroupLayout.new(host)`. new: (host: any) -> GroupLayout, } declare GroupLayout: GroupLayoutClass --- A `GroupLayout`'s sequential group (`createSequentialGroup()`). --- --- A `GroupLayout`'s parallel group (`createParallelGroup()`). export type GroupLayoutGroup = { --- Adds a component (and adds it to the host); returns the group. addComponent: (GroupLayoutGroup, any, number?, number?, number?) -> any, --- A rigid gap; returns the group. addGap: (GroupLayoutGroup, number, number?, number?) -> any, --- A nested group; returns the group. addGroup: (GroupLayoutGroup, any) -> any, } --- A grid whose cells are placed by `GridBagConstraints`. The fields and constants `GridBagConstraints` lists are what it honours. export type GridBagLayout = { } --- `GridBagLayout`'s static functions and constants. export type GridBagLayoutClass = { --- `GridBagLayout.new()`. new: () -> GridBagLayout, } declare GridBagLayout: GridBagLayoutClass --- Children stacked over each other. export type OverlayLayout = { } --- `OverlayLayout`'s static functions and constants. export type OverlayLayoutClass = { --- `OverlayLayout.new(target)`. new: (target: any) -> OverlayLayout, } declare OverlayLayout: OverlayLayoutClass --- Public fields `add` copies (its `insets` too). export type GridBagConstraints = { --- The `fill` field. fill: number, --- The `gridwidth` field. gridwidth: number, --- The `gridx` field. gridx: number, --- The `gridy` field. gridy: number, --- The `insets` field. insets: Insets, --- The `weightx` field. weightx: number, --- The `weighty` field. weighty: number, } --- `GridBagConstraints`'s static functions and constants. export type GridBagConstraintsClass = { --- `GridBagConstraints.new()`: the defaults (`RELATIVE` cell, 1x1, no weight, `CENTER`, `NONE`, zero insets). new: () -> GridBagConstraints, --- 2. HORIZONTAL: number, } declare GridBagConstraints: GridBagConstraintsClass --- The base of the prelude's borders, and of a plugin's own (`class(Border)`). export type Border = { } --- `Border`'s static functions and constants. export type BorderClass = { --- Whether `obj` is a `Border`. isInstance: (any) -> boolean, } declare Border: BorderClass --- Solid coloured edges. export type MatteBorder = EmptyBorder & { } --- `MatteBorder`'s static functions and constants. export type MatteBorderClass = { --- `MatteBorder.new(top, left, bottom, right, color)`; frozen once built. new: (top: number, left: number, bottom: number, right: number, color: Color) -> MatteBorder, } declare MatteBorder: MatteBorderClass --- An outside border around an inside one. export type CompoundBorder = Border & { } --- `CompoundBorder`'s static functions and constants. export type CompoundBorderClass = { --- `CompoundBorder.new(outside, inside)`; frozen once built. new: (outside: Border?, inside: Border?) -> CompoundBorder, } declare CompoundBorder: CompoundBorderClass --- `BorderFactory`'s static functions and constants. export type BorderFactoryClass = { --- An `EmptyBorder`. createEmptyBorder: (top: number?, left: number?, bottom: number?, right: number?) -> EmptyBorder, --- A `LineBorder` of `color`, `thickness` 1 unless given. createLineBorder: (color: Color, thickness: number?) -> Border, --- A `MatteBorder`. createMatteBorder: (top: number, left: number, bottom: number, right: number, color: Color) -> MatteBorder, --- A `CompoundBorder`. createCompoundBorder: (outside: Border?, inside: Border?) -> CompoundBorder, --- A `TitledBorder` with `title`. createTitledBorder: (title: any, title2: string?) -> Border, } declare BorderFactory: BorderFactoryClass --- `SwingConstants`'s static functions and constants. export type SwingConstantsClass = { --- 0. CENTER: number, --- 1. TOP: number, --- 2. LEFT: number, --- 3. BOTTOM: number, --- 4. RIGHT: number, --- 1. VERTICAL: number, } declare SwingConstants: SwingConstantsClass --- `ScrollPaneConstants`'s static functions and constants. export type ScrollPaneConstantsClass = { --- 20. VERTICAL_SCROLLBAR_AS_NEEDED: number, --- 22. VERTICAL_SCROLLBAR_ALWAYS: number, --- 31. HORIZONTAL_SCROLLBAR_NEVER: number, } declare ScrollPaneConstants: ScrollPaneConstantsClass --- `ListSelectionModel`'s static functions and constants. export type ListSelectionModelClass = { --- 0. SINGLE_SELECTION: number, } declare ListSelectionModel: ListSelectionModelClass --- A table with `actionPerformed`, or that function. export type ActionListener = { --- `actionPerformed(e)`: override it; the Swing delivery calls it with the event. actionPerformed: (ActionListener, any) -> (), } --- `ActionListener`'s class table: its default methods, which a listener table or a `class(ActionListener)` subclass overrides; `ActionListener.isInstance(obj)` tests one. declare ActionListener: ActionListener & ClassTable --- A table with its methods, as `addComponentListener` takes it. export type ComponentListener = { --- `componentResized(e)`: override it; the Swing delivery calls it with the event. componentResized: (ComponentListener, any) -> (), } --- `ComponentListener`'s class table: its default methods, which a listener table or a `class(ComponentListener)` subclass overrides; `ComponentListener.isInstance(obj)` tests one. declare ComponentListener: ComponentListener & ClassTable --- Every method does nothing until overridden (`class(ComponentAdapter)`). export type ComponentAdapter = { --- `componentResized(e)`: override it; the Swing delivery calls it with the event. componentResized: (ComponentAdapter, any) -> (), } --- `ComponentAdapter`'s static functions and constants. export type ComponentAdapterClass = { --- `ComponentAdapter.new()`. new: () -> ComponentAdapter, } declare ComponentAdapter: ComponentAdapterClass --- A table with `focusGained` and `focusLost`, as `addFocusListener` takes it. export type FocusListener = { --- `focusGained(e)`: override it; the Swing delivery calls it with the event. focusGained: (FocusListener, any) -> (), --- `focusLost(e)`: override it; the Swing delivery calls it with the event. focusLost: (FocusListener, any) -> (), } --- `FocusListener`'s class table: its default methods, which a listener table or a `class(FocusListener)` subclass overrides; `FocusListener.isInstance(obj)` tests one. declare FocusListener: FocusListener & ClassTable --- Every method does nothing until overridden (`class(FocusAdapter)`). export type FocusAdapter = { --- `focusLost(e)`: override it; the Swing delivery calls it with the event. focusLost: (FocusAdapter, any) -> (), } --- `FocusAdapter`'s static functions and constants. export type FocusAdapterClass = { --- `FocusAdapter.new()`. new: () -> FocusAdapter, } declare FocusAdapter: FocusAdapterClass --- Every method does nothing until overridden (`class(KeyAdapter)`). export type KeyAdapter = { --- `keyPressed(e)`: override it; the Swing delivery calls it with the event. keyPressed: (KeyAdapter, any) -> (), --- `keyTyped(e)`: override it; the Swing delivery calls it with the event. keyTyped: (KeyAdapter, any) -> (), } --- `KeyAdapter`'s static functions and constants. export type KeyAdapterClass = { --- `KeyAdapter.new()`. new: () -> KeyAdapter, } declare KeyAdapter: KeyAdapterClass --- A table with its seven methods, as `JFrame:addWindowListener` takes it. export type WindowListener = { --- `windowClosing(e)`: override it; the window calls it when its close is asked for. windowClosing: (WindowListener, any) -> (), } --- `WindowListener`'s class table: its default methods, which a listener table or a `class(WindowListener)` subclass overrides; `WindowListener.isInstance(obj)` tests one. declare WindowListener: WindowListener & ClassTable --- Every method does nothing until overridden (`class(WindowAdapter)`); a window delivers `WindowListener`'s seven. export type WindowAdapter = { --- `windowClosing(e)`: override it. windowClosing: (WindowAdapter, any) -> (), } --- `WindowAdapter`'s static functions and constants. export type WindowAdapterClass = { --- `WindowAdapter.new()`. new: () -> WindowAdapter, } declare WindowAdapter: WindowAdapterClass --- `WindowConstants`'s static functions and constants. export type WindowConstantsClass = { --- 0. DO_NOTHING_ON_CLOSE: number, --- 2. DISPOSE_ON_CLOSE: number, } declare WindowConstants: WindowConstantsClass --- Told of a document's edits: `Document:addDocumentListener` calls it before the edit returns. export type DocumentListener = { --- `changedUpdate(e)`: override it; the Swing delivery calls it with the event. changedUpdate: (DocumentListener, any) -> (), --- `insertUpdate(e)`: override it; the Swing delivery calls it with the event. insertUpdate: (DocumentListener, any) -> (), --- `removeUpdate(e)`: override it; the Swing delivery calls it with the event. removeUpdate: (DocumentListener, any) -> (), } --- `DocumentListener`'s class table: its default methods, which a listener table or a `class(DocumentListener)` subclass overrides; `DocumentListener.isInstance(obj)` tests one. declare DocumentListener: DocumentListener & ClassTable --- A table with `popupMenuWillBecomeVisible`, `popupMenuWillBecomeInvisible` and `popupMenuCanceled`, told as a popup menu shows and hides. export type PopupMenuListener = { --- `popupMenuCanceled(e)`: override it; the Swing delivery calls it with the event. popupMenuCanceled: (PopupMenuListener, any) -> (), --- `popupMenuWillBecomeInvisible(e)`: override it; the Swing delivery calls it with the event. popupMenuWillBecomeInvisible: (PopupMenuListener, any) -> (), --- `popupMenuWillBecomeVisible(e)`: override it; the Swing delivery calls it with the event. popupMenuWillBecomeVisible: (PopupMenuListener, any) -> (), } --- `PopupMenuListener`'s class table: its default methods, which a listener table or a `class(PopupMenuListener)` subclass overrides; `PopupMenuListener.isInstance(obj)` tests one. declare PopupMenuListener: PopupMenuListener & ClassTable --- A table with `hyperlinkUpdate`, or that function. export type HyperlinkListener = { --- Override it: the pane calls it with each `HyperlinkEvent`. hyperlinkUpdate: (HyperlinkListener, any) -> (), } --- `HyperlinkListener`'s class table: its default methods, which a listener table or a `class(HyperlinkListener)` subclass overrides; `HyperlinkListener.isInstance(obj)` tests one. declare HyperlinkListener: HyperlinkListener & ClassTable --- A table with `getListCellRendererComponent`, or that function, as `JList:setCellRenderer` and `JComboBox:setRenderer` take it. export type ListCellRenderer = { --- Override it: the component that stamps row `index`'s value (`-1`: a combo box's own display). getListCellRendererComponent: (ListCellRenderer, list: any, value: any, index: number, isSelected: boolean, cellHasFocus: boolean) -> any, } --- `ListCellRenderer`'s class table: its default methods, which a listener table or a `class(ListCellRenderer)` subclass overrides; `ListCellRenderer.isInstance(obj)` tests one. declare ListCellRenderer: ListCellRenderer & ClassTable --- The `JLabel` a list or a combo box stamps each cell with (a list given one paints as the one it builds itself); a plugin class extends it with `class(DefaultListCellRenderer)` and calls `DefaultListCellRenderer.getListCellRendererComponent(self, ...)` from its own. `getListCellRendererComponent` writes the cell's text, colours, font, enabled state and border natively, without calling this object's setters, so a subclass's override of `setText` (or of `setFont`, `setEnabled`, `setBorder`) is not called by it: change the value before calling it, or set the text after it returns; only `setIcon` is called through the object. `getBorder()` answers an `EmptyBorder` of the cell border's insets (a list's 1,6,1,6). `setComponentOrientation` is not mirrored (there is no right-to-left orientation). export type DefaultListCellRenderer = JLabel & { --- This label, given the value's text (`tostring`, a table's `toString()`, "" for `nil`; an `Icon` value becomes its icon) and the cell's style: the list's selection colours for a selected row and its own otherwise, its font and enabled state, the look's cell border for the focus state. A subclass overrides it and calls this one. It writes the text, colours, font, enabled state and border natively, so a subclass's `setText` (or `setFont`, `setEnabled`, `setBorder`) override is not called by it (change the value before calling it, or set the text after it returns), and the border it sets answers `getBorder()` as an `EmptyBorder` of the cell insets. getListCellRendererComponent: (DefaultListCellRenderer, list: any, value: any, index: number, isSelected: boolean, cellHasFocus: boolean) -> any, } --- `DefaultListCellRenderer`'s static functions and constants. export type DefaultListCellRendererClass = { --- `DefaultListCellRenderer.new()`: an opaque label with the look's no-focus cell border, named `List.cellRenderer`. new: () -> DefaultListCellRenderer, } declare DefaultListCellRenderer: DefaultListCellRendererClass --- The type of a component's icon (an `ImageIcon`). export type Icon = { } --- `Icon`'s static functions and constants. export type IconClass = { --- Whether `obj` is an `Icon`. isInstance: (any) -> boolean, } declare Icon: IconClass --- Every `PluginPanel` is one; the toolbar calls `onActivate` when the panel is shown and `onDeactivate` when it is hidden. export type Activatable = { --- The panel was shown. Override it. onActivate: (Activatable) -> (), --- The panel was hidden. Override it. onDeactivate: (Activatable) -> (), } --- `Activatable`'s class table: its default methods, which a listener table or a `class(Activatable)` subclass overrides; `Activatable.isInstance(obj)` tests one. declare Activatable: Activatable & ClassTable --- An `Action` whose `actionPerformed` a plugin overrides. export type AbstractAction = { } --- `AbstractAction`'s static functions and constants. export type AbstractActionClass = { --- `AbstractAction.new(name)`. new: (name: string?, icon: any?) -> AbstractAction, } declare AbstractAction: AbstractActionClass --- A key and its modifiers. Instances are shared, so `==` tells whether two are the same stroke. export type KeyStroke = { } --- `KeyStroke`'s static functions and constants. export type KeyStrokeClass = { --- `KeyStroke.getKeyStroke("ctrl Z")`: the stroke the text names, or `nil`. getKeyStroke: (a: any, b: number?, c: boolean?) -> KeyStroke?, } declare KeyStroke: KeyStrokeClass --- A component's input map (`getInputMap()`): its key strokes' action keys, kept in Rust. export type InputMap = { --- Binds `keyStroke` to the action key `key` (a string here). put: (InputMap, keyStroke: KeyStroke?, key: string?) -> (), } --- A component's action map (`getActionMap()`): action keys to `Action`s. export type ActionMap = { --- Binds the action key `key` (a string here) to `action`; `nil` removes it. put: (ActionMap, key: string, action: any?) -> (), } --- The basic button look, for `AbstractButton:setUI`. export type BasicButtonUI = { } --- `BasicButtonUI`'s static functions and constants. export type BasicButtonUIClass = { --- `BasicButtonUI.new()`. new: () -> BasicButtonUI, } declare BasicButtonUI: BasicButtonUIClass --- The basic toggle-button look, for `AbstractButton:setUI`. export type BasicToggleButtonUI = BasicButtonUI & { } --- `BasicToggleButtonUI`'s static functions and constants. export type BasicToggleButtonUIClass = { --- `BasicToggleButtonUI.new()`. new: () -> BasicToggleButtonUI, } declare BasicToggleButtonUI: BasicToggleButtonUIClass --- One selected button among its members. export type ButtonGroup = { --- The button joins the group, last; a selected button stays selected only when the group had no selection. add: (ButtonGroup, AbstractButton) -> (), } --- `ButtonGroup`'s static functions and constants. export type ButtonGroupClass = { --- `ButtonGroup.new()`. new: () -> ButtonGroup, } declare ButtonGroup: ButtonGroupClass --- A list of values, 0-based; each change tells its `ListDataListener`s the range it touched. export type DefaultListModel = { --- Inserts `o` at `index`. add: (DefaultListModel, index: number, o: any) -> (), --- Appends `o`. addElement: (DefaultListModel, any) -> (), --- Removes every element. clear: (DefaultListModel) -> (), --- An enumeration over a copy (`hasMoreElements`, `nextElement`). elements: (DefaultListModel) -> any, --- How many elements. getSize: (DefaultListModel) -> number, --- How many elements. size: (DefaultListModel) -> number, --- Whether it has no element. isEmpty: (DefaultListModel) -> boolean, --- Removes and returns the element at `index`. remove: (DefaultListModel, index: number) -> any, --- Replaces the element at `index`; returns the old one. set: (DefaultListModel, index: number, o: any) -> any, } --- `DefaultListModel`'s static functions and constants. export type DefaultListModelClass = { --- `DefaultListModel.new()`. new: () -> DefaultListModel, } declare DefaultListModel: DefaultListModelClass --- The base of the list models, with a list of `ListDataListener`s. export type AbstractListModel = { --- A `ListDataListener` told each change. addListDataListener: (AbstractListModel, any) -> (), } --- Told of a list model's changes: `intervalAdded`, `intervalRemoved`, `contentsChanged`. export type ListDataListener = { } --- `ListDataListener`'s static functions and constants. export type ListDataListenerClass = { --- Whether `obj` is a `ListDataListener`. isInstance: (any) -> boolean, } declare ListDataListener: ListDataListenerClass --- A list model's change (`getType()`, `getIndex0()`, `getIndex1()`). export type ListDataEvent = { } --- `ListDataEvent`'s static functions and constants. export type ListDataEventClass = { --- Whether `obj` is a `ListDataEvent`. isInstance: (any) -> boolean, } declare ListDataEvent: ListDataEventClass --- A list and its selected item. export type DefaultComboBoxModel = { } --- `DefaultComboBoxModel`'s static functions and constants. export type DefaultComboBoxModelClass = { --- `DefaultComboBoxModel.new(items)`: the array, its first element selected. new: (items: { any }?) -> DefaultComboBoxModel, } declare DefaultComboBoxModel: DefaultComboBoxModelClass --- What a `JSpinner` shows (`SpinnerNumberModel`, or a plugin's own). export type SpinnerModel = { --- The current value. getValue: (SpinnerModel) -> any, } --- A number, its optional bounds and its step. export type SpinnerNumberModel = SpinnerModel & { } --- `SpinnerNumberModel`'s static functions and constants. export type SpinnerNumberModelClass = { --- `SpinnerNumberModel.new(value, minimum, maximum, stepSize)`; a value outside the bounds raises `IllegalArgumentException`. new: (value: number?, minimum: number?, maximum: number?, stepSize: number?) -> SpinnerNumberModel, } declare SpinnerNumberModel: SpinnerNumberModelClass --- A text component's text (`getDocument()`), its edits the component's, heard by its listeners before they return. export type Document = { --- The length in UTF-16 units. getLength: (Document) -> number, --- `length` units from `offset`; raises `BadLocationException` outside the text. getText: (Document, offset: number, length: number) -> string, --- Inserts `str` at `offset` (the attributes are ignored: plain text). insertString: (Document, offset: number, str: string?, attributes: any?) -> (), --- Removes `length` units at `offset`. remove: (Document, offset: number, length: number) -> (), --- `insertUpdate`, `removeUpdate`, `changedUpdate`, the last added first. addDocumentListener: (Document, any) -> (), --- A function of the event, a table with `undoableEditHappened`, or an `UndoManager`. addUndoableEditListener: (Document, any) -> (), } --- `BadLocationException`'s static functions and constants. export type BadLocationExceptionClass = { --- Whether `obj` is a `BadLocationException`. isInstance: (any) -> boolean, } declare BadLocationException: BadLocationExceptionClass --- `CannotUndoException`'s static functions and constants. export type CannotUndoExceptionClass = { --- Whether `obj` is a `CannotUndoException`. isInstance: (any) -> boolean, } declare CannotUndoException: CannotUndoExceptionClass --- A formatter whose text is the value. export type DefaultFormatter = { --- `false`: an edit that does not parse is taken back. setAllowsInvalid: (DefaultFormatter, boolean) -> (), --- `true`: each edit that parses is committed. setCommitsOnValidEdit: (DefaultFormatter, boolean) -> (), } --- A field's text to its value (`stringToValue`, raising `ParseException`) and back (`valueToString`); a plugin's own extends it. export type AbstractFormatter = { --- Abstract: a subclass's override turns the text into the value (`AbstractMethodError` here). stringToValue: (AbstractFormatter, string) -> any, } --- `JFormattedTextField.AbstractFormatter`'s static functions and constants. export type JFormattedTextFieldAbstractFormatterClass = { --- The base constructor a subclass runs. new: () -> AbstractFormatter, } --- Hands a field its formatter. export type AbstractFormatterFactory = { --- Abstract: a subclass's override answers the field's formatter. getFormatter: (AbstractFormatterFactory, any) -> any, } --- `JFormattedTextField.AbstractFormatterFactory`'s static functions and constants. export type JFormattedTextFieldAbstractFormatterFactoryClass = { --- The base constructor a subclass runs. new: () -> AbstractFormatterFactory, } --- A field's formatters with a unit suffix. export type UnitFormatterFactory = { } --- `UnitFormatterFactory`'s static functions and constants. export type UnitFormatterFactoryClass = { --- `UnitFormatterFactory.new(delegateFactory, units)`. new: (delegateFactory: any, units: string) -> UnitFormatterFactory, } declare UnitFormatterFactory: UnitFormatterFactoryClass --- An editor kit, as a pane's `getEditorKitForContentType("text/html")` hands it out. export type HTMLEditorKit = { --- The pane's style sheet. getStyleSheet: (HTMLEditorKit) -> StyleSheet, } --- The rules that style its pane's HTML. export type StyleSheet = { --- Adds a CSS rule to its pane's HTML. addRule: (StyleSheet, string) -> (), } --- A link entered, exited or activated in a `JEditorPane`. export type HyperlinkEvent = { --- `HyperlinkEvent.EventType.ENTERED`, `EXITED` or `ACTIVATED` (compared by identity). getEventType: (HyperlinkEvent) -> any, --- The link's `URL` (`toString()` its text), `nil` unless its `href` is absolute. getURL: (HyperlinkEvent) -> any, } --- `HyperlinkEvent`'s static functions and constants. export type HyperlinkEventClass = { --- `HyperlinkEvent.EventType`: the nested class's table. EventType: HyperlinkEventEventTypeClass, } declare HyperlinkEvent: HyperlinkEventClass --- `HyperlinkEvent.EventType`'s static functions and constants. export type HyperlinkEventEventTypeClass = { --- A click on the link. ACTIVATED: any, } --- `JOptionPane`'s static functions and constants. export type JOptionPaneClass = { --- The answer (`YES_OPTION`, `NO_OPTION`, `CANCEL_OPTION`, `OK_OPTION`) or `CLOSED_OPTION`. showConfirmDialog: (parent: any, message: any, title: string?, optionType: number?, messageType: number?, icon: any?) -> number, --- Returns when the dialog is dismissed. showMessageDialog: (parent: any, message: any, title: string?, messageType: number?, icon: any?) -> (), --- The 0-based index of the option chosen, or `CLOSED_OPTION`. showOptionDialog: (parent: any, message: any, title: string?, optionType: number, messageType: number, icon: any?, options: { any }?, initialValue: any?) -> number, --- The text entered, or `nil` on cancel; with `selectionValues`, one of them (shown as buttons) or `nil`. showInputDialog: (...any) -> any, --- 0. ERROR_MESSAGE: number, --- 1. INFORMATION_MESSAGE: number, --- 2. WARNING_MESSAGE: number, --- -1. PLAIN_MESSAGE: number, --- 2. OK_CANCEL_OPTION: number, --- 0. YES_NO_OPTION: number, --- 0. YES_OPTION: number, } declare JOptionPane: JOptionPaneClass --- `SwingUtil`'s static functions and constants. export type SwingUtilClass = { --- A tooltip that follows the button's selected state. addModalTooltip: (button: any, on: string?, off: string?) -> (), --- Removes every child, `removeNotify` first, recursively. fastRemoveAll: (c: any) -> (), --- The look's icon-button style. removeButtonDecorations: (button: any) -> (), } declare SwingUtil: SwingUtilClass --- A tab of a `MaterialTabGroup`: a `JLabel` that, when pressed, asks its group to select it, and the group shows the tab's content on its display. export type MaterialTab = { --- A `BooleanSupplier` (a function, or a table with `getAsBoolean`) asked before the tab is selected. setOnSelectEvent: (MaterialTab, () -> boolean) -> (), } --- `MaterialTab`'s static functions and constants. export type MaterialTabClass = { --- `MaterialTab.new(textOrIcon, group, content)`. new: (textOrIcon: any, group: any, content: any) -> MaterialTab, } declare MaterialTab: MaterialTabClass --- A row of `MaterialTab`s and an optional `display` panel: selecting a tab shows that tab's content on the display. export type MaterialTabGroup = { --- Adds a tab. addTab: (MaterialTabGroup, any) -> (), --- The tab at the 0-based `index`, `nil` when there is none; past the tabs raises `IndexOutOfBoundsException`. getTab: (MaterialTabGroup, number) -> any, --- Selects the tab and shows its content; `false` when it is not the group's or refused. select: (MaterialTabGroup, any) -> boolean, } --- `MaterialTabGroup`'s static functions and constants. export type MaterialTabGroupClass = { --- `MaterialTabGroup.new()` or `MaterialTabGroup.new(display)`. new: (display: any?) -> MaterialTabGroup, } declare MaterialTabGroup: MaterialTabGroupClass --- A `JTextField` in a panel with a flat look and an optional hover background. export type FlatTextField = { --- The text field's. addActionListener: (FlatTextField, any) -> (), --- The text field's. addKeyListener: (FlatTextField, any) -> (), --- The text field's text. getText: (FlatTextField) -> string, --- The `JTextField` inside. getTextField: (FlatTextField) -> JTextField, --- The background (kept for the hover effect unless `saveColor` is `false`). setBackground: (FlatTextField, Color?, saveColor: boolean?) -> (), --- Whether the text can be edited. setEditable: (FlatTextField, boolean) -> (), --- The background under the pointer. setHoverBackgroundColor: (FlatTextField, Color?) -> (), --- The text field's text. setText: (FlatTextField, string?) -> (), } --- `FlatTextField`'s static functions and constants. export type FlatTextFieldClass = { --- `FlatTextField.new()`. new: () -> FlatTextField, } declare FlatTextField: FlatTextFieldClass --- A text field with an icon on its left and a clear button on its right. export type IconTextField = { --- The text field's. addActionListener: (IconTextField, any) -> (), --- Runs `r` (a function, or a table with `run`) when the clear button empties it. addClearListener: (IconTextField, any) -> (), --- The text field's. addKeyListener: (IconTextField, any) -> (), --- The text field's. removeKeyListener: (IconTextField, any) -> (), --- The text field's text. getText: (IconTextField) -> string, --- The text field's text. setText: (IconTextField, string?) -> (), --- Focuses the text field. requestFocusInWindow: (IconTextField) -> boolean, --- The background. setBackground: (IconTextField, Color?) -> (), --- Whether the text can be edited. setEditable: (IconTextField, boolean) -> (), --- The background under the pointer. setHoverBackgroundColor: (IconTextField, Color?) -> (), --- An `IconTextField.Icon` (or an `ImageIcon`) on the left. setIcon: (IconTextField, any) -> (), } --- `IconTextField`'s static functions and constants. export type IconTextFieldClass = { --- `IconTextField.new()`. new: () -> IconTextField, --- `IconTextField.Icon`: the nested class's table. Icon: IconTextFieldIconClass, } declare IconTextField: IconTextFieldClass --- `IconTextField.Icon`'s static functions and constants. export type IconTextFieldIconClass = { --- `SEARCH`. SEARCH: any, --- `LOADING`. LOADING: any, --- `LOADING_DARKER`. LOADING_DARKER: any, --- `ERROR`. ERROR: any, } --- An error or info message for a plugin panel: a title over a description, hidden until `setContent`. export type PluginErrorPanel = { --- The title and description. setContent: (PluginErrorPanel, string?, string?) -> (), } --- `PluginErrorPanel`'s static functions and constants. export type PluginErrorPanelClass = { --- `PluginErrorPanel.new()`. new: () -> PluginErrorPanel, } declare PluginErrorPanel: PluginErrorPanelClass --- Forwards left-button drags to its target. export type MouseDragEventForwarder = { } --- `MouseDragEventForwarder`'s static functions and constants. export type MouseDragEventForwarderClass = { --- `MouseDragEventForwarder.new(target)`. new: (target: any) -> MouseDragEventForwarder, } declare MouseDragEventForwarder: MouseDragEventForwarderClass --- The `colorPickerManager` global: one picker open at a time. export type ColorPickerManager = { --- A `ColorPicker` (closing the open one); `owner` (a component or the client) places nothing. create: (ColorPickerManager, owner: Component?, previousColor: Color?, title: string?, alphaHidden: boolean?) -> ColorPicker, } --- The `colorPickerManager` global: one picker open at a time. declare colorPickerManager: ColorPickerManager --- Alternative to calling `ui:colorPicker` yourself: a colour picker object over the host's colour dialog. The dialog's look is Bento's. export type ColorPicker = { --- A `Consumer` (a function, or a table with `accept`) told each new colour. setOnColorChange: (ColorPicker, (Color) -> ()) -> (), --- A `Consumer` told the colour when the dialog closes. setOnClose: (ColorPicker, (Color) -> ()) -> (), --- `true` shows the dialog (once); `false` withdraws it. setVisible: (ColorPicker, boolean) -> (), } --- Four edge widths in public fields, as `Container:getInsets()` answers them: --- `Insets.new(top, left, bottom, right)`. export type Insets = { --- `top`: the edge above. top: number, --- `left`: the left edge. left: number, --- `bottom`: the edge below. bottom: number, --- `right`: the right edge. right: number, --- Any other field it carries. [string]: any, } --- `Insets`'s class table. export type InsetsClass = { --- `Insets.new(top, left, bottom, right)`: four edge widths. new: (top: number, left: number, bottom: number, right: number) -> Insets, } --- The `Insets` class: `Insets.new(top, left, bottom, right)`. declare Insets: InsetsClass --- The game client. One instance for the life of the plugin; every call reads the client as it is now. declare client: Client --- Bento's post-process pipeline: passes, their params, lights and a colour LUT. declare gfx: Gfx --- `overlayManager:add(overlay)` in `startUp`, `overlayManager:remove(overlay)` in `shutDown`. declare overlayManager: OverlayManager --- The tooltips to show this frame, one queue for every plugin. declare tooltipManager: TooltipManager --- `infoBoxManager:addInfoBox(box)` shows an `InfoBox` in the infobox panel, `removeInfoBox(box)` takes it away. declare infoBoxManager: InfoBoxManager --- Item images, prices, stats and canonical ids. declare itemManager: ItemManager --- The client's sprites as images. declare spriteManager: SpriteManager --- Skill icons. declare skillIconManager: SkillIconManager --- Chat icons a plugin adds (``) and the rank icons, one manager for every plugin. declare chatIconManager: ChatIconManager --- Points drawn on the world map. declare worldMapPointManager: WorldMapPointManager --- The `ModelOutlineRenderer`: draws outlines around entities' models. declare modelOutlineRenderer: ModelOutlineRenderer --- The `NpcOverlayService`: highlights NPCs (one per plugin). declare npcOverlayService: NpcOverlayService --- The `Hooks`: renderable draw listeners. declare hooks: Hooks --- Schedule work on the client thread: `invoke`, `invokeLater`, `invokeAtTickEnd`. declare clientThread: ClientThread --- Bento's timers on the client thread, in milliseconds, server ticks or client cycles. declare timer: TimerService --- A `ScheduledExecutorService`: tasks run on the client thread at the first invoke point they are due. declare executor: ScheduledExecutorService --- An `OkHttpClient`: requests run off the game thread and call back on it. declare okHttpClient: OkHttpClient --- Bento's HTTP shorthand: `http:get(url, fn)`, `http:post(url, type, body, fn)`. declare http: HttpService --- Notifications: `notify(message)`, `notify(notification, message)`. declare notifier: Notifier --- WAV playback with a gain in dB. declare audioPlayer: AudioPlayer --- Messages between the client tabs on this machine, per plugin and channel. declare clientBus: ClientBus --- Rich Presence for the host's Discord application. declare discordService: DiscordService --- Screenshots into Bento's screenshot folder. declare imageCapture: ImageCapture --- An SLF4J-style logger: `log:debug("x {}", v)` formats `{}` as SLF4J does and writes to the host log under the plugin's id, at INFO and above unless the level is raised (`BENTO_DEBUG=1`, `log:setLevel`). declare log: Logger --- Actions, rates and goals per skill this session. declare xpTrackerService: XpTrackerService --- The item effect table (`ItemStatChanges`). declare itemStatChanges: ItemStatChanges --- The item effect table behind an interface. declare itemStatChangesService: ItemStatChangesService --- Bank tags. declare tagManager: TagManager --- This tick's item spawns. declare lootManager: LootManager --- NPC hitpoints. declare npcManager: NPCManager --- Whether an NPC is dying. declare npcUtil: NpcUtil --- The slayer task and its target NPCs. declare slayerPluginService: SlayerPluginService --- Lay the bank out again, start or reset a bank search. declare bankSearch: BankSearch --- The world list. declare worldService: WorldService --- Cached hiscore lookups. declare hiscoreManager: HiscoreManager --- Hiscore lookups, as futures or polled. declare hiscoreClient: HiscoreLookup --- The chat API, polled; local plugins only. declare chatClient: ChatApi --- Data plugins publish for each other, by topic, as JSON text. declare pluginData: PluginData --- Player menu items in the client's player-option slots. declare menuManager: MenuManager --- Links to the OSRS Wiki's pages, and its DPS calculator, for every plugin. declare wiki: Wiki --- Register a plugin's key listeners (`registerKeyListener`), which see every key on the client thread before the game does and may consume it. declare keyManager: KeyManager --- Register a plugin's mouse and wheel listeners, which see every mouse event on the client thread before the game does and may rewrite or consume it. declare mouseManager: MouseManager --- The game canvas's cursor. declare clientUI: ClientUI --- Adds messages to the chatbox: `queue` a `QueuedMessage`. declare chatMessageManager: ChatMessageManager --- `!command` handlers on chat messages. declare chatCommandManager: ChatCommandManager --- The user's `textrecolor` chat colours, the defaults where unset. declare chatColorConfig: ChatColorConfig -- END GENERATED: classes -- BEGIN GENERATED: plugin-hooks (do not edit; BENTO_DECL_BLESS=1 cargo test -p bento-plugin-luau --lib declaration_is_generated, then python client/tools/sync_declaration.py) --- A plugin: the object `Plugin.new{...}` returns, which `src/main.luau` returns. --- --- Every field is a hook the host reads off it, called as a method --- (`function plugin:onGameTick(event)`). The lifecycle hooks cover starting, --- stopping and settings, an event hook is `on` taking that event --- (`eventBus:subscribe` reaches the same events), and the passes draw. A hook the --- object does not define is not called. export type Plugin = { --- The plugin was enabled, or the client started with it enabled. No event --- reaches it before this returns; the object is registered on the event --- bus after. startUp: (Plugin) -> (), --- The plugin was disabled. The object is unregistered from the event bus --- first, so no event reaches it after. shutDown: (Plugin) -> (), --- The settings page's Reset put the plugin's config group back to its --- defaults. resetConfiguration: (Plugin) -> (), --- Return `configManager:getConfig(SomeConfigGroup)` to make that group the --- plugin's own. Called once, at load; without it the first group the chunk --- asked `configManager:getConfig` for is. provideConfig: (Plugin) -> any, --- The game settings this plugin recommends values for (any row of All --- Settings that holds one: a toggle, a dropdown, ...), as a list of --- `RecommendedSetting`. Asked after a login, after a plugin starts and --- when the Settings tab opens, only while this plugin runs. The client --- tells the player and highlights what differs in the Settings panel. A --- bad entry is dropped with a warning. recommendedSettings: (Plugin) -> {RecommendedSetting}, --- The `ActorDeath` event. onActorDeath: (Plugin, ActorDeath) -> (), --- The `AmbientSoundEffectCreated` event. onAmbientSoundEffectCreated: (Plugin, AmbientSoundEffectCreated) -> (), --- The `AnimationChanged` event. onAnimationChanged: (Plugin, AnimationChanged) -> (), --- The `AreaSoundEffectPlayed` event. onAreaSoundEffectPlayed: (Plugin, AreaSoundEffectPlayed) -> (), --- The `BeforeMenuRender` event. onBeforeMenuRender: (Plugin, BeforeMenuRender) -> (), --- The `BeforeRender` event. onBeforeRender: (Plugin, BeforeRender) -> (), --- The `ChatMessage` event. onChatMessage: (Plugin, ChatMessage) -> (), --- The `ClanChannelChanged` event. onClanChannelChanged: (Plugin, ClanChannelChanged) -> (), --- The `ClanMemberJoined` event. onClanMemberJoined: (Plugin, ClanMemberJoined) -> (), --- The `ClanMemberLeft` event. onClanMemberLeft: (Plugin, ClanMemberLeft) -> (), --- Once per client cycle while logged in. It does not run on the login --- screen; `onPostClientTick` does. onClientTick: (Plugin, ClientTick) -> (), --- The `CommandExecuted` event. onCommandExecuted: (Plugin, CommandExecuted) -> (), --- The `DecorativeObjectDespawned` event. onDecorativeObjectDespawned: (Plugin, DecorativeObjectDespawned) -> (), --- The `DecorativeObjectSpawned` event. onDecorativeObjectSpawned: (Plugin, DecorativeObjectSpawned) -> (), --- The `FakeXpDrop` event. onFakeXpDrop: (Plugin, FakeXpDrop) -> (), --- The `FocusChanged` event. onFocusChanged: (Plugin, FocusChanged) -> (), --- The `FriendsChatChanged` event. onFriendsChatChanged: (Plugin, FriendsChatChanged) -> (), --- The `FriendsChatMemberJoined` event. onFriendsChatMemberJoined: (Plugin, FriendsChatMemberJoined) -> (), --- The `FriendsChatMemberLeft` event. onFriendsChatMemberLeft: (Plugin, FriendsChatMemberLeft) -> (), --- The `FriendsChatSync` event. onFriendsChatSync: (Plugin, FriendsChatSync) -> (), --- The `GameObjectDespawned` event. onGameObjectDespawned: (Plugin, GameObjectDespawned) -> (), --- The `GameObjectSpawned` event. onGameObjectSpawned: (Plugin, GameObjectSpawned) -> (), --- The `GameStateChanged` event. onGameStateChanged: (Plugin, GameStateChanged) -> (), --- The `GameTick` event. onGameTick: (Plugin, GameTick) -> (), --- The `GrandExchangeOfferChanged` event. onGrandExchangeOfferChanged: (Plugin, GrandExchangeOfferChanged) -> (), --- The `GrandExchangeSearched` event. onGrandExchangeSearched: (Plugin, GrandExchangeSearched) -> (), --- The `GraphicChanged` event. onGraphicChanged: (Plugin, GraphicChanged) -> (), --- The `GraphicsObjectCreated` event. onGraphicsObjectCreated: (Plugin, GraphicsObjectCreated) -> (), --- The `GroundObjectDespawned` event. onGroundObjectDespawned: (Plugin, GroundObjectDespawned) -> (), --- The `GroundObjectSpawned` event. onGroundObjectSpawned: (Plugin, GroundObjectSpawned) -> (), --- The `HitsplatApplied` event. onHitsplatApplied: (Plugin, HitsplatApplied) -> (), --- The `InteractingChanged` event. onInteractingChanged: (Plugin, InteractingChanged) -> (), --- The `ItemContainerChanged` event. onItemContainerChanged: (Plugin, ItemContainerChanged) -> (), --- The `ItemDespawned` event. onItemDespawned: (Plugin, ItemDespawned) -> (), --- The `ItemQuantityChanged` event. onItemQuantityChanged: (Plugin, ItemQuantityChanged) -> (), --- The `ItemSpawned` event. onItemSpawned: (Plugin, ItemSpawned) -> (), --- The `MenuEntryAdded` event. onMenuEntryAdded: (Plugin, MenuEntryAdded) -> (), --- The `MenuOpened` event. onMenuOpened: (Plugin, MenuOpened) -> (), --- The `MenuOptionClicked` event. onMenuOptionClicked: (Plugin, MenuOptionClicked) -> (), --- The `MenuShouldLeftClick` event. onMenuShouldLeftClick: (Plugin, MenuShouldLeftClick) -> (), --- The `NameableNameChanged` event. onNameableNameChanged: (Plugin, NameableNameChanged) -> (), --- The `NpcChanged` event. onNpcChanged: (Plugin, NpcChanged) -> (), --- The `NpcDespawned` event. onNpcDespawned: (Plugin, NpcDespawned) -> (), --- The `NpcSpawned` event. onNpcSpawned: (Plugin, NpcSpawned) -> (), --- The `OverheadTextChanged` event. onOverheadTextChanged: (Plugin, OverheadTextChanged) -> (), --- The `PlayerChanged` event. onPlayerChanged: (Plugin, PlayerChanged) -> (), --- The `PlayerDespawned` event. onPlayerDespawned: (Plugin, PlayerDespawned) -> (), --- The `PlayerSpawned` event. onPlayerSpawned: (Plugin, PlayerSpawned) -> (), --- Once per client cycle in every game state, the login screen included. onPostClientTick: (Plugin, PostClientTick) -> (), --- The `PostHealthBarConfig` event. onPostHealthBarConfig: (Plugin, PostHealthBarConfig) -> (), --- The `PostMenuSort` event. onPostMenuSort: (Plugin, PostMenuSort) -> (), --- The `PreMapLoad` event. onPreMapLoad: (Plugin, PreMapLoad) -> (), --- The `ProjectileMoved` event. onProjectileMoved: (Plugin, ProjectileMoved) -> (), --- The `RemovedFriend` event. onRemovedFriend: (Plugin, RemovedFriend) -> (), --- The `ResizeableChanged` event. onResizeableChanged: (Plugin, ResizeableChanged) -> (), --- The `ScriptCallbackEvent` event. onScriptCallbackEvent: (Plugin, ScriptCallbackEvent) -> (), --- The `ScriptPostFired` event. A subscription takes every script the --- client runs, thousands a second. To hear only some, name them: --- `eventFilters.onScriptPostFired = { scriptId = { ... } }`, or --- `eventBus:subscribe`'s fourth argument. onScriptPostFired: (Plugin, ScriptPostFired) -> (), --- The `ScriptPreFired` event. A subscription takes every script the client --- runs, thousands a second. To hear only some, name them: --- `eventFilters.onScriptPreFired = { scriptId = { ... } }`, or --- `eventBus:subscribe`'s fourth argument. onScriptPreFired: (Plugin, ScriptPreFired) -> (), --- The `SoundEffectPlayed` event. onSoundEffectPlayed: (Plugin, SoundEffectPlayed) -> (), --- The `StatChanged` event. onStatChanged: (Plugin, StatChanged) -> (), --- The `VarClientIntChanged` event. onVarClientIntChanged: (Plugin, VarClientIntChanged) -> (), --- The `VarClientStrChanged` event. onVarClientStrChanged: (Plugin, VarClientStrChanged) -> (), --- The `VarbitChanged` event. onVarbitChanged: (Plugin, VarbitChanged) -> (), --- The `WallObjectDespawned` event. onWallObjectDespawned: (Plugin, WallObjectDespawned) -> (), --- The `WallObjectSpawned` event. onWallObjectSpawned: (Plugin, WallObjectSpawned) -> (), --- The `WidgetClosed` event. onWidgetClosed: (Plugin, WidgetClosed) -> (), --- The `WidgetDrag` event. onWidgetDrag: (Plugin, WidgetDrag) -> (), --- The `WidgetLoaded` event. onWidgetLoaded: (Plugin, WidgetLoaded) -> (), --- The `WorldChanged` event. onWorldChanged: (Plugin, WorldChanged) -> (), --- The `WorldListLoad` event. onWorldListLoad: (Plugin, WorldListLoad) -> (), --- The `WorldViewLoaded` event. onWorldViewLoaded: (Plugin, WorldViewLoaded) -> (), --- The `WorldViewUnloaded` event. onWorldViewUnloaded: (Plugin, WorldViewUnloaded) -> (), --- The `AccountHashChanged` event. onAccountHashChanged: (Plugin, AccountHashChanged) -> (), --- The `CanvasSizeChanged` event. onCanvasSizeChanged: (Plugin, CanvasSizeChanged) -> (), --- The `UsernameChanged` event. onUsernameChanged: (Plugin, UsernameChanged) -> (), --- The `WorldEntityDespawned` event. onWorldEntityDespawned: (Plugin, WorldEntityDespawned) -> (), --- The `WorldEntitySpawned` event. onWorldEntitySpawned: (Plugin, WorldEntitySpawned) -> (), --- The `ConfigChanged` event. onConfigChanged: (Plugin, ConfigChanged) -> (), --- The `ExternalPluginsChanged` event. onExternalPluginsChanged: (Plugin, ExternalPluginsChanged) -> (), --- The `OverlayMenuClicked` event. onOverlayMenuClicked: (Plugin, OverlayMenuClicked) -> (), --- The `PlayerLootReceived` event. onPlayerLootReceived: (Plugin, PlayerLootReceived) -> (), --- The `PluginChanged` event. onPluginChanged: (Plugin, PluginChanged) -> (), --- The `ProfileChanged` event. onProfileChanged: (Plugin, ProfileChanged) -> (), --- The `RuneScapeProfileChanged` event. onRuneScapeProfileChanged: (Plugin, RuneScapeProfileChanged) -> (), --- The `ServerNpcLoot` event. onServerNpcLoot: (Plugin, ServerNpcLoot) -> (), --- The `WorldsFetch` event. onWorldsFetch: (Plugin, WorldsFetch) -> (), --- Draw the plugin's side panel. Declaring this is what gives the plugin a --- panel at all. Immediate mode: called every frame. sidePanel: (Plugin, Panel) -> (), --- Open and drive separate viewport windows. The window handle is valid --- only for this pass. renderWindows: (Plugin, Window) -> (), --- Draw over the game. Called once per layer every frame, three calls in --- all, so a hook that ignores `layer` draws three times. The draw surface --- is valid only for this pass. --- --- This hook only draws: it cannot act. An action called from it answers --- `false`, or raises if it is a capitalised static or an item's --- `interact`. --- --- ```luau --- function plugin:renderOverlay(draw, layer) --- if layer == DrawLayer.ABOVE_SCENE then --- draw:tilePoly(tile, Color.RED, Color.new(255, 0, 0, 40)) --- end --- end --- ``` renderOverlay: (Plugin, Draw, DrawLayer) -> (), --- The descriptor's name. getName: (Plugin) -> string?, --- The plugin's id (its package folder's name). getId: (Plugin) -> string?, --- The plugin's own fields and methods (`function plugin:helper()`). [string]: any, } -- END GENERATED: plugin-hooks