Quotes object

From StealthBot Wiki Backup
Jump to: navigation, search

The Quotes object allows you to access and modify the bot's list of quotes. These quotes are stored in quotes.txt.

History

This object was added in StealthBot version 2.7.1 by Ribose.

How to use

Example: Count how many quotes you have.

Value = Quotes.Count

Example: Adding a new quote.

Value = Quotes.Add("Quote1")

Properties

List of properties

Items property

Returns a collection of all stored quote strings. Modifications to this array are not saved.

Count property

Returns the total number of quotes currently stored.

Functions

List of functions

Add function

Call this to store the provided QuoteStr as a new quote. Will update the quotes.txt file as well. Returns the total number of quotes now being stored.

Quotes.Add "new quote"

Remove function

Call this to remove the specified QuoteStr from the stored quotes. You may provide an integer index of the quote (1 through .Count) or a string which equals the quote (not case sensitive). If the quote could not be found, nothing will happen. Will update the quotes.txt file as well. Returns the quote that was removed.

Quotes.Remove "new quote"

Item function

Returns the quote string by the integer index (1 through .Count) of the quote.

' gets the last quote
strValue = Quotes.Item(Quotes.Count)

GetIndexOf function

Returns the numeric item number for a specified quote. You may provide an integer index of the quote (1 through .Count) or a string which equals the quote (not case sensitive). If the quote could not be found, returns 0.

GetRandomQuote functions

Returns a random quote from the quote file.

strValue = Quotes.GetRandomQuote()

See also