Class: Vitals

Inherits:
Object
  • Object
show all
Defined in:
models.rb

Class Method Summary (collapse)

Class Method Details

+ (int) concentration

Concentration

Examples:

Using concentration value in script.

echo Vitals::concentration
=> 100

Returns:

  • (int)

    concentration value 0 - 100



255
256
257
258
# File 'models.rb', line 255

def self.concentration
  $_api_socket.puts "GET CONCENTRATION\n"
  $_api_socket.gets('\0').chomp('\0').to_i
end

+ (int) fatigue

Fatigue

Examples:

Using fatigue value in script.

echo Vitals::fatigue
=> 100

Returns:

  • (int)

    fatigue value 0 - 100



266
267
268
269
# File 'models.rb', line 266

def self.fatigue
  $_api_socket.puts "GET FATIGUE\n"
  $_api_socket.gets('\0').chomp('\0').to_i
end

+ (int) health

Health

Examples:

Using health value in script.

if Vitals::health < 100
  put retreat
end

Returns:

  • (int)

    health value 0 - 100



244
245
246
247
# File 'models.rb', line 244

def self.health
  $_api_socket.puts "GET HEALTH\n"
  $_api_socket.gets('\0').chomp('\0').to_i
end

+ (int) spirit

Health

Examples:

Using spirit value in script.

echo Vitals::spirit

Returns:

  • (int)

    spirit value 0 - 100



276
277
278
279
# File 'models.rb', line 276

def self.spirit
  $_api_socket.puts "GET SPIRIT\n"
  $_api_socket.gets('\0').chomp('\0').to_i
end