How to refer to different parts of the API while scripting

It looks like ruleActive is a global variable. It would be undefined if it hasn’t been given a value on initialisation/definition.

Edit: Oh, I see you have posted here: How to keep a boolean variable defined as true or false