Friend object

From StealthBot Wiki Backup
Jump to: navigation, search

The Friend object exposes your bot's Battle.net friends to you. You may want to use these, for example, to find information on the location of a mutual friend of your bot.

History

This object was added in StealthBot version 2.7 by Eric to create an object-oriented experience in scripting.

How to use

Example: Get the value of a property of a Battle.net friend.

Value = Friends(Index).Property/Sub

Properties

List of properties

Name property

Returns the name of the friend.

DisplayName property

Returns the display name of the friend. This is affected by naming conventions.

Game property

Returns the 4-character product code the friend is currently using. This will be an empty string if the friend is offline.

Location property

Returns the location of the friend, if known.

LocationID property

Returns the integer location ID of the friend.

  • 0 = Offline
  • 1 = Not in chat
  • 2 = In chat
  • 3, 4, and 5 = In a game

Status property

Returns the numerical status of the friend in relation to you.

Can be a combination of the following flags:

  • 0 = None of the below
  • 1 = Mutual friend
  • 2 = User has Do Not Disturb mode on
  • 4 = User has marked himself as Away

DontDisturb property

Returns the Boolean status of the friend's Do Not Disturb mode.

IsAway property

Returns the Boolean status of the friend's Away mode.

IsInChannel property

Returns True if the friend is in a chat channel.

IsInGame property

Returns True if the friend is in a game.

IsMutual property

Returns True if the friend also has the bot on his friend list.

IsOnline property

Returns True if the user is online.

See also