StealthBot.net: Script Manager - StealthBot.net

Jump to content

Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

Script Manager Script viewing and setting control

#1 User is offline   Ribose Icon

  • Fire wants to be free.
  • Icon
  • Group: Global Moderators
  • Posts: 282
  • Joined: July-31 09

Posted November 18, 2009 - 02:21 AM

Script Manager

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.

Posted Image
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.

To get your script's commands listed in the manager, simply add them via bot's CreateCommand() function. The Manager does nothing but list them currently.

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.
  • 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.


(extract the ZIP file to your Scripts\ folder and reload script to install)

Attached File(s)


~Ribose
[ Download ] [ Wiki ] [ Support ] [ Scripting ]
[ Chrome ] [ Notepad++ ] [ fedora ]
[ Homepage ] [ BNLS ♯ ]

#2 User is offline   Novynn Icon

  • Silver Member
  • PipPipPipPipPip
  • Group: Senior Members
  • Posts: 873
  • Joined: October-07 09

Posted November 18, 2009 - 02:38 AM

What a simple yet powerful tool to use!

Thanks Ribose! - No errors so far :D

#3 User is offline   oblivious Icon

  • Full Member
  • PipPipPip
  • Group: Senior Members
  • Posts: 315
  • Joined: October-25 09

Posted November 18, 2009 - 01:27 PM

Awesome. Can you please provide a link to a tutorial (or make one :P) on how to create forms with vbs?

#4 User is offline   FiftyToo Icon

  • StealthBot Developer
  • Icon
  • Group: Administrators
  • Posts: 276
  • Joined: July-31 09

Posted November 21, 2009 - 06:03 AM

That is sexy as hell, I especially love the enums. Nice work Ribose (as always).

How hard would it be to allow this script manager to add settings for a particular script or to create a new, blank script? It would be a very nice tool to help automate some of the manual legwork of creating a new script. Just something to consider for enhancements.

52

#5 User is offline   Ribose Icon

  • Fire wants to be free.
  • Icon
  • Group: Global Moderators
  • Posts: 282
  • Joined: July-31 09

Posted November 21, 2009 - 03:33 PM

I was planning to have a button to add settings for a script and be able to edit a script from the UI (in your own editor, for example), but I have to plan out the UI a little to add them.
~Ribose
[ Download ] [ Wiki ] [ Support ] [ Scripting ]
[ Chrome ] [ Notepad++ ] [ fedora ]
[ Homepage ] [ BNLS ♯ ]

#6 User is offline   wrongz Icon

  • Newbie
  • Pip
  • Group: Members
  • Posts: 1
  • Joined: January-24 10

Posted January 25, 2010 - 09:29 AM

Thanx a lot...

#7 User is offline   T3X0 Icon

  • Full Member
  • PipPipPip
  • Group: Members
  • Posts: 498
  • Joined: June-27 10

Posted September 28, 2010 - 12:48 PM

Error:
Scripting warning: $_ScriptMan.txt is trying to include a file that does not exist: \lib\Ribose\Settings.txt
The following errors were detected with commands.xml...
Only 1 command element can have no enabled attribute or an enabled attribute equal to 1.


i am probally doing something wrong - like always >.<

This post has been edited by art: September 28, 2010 - 12:50 PM


#8 User is offline   Ribose Icon

  • Fire wants to be free.
  • Icon
  • Group: Global Moderators
  • Posts: 282
  • Joined: July-31 09

Posted September 28, 2010 - 05:59 PM

Did you extract the ZIP file to your Scripts folder as I clearly say to do:

View PostRibose, on 17 November 2009 - 10:21 PM, said:

(extract the ZIP file to your Scripts\ folder and reload script to install)

The ZIP contains \lib\Ribose\Settings.txt so make sure that file ends up in the path Scripts\lib\Ribose\Settings.txt. If it does not you are not extracting to the Scripts folder.
~Ribose
[ Download ] [ Wiki ] [ Support ] [ Scripting ]
[ Chrome ] [ Notepad++ ] [ fedora ]
[ Homepage ] [ BNLS ♯ ]

#9 User is offline   Ribose Icon

  • Fire wants to be free.
  • Icon
  • Group: Global Moderators
  • Posts: 282
  • Joined: July-31 09

Posted September 29, 2010 - 04:55 AM

I've updated the Script Manager.
Install the same way (extract entire ZIP from first post to Scripts folder).
Posted Image

This shot shows me editing the ChooseWait time on the Realms script.
~Ribose
[ Download ] [ Wiki ] [ Support ] [ Scripting ]
[ Chrome ] [ Notepad++ ] [ fedora ]
[ Homepage ] [ BNLS ♯ ]

#10 User is offline   T3X0 Icon

  • Full Member
  • PipPipPip
  • Group: Members
  • Posts: 498
  • Joined: June-27 10

Posted September 30, 2010 - 06:29 PM

the bot doesnt install the script manager after i extract the ZIP file to your Scripts\ folder and reload script.
but the bot doesnt show any erros. it just reloads the script normaly.
whats wrong?

#11 User is offline   Ribose Icon

  • Fire wants to be free.
  • Icon
  • Group: Global Moderators
  • Posts: 282
  • Joined: July-31 09

Posted September 30, 2010 - 11:20 PM

Is Script Manager under the Scripts menu? If so, use the menu to view the form.

I don't make my scripts display stupid messages like "script loaded" because then I would be spamming to someone who has 30 scripts that do that!
~Ribose
[ Download ] [ Wiki ] [ Support ] [ Scripting ]
[ Chrome ] [ Notepad++ ] [ fedora ]
[ Homepage ] [ BNLS ♯ ]

#12 User is offline   T3X0 Icon

  • Full Member
  • PipPipPip
  • Group: Members
  • Posts: 498
  • Joined: June-27 10

Posted October 01, 2010 - 01:51 PM

i checked the script (/scripts) and no it wasnt there that's why i am posting here...

#13 User is offline   Ribose Icon

  • Fire wants to be free.
  • Icon
  • Group: Global Moderators
  • Posts: 282
  • Joined: July-31 09

Posted October 01, 2010 - 04:23 PM

What files are in your Scripts folder (Scripting > Open Script Folder)?
~Ribose
[ Download ] [ Wiki ] [ Support ] [ Scripting ]
[ Chrome ] [ Notepad++ ] [ fedora ]
[ Homepage ] [ BNLS ♯ ]

#14 User is offline   T3X0 Icon

  • Full Member
  • PipPipPip
  • Group: Members
  • Posts: 498
  • Joined: June-27 10

Posted October 01, 2010 - 10:07 PM

demo
lib
announce
ccx
claninfo
css
demo
googletranslator
hnghangman
mailer
phelp
pluginsystem
scripts
set-things
snap&jack
st_config
2 times st_users
timeban
tuc

Only the normal scripts
But i dont know what i am doing wrong.
i am dling the zip and extracting the file into the script folder!?

#15 User is offline   new1 Icon

  • Newbie
  • Pip
  • Group: Members
  • Posts: 2
  • Joined: August-17 11

Posted August 17, 2011 - 12:11 AM

Hi im new to SB v2.7. can u guys help me? like how can i make a script where if someone types in .tester it like says u have been added to the list -ty. like tht and adds there name to a list in microsoft or folder etc. if u can help ty

#16 User is offline   Novynn Icon

  • Silver Member
  • PipPipPipPipPip
  • Group: Senior Members
  • Posts: 873
  • Joined: October-07 09

Posted August 17, 2011 - 12:33 AM

View Postnew1, on August 17, 2011 - 01:11 PM, said:

Hi im new to SB v2.7. can u guys help me? like how can i make a script where if someone types in .tester it like says u have been added to the list -ty. like tht and adds there name to a list in microsoft or folder etc. if u can help ty

Don't hijack threads, it's against the forum rules.

Make your own thread in the Script Requests sub-forum.

No doubt a mod will split/delete this shortly.

#17 User is online   Logiczz Icon

  • Junior Member
  • PipPip
  • Group: Members
  • Posts: 17
  • Joined: April-20 18

Posted February 07, 2019 - 12:15 PM

Hey I extracted the script into scripts folder as It told me too, no error loading the actual script but once, Script Managaer -> Manage script
I get this error;
[13:11:56] Format not understood. Error retrieving news from http://www.stealthbot.net.
[13:12:04] Scripting runtime error #380 in Script Manager: (line 152; column 0)
[13:12:04] Okänt körningsfel
[13:12:04] Scripting runtime error #380 in Script Manager: (line 152; column 0)
[13:12:04] Okänt körningsfel
[13:12:04] Scripting runtime error #380 in Script Manager: (line 152; column 0)
[13:12:04] Okänt körningsfel
[13:12:04] Scripting runtime error #380 in Script Manager: (line 152; column 0)
[13:12:04] Okänt körningsfel


any1 know why?

Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

1 User(s) are reading this topic
0 members, 1 guests, 0 anonymous users