Module: Lich::Resources

Defined in:
documented/attributes/resources.rb

Overview

The Resources module handles resource-related information.

Examples:

Lich::Resources.weekly

Class Method Summary collapse

Class Method Details

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

Note:

This method issues a command and may take time to respond.

Checks the current resources and returns weekly, total, and suffused resources.

Examples:

resources = Lich::Resources.check(true)

Parameters:

  • quiet (Boolean) (defaults to: false)

    Whether to suppress output (default: false).

Returns:

  • (Array<Object>)

    An array containing weekly, total, and suffused resource data.



63
64
65
66
# File 'documented/attributes/resources.rb', line 63

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_chargesObject

Retrieves the covert arts charges.

Examples:

charges = Lich::Resources.covert_arts_charges

Returns:

  • (Object)

    The covert arts charges data.



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

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

.suffusedObject

Retrieves the suffused resources.

Examples:

resources = Lich::Resources.suffused

Returns:

  • (Object)

    The suffused resource data.



29
30
31
# File 'documented/attributes/resources.rb', line 29

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

.totalObject

Retrieves the total resources.

Examples:

resources = Lich::Resources.total

Returns:

  • (Object)

    The total resource data.



21
22
23
# File 'documented/attributes/resources.rb', line 21

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

.typeObject

Retrieves the type of resources.

Examples:

resource_type = Lich::Resources.type

Returns:

  • (Object)

    The resource type data.



37
38
39
# File 'documented/attributes/resources.rb', line 37

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

.voln_favorObject

Retrieves the Voln favor resources.

Examples:

voln_favor = Lich::Resources.voln_favor

Returns:

  • (Object)

    The Voln favor resource data.



45
46
47
# File 'documented/attributes/resources.rb', line 45

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

.weeklyObject

Retrieves the weekly resources.

Examples:

resources = Lich::Resources.weekly

Returns:

  • (Object)

    The weekly resource data.



13
14
15
# File 'documented/attributes/resources.rb', line 13

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