Module you
Information about the player.
Functions
abilities () | Available abilities |
ability_letters () | Ability letters in use. |
ability_table () | Ability table. |
absdepth () | The current "absolute depth". |
ac () | Armour class. |
activate_ability (the[, x=0[, y=0[, if=false]]]) | Activate an ability by name, supplying a target where relevant. |
agile () | Are you agile? |
anchored () | Are you dimensionally anchored? |
asleep () | Are you asleep? |
base_mp () | Base max mp. |
base_skill (name) | Base skill level. |
berserk () | Are you berserk? |
best_skill () | Best skill. |
branch () | What branch are you in? |
breath_timeout () | Are you out of breath? |
brilliant () | Are you brilliant? |
can_smell () | Can you smell? |
can_train_skill (name) | Can a skill be trained? |
caught () | Are you caught in something? |
class () | Get name of player's background. |
confused () | Are you confused? |
constricted () | Are you currently constricted? |
constricting () | Are you currently constricting anything? |
contaminated () | Are you contaminated? |
corrosion () | Corrosion amount. |
deaths () | How many times have you died? |
depth () | Your current depth in that branch. |
depth_fraction () | What fraction of the branch you've gone into. |
dexterity () | Dexterity. |
drain () | How much drain. |
ego ([terse=false]) | What is the ego of our unarmed attack? |
ev () | Evasion. |
evil_god ([god=you.god()]) | Is this [player's] god evil? |
exhausted () | Are you exhausted? |
extra_resistant () | Are you extra resistant? |
feel_safe () | Do you feel safe? |
floor_items () | The items on your cell on the floor. |
flying () | Are you flying? |
genus () | Your genus. |
get_base_mutation_level (mutationname[, innate=true[, temp=true[, normal=true]]]) | Get the mutation level of a mutation. |
get_training_target (name) | Get a training target. |
god () | Get name of player's god |
gold () | How much gold do you have? |
good_god ([god=you.god()]) | Is this [player's] god good? |
hand () | Get noun for player's hands. |
has_claws () | Do you have claws? |
hasted () | Are you hasted? |
have_orb () | Do you have the orb? |
have_rune (rune) | Do you have the given rune? |
how_mutated (innate, levels, temp) | How mutated are you? |
hp () | Hit points. |
intelligence () | Intelligence. |
invisible () | Are you invisible? |
is_level_on_stack (levelname) | Check the level stack. |
known_items () | Get the current state of item identification as a list of strings. |
lives () | How many extra lives do you have? |
los () | LOS Radius. |
mem_spells () | Get memorisable spells. |
memorise () | Memorise a spell by name Memorise a spell by name, erroring only on an invalid spell name. |
mesmerised () | Are you mesmerised? |
mighty () | Are you mighty? |
monster () | The name of your monster type. |
mp () | Magic points. |
mutation (mutation) | Deprecated: use you.get_base_mutation_level. |
mutation_overview () | Mutation overview string. |
name () | Get player's name. |
noise_perception () | What was the loudest noise you heard in the last turn? |
num_runes () | How many runes do you have? |
on_fire () | Are you on fire? |
one_time_ability_used () | Has the [player's] current god's one-time ability been used? |
paralysed () | Are you paralysed? |
petrifying () | Are you petrifying? |
piety_rank () | Stars of piety. |
poison_survival () | Minimum hp after poison wears off. |
poisoned () | Are you poisoned? |
race () | Get name of player's race. |
regenerating () | Are you regenerating? |
res_cold () | Cold resistance (rC). |
res_corr () | Corrosion resistance (rCorr). |
res_draining () | Negative energy resistance (rN). |
res_drowning () | Drowning resistance (rDrown). |
res_fire () | Fire resistance (rF). |
res_mutation () | Mutation resistance (rMut). |
res_poison () | Poison resistance (rPois). |
res_shock () | Electric resistance (rElec). |
rooted () | Are you rooted? |
see_cell (x, y) | Can you see a cell? |
see_cell_no_trans (x, y) | Can you see this cell without looking through a window? |
see_cell_solid (x, y) | Can you see this cell without something solid in the way? |
see_cell_solid_see (x, y) | Can you see this cell with nothing in the way? |
see_invisible () | See invisible (sInv). |
set_training_target (name, target) | Set a training target. |
sh () | Shield class. |
sick () | Are you sick? |
silenced () | Are you silenced? |
silencing () | Are you silencing the world around you? |
skill (name) | Current skill level. |
skill_cost (name) | Cost of training this skill. |
skill_progress (name) | Skill progress. |
slowed () | Are you slowed? |
species () | Get name of player's species. |
spell_letters () | Currently used spell letters |
spell_levels () | How many spell levels are currently available. |
spell_table () | Get the spell table. |
spells () | List your spells |
spirit_shield () | Guardian spirit. |
status ([stat]) | Check status effects. |
stealth_pips () | Stealth pips. |
stop_activity () | Interrupt the current multi-turn activity or macro sequence. |
strength () | Strength. |
swift () | Are you currently +Swift or -Swift? |
taking_stairs () | Are you taking the stairs? |
teleporting () | Are you teleporting? |
temp_mutation (mutation) | Deprecated: use you.get_base_mutation_level. |
temp_mutations () | How many temporary mutations do you have? |
time () | Total elapsed time in auts. |
torment_immune () | Are you currently immune to torment? |
train_skill (name[, level]) | Train a skill. |
transform () | Current transformation, if any. |
turn_is_over () | Has player done something that takes time? |
turns () | How many turns have been taken. |
turns_on_level () | How long has the player been on the current level? |
unarmed_damage_rating () | Unarmed damage rating. |
under_penance () | Are you under penance? |
where () | Where are you? |
willpower () | Willpower (WL). |
wizard () | Is player in wizard mode? |
xl_progress () | XL progress. |
you_immune_to_hex (spell) | Are you intrinsically immune to this particular hex spell? |
Functions
- abilities ()
-
Available abilities
Returns:
-
array
An array of ability names.
- ability_letters ()
-
Ability letters in use.
Returns:
-
array
An array of ability letters
- ability_table ()
-
Ability table.
Returns:
-
table
A map of letters to ability names
- absdepth ()
-
The current "absolute depth".
Absolute depth of the current location.
Returns:
-
number
- ac ()
-
Armour class.
Returns:
-
int
- activate_ability (the[, x=0[, y=0[, if=false]]])
-
Activate an ability by name, supplying a target where relevant. If the
ability is not targeted, the target is ignored. An invalid target will
open interactive targeting.
Parameters:
- the string name of the ability
- x number coordinate (default 0)
- y number coordinate (default 0)
- if boolean true, aim at the target; if false, shoot past it (default false)
Returns:
-
boolean
whether an action took place
- agile ()
-
Are you agile?
Returns:
-
boolean
- anchored ()
-
Are you dimensionally anchored?
Returns:
-
boolean
- asleep ()
-
Are you asleep?
Returns:
-
boolean
- base_mp ()
-
Base max mp.
Returns:
-
int
- base_skill (name)
-
Base skill level.
Ignores drain, crosstraining, &c.
Parameters:
- name string
- berserk ()
-
Are you berserk?
Returns:
-
boolean
- best_skill ()
-
Best skill.
Returns:
-
string
- branch ()
-
What branch are you in?
Returns:
-
string
- breath_timeout ()
-
Are you out of breath?
Returns:
-
boolean
- brilliant ()
-
Are you brilliant?
Returns:
-
boolean
- can_smell ()
-
Can you smell?
Returns:
-
boolean
- can_train_skill (name)
-
Can a skill be trained?
Parameters:
- name string skill name
Returns:
-
boolean
- caught ()
-
Are you caught in something?
Returns:
-
string or nil
what's got you
- class ()
-
Get name of player's background.
Returns:
-
string
- confused ()
-
Are you confused?
Returns:
-
boolean
- constricted ()
-
Are you currently constricted?
Returns:
-
boolean
- constricting ()
-
Are you currently constricting anything?
Returns:
-
boolean
- contaminated ()
-
Are you contaminated?
Returns:
-
number
- corrosion ()
-
Corrosion amount.
Returns:
-
int
- deaths ()
-
How many times have you died?
Returns:
-
int
- depth ()
-
Your current depth in that branch.
Returns:
-
int
- depth_fraction ()
-
What fraction of the branch you've gone into.
Returns:
-
number
- dexterity ()
-
Dexterity.
Returns:
-
int
current dexterity
- drain ()
-
How much drain.
Returns:
-
int
- ego ([terse=false])
-
What is the ego of our unarmed attack?
Parameters:
- terse boolean (default false)
Returns:
-
string or nil
the ego for unarmed combat, if any
- ev ()
-
Evasion.
Returns:
-
int
- evil_god ([god=you.god()])
-
Is this [player's] god evil?
Parameters:
- god string (default you.god())
Returns:
-
boolean
- exhausted ()
-
Are you exhausted?
Returns:
-
boolean
- extra_resistant ()
-
Are you extra resistant?
Returns:
-
boolean
- feel_safe ()
-
Do you feel safe?
Returns:
-
boolean
- floor_items ()
-
The items on your cell on the floor.
Returns:
-
array
an Array of items.Item objects
- flying ()
-
Are you flying?
Returns:
-
boolean
- genus ()
-
Your genus.
As a lower-case plural string.
Returns:
-
string
- get_base_mutation_level (mutationname[, innate=true[, temp=true[, normal=true]]])
-
Get the mutation level of a mutation.
If all optional parameters are false this returns zero.
Parameters:
- mutationname string
- innate boolean include innate mutations (default true)
- temp boolean include temporary mutations (default true)
- normal boolean include normal mutations (default true)
Returns:
-
int
level
- get_training_target (name)
-
Get a training target.
Parameters:
- name string
Returns:
-
number
- god ()
-
Get name of player's god
Returns:
-
string
- gold ()
-
How much gold do you have?
Returns:
-
int
- good_god ([god=you.god()])
-
Is this [player's] god good?
Parameters:
- god string (default you.god())
Returns:
-
boolean
- hand ()
-
Get noun for player's hands.
Returns:
-
string
- has_claws ()
-
Do you have claws?
Returns:
-
int
claws level
- hasted ()
-
Are you hasted?
Returns:
-
boolean
- have_orb ()
-
Do you have the orb?
Returns:
-
boolean
- have_rune (rune)
-
Do you have the given rune?
Parameters:
- rune string or number number or rune name
Returns:
-
boolean
- how_mutated (innate, levels, temp)
-
How mutated are you?
Adds up the total number (including levels if requested) of mutations.
Parameters:
- innate boolean include innate mutations
- levels boolean count levels
- temp boolean include temporary mutations
Returns:
-
int
- hp ()
-
Hit points.
Returns:
- int current hp
- int current max hp
- intelligence ()
-
Intelligence.
Returns:
-
int
current intelligence
- invisible ()
-
Are you invisible?
Returns:
-
boolean
- is_level_on_stack (levelname)
-
Check the level stack.
When entering portal branches or the abyss crawl tracks
where we came from with a level stack, which we can query.
Can take a Branch or Branch:depth string.
Parameters:
- levelname string
Returns:
-
boolean
- known_items ()
-
Get the current state of item identification as a list of strings.
Returns:
-
table
The list of names of known identifiable items.
- lives ()
-
How many extra lives do you have?
Returns:
-
int
- los ()
-
LOS Radius.
Returns:
-
int
- mem_spells ()
-
Get memorisable spells.
This lists the spells available in the spell library.
Returns:
-
array
An array of spell names.
- memorise ()
-
Memorise a spell by name
Memorise a spell by name, erroring only on an invalid spell name.
Returns:
-
boolean
whether memorisation succeeded
- mesmerised ()
-
Are you mesmerised?
Returns:
-
boolean
- mighty ()
-
Are you mighty?
Returns:
-
boolean
- monster ()
-
The name of your monster type.
Returns:
-
string
- mp ()
-
Magic points.
Returns:
- int current mp
- int current max mp
- mutation (mutation)
-
Deprecated: use you.get_base_mutation_level.
Equivalent to
you.get_base_mutation_level(name)
Parameters:
- mutation string name
Returns:
-
int
num
- mutation_overview ()
-
Mutation overview string.
Returns:
-
string
- name ()
-
Get player's name.
Returns:
-
string
- noise_perception ()
-
What was the loudest noise you heard in the last turn?
Returns a number from [0, 1000], representing the current noise bar.
If the player's coordinates are silenced, return 0.
Noise bar colour breakpoints, listed here for clua api convenience: LIGHTGREY <= 333 , YELLOW <= 666 , RED < 1000 , else LIGHTMAGENTA Each colour breakpoint aims to approximate 1 additional los radius of noise.
Returns:
-
int
noise value
- num_runes ()
-
How many runes do you have?
Returns:
-
int
- on_fire ()
-
Are you on fire?
Returns:
-
boolean
- one_time_ability_used ()
-
Has the [player's] current god's one-time ability been used? (if any).
Returns:
-
boolean
- paralysed ()
-
Are you paralysed?
Returns:
-
boolean
- petrifying ()
-
Are you petrifying?
Returns:
-
boolean
- piety_rank ()
-
Stars of piety.
Returns:
-
int
- poison_survival ()
-
Minimum hp after poison wears off.
Returns:
-
int
- poisoned ()
-
Are you poisoned?
Returns:
-
boolean
- race ()
-
Get name of player's race.
Returns:
-
string
- regenerating ()
-
Are you regenerating?
Returns:
-
boolean
- res_cold ()
-
Cold resistance (rC).
Returns:
-
int
resistance level
- res_corr ()
-
Corrosion resistance (rCorr).
Returns:
-
int
resistance level
- res_draining ()
-
Negative energy resistance (rN).
Returns:
-
int
resistance level
- res_drowning ()
-
Drowning resistance (rDrown).
Returns:
-
boolean
- res_fire ()
-
Fire resistance (rF).
Returns:
-
int
resistance level
- res_mutation ()
-
Mutation resistance (rMut).
Returns:
-
int
resistance level
- res_poison ()
-
Poison resistance (rPois).
Returns:
-
int
resistance level
- res_shock ()
-
Electric resistance (rElec).
Returns:
-
int
resistance level
- rooted ()
-
Are you rooted?
Returns:
-
boolean
- see_cell (x, y)
-
Can you see a cell?
Uses player-centered coordinates
Parameters:
- x int
- y int
Returns:
-
boolean
- see_cell_no_trans (x, y)
-
Can you see this cell without looking through a window?
Checks line of sight treating transparent rock and stone as opaque.
Uses player-centered coordinates.
Parameters:
- x int
- y int
Returns:
-
boolean
- see_cell_solid (x, y)
-
Can you see this cell without something solid in the way?
Checks line of sight treating all solid features as opaque.
Uses player-centered coordinates.
Parameters:
- x int
- y int
Returns:
-
boolean
- see_cell_solid_see (x, y)
-
Can you see this cell with nothing in the way?
Checks line of sight treating all solid features as opaque and properly
checking bushes and clouds.
Uses player-centered coordinates.
Parameters:
- x int
- y int
Returns:
-
boolean
- see_invisible ()
-
See invisible (sInv).
Returns:
-
boolean
- set_training_target (name, target)
-
Set a training target.
Parameters:
- name string
- target number
Returns:
-
number or nil
if successfully set the new target
- sh ()
-
Shield class.
Returns:
-
int
- sick ()
-
Are you sick?
Returns:
-
boolean
- silenced ()
-
Are you silenced?
Returns:
-
boolean
- silencing ()
-
Are you silencing the world around you?
Returns:
-
boolean
- skill (name)
-
Current skill level.
Parameters:
- name string
Returns:
-
number
- skill_cost (name)
-
Cost of training this skill.
Parameters:
- name string
Returns:
-
number
- skill_progress (name)
-
Skill progress.
Parameters:
- name string skill name
Returns:
-
number
percentage of the way to the next skill level
- slowed ()
-
Are you slowed?
Returns:
-
boolean
- species ()
-
Get name of player's species.
Returns:
-
string
- spell_letters ()
-
Currently used spell letters
Returns:
-
array
An array of letters
See also:
- spell_levels ()
-
How many spell levels are currently available.
Returns:
-
int
- spell_table ()
-
Get the spell table.
Returns:
-
table
A table matching spell letters to spell names
See also:
- spells ()
-
List your spells
Returns:
-
array
An array of spell names
See also:
- spirit_shield ()
-
Guardian spirit.
Returns a number for backwards compatibility.
Returns:
-
int
- status ([stat])
-
Check status effects.
Given a specific status name, checks for that status.
Otherwise, lists all statuses.
Parameters:
- stat string (optional)
Returns:
-
string or boolean
- stealth_pips ()
-
Stealth pips.
Returns:
-
int
number of stealth pips
- stop_activity ()
- Interrupt the current multi-turn activity or macro sequence.
- strength ()
-
Strength.
Returns:
-
int
current strength
- swift ()
-
Are you currently +Swift or -Swift?
If you have neither, returns 0. If you are +Swift, +1, and -Swift, -1.
Returns:
-
int
Swift level
- taking_stairs ()
-
Are you taking the stairs?
Returns:
-
boolean
- teleporting ()
-
Are you teleporting?
Returns:
-
boolean
- temp_mutation (mutation)
-
Deprecated: use you.get_base_mutation_level.
Equivalent to
you.get_base_mutation_level(name, false, true, false)
Parameters:
- mutation string name
Returns:
-
int
num
- temp_mutations ()
-
How many temporary mutations do you have?
Returns:
-
int
- time ()
-
Total elapsed time in auts.
Returns:
-
int
- torment_immune ()
-
Are you currently immune to torment?
Returns:
-
boolean
- train_skill (name[, level])
-
Train a skill.
Training levels:
- 0 is disable
- 1 is enable
- 2 is focus
If no level is passed, does not change the current training.
Parameters:
- name string
- level int set training level (optional)
Returns:
-
int
training level
- transform ()
-
Current transformation, if any.
Returns:
-
string
transformation name
- turn_is_over ()
-
Has player done something that takes time?
Returns:
-
boolean
- turns ()
-
How many turns have been taken.
Returns:
-
int
- turns_on_level ()
-
How long has the player been on the current level?
Returns:
-
number
- unarmed_damage_rating ()
-
Unarmed damage rating.
Returns:
- number The damage rating for unarmed combat.
- string The full damage rating string for unarmed combat.
- under_penance ()
-
Are you under penance?
Returns:
-
boolean
- where ()
-
Where are you?
Returns:
-
string
- willpower ()
-
Willpower (WL).
Returns:
-
int
number of WL pips
- wizard ()
-
Is player in wizard mode?
Returns:
-
boolean
- xl_progress ()
-
XL progress.
Returns:
-
number
percentage of the way to the next xl [0,100]
- you_immune_to_hex (spell)
-
Are you intrinsically immune to this particular hex spell?
Parameters:
- spell string name
Returns:
-
boolean