Skip to the article
NeuraCoreUser Wiki
โ† Back to this chapter
Embedded Python

The Python Runner

Where it is, what is already loaded when a script starts, and what happens when you press Run.

Where to find it

Open an avatar window and go to Automation, then Python Runner. There are three parts: the dropdown that says which script you are looking at, the editor you type into, and the output area underneath it. Run starts the script, and everything it prints appears below as it is printed.

Python comes with an Individual or a Business licence. It is part of the Automation tab, so a Free licence has neither.

A script belongs to one avatar

The script runs as the avatar whose window you opened it in. That is not a setting and there is nothing to select: a script typed into Xena's window is Xena's script, and running the same text in another avatar's window runs it as that avatar.

This matters more than it sounds. A script that pays somebody, or clears an inventory folder, does it as whichever avatar you happened to be looking at. Read the window title before you press Run.

Each avatar keeps its own scripts, up to ten of them, and the next topic is about managing more than one.

What is already there

One name is defined before your first line runs: avatar. It is the connection to the avatar whose window you are in, and every action goes through it. You do not import anything and you do not create it.

The rest is ordinary Python. The standard library is available, so import time, import json and import random all work, and so do functions, loops, sets and everything else you already know.

What Run actually does

Your script runs on its own, away from the interface, so a script that waits does not freeze NeuraCore. The avatar carries on doing whatever it was doing.

Anything printed appears in the output area as it is printed, rather than in one lump at the end, so a script that runs for an hour can be watched while it does. So is the error, if it stops early, with the line it happened on. Nothing is written to a file and nothing leaves your computer.

A script runs to its end and stops. Closing NeuraCore ends it, and so does its avatar going offline. A script that should keep going has to loop, and the topic on waiting says how; a script that should start on its own can be told to, and the next topic says how.

Every call is still checked

Python is not a way round the permission list. Every action a script calls goes through exactly the gate the buttons go through: Automation, then Action Permissions. An action switched off there is refused when a script calls it, and paying Linden dollars is switched off from the start.

Every call is also written to Execution History with Python named as the caller, so what a script did is as visible afterwards as what you did by hand.