Difference between revisions of "User object"
m (→Game property: Added example to clear up confusion on actual orientation) |
m (1 revision imported) |
(No difference)
|
Latest revision as of 08:20, 1 December 2017
This object exposes information on a user in the current Battle.net channel at the time of access.
Contents
- 1 History
- 2 How to use
- 3 Properties
- 3.1 List of properties
- 3.2 Name property
- 3.3 DisplayName property
- 3.4 CharacterName property
- 3.5 Game property
- 3.6 Ping property
- 3.7 Flags property
- 3.8 Stats property
- 3.9 Statstring property
- 3.10 JoinTime property
- 3.11 LastTalkTime property
- 3.12 Clan property
- 3.13 IsOperator property
- 3.14 IsSquelched property
- 3.15 IsUsingDII property
- 3.16 IsUsingWarIII property
- 3.17 PassedChannelAuth property
- 3.18 PendingBan property
- 4 Functions
- 5 See also
History
This object was added in StealthBot version 2.7 by Eric to create an object-oriented experience in scripting.
How to use
Example: Put the number of users in the channel into the Count
variable.
Count = Channel.Users.Count
Example: Get the value of a property of a user in channel at index Index
.
Value = Channel.Users(Index).PropertyName
Properties
List of properties
- .Name
- .DisplayName
- .CharacterName
- .Game
- .Ping
- .Flags
- .Stats
- .Statstring
- .JoinTime
- .LastTalkTime
- .Clan
- .IsOperator
- .IsSquelched
- .IsUsingDII
- .IsUsingWarIII
- .PassedChannelAuth
- .PendingBan
Name property
This property returns the person's actual name on Battle.net.
DisplayName property
This property returns the person's displayed name on Battle.net. This is affected by nameing conventions.
CharacterName property
This property returns the Diablo II character name if available for this user.
Game property
This property returns the person's 4-character product code oriented backwards. (WAR3, W3XP, D2DV, etc)
Ping property
This property returns the person's numeric ping at logon, in milliseconds.
Flags property
This property returns the person's Battle.net user flags within the channel.
Stats property
This property returns a UserStats object for the user.
Statstring property
This property returns a string containing the parsed statstring, also available as ChannelUserObj.UserStats.ToString.
JoinTime property
This property returns a time and date object for the time this user entered the channel. If the bot did not see the user join, this is the time the bot joined.
LastTalkTime property
This property returns a time and date object for the last time this user has talked. If the user has not talked, this is the time they joined.
Clan property
String representing the clan (if any) the user is in. Clan-less users will be represented with am empty string.
IsOperator property
This property returns a boolean which determines if the user has flags 0x02
(channel operator, hammer, etc).
IsSquelched property
This property returns a boolean which determines if the user has flags 0x20
(ignored a.k.a. squelched).
IsUsingDII property
This property returns True if the user is on Diablo II or its expansion, and False otherwise.
IsUsingWarIII property
This property returns True if the user is on WarCraft III or its expansion, and False otherwise.
PassedChannelAuth property
This property returns True if the user has passed the channel password check when the bot has one set.
PendingBan property
This property returns True if the user is planned to be banned by this bot.
Functions
List of functions
- .TimeInChannel()
- .TimeSinceTalk()
TimeInChannel function
This function returns the number of seconds since this user joined the channel. If the bot did not see the user join, the number of seconds will be the bot's own seconds since join.
TimeSinceTalk function
This function returns the number of seconds since this user last talked. If the bot did not see the user talk since he/she joined, the number of seconds will be the user's TimeInChannel value.