WikilyWIKILY
Tous les jeux19 wikis · choisissez votre jeu
Menu

Documentation

Variables & Scripts

Updated 2026-09-29

A data block can read a variable instead of storing its own rows. Click its variable name to see what fills it.

From a block to its script

Diagram: the script name in the table is clickable. The inspector's variable picker also has a View link.
  1. Click the script name in the block, or use its inspector's View link.
  2. Read the source and the Reads these variables buttons.
  3. Choose Edit source to open the editor that owns it.

Unsaved page changes use the normal save-or-discard prompt before leaving. Dependency inspection keeps your open variable draft in place.

Find all scripts in one place

Open Manage › Variables & Scripts. Search for a name such as wovItemRecipeUses. The catalog includes definitions saved on pages, shared layouts and reusable blocks, with a link to each source editor.

WikiOpen Manage › Variables & Scripts. Changes can affect many pages. Admin access is required.
Shared layoutEdit source opens the dataset's shared layout editor. Its variables save with that layout and affect pages using it.
Page or blockEdit the definition in place. Apply it to your draft, then save the page or reusable block.
The central catalog shows where each definition belongs. In a page editor, View › Variables & Scripts also lists the definitions available to that page.

Names are identifiers: letters, digits and underscores, with a letter or underscore first. Labels and descriptions can contain spaces. Keep a used name stable, or update the blocks and scripts that read it.

Test before saving

The Lua editor checks syntax as you type. An error names the line to fix. The check compiles the code without running it; use Test script to check its result with data.

Diagram: Load page values uses the unsaved editor draft and its sample page. You can change the loaded JSON to try another case.
  1. Open Test script. Use Load page values when available, or enter a small JSON sample.
  2. Choose Run test. Read the result or the error message.
  3. Apply the variable, preview the page, then save. Testing does not publish changes.
[]An empty list. A table has no rows for these values.
nullNo displayable value. Check return and the result shape.
Test failedRead the Lua error, fix the indicated code, then run again.
Paged scriptProvide a small batch and any state variables in JSON. This test runs one script call; use page Preview to check paging.

Try the real script editor

Checking Lua syntax...

Checks syntax only. Use Test script to check values and results.

Test script

Runs your current script without saving. Test values become the Lua vars table.

Use a small sample. For paged scripts, include the batch and state variables your script expects.

Open Test script, enter { "level": 10 }, then Run test. Result: 50. This example saves nothing.

The smallest useful Lua script

local level = vars.level or 1
return level * 5
Readvars.entry.name
Return a valuereturn (vars.level or 1) * 5
Return rowsreturn { { label = "Health", value = 100 } }
Show a value{{ damage }}

Lua runs in Wikily's restricted sandbox with a short time limit. Scripts can read the supplied variables, with no file or network access.