Lua scripts

A mod script is written in Lua 5.4. It listens to game events and answers with data. For a talk, the answer is a line to say. A script can also read the pockets, the town and its villagers, and queue commands for letters, items, lines and questions.

For a first script, start with the scripter path.

Setting a script up #

In mod.json, name the file and list every event it listens to:

mod.json (part)
"scripts": {
  "main": "main.lua",
  "events": ["villager_talked", "day_started"]
}
  • main must end in lower case .lua and be in the ZIP. It can sit in a folder, as in scripts/main.lua.
  • A mod has one script. There is no require, so keep your code in that one file.
  • events lists events, each once. Calling on() for an event that is not listed is an error.
  • A script works in a Just you mod and in a World mod.
  • A script that only offers functions to other mods still lists one event in events. List one and register no handler. See a library mod.

Reference: main.lua, with every limit and error code.

When your code runs #

  1. When the game starts, each mod's script runs from top to bottom once. This is where you call on() and set up your tables.
  2. After that, only your handlers run, when their event happens.
  3. Your variables keep their values for the whole session. They start fresh at the next restart. Use store for anything that must last.

The API #

CallWhat it does
on(event, fn)Runs fn each time event happens. Call it only while the script first runs, never from inside a handler. Up to 16 handlers per event.
log(...)Writes a line to the Mod log and the browser console as [Mods] your-id: .... Values are joined with spaces. A line is cut at 299 bytes.
message(key)Returns the line with that key from your messages file, or nil. With a colon, as in "other.mod:key", it reads another mod's line.
game.time()Returns the game's date and time as a table { year, month, day, hour, minute, weekday }. weekday is 0 for Sunday to 6 for Saturday.
store.get(key)Returns a saved value, or nil.
store.set(key, value)Saves a string, number or boolean. nil deletes the key. See the store.
game.day_number()Returns the game clock's day as one whole number, counted in days since 2000-01-01.
store.town()Returns an opaque text that names the town the store belongs to now, or nil before a town loads. When it changes, read again what you keep in locals.
store.player.get, store.player.setThe store of the player who is playing. There is one per mod, per town, per player. See the store.
store.client.get, store.client.setThe per-browser store. There is one per mod, whatever town is loaded. See the store.
game.pockets()Returns the held items only, in slot order, as { { slot, item, mod_item }, ... }. slot is 1 to 15. Empty pockets give {}.
game.bells()Returns the Bells in the wallet, or nil when no town is loaded.
game.town()Returns { name, id, year, month, day, hour, minute, weekday, season }, or nil when no town is loaded. season is spring, summer, fall or winter.
game.villagers()Returns { { id, name, species, personality }, ... }. personality is normal, peppy, lazy, jock, cranky or snooty. Every villager is on the villagers list.
game.player()Returns { name, id, x, y, z, angle, acre, scene, tool, state }, or nil when no town is loaded. id stays the same for that resident in that town. The rest says where the player stands and what they are doing. See the player.
game.weather()Returns the weather where the player is, { kind, intensity }, or nil when no town is loaded. See the weather and where the player is.
game.place()Returns where the player is, { scene, name, island, acre, acre_x, acre_z, unit_x, unit_z }, or nil when no town is loaded. See the weather and where the player is.
game.calendar_today()Returns the ids of your own calendar days that fall on the town's date today, in file order. It returns {} when there are none. See calendar days.
game.input()Returns the player's buttons held now and the main stick: { a, b, ..., c_right, stick_x, stick_y }. See the player's buttons.
settings.get(name)Returns a setting's value. That is the player's value, or the default. See settings.
remote.add, remote.call, remote.hasOffer functions to other mods and call theirs. See dependencies.
remote.versionWhether a mod named in depends or optional_depends is there, and at what version. See optional dependencies.
rng(), rng(n), rng(m, n)Return a random number. rng() gives a fraction from 0 up to 1. rng(n) gives a whole number from 1 to n. rng(m, n) gives one from m to n. See random numbers.
timer.after(minutes, name, data)Sets a timer that fires once, as a timer_fired event, that many game minutes from now. It returns the timer's id. See timers.
timer.cancel(id)Cancels a waiting timer. It returns true when there was one.
cmd.*Queues a command. See Commands.

Events #

Every handler gets exactly one table, e. A field with nothing to say is nil, never an empty string or 0. Ids are always numbers in Lua. JSON files write them as strings such as "0x2800". cmd.* takes a number, "0x2800" or your mod's own "author.mod:thing".

EventeReturnWhen
villager_talked{ villager }nil, a talk table { place, line, topics, ask }, or a list of talk tables.The player starts an ordinary talk with a villager.See the places.
day_started{ year, month, day, weekday }NothingA new day begins in the game.
item_picked_up{ item, mod_item }NothingThe player got an item.
scene_entered{ scene, name }NothingA scene starts, such as the town, a house or a shop.
data_migrated{ from, to }NothingFires once per town, when mod.json "data_version" differs from the version the town's data was written at.See moving your data forward.
hour_changed{ year, month, day, hour }NothingThe game's clock reached a new hour.
item_bought{ item, mod_item, price, shop, ordered }NothingThe player bought a good for Bells at any counter in the game.See the shops.
item_sold{ item, mod_item, count, bells, shop }NothingThe player sold for Bells.See the shops.
fish_caught{ item, pocketed }NothingA fish was landed.
bug_caught{ item, pocketed }NothingA bug was netted.
letter_read{ sender, item, mod_item, first_time, letter }NothingThe player chose Read on a letter.
villager_moved_in{ villager }NothingA villager with no house was given one.
visitor_arrived{ kind }NothingA friend is riding into this player's own town.
command_finished{ id, command, ok, via, code, message }NothingA command this mod queued was applied or refused.
question_answered{ id, choice, text }NothingThe player answered this mod's ask, or closed it.
timer_fired{ id, name, data }NothingA timer this mod set with timer.after is due.See timers.
villager_answered{ villager, choice, text }nil, a line, or a reply table { line, ask }.The player answered the question this mod's conversation asked (villager_talked returned place = "conversation" with an ask).See a conversation that asks.
button_pressed{ button }NothingA button on the player's controller was pressed.See the player's buttons.
button_released{ button }NothingA button on the player's controller was let go.See the player's buttons.
player_acted{ action, item, reaction }NothingThe player started one of the actions below.See the player.

Notes on the fields:

  • villager is the same table wherever a villager appears, in events and in each entry of game.villagers(). It is { id, name, species, personality }. id is a number that stays the same for that villager. species and personality are nil when the game cannot tell.
  • In scene_entered, scene is the scene number. name is its name from the scenes list, like "player_house". It is nil for a scene with no published name.
  • In letter_read, item is the present. It is nil when there is none.
  • In letter_read, letter names the letter when a mod's letters file sent it. It is the full id, like "your.mod:welcome". To act when the player reads your invitation, test e.letter == "your.mod:welcome". It is nil for the game's letters, a player's letters and a letter sent with cmd.send_letter{ text }. The game finds the letter by its words, so two letters with the same body and sign-off are not told apart.
  • mod_item is the full id of a mod item, like "your.mod:ghost-lantern", when the piece is one. item is then the furniture it stands on. For item_sold, it describes the first piece sold. mod_item is nil for a plain good. It is also nil for a visitor shopping in a friend's town, whose piece is plain furniture.
  • item_picked_up carries mod_item when you pick a mod item up off the floor of your own house. That is the only place a mod item stands. A mod item dropped outdoors is plain furniture, so it comes back plain.
  • letter_read carries mod_item when the letter's present is a mod item, such as one you attached to a letter yourself.
  • fish_caught and bug_caught have no mod_item. A fish or a bug is never a mod item.
  • fish_caught has no size or length, because the game keeps none for a caught fish. Each kind of fish has one shadow size, so item tells you that.
  • In item_picked_up, write item numbers in hex to match the game's lists, with string.format("0x%04X", e.item).
  • item_picked_up does not fire for anything bought. It also does not fire when the pockets are full, because the item is not yours yet.
  • A fish or a bug that goes into the pockets fires item_picked_up and then fish_caught or bug_caught. A script that counts in both handlers counts that catch twice. Count catches in fish_caught and bug_caught, where pocketed says whether it was kept. Or skip fish and bugs in item_picked_up.

Notes on villager_talked:

  • Use it for a line that depends on something, such as the time, the date, the store or an item in the pockets. The script kit has a villager notice an apple you carry. Small talk needs no script: put it in a talk pool, by villager or personality, season, time of day, weather and calendar day.
  • Every line names its place: a plain string returned alone is refused and logged. A talk table names its place: before, hello, topic, after or conversation, and its line is a string or a list of up to 8 pages. Return a list of talk tables for several places at once. See any place from a script.
  • A conversation can end in ask = { text, choices }. The pick goes to your villager_answered handler, which returns what the villager says next. See a conversation that asks.
  • A place a script did not take can still get a calendar day or talk pool line, so one talk can have both.
  • It is never called for a special talk. Special talks carry the game's own story, so no mod hears them. They are a first meeting, a villager moving out, an errand, delivery or contest in progress with that villager, a complaint, a pitfall or a bee chase, an islander, Kamakura and summer camp.
  • The villager's next ordinary talk calls villager_talked as usual. A line you keep for "the next time we talk", such as a thank-you, comes then.
  • The game asks every mod in the order of the Mods tab list, from the top. The first line returned for a place takes it; a later one for that place is written to the Mod log. A conversation takes the whole talk, and the mods below it are not asked.
  • A page is 1 to 400 bytes, with no zero byte. Returning "" or nil means no line. A table that is not right is written to the Mod log and nothing of it is said.

Notes on item_bought and item_sold. shop says where:

shopWhere
"nook"Nook's in every size, and Nookington's in The City
"flower"The flower shop
"redd"Crazy Redd
"saharah"Saharah's carpet, swapped for one of yours plus Bells
"joan"Turnips
"fireworks"The fireworks show's stall
"shrine"The New Year fortune slip
"gyroid"What another player put up at their gyroid
"villager"A villager's trade
  • Only Nook's and villagers buy from you. To keep to Nook's, test e.shop == "nook".
  • ordered is true for a Nook's catalog order. It is paid now and mailed tomorrow, so it is not in the pockets yet.
  • A service is not a good and sends no item_bought. Services are a new look at the Pampered Paw (the haircut service), Katrina's fortune, a dream and an Able Sisters design.

Notes on timing:

  • day_started does not run again when the game restarts later on a day the town already saw. The save holds the day it last began.
  • If the game was not saved since that day began, the save still holds the day before. The next start then runs day_started again. To count days, store the last date you saw instead of counting calls.
  • No event runs in the title screen demo.

The player #

game.player() reads the player as they are right now, so it is cheap to call from any event or timer:

  • x, y, z: where they stand. A ground tile is 40 across and an acre is 640. x grows to the east and z to the south, down the screen. Inside a building they are the room's own.
  • angle: which way they face, 0 to 359 degrees. 0 faces south, toward the camera, 90 east, 180 north and 270 west.
  • acre: { x, z } in the town, as the map counts acres. x is the column, 1 to 5 from west to east. z is the row, 1 (the train station's row, A on the map) to 6 (the beach row, F). It is nil in any scene but the town.
  • scene: the scene's name from the scenes list, like "town".
  • tool: "axe", "net", "rod", "shovel" or "umbrella" in their hand, golden ones too. nil for an empty hand or anything else.
  • state: one word: "standing", "walking", "running", "sitting", "lying" (on a bed), "wading" or "busy". "wading" is the game's word for walking into the next acre while the screen scrolls: the town has no water a player can wade into. "busy" is everything else: a tool swing, picking something up, a talk, a door, a cutscene. Treat a word you do not know as "busy": the list may grow.

Everything after id is nil while the scene is still being built, such as in day_started as the game starts. On a visit it is the visitor, standing in the host's town.

main.lua
local p = game.player()
if p and p.scene == "town" and p.acre then
  log("in acre", p.acre.x, p.acre.z, "facing", p.angle, "holding", p.tool or "nothing", "and", p.state)
end

player_acted fires when the player starts an action. e.action is one of axe_swung (at a tree or at nothing), axe_hit_rock, axe_broke, net_swung, rod_cast, shovel_dug, hole_filled, tree_shaken, sat_down, stood_up, lay_down, stung, fell_in_pitfall, tripped, shocked, door_entered or reacted. It arrived in API 1.1.

  • Walking, running and standing are never events. Read game.player().state for those.
  • item is the tool's item number for an axe, net, rod or shovel action. An axe's number changes as it wears. It is nil for every other action.
  • reaction names the reaction for reacted: one played from the reactions bar or by cmd.react.
  • It is the start, not the result: axe_swung fires for every swing, whether the tree falls or not.
  • Only the player playing this game sends it. A friend on a visit or another player in The City does not.
  • It fires on a visit and in The City too, where it changes nothing.
  • A word you do not know may come in a later update: ignore it.

cmd.react(name) plays a reaction on the player's own character. See the commands. The player is busy with the action that just started, so react a moment later, from a timer:

main.lua
-- Count the trees shaken today, per resident, and cheer on the tenth.
on("player_acted", function(e)
  if e.action ~= "tree_shaken" then return end
  local n = (store.player.get("trees") or 0) + 1
  store.player.set("trees", n)
  -- The player is busy shaking the tree right now, so cheer a minute later.
  if n == 10 then timer.after(1, "cheer") end
end)

on("timer_fired", function(e)
  if e.name == "cheer" then cmd.react("hooray") end
end)

Small examples #

Say something different on Sunday mornings:

main.lua
on("villager_talked", function(e)
  local t = game.time()
  if t.weekday == 0 and t.hour < 12 then
    return { place = "before", line = "A lazy Sunday morning, " .. e.villager.name .. " says. Isn't it lovely?" }
  end
  return nil
end)

Count every item you pick up, across sessions:

main.lua
on("item_picked_up", function(e)
  local n = (store.get("picked") or 0) + 1
  store.set("picked", n)
  if n % 100 == 0 then
    log("you have picked up", n, "things")
  end
end)

The cookbook has whole mods to read.

The store #

  • store is one per mod per town, with 8 KB per town. store.client is one per browser.
  • The main part of your script runs before a town loads, so read and save from events. See Per-town data.
  • A town has up to 4 residents, and they share store. store.player is one per mod, per town, per player. Keep there anything one resident earns alone, such as a quest or today's gift. It takes the same keys and values and lives inside the same 8 KB.
  • When a resident is deleted, the game deletes what your mod saved for them in store.player. A new resident in that save slot starts with nothing.
  • Every store.set, store.player.set and store.client.set writes your mod's file in the save folder before it returns.
  • The browser keeps the save folder at the game's next save sync. That is a game save. For the cloud, mod data uploads at most every 2 minutes. A tab closed before that sync loses the last sets.
  • A key is a string of up to 64 bytes. It cannot start with a control character.
  • A value is a string of up to 1024 bytes, a number, true or false. Whole numbers come back whole.
  • A store.set that breaks a limit changes nothing and raises an error. The error stops your script unless you catch it:
main.lua
local ok, err = pcall(store.set, "notes", long_text)
if not ok then
  log("could not save notes:", err)
end

Timers #

A script cannot wait. It asks to be called later: timer.after(minutes, name, data) sets a timer, and the game sends your mod a timer_fired event when it is due.

main.lua
-- mod.json: "events": ["villager_talked", "timer_fired"],
--           "permissions": ["show_line"]
-- The mark is in the town's store, not store.player: the timer can fire
-- while another resident plays, and it must be cleared then too.
on("villager_talked", function(e)
  if store.get("kettle") then return nil end
  local id, why, code = timer.after(30, "kettle", e.villager.name)
  if not id then
    log("no timer:", why, code)
    return nil
  end
  store.set("kettle", id)
  return { place = "before", line = "I put the kettle on. Come back in half an hour!" }
end)

on("timer_fired", function(e)
  -- e = { id, name, data }: the timer is already gone
  if e.name == "kettle" then
    store.set("kettle", nil)
    cmd.show_line("The kettle at " .. e.data .. "'s place must be boiling by now.")
  end
end)
  • List timer_fired in scripts.events and add its handler. Without a handler, timer.after is refused.
  • minutes is a whole number of game minutes, 1 to 10,080. That is up to 7 game days.
  • name says what the timer is for. It is 1 to 40 bytes of letters, digits, _, - and .. One handler gets all your timers, so test e.name.
  • data is optional. It is text of up to 240 bytes, a number, true or false. It comes back as e.data. Empty text comes back as nil.
  • timer.after returns the timer's id. An id is never used twice in a town. When it is refused, it returns nil, a message and a code.
  • timer.cancel(id) cancels a waiting timer and returns true. It returns false for a timer that already fired.

The clock:

  • Time is counted on the game's clock, the one game.time() reads. A timer keeps counting while the game is paused or closed.
  • A timer fires at the end of a frame's update, in whatever scene the player is in. One that came due while the game was closed fires soon after the town loads.
  • A timer never fires at the title screen or at player select. Nothing of a mod runs there: no event, no timer and no command. It all carries on when play starts.
  • The smallest step is one game minute. A timer never fires early.
  • If the player sets the game's clock forward, every timer that is now due fires. If they set it back, a timer waits again, but never longer than 10,080 minutes from the new time.

Where a timer is kept:

  • A waiting timer is kept in your mod's town store. It survives a save and a reload, and it travels with the town in a cloud save or an export.
  • It counts toward the store's 8 KB, with its name and data. A timer that does not fit is refused.
  • A mod may have 16 timers waiting in one town.
  • The main part of your script runs before a town loads. Set timers from events.
  • On a visit and in The City, the store lives in memory, and so do timers set there. They are gone when the player leaves.
  • A scene change does not touch a timer.

Limits when a timer fires:

  • timer_fired is an event like any other. Its handlers share the usual budget of 200,000 instructions.
  • Commands queued from it count against the caps per event and per day, as from any event.
  • At most one timer per mod fires in a frame. When several are due, the rest fire in the next frames, earliest first.
  • The timer is gone before your handler runs. To repeat, set the next one inside the handler.
CodeTry againWhen
timer-argsneverWrong arguments, such as the minutes, the name or the data. Also when the script has no timer_fired handler.
timer-limitlaterThe mod already has timers.per_mod timers waiting in this town.
timer-no-townlaterNo town is loaded yet. The script's main chunk runs before the save loads.
timer-no-clocklaterThe game clock is not set. It reads a date before the year 2000, so there is no minute to count from.
timer-store-fulllaterThe timer does not fit in this mod's town store (store.bytes), or the store could not be written.

The player's buttons #

A script can read the controls the player plays with. A keyboard key, a controller button and the on-screen touch pad all reach the game as the same controller, with the player's own key settings applied, so one handler covers all three. The Button Tricks example gives each D-pad button a trick of its own.

main.lua
-- mod.json: "events": ["button_pressed"], "permissions": ["show_line"]
on("button_pressed", function(e)
  -- Z while L is held: a combination the game itself does not use
  local input = game.input() -- nil while the text editor is open
  if e.button == "z" and input and input.l then
    cmd.show_line("Hotkey!")
  end
end)
  • The buttons are a, b, x, y, z, l, r, start, dpad_up, dpad_down, dpad_left, dpad_right, c_up, c_down, c_left and c_right. The C stick is the four c_ buttons.
  • The two events and game.input() arrived in API 1.1. A playac-mod older than 1.1.0 does not know them.
  • button_pressed and button_released hand you { button }. They come once a frame, releases first, each in the order above.
  • A button already held when play starts, or held through a change of scene or the text editor, is not a press.
  • game.input() gives every button as true while held, and the main stick as stick_x (right) and stick_y (up), each from -1 to 1. The keyboard's movement keys tilt it fully.
  • The game still gets every press. A button your handler listens to does what it always does too, so pick a combination the player does not use for anything else.
  • Your script never sees which key was typed. Nothing reaches it while the game's text editor is open, such as writing a letter or a name, whether by keyboard or by controller. game.input() answers nil then.

The weather and where the player is #

Two questions a script can ask at any time, from any event. Asking changes nothing, so they need no permission.

main.lua
-- mod.json: "events": ["scene_entered"], "permissions": ["show_line"]
on("scene_entered", function(e)
  if e.name ~= "town" then return end
  local w, p = game.weather(), game.place()
  if not w or not p or not p.acre then return end
  if w.kind == "rain" and w.intensity == "heavy" then
    cmd.show_line("Pouring at " .. p.acre .. ". Good day for fish.")
  end
end)
  • game.weather().kind is clear, rain or snow, the same words shops and talk pools use. Cherry blossom petals and falling leaves count as clear.
  • intensity is light, normal or heavy for rain and snow, and none when it is clear.
  • Indoors, game.weather() is the weather outside. On the island it is the island's, which can differ from the town's.
  • game.place() gives scene and name as scene_entered does, and island, true on the island or in a cottage there.
  • Outdoors it adds the acre. acre is the town map's own label, from "A-1" to "F-5", or "island-1" and "island-2" on the island. acre_x is the column and acre_z the row, 1 for A. unit_x and unit_z are the square inside the acre, 0 to 15 from the north-west corner. Indoors these are nil.
  • game.place() names a place the way the town map does, to one square. For the exact position, use game.player(). Both are only ever the player's own: a mod never sees where another player is.
  • On a visit, both describe the town being visited, the one game.town() names.

Random numbers #

  • rng() counts how many numbers your mod has drawn in this town on this game day. Each call gives the next one, so calls in a day differ.
  • The count is saved with the town. A reload carries on from it, so reloading cannot reroll. A new game day starts new numbers.
  • On a visit, in The City and before a town loads, the count is kept in memory only.
  • math.random and math.randomseed are not available. Calling one stops the script with an error that says to use rng().

What Lua you get #

  • You get Lua 5.4 with the string, table, math, utf8 and coroutine libraries.
  • You get the basic functions, such as pairs, ipairs, tostring, tonumber, type, select, pcall, error and setmetatable.
  • These are not there: io, os, debug, package, require, load, loadfile, dofile, collectgarbage, print and string.dump. Use log in place of print.
  • __gc metamethods are refused. A table with a __len metamethod cannot be passed to table.insert, remove, sort or concat.
  • For random numbers, use rng.

Limits and what happens past them #

LimitValue
Work per event200,000 Lua instructions for all your mod's handlers of that event together. Library work counts too. That covers string patterns, table sorts and joins, string.pack and unpack at 1 instruction per 4 format bytes, and memory you allocate.
Time per eventA backstop: one event run past 125 ms stops the script. 3 runs in a row over 8 ms stop it too. Both are stretched on a slow device. See what stops a script.
Time at startA backstop: the main part of the script, when the game starts, gets 250 ms.
Memory4 MB per mod, 16 MB for all mods together
Handlers16 per event per mod
log()20 lines per event and 500 per session. Past that, lines are dropped with a note.
Script file512 KB

A script that raises an error, runs out of memory or runs past its time is stopped for the rest of the session. Your mod's other content, such as textures and a shop, keeps working. The Mods tab shows Script stopped: and the reason, for example yourname.my-script/main.lua:12: attempt to index a nil value. The same line goes to the console. pcall catches ordinary errors, but never a stop for running too long.

What stops a script, and what does not #

  • The instruction count is the rule. A run that goes past 200,000 instructions is stopped with script took too long (over 200000 instructions). The count is the same on every device. An endless loop and a huge allocation are stopped this way, on a fast computer and on a slow phone alike.
  • Wall-clock time is only a backstop. Some work happens inside one instruction, such as a garbage collection. The count cannot see that time, so a run past 125 ms is stopped too, with script took too long (over ... ms). A script that stays inside its count does not get near it.
  • Slow runs. A run over 8 ms is a strike. 3 strikes in a row stop the script with script kept the game waiting. One fast run clears the strikes, so one pause of a busy device is not enough.
  • A slow or busy device. The game measures how long its own work takes each frame, without the mods' time. When its frames are slower than usual, the wall-clock limits above are stretched by the same factor, up to 8 times. So a phone, or a computer busy with other programs, does not stop a mod that a fast computer runs. The message shows the stretched number.
  • The frame share never stops a mod. All mods together get 4 ms of Lua a frame. Past that, events wait for the next frame, in order, and a talk is answered by the villager's own line. On a slow device events wait more often, but they still run.

What a script cannot do #

  • It cannot change anything in the game directly. A handler only returns data and queues commands. The game applies them at the end of a frame's update, within the mod's permissions and caps. Moving villagers or reshaping the town is not a command.
  • It cannot run every frame. There is no per-frame event, and there will not be one. A timer waits at least one game minute.
  • It cannot take anything from the player on its own. cmd.take_item and cmd.take_bells only ask, in the game's own words, and the player decides. See taking items or Bells.
  • It cannot write the player's save on its own terms. cmd.save() asks the game for the same save the Autosave setting makes, and the game writes it only outdoors in the player's own town, in free control. See saving the game.
  • It cannot make any weather it likes. cmd.set_weather asks for weather the game itself could have on that date, and the game changes it as it does on its own. See the weather.
  • It cannot read files or reach the internet. It cannot see the page, the player's account or other mods' variables.
  • It cannot load more code or compiled Lua.

The reference lists every event, query and command.