Class: Exp

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

Class Method Summary (collapse)

Class Method Details

+ (Array) names

List of internal exp names

Examples:

Using exp state in script.

echo Exp::names
>> ["Teaching", "Light Crossbow", "Scholarship", "First Aid", "Climbing"]

Returns:

  • (Array)

    list of exp names



148
149
150
151
# File 'models.rb', line 148

def self.names()
  $_api_socket.puts "GET EXP_NAMES\n"
  $_api_socket.gets('\0').chomp('\0').to_s.split("\n")
end

+ (int) rank(exp_string)

Exp rank

Examples:

Using exp rank in script.

echo Exp::rank
=> 222

Parameters:

  • exp_string (String)

    exp field name

Returns:

  • (int)

    rank of skill



124
125
126
127
# File 'models.rb', line 124

def self.rank(exp_string)
  $_api_socket.puts "GET EXP_RANK?#{ERB::Util.url_encode(exp_string.to_s.downcase)}\n"
  $_api_socket.gets('\0').chomp('\0').to_i
end

+ (int) state(exp_string)

Exp state

Examples:

Using exp state in script.

if Exp::state("climbing") == 34
  exit
end

Parameters:

  • exp_string (String)

    exp field name

Returns:

  • (int)

    learning state */34



137
138
139
140
# File 'models.rb', line 137

def self.state(exp_string)
  $_api_socket.puts "GET EXP_STATE?#{ERB::Util.url_encode(exp_string.to_s.downcase)}\n"
  $_api_socket.gets('\0').chomp('\0').to_i
end