Difference between revisions of "Proxy Records"

From Kolmafia
Jump to navigation Jump to search
imported>Bale
(added bounty proxy information in r9881)
imported>Fredg1
(Undo revision 12358 by Fredg1 (talk))
(8 intermediate revisions by 6 users not shown)
Line 1: Line 1:
Proxy Records is a way for KoLmafia to pass additional information to the scripter. Many datatypes contain these proxy records. such as items, skills, effects, monsters and coinmasters. This information is referred to as proxy records because the manner of reference is similar to a field of a [[Data_Structures#Records|record]].
+
Proxy records are special records associated with the special [[Data Types|data types]] available to scripters. These records are always available for the special datatypes. The fields in a proxy record are referenced in the same manner as a [[Data_Structures#Records|record]].
  
 +
==Special Datatypes==
  
{{CodeSample|
+
===bounty===
description=This is an example of how to retrieve proxy record information in a script. Notice it uses the same notation as if the item datatype is a record.|
+
{| cellpadding="3" cellspacing="0" border="1px" class="sortable"
code=<syntaxhighlight>
+
|- | style="background-color: #F2F2F2"
item it = $item[coffee pixie stick];
+
|-
print("You can buy a "+ it +" at the "+ it.seller);
+
! Field
print("It will consume "+ it.spleen +" spleen and give "+ it.adventures +" adventures.");
+
! Data type
</syntaxhighlight>}}
+
! Default value
 +
! ASH Accessor Function / Notes
 +
|-
 +
| plural
 +
| string
 +
| ""
 +
|
 +
|-
 +
| type
 +
| string
 +
| ""
 +
|
 +
|-
 +
| kol_internal_type
 +
| string
 +
| ""
 +
|
 +
|-
 +
| number
 +
| int
 +
| 0
 +
|
 +
|-
 +
| image
 +
| string
 +
| ""
 +
|
 +
|-
 +
| monster
 +
| monster
 +
| none
 +
|
 +
|-
 +
| location
 +
| location
 +
| none
 +
|
 +
|}
  
 +
===class===
 +
{| cellpadding="3" cellspacing="0" border="1px" class="sortable"
 +
|- | style="background-color: #F2F2F2"
 +
|-
 +
! Field
 +
! Data type
 +
! Default value
 +
! ASH Accessor Function / Notes
 +
|-
 +
| primestat
 +
| stat
 +
| Muscle
 +
|
 +
|}
  
Here's an example of displaying a proxy record in the CLI. Note that it displays all fields associated with that datatype.
+
===coinmaster===
<pre>
+
{| cellpadding="3" cellspacing="0" border="1px" class="sortable"
> ash $item[coffee pixie stick]
+
|- | style="background-color: #F2F2F2"
 +
|-
 +
! Field
 +
! Data type
 +
! Default value
 +
! ASH Accessor Function / Notes
 +
|-
 +
| token
 +
| string
 +
| ""
 +
|
 +
|-
 +
| item
 +
| item
 +
| none
 +
|
 +
|-
 +
| property
 +
| string
 +
| ""
 +
|
 +
|-
 +
| available_tokens
 +
| int
 +
| 0
 +
|
 +
|-
 +
| buys
 +
| boolean
 +
| false
 +
|
 +
|-
 +
| sells
 +
| boolean
 +
| false
 +
|
 +
|}
  
Returned: coffee pixie stick
+
===effect===
plural => coffee pixie sticks
+
{| cellpadding="3" cellspacing="0" border="1px" class="sortable"
descid => 936288573
+
|- | style="background-color: #F2F2F2"
image => cpstick.gif
+
|-
levelreq => 4
+
! Field
quality =>
+
! Data type
adventures => 5-10
+
! Default value
muscle => 0
+
! ASH Accessor Function / Notes
mysticality => 0
+
|-
moxie => 0
+
| default
fullness => 0
+
| string
inebriety => 0
+
| ""
spleen => 4
+
|
notes =>
+
|-
combat => false
+
| note
reusable => false
+
| string
usable => false
+
| ""
multi => true
+
|
bounty => none
+
|-
bounty_count => 0
+
| all
seller => Arcade Ticket Counter
+
| aggregate
buyer => none
+
boolean [string] =>
 +
|
 +
|-
 +
| image
 +
| string
 +
| "/images/debug.gif"
 +
|
 +
|-
 +
| descid
 +
| string
 +
| ""
 +
|
 +
|}
  
> ash $coinmaster[Arcade Ticket Counter]
+
===element===
 +
{| cellpadding="3" cellspacing="0" border="1px" class="sortable"
 +
|- | style="background-color: #F2F2F2"
 +
|-
 +
! Field
 +
! Data type
 +
! Default value
 +
! ASH Accessor Function / Notes
 +
|-
 +
| image
 +
| string
 +
| "circle.gif"
 +
|
 +
|}
  
Returned: Arcade Ticket Counter
+
===familiar===
token => ticket
+
{| cellpadding="3" cellspacing="0" border="1px" class="sortable"
item => Game Grid ticket
+
|- | style="background-color: #F2F2F2"
property =>
+
|-
available_tokens => 0
+
! Field
buys => false
+
! Data type
sells => true
+
! Default value
 +
! ASH Accessor Function / Notes
 +
|-
 +
| hatchling
 +
| item
 +
| none
 +
|
 +
|-
 +
| image
 +
| string
 +
| "debug.gif"
 +
|
 +
|-
 +
| name
 +
| string
 +
| ""
 +
|
 +
|-
 +
| experience
 +
| int
 +
| 0
 +
|
 +
|-
 +
| charges
 +
| int
 +
| 0
 +
|
 +
|-
 +
| drop_name
 +
| string
 +
| ""
 +
|
 +
|-
 +
| drop_item
 +
| item
 +
| none
 +
|
 +
|-
 +
| drops_today
 +
| int
 +
| 0
 +
|
 +
|-
 +
| drops_limit
 +
| int
 +
| 0
 +
|
 +
|-
 +
| combat
 +
| boolean
 +
| false
 +
|
 +
|-
 +
| physical_damage
 +
| boolean
 +
| false
 +
|
 +
|-
 +
| elemental_damage
 +
| boolean
 +
| false
 +
|
 +
|-
 +
| block
 +
| boolean
 +
| false
 +
|
 +
|-
 +
| delevel
 +
| boolean
 +
| false
 +
|
 +
|-
 +
| hp_during_combat
 +
| boolean
 +
| false
 +
|
 +
|-
 +
| mp_during_combat
 +
| boolean
 +
| false
 +
|
 +
|-
 +
| other_action_during_combat
 +
| boolean
 +
| false
 +
|
 +
|-
 +
| hp_after_combat
 +
| boolean
 +
| false
 +
|
 +
|-
 +
| mp_after_combat
 +
| boolean
 +
| false
 +
|
 +
|-
 +
| other_action_after_combat
 +
| boolean
 +
| false
 +
|
 +
|-
 +
| passive
 +
| boolean
 +
| false
 +
|
 +
|-
 +
| variable
 +
| boolean
 +
| false
 +
|
 +
|}
  
> ash $location[Fantasy Airship]
+
===item===
 +
{| cellpadding="3" cellspacing="0" border="1px" class="sortable"
 +
|- | style="background-color: #F2F2F2"
 +
|-
 +
! Field
 +
! Data type
 +
! Default value
 +
! ASH Accessor Function / Notes
 +
|-
 +
| plural
 +
| string
 +
| ""
 +
|
 +
|-
 +
| descid
 +
| string
 +
| ""
 +
|
 +
|-
 +
| image
 +
| string
 +
| ""
 +
|
 +
|-
 +
| smallimage
 +
| string
 +
| ""
 +
|
 +
|-
 +
| levelreq
 +
| int
 +
| 0
 +
|
 +
|-
 +
| quality
 +
| string
 +
| ""
 +
|
 +
|-
 +
| adventures
 +
| string
 +
| ""
 +
|
 +
|-
 +
| muscle
 +
| string
 +
| ""
 +
|
 +
|-
 +
| mysticality
 +
| string
 +
| ""
 +
|
 +
|-
 +
| moxie
 +
| string
 +
| ""
 +
|
 +
|-
 +
| fullness
 +
| int
 +
| 0
 +
|
 +
|-
 +
| inebriety
 +
| int
 +
| 0
 +
|
 +
|-
 +
| spleen
 +
| int
 +
| 0
 +
|
 +
|-
 +
| minhp
 +
| int
 +
| 0
 +
|
 +
|-
 +
| maxhp
 +
| int
 +
| 0
 +
|
 +
|-
 +
| minmp
 +
| int
 +
| 0
 +
|
 +
|-
 +
| maxmp
 +
| int
 +
| 0
 +
|
 +
|-
 +
| dailyusesleft
 +
| int
 +
| 0
 +
|
 +
|-
 +
| notes
 +
| string
 +
| ""
 +
|
 +
|-
 +
| quest
 +
| boolean
 +
| false
 +
|
 +
|-
 +
| gift
 +
| boolean
 +
| false
 +
|
 +
|-
 +
| tradeable
 +
| boolean
 +
| false
 +
|
 +
|-
 +
| discardable
 +
| boolean
 +
| false
 +
|
 +
|-
 +
| combat
 +
| boolean
 +
| false
 +
|
 +
|-
 +
| combat_reusable
 +
| boolean
 +
| false
 +
|
 +
|-
 +
| usable
 +
| boolean
 +
| false
 +
|
 +
|-
 +
| reusable
 +
| boolean
 +
| false
 +
|
 +
|-
 +
| multi
 +
| boolean
 +
| false
 +
|
 +
|-
 +
| fancy
 +
| boolean
 +
| false
 +
|
 +
|-
 +
| candy
 +
| boolean
 +
| false
 +
|
 +
|-
 +
| seller
 +
| coinmaster
 +
| none
 +
|
 +
|-
 +
| buyer
 +
| coinmaster
 +
| none
 +
|
 +
|-
 +
| name_length
 +
| int
 +
| 0
 +
|
 +
|}
  
Returned: Fantasy Airship
+
===location===
nocombats => false
+
{| cellpadding="3" cellspacing="0" border="1px" class="sortable"
zone => Beanstalk
+
|- | style="background-color: #F2F2F2"
parent => Plains
+
|-
parentdesc => Nearby Plains
+
! Field
bounty => burned-out arcanodiode
+
! Data type
 +
! Default value
 +
! ASH Accessor Function / Notes
 +
|-
 +
| nocombats
 +
| boolean
 +
| false
 +
|
 +
|-
 +
| zone
 +
| string
 +
| ""
 +
|
 +
|-
 +
| parent
 +
| string
 +
| ""
 +
|
 +
|-
 +
| parentdesc
 +
| string
 +
| ""
 +
|
 +
|-
 +
| environment
 +
| string
 +
| ""
 +
|
 +
|-
 +
| bounty
 +
| bounty
 +
| none
 +
|
 +
|-
 +
| combat_queue
 +
| string
 +
| ""
 +
|
 +
|-
 +
| noncombat_queue
 +
| string
 +
| ""
 +
|
 +
|-
 +
| turns_spent
 +
| int
 +
| 0
 +
|
 +
|-
 +
| kisses
 +
| int
 +
| 0
 +
|
 +
|-
 +
| recommended_stat
 +
| int
 +
| 0
 +
|
 +
|-
 +
| water_level
 +
| int
 +
| 0
 +
|
 +
|}
  
> ash $item[burned-out arcanodiode]
+
===monster===
 +
{| cellpadding="3" cellspacing="0" border="1px" class="sortable"
 +
|- | style="background-color: #F2F2F2"
 +
|-
 +
! Field
 +
! Data type
 +
! Default value
 +
! ASH Accessor Function / Notes
 +
|-
 +
| id
 +
| int
 +
| 0
 +
|
 +
|-
 +
| base_hp
 +
| int
 +
| 0
 +
| {{f|monster_hp}} (includes modifiers)
 +
|-
 +
| base_attack
 +
| int
 +
| 0
 +
| {{f|monster_attack}} (includes modifiers)
 +
|-
 +
| base_defense
 +
| int
 +
| 0
 +
| {{f|monster_defense}} (includes modifiers)
 +
|-
 +
| raw_hp
 +
| int
 +
| 0
 +
| (excludes modifiers)
 +
|-
 +
| raw_attack
 +
| int
 +
| 0
 +
| (excludes modifiers)
 +
|-
 +
| raw_defense
 +
| int
 +
| 0
 +
| (excludes modifiers)
 +
|-
 +
| base_initiative
 +
| int
 +
| 0
 +
| {{f|monster_initiative}} (includes modifiers)
 +
|-
 +
| raw_initiative
 +
| int
 +
| 0
 +
| (excludes modifiers)
 +
|-
 +
| element attack_element
 +
| element
 +
| none
 +
|
 +
|-
 +
| element defense_element
 +
| element
 +
| none
 +
| {{f|monster_element}}
 +
|-
 +
| physical_resistance
 +
| int
 +
| 0
 +
|
 +
|-
 +
| min_meat
 +
| int
 +
| 0
 +
| (excludes modifiers)
 +
|-
 +
| max_meat
 +
| int
 +
| 0
 +
| (excludes modifiers)
 +
|-
 +
| base_mainstat_exp
 +
| foat
 +
| 0.0
 +
| (includes bonus stats from +ML, but not from +stat effects)
 +
|-
 +
| phylum
 +
| phylum
 +
| none
 +
| {{f|monster_phylum}}
 +
|-
 +
| poison
 +
| effect
 +
| none
 +
|
 +
|-
 +
| boss
 +
| boolean
 +
| false
 +
|
 +
|-
 +
| dummy
 +
| boolean
 +
| false
 +
|
 +
|-
 +
| image
 +
| string
 +
| ""
 +
|
 +
|-
 +
| images
 +
| aggregate boolean [string]
 +
|
 +
|
 +
|-
 +
| attributes
 +
| string
 +
| ""
 +
| A compilation of attack, defense, initiative, element, meat drop, and phylum
 +
|-
 +
| random_modifiers
 +
| aggregate boolean [string]
 +
|
 +
| The monster's random modifiers - like those generated in the One Crazy Random Summer path
 +
|-
 +
| manuel_name
 +
| string
 +
| ""
 +
|
 +
|}
  
Returned: burned-out arcanodiode
+
===phylum===
plural => burned-out arcanodiodes
+
{| cellpadding="3" cellspacing="0" border="1px" class="sortable"
descid => 207784873
+
|- | style="background-color: #F2F2F2"
image => diode.gif
+
|-
levelreq => 0
+
! Field
quality =>
+
! Data type
adventures =>
+
! Default value
muscle =>
+
! ASH Accessor Function / Notes
mysticality =>
+
|-
moxie =>
+
| image
fullness => 0
+
| string
inebriety => 0
+
| none
spleen => 0
+
|
notes =>
+
|}
combat => false
 
reusable => false
 
usable => false
 
multi => false
 
bounty => Fantasy Airship
 
bounty_count => 5
 
seller => none
 
buyer => none
 
  
> ash $skill[empathy of the newt]
+
===servant===
 +
{| cellpadding="3" cellspacing="0" border="1px" class="sortable"
 +
|- | style="background-color: #F2F2F2"
 +
|-
 +
! Field
 +
! Data type
 +
! Default value
 +
! ASH Accessor Function / Notes
 +
|-
 +
| id
 +
| int
 +
| 0
 +
|
 +
|-
 +
| name
 +
| string
 +
| ""
 +
|
 +
|-
 +
| level
 +
| int
 +
| 0
 +
|
 +
|-
 +
| experience
 +
| int
 +
| 0
 +
|
 +
|-
 +
| image
 +
| string
 +
| ""
 +
|
 +
|-
 +
| level1_ability
 +
| string
 +
| ""
 +
|
 +
|-
 +
| level7_ability
 +
| string
 +
| ""
 +
|
 +
|-
 +
| level14_ability
 +
| string
 +
| ""
 +
|
 +
|-
 +
| level21_ability
 +
| string
 +
| ""
 +
|
 +
|}
  
Returned: Empathy of the Newt
+
===skill===
level => 8
+
{| cellpadding="3" cellspacing="0" border="1px" class="sortable"
traincost => 6500
+
|- | style="background-color: #F2F2F2"
class => Turtle Tamer
+
|-
libram => false
+
! Field
passive => false
+
! Data type
buff => true
+
! Default value
combat => false
+
! ASH Accessor Function / Notes
permable => true
+
|-
 +
| level
 +
| int
 +
| -1
 +
|
 +
|-
 +
| image
 +
| string
 +
| none
 +
|
 +
|-
 +
| traincost
 +
| int
 +
| 0
 +
|
 +
|-
 +
| class
 +
| class
 +
| none
 +
|
 +
|-
 +
| libram
 +
| boolean
 +
| false
 +
|
 +
|-
 +
| passive
 +
| boolean
 +
| false
 +
|
 +
|-
 +
| buff
 +
| boolean
 +
| false
 +
|
 +
|-
 +
| combat
 +
| boolean
 +
| false
 +
|
 +
|-
 +
| song
 +
| boolean
 +
| false
 +
| Avatar of Boris song
 +
|-
 +
| expression
 +
| boolean
 +
| false
 +
|
 +
|-
 +
| summon
 +
| boolean
 +
| false
 +
|
 +
|-
 +
| permable
 +
| boolean
 +
| true
 +
|
 +
|-
 +
| dailylimit
 +
| int
 +
| -1
 +
|
 +
|-
 +
| timescast
 +
| int
 +
| 0
 +
|
 +
|}
  
> ash $familiar[slimeling]
+
=== slot ===
 +
Slot does not have any fields.
  
Returned: Slimeling
+
===stat===
combat => true
+
Stat does not have any fields.
hatchling => squirming Slime larva
 
image => slimeling.gif
 
name => Princess Vina
 
  
> ash $monster[black widow]
+
===thrall===
 
+
{| cellpadding="3" cellspacing="0" border="1px" class="sortable"
Returned: Black Widow
+
|- | style="background-color: #F2F2F2"
base_hp => 130
+
|-
base_attack => 139
+
! Field
base_defense => 128
+
! Data type
base_initiative => 0
+
! Default value
attack_element => none
+
! ASH Accessor Function / Notes
defense_element => none
+
|-
min_meat => 40
+
| id
max_meat => 60
+
| int
base_mainstat_exp => 17.375
+
| 0
phylum => bug
+
|
poison => Really Quite Poisoned
+
|-
 
+
| name
> ash $effect[sugar rush]
+
| string
 
+
| ""
Returned: Sugar Rush
+
|
default => use either 1 Angry Farmer candy, 1 Tasty Fun Good rice candy, 1 Crimbo candied pecan,
+
|-
Crimbo fudge, Crimbo peppermint bark, 1 Breath mint
+
| level
note =>
+
| int
all => aggregate boolean [string]
+
| 0
  use 1 Angry Farmer candy => true
+
|
  use 1 Tasty Fun Good rice candy => true
+
|-
  use 1 Crimbo candied pecan => true
+
| image
  use Crimbo fudge => true
+
| string
  use Crimbo peppermint bark => true
+
| ""
  use 1 Breath mint => true
+
|
image => http://images.kingdomofloathing.com/itemimages/hoppedup.gif
+
|-
descid => 83695b70e0470a36125feca3198a16b4
+
| tinyimage
</pre>
+
| string
 
+
| ""
[[Category:Scripting]]
+
|
 +
|-
 +
| skill
 +
| skill
 +
| none
 +
|
 +
|-
 +
| current_modifiers
 +
| string
 +
| ""
 +
|
 +
|}

Revision as of 19:49, 23 December 2019

Proxy records are special records associated with the special data types available to scripters. These records are always available for the special datatypes. The fields in a proxy record are referenced in the same manner as a record.

Special Datatypes

bounty

Field Data type Default value ASH Accessor Function / Notes
plural string ""
type string ""
kol_internal_type string ""
number int 0
image string ""
monster monster none
location location none

class

Field Data type Default value ASH Accessor Function / Notes
primestat stat Muscle

coinmaster

Field Data type Default value ASH Accessor Function / Notes
token string ""
item item none
property string ""
available_tokens int 0
buys boolean false
sells boolean false

effect

Field Data type Default value ASH Accessor Function / Notes
default string ""
note string ""
all aggregate

boolean [string] =>

image string "/images/debug.gif"
descid string ""

element

Field Data type Default value ASH Accessor Function / Notes
image string "circle.gif"

familiar

Field Data type Default value ASH Accessor Function / Notes
hatchling item none
image string "debug.gif"
name string ""
experience int 0
charges int 0
drop_name string ""
drop_item item none
drops_today int 0
drops_limit int 0
combat boolean false
physical_damage boolean false
elemental_damage boolean false
block boolean false
delevel boolean false
hp_during_combat boolean false
mp_during_combat boolean false
other_action_during_combat boolean false
hp_after_combat boolean false
mp_after_combat boolean false
other_action_after_combat boolean false
passive boolean false
variable boolean false

item

Field Data type Default value ASH Accessor Function / Notes
plural string ""
descid string ""
image string ""
smallimage string ""
levelreq int 0
quality string ""
adventures string ""
muscle string ""
mysticality string ""
moxie string ""
fullness int 0
inebriety int 0
spleen int 0
minhp int 0
maxhp int 0
minmp int 0
maxmp int 0
dailyusesleft int 0
notes string ""
quest boolean false
gift boolean false
tradeable boolean false
discardable boolean false
combat boolean false
combat_reusable boolean false
usable boolean false
reusable boolean false
multi boolean false
fancy boolean false
candy boolean false
seller coinmaster none
buyer coinmaster none
name_length int 0

location

Field Data type Default value ASH Accessor Function / Notes
nocombats boolean false
zone string ""
parent string ""
parentdesc string ""
environment string ""
bounty bounty none
combat_queue string ""
noncombat_queue string ""
turns_spent int 0
kisses int 0
recommended_stat int 0
water_level int 0

monster

Field Data type Default value ASH Accessor Function / Notes
id int 0
base_hp int 0 monster_hp() (includes modifiers)
base_attack int 0 monster_attack() (includes modifiers)
base_defense int 0 monster_defense() (includes modifiers)
raw_hp int 0 (excludes modifiers)
raw_attack int 0 (excludes modifiers)
raw_defense int 0 (excludes modifiers)
base_initiative int 0 monster_initiative() (includes modifiers)
raw_initiative int 0 (excludes modifiers)
element attack_element element none
element defense_element element none monster_element()
physical_resistance int 0
min_meat int 0 (excludes modifiers)
max_meat int 0 (excludes modifiers)
base_mainstat_exp foat 0.0 (includes bonus stats from +ML, but not from +stat effects)
phylum phylum none monster_phylum()
poison effect none
boss boolean false
dummy boolean false
image string ""
images aggregate boolean [string]
attributes string "" A compilation of attack, defense, initiative, element, meat drop, and phylum
random_modifiers aggregate boolean [string] The monster's random modifiers - like those generated in the One Crazy Random Summer path
manuel_name string ""

phylum

Field Data type Default value ASH Accessor Function / Notes
image string none

servant

Field Data type Default value ASH Accessor Function / Notes
id int 0
name string ""
level int 0
experience int 0
image string ""
level1_ability string ""
level7_ability string ""
level14_ability string ""
level21_ability string ""

skill

Field Data type Default value ASH Accessor Function / Notes
level int -1
image string none
traincost int 0
class class none
libram boolean false
passive boolean false
buff boolean false
combat boolean false
song boolean false Avatar of Boris song
expression boolean false
summon boolean false
permable boolean true
dailylimit int -1
timescast int 0

slot

Slot does not have any fields.

stat

Stat does not have any fields.

thrall

Field Data type Default value ASH Accessor Function / Notes
id int 0
name string ""
level int 0
image string ""
tinyimage string ""
skill skill none
current_modifiers string ""