Module: Lich::Resources

Defined in:
lib/attributes/resources.rb

Class Method Summary collapse

Class Method Details

.check(quiet = false) ⇒ Array<String>

Checks the current resources and returns an array of resource information.

Examples:

Lich::Resources.check

Parameters:

  • quiet (Boolean) (defaults to: false)

    whether to suppress output (default: false).

Returns:

  • (Array<String>)

    an array containing weekly, total, and suffused resource information.

Raises:

  • (StandardError)

    if the command fails to execute properly.



64
65
66
67
# File 'lib/attributes/resources.rb', line 64

def self.check(quiet = false)
  Lich::Util.issue_command('resource', /^Health: \d+\/(?:<pushBold\/>)?\d+(?:<popBold\/>)?\s+Mana: \d+\/(?:<pushBold\/>)?\d+(?:<popBold\/>)?\s+Stamina: \d+\/(?:<pushBold\/>)?\d+(?:<popBold\/>)?\s+Spirit: \d+\/(?:<pushBold\/>)?\d+/, /<prompt/, silent: true, quiet: quiet)
  return [self.weekly, self.total, self.suffused]
end

.covert_arts_chargesString

Retrieves the covert arts charges resource information.

Examples:

Lich::Resources.covert_arts_charges

Returns:

  • (String)

    the covert arts charges resource information.



53
54
55
# File 'lib/attributes/resources.rb', line 53

def self.covert_arts_charges
  Lich::Gemstone::Infomon.get('resources.covert_arts_charges')
end

.suffusedString

Retrieves the suffused resource information.

Examples:

Lich::Resources.suffused

Returns:

  • (String)

    the suffused resource information.



26
27
28
# File 'lib/attributes/resources.rb', line 26

def self.suffused
  Lich::Gemstone::Infomon.get('resources.suffused')
end

.totalString

Retrieves the total resource information.

Examples:

Lich::Resources.total

Returns:

  • (String)

    the total resource information.



17
18
19
# File 'lib/attributes/resources.rb', line 17

def self.total
  Lich::Gemstone::Infomon.get('resources.total')
end

.typeString

Retrieves the type of resources.

Examples:

Lich::Resources.type

Returns:

  • (String)

    the type of resources.



35
36
37
# File 'lib/attributes/resources.rb', line 35

def self.type
  Lich::Gemstone::Infomon.get('resources.type')
end

.voln_favorString

Retrieves the Voln favor resource information.

Examples:

Lich::Resources.voln_favor

Returns:

  • (String)

    the Voln favor resource information.



44
45
46
# File 'lib/attributes/resources.rb', line 44

def self.voln_favor
  Lich::Gemstone::Infomon.get('resources.voln_favor')
end

.weeklyString

Retrieves the weekly resource information.

Examples:

Lich::Resources.weekly

Returns:

  • (String)

    the weekly resource information.



8
9
10
# File 'lib/attributes/resources.rb', line 8

def self.weekly
  Lich::Gemstone::Infomon.get('resources.weekly')
end