Author: Ribose
Version: v1.0.20100928
Description: This script gives you a window to manage scripts, as well as providing a standard way to change script settings.
Commands:
None
Settings:
None: this script has no settings except window state information.
What is this:
This script provides a window with information on the selected script.
Go to Scripting > Script Manager > Manage Scripts to manage your scripts.

Here is the Script Manager.
How to code for the Script Manager:
No changes need to be made to your code except to your header, and any changes you do are completely optional but help users who use this script to view scripts in a unified window.
Header:
As an example here is the Script Manager's header:
Script("Name") = "Script Manager" Script("Author") = "Ribose" Script("Major") = 0 Script("Minor") = 9 Script("Revision") = 20091117 Script("Settings") = "\Script Manager\settings.xml" Script("Description") = "This script gives you a window and commands to manage scripts, " & _ "as well as providing a standard way to change script settings."
The Name, Author, Major, Minor, and Revision items are already read by StealthBot, and the Script Manager will read those the same.
The Settings item optionally provides the path to a settings.xml informational file (which I will explain later).
The Description item optionally provides a description blurb that will appear in the Script Manager as in the screenshot above.
Settings.xml:
You can optionally provide this file with your script and reference it in Script("Settings") with a path in the same format as an #include path (relative to BotPath\Scripts).
The format is an XML document like so:
<?xml version="1.0"?> <settings> <setting name="key" defaultvalue="default value" type="0"> <description> description of setting, this is a "string" type setting </description> </setting> <setting name="name" type="4" defaultvalue="False"> <description> example boolean setting </description> </setting> <setting name="enumkey" type="3" defaultvalue="0"> <enum> <value name="value0">description (not used yet)</value> <value name="value1" /> <value name="value2" /> </enum> <description> example enumeration setting </description> </setting> <setting name="hiddentest" hidden="1" /> </settings>Reminder that the Script Manager will add Enabled and Public then already existent settings in the INI for a script as "string" settings with no description. This XML file is only to give descriptions and restrictions to settings so that the user can understand your settings better, and choose values that your script will understand.
Setting Name:
This has to match the key (the setting name) in the INI for which values will be read and written
Setting Type:
There are five setting types available which you set with the number of the type in the XML:
0 = STRING, a value that can be anything
1 = WORD, a value that can be anything without whitespace
2 = NUMERIC, a value that can only be numeric, including decimals and negatives
3 = ENUMERATED, a value that can only be one of a set of numeric values, provided by the <enum> tag (the INI will store the numeric value, but the UI will show the "name" attribute; 0-based in the order of the <value> tags).
4 = BOOLEAN, a value that can only be TRUE or FALSE (will accept Y and N and variations thereupon, as well; case insensitive).
Setting Default Value:
Set this in the XML to have a "fall-back" value if the INI stores a value that is not valid given the setting type.
Hidden Settings:
Pass "1" to the hidden attribute in the XML, and the UI will not show the setting with the provided name.
This is for simple "user protection" in cases like: settings storing form position and state don't really need to be touched, they will be updated automatically when the form's size or state changes; or settings persisting important data that is read/written automatically such as so that you can stay logged in with my Realm script over script reloads.
Settings.txt Include:
This script comes with the Settings.txt #include. Optionally include it with your scripts to get two functions to help you with reading setting values from your script's settings. Since you can't directly use the Setting Manager to read your settings in your own scripts, I instead made this #include to add to others' scripts to easily read numeric and boolean settings.
GetNumericSettingsEntry(SettingName, DefaultValue)
Always returns an integer. Returns the value of the setting requested if it is a valid integer. Otherwise returns what you passed into DefaultValue. This makes the task of always checking IsNumeric() and then converting with CInt() if valid, or returning a default if not valid, into one line of your script.
GetBooleanSettingsEntry(SettingName, DefaultValue)
Always returns a boolean. Returns true if the setting contained "True", "Y" or close values. Returns falso if the setting contains "False", "N" or close values. Otherwise returns what you passed into DefaultValue.
Include these two functions with this line at the top of your script:
#include "\lib\Ribose\Settings.txt"
Changelog:
- v0.9.20091117: 2009-11-17 ~Ribose
- This is the first release of the script. Note that this script is in beta, and may not be fully functional.
- Created changelog.
- This is the first release of the script. Note that this script is in beta, and may not be fully functional.
- v1.0.20100928: 2010-09-28 ~Ribose
- [REM] Removed the command listing: use the command manager!
- [FIX] Completed: It will now allow only valid input into the setting input box.
- [FIX] Completed: It will not ignore minvalue, maxvalue, minlength, or matchstring attributes.
- [FIX] Completed: Enumerations are handled how I want them to be.
- [FIX] Tidying: The form will now use the font set for the channel in Fonts and Colors. It will also have more space for the script description and setting descriptions. It will now display what type of setting the XML expects.
- [FIX] Fixes for Build 465's form changes.
- [REM] Removed the command listing: use the command manager!
(extract the ZIP file to your Scripts\ folder and reload script to install)
Attached File(s)
-
ScriptMan.zip (8.9K)
Number of downloads: 347