write_script
Create or overwrite NWScript (.nss) source files in a module and compile them to catch errors. Use it to add new scripts or edit existing ones.
Instructions
Write NWScript (.nss) source code to the module and optionally compile it. Creates or overwrites the .nss file. Use for creating new scripts or editing existing ones.
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"resref": "<resref>",
"source": "<source>"
},
"name": "write_script"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| resref | Yes | Script resref without extension | |
| source | Yes | The NWScript source code to write | |
| compile | No | Compile after writing (default true) |