# TEAMCAPTAIN aesen
##### Crawl Init file ###############################################
# For descriptions of all options, as well as some more in-depth information
# on setting them, consult the file
# options_guide.txt
# in your /docs directory. If you can't find it, the file is also available
# online at:
# https://gitorious.org/crawl/crawl/source/HEAD:crawl-ref/docs/options_guide.txt
#
# Crawl uses the first file of the following list as its option file:
# * init.txt in the -rcdir directory (if specified)
# * .crawlrc in the -rcdir directory (if specified)
# * init.txt (in the Crawl directory)
# * ~/.crawl/init.txt (Unix only)
# * ~/.crawlrc (Unix only)
# * ~/init.txt (Unix only)
# * settings/init.txt (in the Crawl directory)
##### Some basic explanation of option syntax #######################
# Lines beginning with '#' are comments. The basic syntax is:
#
# field = value or field.subfield = value
#
# Only one specification is allowed per line.
#
# The terms are typically case-insensitive except in the fairly obvious
# cases (the character's name and specifying files or directories when
# on a system that has case-sensitive filenames).
#
# White space is stripped from the beginning and end of the line, as
# well as immediately before and after the '='. If the option allows
# multiple comma/semicolon-separated terms (such as
# autopickup_exceptions), all whitespace around the separator is also
# trimmed. All other whitespace is left intact.
#
# There are three broad types of Crawl options: true/false values (booleans),
# arbitrary values, and lists of values. The first two types use only the
# simple =, with later options - which includes your options that are different
# from the defaults - overriding earlier ones. List options allow using +=, ^=,
# -=, and = to append, prepend, remove, and reset, respectively. Usually you will
# want to use += to add to a list option. Lastly, there is := which you can use
# to create an alias, like so:
# ae := autopickup_exceptions
# From there on, 'ae' will be treated as if it you typed autopickup_exceptions,
# so you can save time typing it.
#
##### Other files ###################################################
# You can include other files from your options file using the 'include'
# option. Crawl will treat it as if you copied the whole text of that file
# into your options file in that spot. You can uncomment some of the following
# lines by removing the beginning '#' to include some of the other files in
# this folder.
# Some useful, more advanced options, implemented in LUA.
# include = advanced_optioneering.txt
# Alternative vi bindings for Dvorak users.
# include = dvorak_command_keys.txt
# Alternative vi bindings for Colemak users.
# include = colemak_command_keys.txt
# Override the vi movement keys with a non-command.
# include = no_vi_command_keys.txt
# Turn the shift-vi keys into safe move, instead of run.
# include = safe_move_shift.txt
##### Ancient versions ##############################################
# If you're used to the interface of ancient versions of Crawl, you may
# get back parts of it by uncommenting the following options:
# include = 034_command_keys.txt
# And to revert monster glyph and colouring changes:
# include = 034_monster_glyphs.txt
# include = 052_monster_glyphs.txt
# include = 060_monster_glyphs.txt
# include = 071_monster_glyphs.txt
# include = 080_monster_glyphs.txt
# include = 0.9_monster_glyphs.txt
# include = 0.12_monster_glyphs.txt
# include = 0.13_monster_glyphs.txt
# include = 0.14_monster_glyphs.txt
more += distortion
force_more_message += transformation, weakening
runrest_stop_message += friend_action:
runrest_stop_message += melt, evaporates, transformation, flicker, weakening
auto_sacrifice = true
auto_butcher = true
explore_auto_rest = true
autofight_stop = 70
rest_wait_percent = 100
tile_web_mouse_control = false
auto_exclude += web
flash_screen_message += wielding.*distortion
use_animations -= player
easy_floor_use = true
force_more_message += fall into a
force_more_message += toss it
force_more_message += Xom
force_more_message += You are engulfed in calcifying dust
force_more_message += creaks loudly
force_more_message += almost over
force_more_message += You revert
force_more_message += goes berserk
force_more_message += "Detected throwing nets!"
force_more_message += "miscast Maxwell"
runrest_stop_message ^= Your transformation is almost over
runrest_stop_message ^= You revert
runrest_stop_message ^= has ended
runrest_stop_message ^= faded away
interrupt_memorise += sense_monster
interrupt_memorise += monster
interrupt_armour_on += sense_monster
interrupt_armour_on += monster
interrupt_armour_on += monster_attack
interrupt_armour_off += sense_monster
interrupt_armour_off += monster
interrupt_armour_on += monster_attack
confirm_action += Exsanguinate
confirm_action += Evoke Invisibility
confirm_action += "Evoke Blink"
travel_avoid_terrain += deep water
autoinscribe += atropa-tipped dart:!f
autoinscribe += datura-tipped dart:!f
autoinscribe += boomerang of dispersal:!f
autoinscribe += boomerangs of dispersal:!f
autopickup_exceptions += phantom,condenser,beasts,phial
prompt_menu=false
###############
# Damage Calc #
###############
<
local previous_hp = 0
local previous_mp = 0
local previous_form = ""
local was_berserk_last_turn = false
function AnnounceDamage()
local current_hp, max_hp = you.hp()
local current_mp, max_mp = you.mp()
--Things that increase hp/mp temporarily really mess with this
local current_form = you.transform()
local you_are_berserk = you.berserk()
local max_hp_increased = false
local max_hp_decreased = false
if (current_form ~= previous_form) then
if (previous_form:find("dragon") or
previous_form:find("statue") or
previous_form:find("tree") or
previous_form:find("ice")) or
previous_form:find("hydra")then
max_hp_decreased = true
elseif (current_form:find("dragon") or
current_form:find("statue") or
current_form:find("tree") or
previous_form:find("ice")) or
previous_form:find("hydra")then
max_hp_increased = true
end
end
if (was_berserk_last_turn and not you_are_berserk) then
max_hp_decreased = true
elseif (you_are_berserk and not was_berserk_last_turn) then
max_hp_increased = true
end
--crawl.mpr(string.format("previous_form is: %s", previous_form))
--crawl.mpr(string.format("current_form is: %s", current_form))
--crawl.mpr(string.format("max_hp_increased is: %s", max_hp_increased and "True" or "False"))
--crawl.mpr(string.format("max_hp_decreased is: %s", max_hp_decreased and "True" or "False"))
--crawl.mpr(string:format("you_are_berserk is: %s", you_are_berserk and "True" or "False"))
--crawl.mpr(string:format("was_berserk_last_turn is: %s", was_berserk_last_turn and "True" or "False"))
--Skips message on initializing game
if previous_hp > 0 then
local hp_difference = previous_hp - current_hp
local mp_difference = previous_mp - current_mp
if max_hp_increased or max_hp_decreased then
if max_hp_increased then
crawl.mpr("You now have " .. current_hp .. "/" .. max_hp .. " hp.")
else
crawl.mpr("You now have " .. current_hp .. "/" .. max_hp .. " hp.")
end
else
--On losing health
if (current_hp < previous_hp) then
if current_hp <= (max_hp * 0.30) then
crawl.mpr("You take " .. hp_difference .. " damage, and have " .. current_hp .. "/" .. max_hp .. " hp.")
elseif current_hp <= (max_hp * 0.50) then
crawl.mpr("You take " .. hp_difference .. " damage, and have " .. current_hp .. "/" .. max_hp .. " hp.")
elseif current_hp <= (max_hp * 0.70) then
crawl.mpr("You take " .. hp_difference .. " damage, and have " .. current_hp .. "/" .. max_hp .. " hp.")
elseif current_hp <= (max_hp * 0.90) then
crawl.mpr("You take " .. hp_difference .. " damage, and have " .. current_hp .. "/" .. max_hp .. " hp.")
else
crawl.mpr("You take " .. hp_difference .. " damage, and have " .. current_hp .. "/" .. max_hp .. " hp.")
end
if hp_difference > (max_hp * 0.20) then
crawl.mpr("MASSIVE DAMAGE!!")
end
end
--On gaining more than 1 health
if (current_hp > previous_hp) then
--Removes the negative sign
local health_inturn = (0 - hp_difference)
if (health_inturn > 1) and not (current_hp == max_hp) then
if current_hp <= (max_hp * 0.30) then
crawl.mpr("You regained " .. health_inturn .. " hp, and now have " .. current_hp .. "/" .. max_hp .. " hp.")
elseif current_hp <= (max_hp * 0.50) then
crawl.mpr("You regained " .. health_inturn .. " hp, and now have " .. current_hp .. "/" .. max_hp .. " hp.")
elseif current_hp <= (max_hp * 0.70) then
crawl.mpr("You regained " .. health_inturn .. " hp, and now have " .. current_hp .. "/" .. max_hp .. " hp.")
elseif current_hp <= (max_hp * 0.90) then
crawl.mpr("You regained " .. health_inturn .. " hp, and now have " .. current_hp .. "/" .. max_hp .. " hp.")
else
crawl.mpr("You regained " .. health_inturn .. " hp, and now have " .. current_hp .. "/" .. max_hp .. " hp.")
end
end
if (current_hp == max_hp) then
crawl.mpr("Health restored: " .. current_hp .. "")
end
end
--On gaining more than 1 magic
if (current_mp > previous_mp) then
--Removes the negative sign
local mp_inturn = (0 - mp_difference)
if (mp_inturn > 1) and not (current_mp == max_mp) then
if current_mp < (max_mp * 0.25) then
crawl.mpr("You regained " .. mp_inturn .. " mp, and now have " .. current_mp .. "/" .. max_mp .. " mp.")
elseif current_mp < (max_mp * 0.50) then
crawl.mpr("You regained " .. mp_inturn .. " mp, and now have " .. current_mp .. "/" .. max_mp .. " mp.")
else
crawl.mpr("You regained " .. mp_inturn .. " mp, and now have " .. current_mp .. "/" .. max_mp .. " mp.")
end
end
if (current_mp == max_mp) then
crawl.mpr("MP restored: " .. current_mp .. "")
end
end
--On losing magic
if current_mp < previous_mp then
if current_mp <= (max_mp / 5) then
crawl.mpr("You now have " .. current_mp .. "/" ..max_mp .." mp.")
elseif current_mp <= (max_mp / 2) then
crawl.mpr("You now have " .. current_mp .. "/" ..max_mp .." mp.")
else
crawl.mpr("You now have " .. current_mp .. "/" ..max_mp .." mp.")
end
end
end
end
--Set previous hp/mp and form at end of turn
previous_hp = current_hp
previous_mp = current_mp
previous_form = current_form
was_berserk_last_turn = you_are_berserk
end
>
####################
# Opens skill menu #
####################
<
local need_skills_opened = true
function OpenSkills()
if you.turns() == 0 and need_skills_opened then
need_skills_opened = false
crawl.sendkeys("m")
end
end
>
########################################################
## Safe movement: alert when enemies appear ##
########################################################
{
safe_move_toggle = true
function toggle_safe_move()
if safe_move_toggle then
safe_move_toggle = false
crawl.message("safe move off", 0)
crawl.setopt("mon_glyph += player : red")
else
safe_move_toggle = true
crawl.message("safe move on", 0)
crawl.setopt("mon_glyph += player : green")
end
end
safe = you.feel_safe()
function update_safe()
local old_safe = safe
safe = you.feel_safe()
if not safe and old_safe and safe_move_toggle then
crawl.mpr("Danger!", "warning")
crawl.more()
end
end
function check_contam()
if you.contaminated() > 1 then
crawl.setopt("confirm_action += Irradiate")
else
crawl.setopt("confirm_action -= Irradiate")
end
end
function repeat_spell_warns()
-- - is a special character in Lua. If you find the creator of Lua, give them a kick from me.
if string.find(you.status(), "ce%-armoured") then
crawl.setopt("confirm_action += Ozocubu's Armour")
else
crawl.setopt("confirm_action -= Ozocubu's Armour")
end
end
function log_status()
crawl.mpr(you.status())
end
}
macros += M ` ===toggle_safe_move
########################################################
## Don't warn for allies if a toggle is on ##
########################################################
hurt_allies_toggle = False
autorefresh_needed = False
{
function toggle_hurt_allies()
if hurt_allies_toggle then
hurt_allies_toggle = false
crawl.message("hurt allies off", 0)
crawl.setopt("mon_glyph += player : red")
else
hurt_allies_toggle = true
crawl.message("hurt allies on", 0)
crawl.setopt("mon_glyph += player : green")
end
end
function c_answer_prompt(prompt)
if hurt_allies_toggle and prompt:find("Really attack your") then
crawl.mpr("here")
return true
end
if prompt:find("while wielding") then
autorefresh_needed = true
end
end
}
# macros += M 1 ===toggle_hurt_allies
########################################################
## Swap weapon to inscribed on explore/rest ##
## Also warn before resting if rest not needed ##
########################################################
{
dangerous_friend = false
function summon_check()
los = you.los()
found_beast = false
ally_spell_pairs = {}
ally_spell_pairs["cerulean imp"]="Call Imp"
ally_spell_pairs["martyr"]="Martyr's Knell"
ally_spell_pairs["ice beast"]="Summon Ice Beast"
ally_spell_pairs["animated"]="Animate Armour"
ally_spell_pairs["spellforged"]="Spellforged Servitor"
ally_spell_pairs["cactus"]="Summon Cactus Giant"
ally_spell_pairs["mana"]="Mana Viper"
spell_set_pairs = {}
for k, v in pairs(ally_spell_pairs) do
spell_set_pairs[v] = false
end
dangerous_friend = false
orc_friend = false
for x=-los,los do
for y=-los,los do
mons = monster.get_monster_at(x, y)
if mons ~= nil then
if mons:attitude() == 4 then
for k, v in pairs(ally_spell_pairs) do
if string.find(mons:name(), k) == 1 then
spell_set_pairs[v] = true
end
if string.find(mons:name(), "tentacle segment") then
dangerous_friend = true
end
end
end
if mons:attitude() > 2 then
if string.find(mons:name(), "orc") then
orc_friend = true
end
end
end
end
end
for k, v in pairs(spell_set_pairs) do
if v then
crawl.setopt("confirm_action += " .. k)
else
crawl.setopt("confirm_action -= " .. k)
end
end
if string.find(you.status(), "nimating") then
crawl.setopt("confirm_action += Animate Dead")
else
crawl.setopt("confirm_action -= Animate Dead")
end
if you.res_shock() == 0 or orc_friend then
crawl.setopt("confirm_action += Conjure Ball Lightning")
else
crawl.setopt("confirm_action -= Conjure Ball Lightning")
end
end
queued_actions = {}
function swap_for_autoexplore()
local w = items.equipped_at("Weapon")
if w and string.find(w.inscription, "autoexplore") then
a = 1
else
for i, j in ipairs(items.inventory()) do
if string.find(j.inscription, "autoexplore") then
return items.index_to_letter(j.slot)
end
end
return nil
end
end
function swap_for_autoring()
good_ring_one = ""
good_ring_two = ""
for i, j in ipairs(items.inventory()) do
if string.find(j.inscription, "autoring") then
if good_ring_one == "" then
good_ring_one = j.slot
else
if good_ring_two == "" then
good_ring_two = j.slot
else
crawl.mpr("More than two autorings, doing nothing")
return
end
end
end
end
if not (good_ring_one == "") then
if good_ring_two == "" then
crawl.mpr("One autorings, doing nothing")
else
one_found = false
two_found = false
have_empty = false
swap_slot = ""
for x=7,8 do
local w = items.equipped_at(x)
if w == nil then
have_empty = true
else
if w.slot == good_ring_one then
one_found = true
else
if w.slot == good_ring_two then
two_found = true
else
swap_slot = w.slot
end
end
end
end
if not one_found then
slot = items.index_to_letter(good_ring_one)
if have_empty then
crawl.mpr("Swapping " .. slot .. " into empty")
return "P" .. slot
else
swap_slot_letter = items.index_to_letter(swap_slot)
crawl.mpr("Swapping " .. slot .. " into " .. swap_slot_letter)
return "P" .. slot .. swap_slot_letter
end
else
if not two_found then
slot = items.index_to_letter(good_ring_two)
if have_empty then
crawl.mpr("Swapping " .. slot .. " into empty")
return "P" .. slot
else
swap_slot_letter = items.index_to_letter(swap_slot)
crawl.mpr("Swapping " .. slot .. " into " .. swap_slot_letter)
return "P" .. slot .. swap_slot_letter
end
end
end
end
end
end
function swap_for_autorest()
local w = items.equipped_at("Weapon")
if w and string.find(w.inscription, "autorest") then
return nil
else
for i, j in ipairs(items.inventory()) do
if string.find(j.inscription, "autorest") then
return items.index_to_letter(j.slot)
end
end
return nil
end
end
function autorefresh_slot()
local w = items.equipped_at("Weapon")
if w and string.find(w.inscription, "autorefresh") then
return items.index_to_letter(w.slot)
end
end
function should_rest()
if you.breath_timeout() then
return true
end
if dangerous_friend then
return true
end
if hp_percent() ~= 100 then
return true
end
if mp_percent() ~= 100 then
return true
end
bad_statuses = {"hop", "contam", "slowed", "potion", "cooldown", "berserk", "mark", "corr", "weakened", "spewing sludge", "Wisp%-form", "weak%-willed", "frozen", "exhausted", "spiked", "confused", "fragile", "bat%-form", "Unable to call", "vulnerable"}
for k, v in pairs(bad_statuses) do
if string.find(string.lower(you.status()), string.lower(v)) then
crawl.mpr("Waiting off " .. v)
return true
end
end
if you.god() == "Hepliaklqana" and you.piety_rank() > 0 then
found_ancestor = false
for x=-los,los do
for y=-los,los do
mons = monster.get_monster_at(x, y)
if mons ~= nil then
if string.find(mons:desc(true), "insubstantial memory") then
if mons:damage_level() > 0 then
crawl.mpr("Waiting for ancestor to heal")
return true
end
found_ancestor = true
end
end
end
end
if not found_ancestor then
crawl.mpr("Waiting for ancestory")
return true
end
end
if you.god() == "Yredelemnul" then
for x=-los,los do
for y=-los,los do
mons = monster.get_monster_at(x, y)
if mons ~= nil then
if string.find(mons:desc(true), "bound") then
if mons:damage_level() > 0 then
crawl.mpr("Waiting for bound soul to heal")
return true
end
end
end
end
end
end
return false
end
function custom_autoexplore()
no_explore_statuses = {"mark"}
for k, v in pairs(no_explore_statuses) do
if string.find(string.lower(you.status()), string.lower(v)) then
crawl.mpr("Not autoexploring with " .. v)
return
end
end
if not you.feel_safe() then
crawl.mpr("But you're not safe!")
return
end
if dangerous_friend then
crawl.mpr("Not exploring near that thing")
return
end
if should_rest() then
crawl.sendkeys("5")
return
end
local action = ""
local swap = swap_for_autoexplore()
if swap then
crawl.mpr("Swap")
action = "w" .. swap
crawl.sendkeys(action)
queued_actions = {"o"}
return
end
local swap = swap_for_autoring()
if swap then
crawl.mpr("Rings! " .. swap)
crawl.sendkeys(swap)
queued_actions = {"o"}
return
end
if autorefresh_needed then
local refresh = autorefresh_slot()
if refresh then
crawl.sendkeys("w -")
queued_actions = {"w" .. refresh, "o"}
autorefresh_needed = False
return
end
end
crawl.sendkeys("o")
end
function hp_percent() a,b=you.hp() return 100*a/b end
function mp_percent()
a,b=you.mp()
if a == 0 and b == 0 then
return 100
end
return 100*a/b
end
function custom_rest()
if not you.feel_safe() then
crawl.mpr("But you're not safe!")
return
end
delay = false
local swap = swap_for_autorest()
if swap then
action = "w" .. swap
crawl.sendkeys(action)
queued_actions = {"5"}
delay = true
end
local swap = swap_for_autoring()
if swap then
crawl.mpr("Rings! " .. swap)
crawl.sendkeys(swap)
queued_actions = {"5"}
return
end
if not you.feel_safe() then
return
end
if autorefresh_needed then
local refresh = autorefresh_slot()
if refresh then
crawl.mpr("autorefresh")
crawl.sendkeys("w -")
if not you.feel_safe() then
return
end
crawl.sendkeys("w" .. refresh)
end
autorefresh_needed = False
end
if not should_rest() then
if crawl.yesno("Wait 100 turns?", true, 'n') then
crawl.sendkeys("5")
end
else
crawl.sendkeys("5")
end
end
function all_enemies_sleep_and_max_hp()
local current_hp, max_hp = you.hp()
local current_mp, max_mp = you.mp()
-- If we somehow take damage, let's not just press s until we die
if current_hp ~= max_hp or current_mp ~= max_mp then
crawl.mpr("Not max hp/mp")
return false
end
any_enemy = false
for x=-los,los do
for y=-los,los do
mons = monster.get_monster_at(x, y)
if mons ~= nil then
if mons:attitude() == 0 and not mons:is_firewood() then
any_enemy = true
if not string.find(mons:status(), "asleep") and not string.find(mons:status(), "dormant") then
return false
end
end
end
end
end
return any_enemy
end
sleep_wait = false
function check_sleep_wait()
if not sleep_wait then
return
end
if all_enemies_sleep_and_max_hp() then
crawl.sendkeys("s")
else
sleep_wait = false
end
end
function start_sleep_wait()
crawl.mpr("Starting sleep wait")
sleep_wait = true
check_sleep_wait()
end
function check_queue()
if next(queued_actions) == nil then
return
end
if not you.feel_safe() then
crawl.mpr('Not safe, discarding queue')
queued_actions = {}
return
end
action = table.remove(queued_actions, 1)
crawl.mpr('Executing queued action')
crawl.sendkeys(action)
end
function queue_and_do_first(actions)
if next(queued_actions) ~= nil then
crawl.mpr('Already have queued actions - confused. Clearing.')
queued_actions = {}
return
end
queued_actions = actions
check_queue()
end
function test_queue()
queue_and_do_first({"n", "n"})
end
function queue_statue()
crawl.mpr('Queue statue')
queue_and_do_first({"we", "zs", "w-"})
end
function queue_storm()
crawl.mpr('Queue storm')
queue_and_do_first({"PUI", "zb", "PIU"})
end
}
function exclude_all_hostiles()
for x=-los,los do
for y=-los,los do
mons = monster.get_monster_at(x, y)
if mons ~= nil then
if mons:attitude() == 0 and not mons:is_firewood() then
travel.set_exclude(mons:x_pos(), mons:y_pos(),los)
end
end
end
end
end
macros += M / ===queue_statue
macros += M o ===custom_autoexplore
macros += M 5 ===custom_rest
macros += M 3 ===queue_storm
macros += M 4 ===log_status
macros += M S ===start_sleep_wait
########################################################
## Alert if swapping when not safe ##
########################################################
{
function custom_armour_swap()
if not you.feel_safe() then
if crawl.yesno("Swap armour despite not safe?", true, 'n') then
crawl.sendkeys("W")
end
else crawl.sendkeys("W")
end
end
}
macros += M W ===custom_armour_swap
########################################################
## Equipment autopickup (by Medar and various others) ##
########################################################
{
local function pickup_equipment(it, name)
if it.is_useless then return end
local class = it.class(true)
if class == "armour" then
local good_slots = {cloak="Cloak", helmet="Helmet",
gloves="Gloves", boots="Boots"}
st, _ = it.subtype()
-- Autopickup found aux armour if 1) we don't have any or 2) it's artefact,
-- or 3) if we don't have artefact or ego armour, and the found armour is
-- ego.
if good_slots[st] ~= nil then
if good_slots[st] == "Gloves" and you.has_claws() > 0 then return end
if it.artefact then return true end
local cur = items.equipped_at(good_slots[st])
if cur == nil then return true end
if cur.branded or cur.artefact then return end
if it.branded then return true end
-- Autopickup found body armour of the same kind we're wearing, according
-- to conditions (2) and (3) above used for aux slots.
elseif st == "body" then
local cur = items.equipped_at("armour")
if cur == nil then return end
if cur.name("qual") ~= it.name("qual") then return end
if it.artefact then return true end
if cur.branded or cur.artefact then return end
if it.branded then return true end
end
end
return
end
add_autopickup_func(pickup_equipment)
}
###############
# Spell slots #
###############
force_targeter=true
# Set Alias for Spell Slots
slot := spell_slot
# Try to keep in alphabetic order (by keybind)
slot += Freeze:a
slot += Borgnjor's Vile Clutch:b
slot += Stone Arrow:c
slot += Call Canine Familiar:c
slot += Confuse:c
slot += Conjure Flame:c
slot += Control Undead:c
slot += Freezing Aura:c
slot += Frozen Ramparts:f
slot += Fireball:f
slot += Apportation:g
slot += Iskenderun's Battlesphere:i
slot += Summon Ice Beast:i
slot += Lee's Rapid Deconstruction:l
slot += Summon Lightning Spire:l
slot += Lightning Bolt:l
slot += Sublimation of Blood:m
slot += Iskenderun's Mystic Blast:m
slot += Mephitic Cloud:m
slot += Ozocubu's Armour:o
slot += Petrify:p
slot += Slow:s
slot += Sticky Flame:s
slot += Passwall:w
slot += Vampiric Draining:v
slot += Blink:B
slot += Death's Door:D
slot += Swiftness:S
slot += Borgnjor's Revivification:B
item_slot ^= potions? of curing:q
item_slot ^= potions? of heal wounds:l
item_slot ^= potions? of haste:h
item_slot ^= potions? of might:d
item_slot ^= potions? of agility:s
item_slot ^= potions? of resistance:n
item_slot ^= ring of poison resistance:P
item_slot ^= ring of positive energy:N
item_slot ^= ring of protection from cold:I
item_slot ^= ring of protection from fire:F
item_slot ^= ring of protection from magic:mM
item_slot ^= ring of resist corrosion:C
item_slot ^= ring of see invisible:S
item_slot ^= ring of wizardry:W
item_slot ^= scrolls? of blinking:B
item_slot ^= scrolls? of fear:g
item_slot ^= scrolls? of identify:i
item_slot ^= scrolls? of teleportation:t
item_slot ^= scrolls? of remove curse:w
item_slot ^= wand of digging:D
#####################
# Check for summons #
#####################
{
function god_based_checks()
if you.god() == "Ashenzari" then
crawl.setopt("force_more_message -= malevolen")
crawl.setopt("flash_screen_message -= malevolen")
else
crawl.setopt("force_more_message += malevolen")
crawl.setopt("flash_screen_message += malevolen")
end
end
function exclude_all_hostiles()
for x=-los,los do
for y=-los,los do
mons = monster.get_monster_at(x, y)
if mons ~= nil then
if mons:attitude() == 0 and not mons:is_firewood() then
travel.set_exclude(mons:x_pos(), mons:y_pos(),los)
end
end
end
end
end
found_throwing_net_last = false
function describe_bad_monsters()
found_throwing_net = false
for x=-los,los do
for y=-los,los do
mons = monster.get_monster_at(x, y)
if mons ~= nil then
if mons:attitude() == 0 and not mons:is_firewood() then
if string.find(mons:desc(true), "throwing net") then
found_throwing_net = true
end
end
end
end
end
if found_throwing_net and not found_throwing_net_last then
crawl.mpr("Detected throwing nets!")
end
found_throwing_net_last= found_throwing_net
end
function feat_is_stair(feat)
return (feat:find("stone_stairs_up") or
(feat:find("exit_") and (feat == "exit_hell" or feat == "exit_vaults"
or feat == "exit_zot" or feat == "exit_slime_pits"
or feat == "exit_orcish_mines" or feat == "exit_lair"
or feat == "exit_crypt" or feat == "exit_snake_pit"
or feat == "exit_elven_halls" or feat == "exit_tomb"
or feat == "exit_swamp" or feat == "exit_shoals"
or feat == "exit_spider_nest" or feat == "exit_depths"
or feat == "exit_temple" or feat == "exit_dungeon"))
or feat == "escape_hatch_up"
or feat:find("stone_stairs_down")
or feat:find("enter_")
or feat == "escape_hatch_down")
end
function feat_is_open(feat)
local fname = feat:lower()
-- Unique substrings that identify solid features.
local solid_features = {"wall", "grate", "tree", "mangrove",
"endless_lava", "open_sea", "statue", "idol",
"malign_gateway", "sealed_door", "closed_door",
"runed_door", "explore_horizon"}
for i,p in ipairs(solid_features) do
if fname:find(p) then
return false
end
end
return true
end
function can_see(x, y)
return (x == 0 and y == 0) or view.cell_see_cell(0, 0, x, y)
end
function bog_check()
crawl.setopt("confirm_action -= Eringya's Noxious Bog")
for x=-4,4 do
for y=-4,4 do
local feat = view.feature_at(x,y)
if feat_is_stair(feat) and can_see(x, y) then
solids = 0
for dx=-1,1 do
for dy = -1,1 do
if not feat_is_open(view.feature_at(x+dx,y+dy)) then
solids = solids + 1
end
end
end
if solids < 3 then
crawl.setopt("confirm_action += Eringya's Noxious Bog")
end
end
end
end
end
}
macros += M ] ===exclude_all_hostiles
########################################################
## Stuff with silly message parsing ##
########################################################
{
turns_since_mcc = 100
current_mcc = false
check_s = false
function check_s_mcc()
if turns_since_mcc < 10 and not current_mcc then
check_s = true
else
check_s = false
end
turns_since_mcc = turns_since_mcc + 1
end
function c_message(text, channel)
if text:find("You feel charge building up") then
turns_since_mcc = 0
current_mcc = true
crawl.setopt("confirm_action += Maxwell's Capacitive Coupling")
end
if text:find("electric haze") then
current_mcc = false
crawl.setopt("confirm_action -= Maxwell's Capacitive Coupling")
end
if text:find("condenses as gold") then
current_mcc = false
crawl.setopt("confirm_action -= Maxwell's Capacitive Coupling")
end
if text:find("without a target") then
current_mcc = false
crawl.setopt("confirm_action -= Maxwell's Capacitive Coupling")
end
if text:find("insufficient charge dissipates harmlessly") then
current_mcc = false
crawl.setopt("confirm_action -= Maxwell's Capacitive Coupling")
end
if text:find("electricity discharges through something") then
current_mcc = false
crawl.setopt("confirm_action -= Maxwell's Capacitive Coupling")
end
if text:find("miscast Maxwell's Capacitive Coupling.") then
turns_since_mcc = 0
end
end
function custom_s()
if check_s then
if crawl.yesno("Really s? MCC is not going.") then
check_s = false
turns_since_mcc = 100
crawl.sendkeys('s')
else
return
end
else
crawl.sendkeys('s')
end
end
function custom_s_simple()
crawl.sendkeys('s')
end
}
# macros += M s ===custom_s
########################################################
## Annotate V:5 ##
########################################################
{
-- annotate warning for vaults 5 versions tho
annotated_v5 = false
function annotate_v5()
crawl.sendkeys("!v5" .. string.char(13) .. "!vaults warning" .. string.char(13))
annotated_v5 = true
end
}
########################################################
## No tabbing in bad clouds ##
########################################################
{
function cloud_check()
cloud_type = view.cloud_at(0, 0)
crawl.setopt("autofight_stop = 70")
if cloud_type then
crawl.mpr(cloud_type)
if (cloud_type == "poison gas" or cloud_type == "noxious fumes") and you.res_poison() == 0 then
crawl.mpr("Standing in poison without rpois")
crawl.setopt("autofight_stop = 101")
end
end
end
}
########################################################
## Ready. Always at the bottom. ##
########################################################
{
turn_count = 0
function ready()
if you.turns() ~= turn_count then
AnnounceDamage()
OpenSkills()
update_safe()
check_contam()
repeat_spell_warns()
check_queue()
summon_check()
god_based_checks()
describe_bad_monsters()
bog_check()
check_s_mcc()
check_sleep_wait()
cloud_check()
if (not annotated_v5) and (you.branch() == "Vaults") then
annotate_v5()
end
turn_count = you.turns()
end
end
}