n3 Code Console
The n3 Code Console is a disabled-by-default, hidden developer plugin that runs small, controlled n3 command scripts from a Swing panel. It avoids compiling or executing arbitrary Java, shell commands, or persisted scripts.Enablement
- Plugin entrypoint:
com.n3plugins.codeconsole.CodeConsolePlugin - RuneLite panel tooltip:
n3 Code Console - Bundle registration:
runelite-plugin.properties - Descriptor:
hidden = true(session/developer console, excluded from default user plugin list unless enabled via internal/hidden plugin configurations)
UI Controls
Commands: session-only script editor.Output: structured status and command result log.Run: parses the entire editor first, then queues the script if it is valid.Stop: requests a safe stop. The active script stops on the next console tick.Clear: clears output text only.Ctrl+Enter: same asRun.Status: shows idle, queued, running, stopping, or parse-error state.
Script Rules
- One command per line.
- The parser ignores blank lines.
#starts a comment unless it appears inside quotes.- Use double quotes for multi-word arguments.
- Item and NPC targets accept names or numeric IDs where the command supports both.
- Boolean arguments accept
true,false,noted,item,on, andoffwhere noted/item mode applies. - The parser validates the full script before executing commands.
- Unknown commands, wrong argument counts, unclosed quotes, and invalid numbers stop the script from queueing.
Execution Model
The executor runs one script at a time from RuneLite game ticks. Run and Stop button events schedule executor state changes throughClientThreadBridge.invokeLater, keeping executor mutation on the client-thread path with tick execution. Each command returns a StepResult:
SUCCESS: log the result and advance to the next command.WAIT: delay by the requested number of ticks, then continue.RETRY: retry the same command up to the bounded retry limit.FAILED: stop the script and log the failure.RESET: return to the first command.
ClientThreadBridge and result-aware Api.actions wrappers.
Commands
Command names ignore case. The console passes names and actions to the existing interaction APIs, so exact available actions depend on the current widget, item, NPC, and RuneLite state.Bank
bank.withdraw argument per call. noted, true, and on switch to noted mode before withdrawing; item, false, and off switch back to item mode before withdrawing.
Inventory
NPC
Object
Tile Item
Prayer
inv.use requires the Inventory tab to be visible, and prayer.set requires the Prayer tab when a state change is needed. The console propagates WIDGET_HIDDEN; it does not select tabs automatically. Open the required tab in the client before running the dependent line.
Walk
State And Vars
Flow Control
Safety Boundaries
The v1 console excludes:- arbitrary Java evaluation
- dynamic compilation
- shell execution
- global
System.out/System.errredirection - unsafe thread stopping
- saved script files
CodeConsoleCommandAdapter, DefaultCodeConsoleCommandAdapter, and CodeConsoleParser. Then test parser dispatch and executor behavior under src/test/java/com/n3plugins/codeconsole.
Verification
After changing the console, run:com/n3plugins/codeconsole/CodeConsolePlugin.class, and runelite-plugin.properties lists com.n3plugins.codeconsole.CodeConsolePlugin.