🧠 Runtime Context
The runtime context is the global environment in which your script executes. Every variable you define, and certain system-provided variables like account
, exist within this context.
It is shared across all parts of the script — including inside loops, conditionals, and functions.
🌐 Global Scope
The runtime context is fully global. This means:
x = 5
function log_value
print(x)
end
log_value()
Any variable defined at the top level is accessible throughout the script, including within functions.
⚙️ Injected Variables
Fuyu may automatically inject certain variables into your script context depending on usage:
account
— If your script references this variable, Fuyu will prompt the user to select an account before the script runs. It can be used to load cookies, access custom fields, etc.Keys
— A global object used to simulate keyboard input (see below).
These variables are available without needing to declare them.
⌨️ Keys
The Keys
object is globally available and can be used to simulate keyboard input.
Examples:
el.send_keys(Keys.ENTER)
el.send_keys(Keys.CTRL + "a")
el.send_keys(Keys.SHIFT + "abc")
You can combine modifier keys like CTRL
, SHIFT
, and ALT
with other keys or text — useful for shortcuts, form navigation, or selection operations.
🔒 Internal Values
Some internal variables (like _team_id
) exist in the runtime context. These values are accessible in scripts, but they are reserved for internal use and cannot be reassigned. Overwriting them may result in unexpected behavior or script errors.
To avoid conflicts, do not declare variables with leading underscores (_
).
💡 Best Practices
- Everything declared in your script is globally accessible.
- Avoid naming variables with leading underscores (
_
) to prevent conflict with internal system values. - Use
print()
to inspect values during debugging.