User Variables - Advanced Use

Top  Previous  Next

FARR now supports user variables which can be set in the Options Dialog:



These user variables are an easy way for aliases and plugins to read values and settings that the user can customize.


While plugins can create their own settings dialogs, this is especially useful for alias options, such as parameters and login information.

These values are stored inside the FindAndRunRobot.ini settings file.


The format for the User Variable area is:


// comments




To replace a variable in an alias use:



To get a value from a plugin call:


or to avoid % variable replacement in value



To set a value from a plugin call:


or to avoid % variable replacement in value



A plugin can also get all variables with:





An important feature of user variables is the ability to set some initial default values from an alias file (or a plugin).  In this way when your alias is first loaded it will create sample values for the user to modify, which makes it easier to explain to the user what variables to set.


In an alias xml file include the following section:




// twitter plugin login settings -- change to your values\n





NOTE: you need to use \n at the end of  each line (because of xml removal of whitespace).


From a plugin you can do the same thing by calling the following each time your plugin is loaded:


set_strval("DefaultUserVars","[TwitterPlugin]\n// twitter plugin login settings -- change to your values\nusername=YOUR_TWITTER_USERNAME\npassword=YOUR_TWITTER_PASSWORD\n");