Replace a Lua action inside a scenario
cmo_write_action_scriptReplace the Lua script text for one matched event action in a Command scenario and write a new .scen file; the original stays unchanged unless output_path points to it.
Instructions
Replace the ScriptText of one Lua event action and write a new .scen file. The original file is left unchanged unless output_path is that same file.
The action is matched by its description, which cmo_read_scenario lists. Load the new file in Command to try it. This rewrites the compressed scenario body, so open the result in Command before you delete the original.
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": {
"path": "<path>",
"action": "<action>",
"script": "<script>"
},
"name": "cmo_write_action_script"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| path | Yes | Existing .scen file to read | |
| action | Yes | Description of the Lua action to replace | |
| script | Yes | New Lua source for that action | |
| output_path | No | Where to write the new .scen. Defaults to the original name with .cmo-lua.scen beside it |