Calling any action at all
The friendly methods cover the common ground. Underneath them is one call that reaches everything.
Two ways to say the same thing
avatar.get_balance() is a friendly method: a short name for something you will want often. There are a few hundred actions and not all of them have one.
Every action, with or without a friendly name, can be called directly:
print(avatar.execute("get_connection_status"))- execute takes the action's exact name, as a string, in quotes.
- The name is the one in the action directory, spelled exactly. get_connection_status has no friendly method, so this is how it is reached.
Actions that need details
An action that needs to be told something takes a second argument: a dictionary of named values.
avatar.execute("send_im", {
"to_agent_id": "00000000-0000-0000-0000-000000000000",
"message": "Hello from a script",
})- The keys are the names the action expects. The Automation tab lists them beside each action.
- The value shown is a resident key, which is what to_agent_id means. Replace it with a real one.
- The trailing comma after the last entry is allowed in Python and makes adding another line a one-line change.
Finding the name you want
The complete list is in this wiki, under Automation Engine, All available actions. Names beginning with get read something; names beginning with set change a setting; anything else describes what it does.
The Automation tab in the avatar window shows the same list beside the permission switches, which is the quickest place to check both the spelling and whether it is currently allowed.