Module: Lich::DragonRealms::DRParser::Pattern

Defined in:
documented/dragonrealms/drinfomon/drparser.rb

Constant Summary collapse

ExpColumns =

Regular expression pattern for experience columns This pattern matches skill experience data in the format:

Skill: Rank Percent Rate

Examples:

line.match(DRParser::Pattern::ExpColumns)
/(?:\s*(?<skill>[a-zA-Z\s]+)\b:\s*(?<rank>\d+)\s+(?<percent>\d+)%\s+(?<rate>[a-zA-Z\s]+)\b)/.freeze
BriefExpOn =

Regular expression pattern for brief experience on This pattern matches the XML component for skills with experience on.

Examples:

line.match(DRParser::Pattern::BriefExpOn)
%r{<component id='exp .*?<d cmd='skill (?<skill>[a-zA-Z\s]+)'.*:\s+(?<rank>\d+)\s+(?<percent>\d+)%\s*\[\s?(?<rate>\d+)\/34\].*?<\/component>}.freeze
BriefExpOff =

Regular expression pattern for brief experience off This pattern matches the XML component for skills with experience off.

Examples:

line.match(DRParser::Pattern::BriefExpOff)
%r{<component id='exp .*?\b(?<skill>[a-zA-Z\s]+)\b:\s+(?<rank>\d+)\s+(?<percent>\d+)%\s+\b(?<rate>[a-zA-Z\s]+)\b.*?<\/component>}.freeze
NameRaceGuild =

Regular expression pattern for name, race, and guild This pattern captures the player’s name, race, and guild from the output.

Examples:

line.match(DRParser::Pattern::NameRaceGuild)
/^Name:\s+\b(?<name>.+)\b\s+Race:\s+\b(?<race>.+)\b\s+Guild:\s+\b(?<guild>.+)\b\s+/.freeze
GenderAgeCircle =

Regular expression pattern for gender, age, and circle This pattern captures the player’s gender, age, and circle from the output.

Examples:

line.match(DRParser::Pattern::GenderAgeCircle)
/^Gender:\s+\b(?<gender>.+)\b\s+Age:\s+\b(?<age>.+)\b\s+Circle:\s+\b(?<circle>.+)/.freeze
StatValue =

Regular expression pattern for stat values This pattern captures individual stat values and their corresponding numbers.

Examples:

line.scan(DRParser::Pattern::StatValue)
/(?<stat>Strength|Agility|Discipline|Intelligence|Reflex|Charisma|Wisdom|Stamina|Favors|TDPs)\s+:\s+(?<value>\d+)/.freeze
TDPValue =

Regular expression pattern for TDP values This pattern captures the total number of TDPs available.

Examples:

line.match(DRParser::Pattern::TDPValue)
/You have (\d+) TDPs\./.freeze
EncumbranceValue =

Regular expression pattern for encumbrance values This pattern captures the player’s current encumbrance status.

Examples:

line.match(DRParser::Pattern::EncumbranceValue)
/^\s*Encumbrance\s+:\s+(?<encumbrance>[\w\s'?!]+)$/.freeze
LuckValue =

Regular expression pattern for luck values This pattern captures the player’s luck status.

Examples:

line.match(DRParser::Pattern::LuckValue)
/^\s*Luck\s+:\s+.*\((?<luck>[-\d]+)\/3\)/.freeze
BalanceValue =

Regular expression pattern for balance values This pattern captures the player’s balance status.

Examples:

line.match(DRParser::Pattern::BalanceValue)
/^(?:You are|\[You're) (?<balance>#{Regexp.union(DR_BALANCE_VALUES)}) balanced?/.freeze
ExpClearMindstate =

Regular expression pattern for clearing mindstate This pattern matches the XML component indicating a skill has no experience.

Examples:

line.match(DRParser::Pattern::ExpClearMindstate)
%r{<component id='exp (?<skill>[a-zA-Z\s]+)'><\/component>}.freeze
RoomPlayers =

Regular expression pattern for room players This pattern captures the list of players present in the room.

Examples:

line.match(DRParser::Pattern::RoomPlayers)
%r{\'room players\'>Also here: (.*)\.</component>}.freeze
RoomPlayersEmpty =

Regular expression pattern for empty room players This pattern matches the case where no players are present in the room.

Examples:

line.match(DRParser::Pattern::RoomPlayersEmpty)
%r{\'room players\'></component>}.freeze
RoomObjs =

Regular expression pattern for room objects This pattern captures the list of objects present in the room.

Examples:

line.match(DRParser::Pattern::RoomObjs)
%r{\'room objs\'>(.*)</component>}.freeze
RoomObjsEmpty =

Regular expression pattern for empty room objects This pattern matches the case where no objects are present in the room.

Examples:

line.match(DRParser::Pattern::RoomObjsEmpty)
%r{\'room objs\'></component>}.freeze
GroupMembers =

Regular expression pattern for group members This pattern captures the list of members in the player’s group.

Examples:

line.match(DRParser::Pattern::GroupMembers)
%r{<pushStream id="group"/>  (\w+):}.freeze
GroupMembersEmpty =

Regular expression pattern for empty group members This pattern matches the case where no group members are present.

Examples:

line.match(DRParser::Pattern::GroupMembersEmpty)
%r{<pushStream id="group"/>Members of your group:}.freeze
ExpModsStart =

Regular expression pattern for the start of experience modifiers This pattern indicates the beginning of a list of skills under modifiers.

Examples:

line.match(DRParser::Pattern::ExpModsStart)
/^(<.*?\/>)?The following skills are currently under the influence of a modifier/.freeze
KnownSpellsStart =

Regular expression pattern for known spells This pattern indicates the start of the known spells list for magic users.

Examples:

line.match(DRParser::Pattern::KnownSpellsStart)
/^You recall the spells you have learned/.freeze
BarbarianAbilitiesStart =

Regular expression pattern for barbarian abilities This pattern indicates the start of the list of known barbarian abilities.

Examples:

line.match(DRParser::Pattern::BarbarianAbilitiesStart)
/^You know the (Berserks:)/.freeze
ThiefKhriStart =

Regular expression pattern for thief khri This pattern indicates the start of the list of known khri for thieves.

Examples:

line.match(DRParser::Pattern::ThiefKhriStart)
/^From the Subtlety tree, you know the following khri:/.freeze
SpellBookFormat =

Regular expression pattern for spellbook format This pattern captures the format type of the spellbook output.

Examples:

line.match(DRParser::Pattern::SpellBookFormat)
/^You will .* (?<format>column-formatted|non-column) output for the SPELLS verb/.freeze
PlayedAccount =

Regular expression pattern for played account This pattern captures the account information of the player.

Examples:

line.match(DRParser::Pattern::PlayedAccount)
/^(?:<.*?\/>)?Account Info for (?<account>.+):/.freeze
PlayedSubscription =

Regular expression pattern for played subscription This pattern captures the subscription status of the player’s account.

Examples:

line.match(DRParser::Pattern::PlayedSubscription)
/Current Account Status: (?<subscription>F2P|Basic|Premium|Platinum)/.freeze
LastLogoff =

Regular expression pattern for last logoff This pattern captures the last logoff time of the player.

Examples:

line.match(DRParser::Pattern::LastLogoff)
/^\s+Logoff :  (?<weekday>[A-Z][a-z]{2}) (?<month>[A-Z][a-z]{2}) (?<day>[\s\d]{2}) (?<hour>\d{2}):(?<minute>\d{2}):(?<second>\d{2}) ET (?<year>\d{4})/.freeze
RoomIDOff =

Regular expression pattern for room ID off This pattern indicates that room IDs are no longer visible.

Examples:

line.match(DRParser::Pattern::RoomIDOff)
/^You will no longer see room IDs when LOOKing in the game and room windows\./.freeze