function ready()
load_message()
AnnounceDamage()
OpenSkills()
end
>
--macros += M S ===save_with_message
--macros += M o ===HDAtravel
##########
# Travel #
##########
travel_delay = -1
explore_delay = -1
rest_delay = -1
feature += explore horizon {.,,green}
show_travel_trail = true
explore_wall_bias = 10
explore_stop = items,greedy_pickup_smart,glowing_items
explore_stop += stairs,shops,altars,gates,greedy_sacrificeable
: if you.god() ~= "Elyvilon" and you.god() ~= "No God" then
auto_sacrifice = true
: else
auto_sacrifice = false
: end
runrest_ignore_poison = 2:30
runrest_ignore_monster += butterfly:1, swamp worm:2
trapwalk_safe_hp = dart:20,needle:15,arrow:35,bolt:45,spear:40,blade:95
auto_exclude += oklob,statue,curse skull,roxanne,lightning
spire,mimic
sort_menus += inv: true : equipped, freshness, charged
stop := runrest_stop_message
ignore := runrest_ignore_message
# Annoyances
ignore += Jiyva gurgles merrily
ignore += Jiyva appreciates your sacrifice
ignore += Jiyva says: Divide and consume
ignore += You hear.*splatter
ignore += You feel.*sick
ignore += disappears in a puff of smoke
ignore += engulfed in a cloud of smoke
ignore += standing in the rain
ignore += engulfed in white fluffiness
ignore += safely over a trap
ignore += A.*toadstool withers and dies
ignore += toadstools? grow
ignore += You walk carefully through the
ignore += grinding sound
ignore += contamination has completely
ignore += rod.*has recharged
ignore += your breath back
ignore += the plant is engulfed
ignore += the walls burn your
ignore += the wall burns your
ignore += absorbed by ash
# Bad things
stop += found.*trap
stop += You fall through a shaft
stop += emits a blaring wail
stop += (blundered into a|invokes the power of) Zot
stop += A huge blade swings out and slices into you
stop += sense of stasis
stop += flesh start
stop += (starving|devoid of blood)
stop += wrath finds you
stop += lose consciousness
# Expiring effects
stop += You feel yourself slow down
stop += You are starting to lose your buoyancy
stop += You start to feel a little slower
stop += Your transformation is almost over
stop += You lose control over your flight
stop += You start to feel a little uncertain
stop += Your skin is crawling a little less now
stop += Your stomach is not as upset anymore
stop += Your magical contamination has completely faded away
stop += Your hearing returns
stop += back to life
stop += uncertain
stop += time is quickly running out
stop += life is in your own hands
stop += is no longer charmed
# Vehumet granting a new spell
stop += Vehumet offers you knowledge of
:if you.god() == "Xom" then
stop += god:
:else
ignore += god:
:end
stop += hell_effect:
ignore += pray:
ignore += talk:
ignore += talk_visual:
ignore += friend_spell:
ignore += friend_enchant:
ignore += friend_action:
ignore += sound:
{
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
}
show_more = false
default_manual_training = true
# 3-f : Travel and Exploration
# ----------------------------
auto_butcher = true
travel_delay = -1
rest_delay = -1
explore_stop = glowing_items,artefacts,greedy_pickup_smart
explore_stop += greedy_visited_item_stack,stairs,shops
explore_stop += altars,portals,branches,runed_doors,greedy_sacrificeable
# Adjusts how much autoexplore favours attempting to discover room perimeters and corners.
# At values higher than 0, autoexplore will more heavily favour visiting squares that are next to walls
# reasonable values range from 0 to 10 maybe?
explore_wall_bias = 5
# Disables key press from stopping autoexplore
travel_key_stop = false
stop := runrest_stop_message
ignore := runrest_ignore_message
ignore += You regained.*mp
# Jiyva Messages
ignore += Jiyva appreciates your sacrifice
ignore += Jiyva gurgles merrily
ignore += Jiyva says: Divide and consume
ignore += You hear.*splatter
# Annoyances -- Don't stop autotravel for these events
ignore += A.*toadstool withers and dies
ignore += disappears in a puff of smoke
ignore += engulfed in a cloud of smoke
ignore += engulfed in white fluffiness
ignore += grinding sound
ignore += in your inventory.*rotted away
ignore += safely over a trap
ignore += standing in the rain
ignore += toadstools? grow
ignore += You feel.*sick
ignore += You walk carefully through the
# Qazlal
ignore += The plant is engulfed
ignore += You destroy the (bush|fungus|plant)
ignore += You displace your
# Bad things -- Stop autotravel for these events
stop += (blundered into a|invokes the power of) Zot
#stop += (devoid of blood|starving)
#stop += A huge blade swings out and slices into you[^r]
#stop += An alarm trap emits a blaring wail
stop += flesh start
#stop += found a zot trap
#stop += hear a soft click
stop += lose consciousness
stop += sense of stasis
stop += Wait a moment
stop += wrath finds you
stop += You fall through a shaft
# Expiring effects -- Stop autotravel for spells beginning to expire (to allow recasts)
# Control Teleport
# stop += uncertain
# Deaths Door
stop += time is quickly running out
stop += life is in your own
# Enslavement
stop += is no longer charmed
# Flight
stop += You are starting to lose your buoyancy
stop += You lose control over your flight
# Haste
stop += You feel yourself slow down
# Necromutation
stop += You have a feeling this form
stop += You feel yourself come back to life
# Shroud
stop += shroud begins to fray
stop += shroud unravels
# Swiftness
stop += start to feel a little slower
# Ghouls
: if you.race() == "Ghoul" then
stop += smell.*(rott(ing|en)|decay)
stop += something tasty in your inventory
: end
# Good things - Bad things wearing off
stop += contamination has completely
stop += You are no longer firmly anchored in space
#Ally actions?
#ignore += pray:
#ignore += friend_spell:
#ignore += friend_enchant:
#ignore += friend_action:
#ignore += sound:
auto_butcher = true
travel_delay = -1
rest_delay = -1
explore_stop = glowing_items,artefacts,greedy_pickup_smart
explore_stop += greedy_visited_item_stack,stairs,shops
explore_stop += altars,portals,branches,runed_doors,greedy_sacrificeable
# Adjusts how much autoexplore favours attempting to discover room perimeters and corners.
# At values higher than 0, autoexplore will more heavily favour visiting squares that are next to walls
# reasonable values range from 0 to 10 maybe?
explore_wall_bias = 5
# Disables key press from stopping autoexplore
travel_key_stop = false
stop := runrest_stop_message
ignore := runrest_ignore_message
ignore += You regained.*mp
delay_safe_poison = 50:30
runrest_ignore_monster += butterfly:1
# rest_wait_both = true
# explore_auto_rest = true
# This list needs to be updated.
auto_exclude += Agnes, Aizul, Arachne, Asterion, Bai Suzhen, Blork, Boris, Crazy Yiuf, Donald, Dowan
auto_exclude += Duvessa, Edmund, Erica, Erolcha, Eustachio, Fannar, Frances, Frederick, Gastronok, Grinder
auto_exclude += Grum, Harold, Ijyb, Jessica, Jorgrun, Joseph, Kirke, Louise, Mara
auto_exclude += Maurice, Menkaure, Mennas, Natasha, Nergalle, Nessos, Nikola, Pikel
auto_exclude += Polyphemus, Prince Ribbit, Psyche, Robin, Roxanne, Saint Roka, Sigmund, Snorg
auto_exclude += Sojobo, Sonja, Terence, Urug, Xtahua, hog, slave
wall_jump_prompt = true
# 3-g : Command Enhancements
# --------------------------
sort_menus = true
equip_unequip = true
easy_confirm = all
allow_self_target = prompt
autofight_stop = 60
autofight_throw = false
autofight_fire_stop = true
autofight_caught = true
# 3-h : Messages and Display Enhancements
-----------------------------------------
#hp_warning = 25 -- Damage Calc overrides these
#mp_warning = 25 -- Damage Calc overrides these
hp_colour = 100:green, 99:lightgrey, 75:yellow, 50:lightred, 25:red
mp_colour = 100:green, 99:lightgrey, 75:yellow, 50:lightred, 25:red
stat_colour = 3:red, 7:lightred
show_more = false
small_more = true
{
----------------------------
---- Begin load_message ----
----------------------------
function control(c)
return string.char(string.byte(c) - string.byte('a') + 1)
end
-- See README.md for documentation.
message_color = "white"
-- Wrapper of crawl.mpr() that prints text in white by default.
if not mpr then
mpr = function (msg, color)
if not color then
color = "white"
end
crawl.mpr("<" .. color .. ">" .. msg .. "" .. color .. ">")
end
end
function save_with_message()
if you.turns() == 0 then
crawl.sendkeys("S")
return
end
crawl.formatted_mpr("Save game and exit?", "prompt")
local res = crawl.getch()
if not (string.char(res) == "y" or string.char(res) == "Y") then
crawl.formatted_mpr("Okay, then.", "prompt")
return
end
crawl.formatted_mpr("Leave a message: ", "prompt")
local res = crawl.c_input_line()
c_persist.message = res
crawl.sendkeys(control("s"))
end
function load_message()
if c_persist.message and c_persist.message ~= "nil"
and c_persist.message ~= "" then
mpr("MESSAGE: " .. c_persist.message, message_color)
c_persist.message = nil
end
end
-----------------------------------
---- End leave message on save ----
-----------------------------------
}
###################
# Message colours #
###################
$inedible := darkgrey
$evil := red
$preferred := yellow
$rot-inducing := lightred
$mutagenic := magenta
$dangerous := magenta
$poisonous := lightgreen
$contaminated := brown
### standard colours to be used for message highlighting
$danger := lightred
$warning := yellow
$boring := darkgrey
$item_dmg := $danger
msc := message_colour
msc =
menu := menu_colour
menu =
# Multi-turn
channel.multiturn = mute
# Allies
msc += mute:returns to your side
msc += mute:a demon appears
msc += mute:puff of smoke
msc += mute:carefully avoids
msc += mute:is recalled
msc += mute:wall.*burn.*your
msc += mute:dissolves? into (sparkling lights|shadows)
msc += mute:crumbles away
msc += mute:you swap places
msc += mute:your.*(looks stronger|shudders|resists)
msc += mute:(stumbles backwards|holds.*ground)
msc += mute:(something|your).*(misses|does no damage)
msc += mute:your.*(blinks|safely over|gestures)
msc += mute:(phases out.*|misses) (your|something).*
msc += mute:your.*but does no damage
msc += mute:your.*(picks up|drops)
msc += mute:your.*basks in the mutagenic energy
msc += mute:you.*(struggles|tears|pulls away).*(web|net)
msc += mute:constricts?.*no damage
message_colour ^= mute:Your.*(bites|misses|hits|claws|gores)
message_colour ^= mute:coagulate
message_colour ^= mute:smell something rotten
message_colour ^= mute:yum
message_colour ^= mute:have rotted away
message_colour ^= mute:plant is engulfed
# Prayer
channel.pray += mute
# Jiyva
: if you.god() == "Jiyva" then
msc += mute:slurping|squelching
msc += mute:splits in two
msc += mute:You feel.*(less hungry|power returning|better)
: end
# Interface
msc += mute:Cast which spell\? \(
msc += mute:^Casting.*
msc += mute:Confirm with \. or Enter, or press \? or \* to list all spells\.
msc += mute:Press\: \? - help, Shift-Dir - straight line, f - you
msc += mute:for a list of commands and other information
msc += mute:melds.*
msc += mute:Switching to.*
msc += mute:Switching back.*
# Other
msc += mute:This raw flesh tastes terrible
msc += mute:melds into your body
msc += mute:begins to bleed from.*wounds
msc += mute:writhes in agony as.*flesh
msc += mute:An air elemental.*itself.*the air
msc += mute:You feel a.*surge of power
msc += mute:Your legs become a tail as you enter the water
msc += mute:You cannot train any new skill
# Default colours
msc += $danger:drains you
msc += $danger:feel drained
msc += $danger:strangely unstable
msc += $danger:curare-tipped.*hits you
msc += $danger:Space warps.* around you
msc += $danger:Space bends around you
msc += $danger:sense of stasis
msc += $danger:clumsily bash
msc += $danger:goes berserk
msc += $danger:Forgetting.* will destroy the book
msc += $danger:The blast of calcifying dust hits you
msc += $danger:You are engulfed in calcifying dust
msc += $danger:is moving more slowly
#msc += $danger:^Something .* you
msc += $danger:You block its attack
msc += $danger:constricts you
msc += $danger:you convulse
msc += $danger:You feel a build-up of mutagenic energy
msc += $danger:place you under penance
msc += $item_dmg:acid corrodes
msc += $item_dmg:catch(es)? fire
msc += $item_dmg:freezes? and shatters?
msc += $item_dmg:covered with spores
msc += $item_dmg:rots? away
msc += $warning:ticking.*clock
msc += $warning:dying ticks
msc += $warning:distant snort
msc += $warning:odd grinding sound
msc += $warning:creaking of ancient gears
msc += $warning:floor suddenly vibrates
msc += $warning:a sudden draft
msc += $warning:coins.*counted
msc += $warning:tolling.*bell
msc += $warning:roar of battle
msc += $warning:creaking.*portcullis
msc += $warning:portcullis is probably
msc += $warning:wave of frost
msc += $warning:crackling.*melting
msc += $warning:hiss.*sand
msc += $warning:sound.*rushing water
msc += $warning:rusting.*drain
msc += $warning:drain falling apart
msc += $warning:oppressive heat
msc += $warning:rumble.*avalanche of rocks
msc += $warning:crackle.*arcane power
msc += $warning:crackle.*magical portal
msc += $warning:fails to return
msc += $warning:no longer ripe
msc += $boring:You start (resting|waiting)
msc += $boring:Unknown command
msc += $boring:but (do no|doesn't do any) damage
msc += $boring:(prevent|prevents) you from hitting
menu += inventory:white:\w \+\s
menu += inventory:white:\w \#\s
menu += darkgrey:(melded)
menu += darkgrey:.*useless_item.*
menu += red:.*evil_item.*
menu += lightred: cursed
menu += inventory:lightgreen:.*equipped.*
menu += lightmagenta:.*misc.*rune( of Zot)?
menu += lightmagenta:.*orb.*Zot
menu += white:.*artefact.*
menu += lightblue:^unidentified .*(potion|scroll|wand|jewellery).*
menu += lightblue:^unidentified .*weapon.*(runed|glowing)
menu += lightblue:^unidentified .*armour.*(runed|glowing)
menu += lightblue:^unidentified .*armour.*(embroidered|shiny|dyed)
menu += yellow:(heal wounds|teleport|hasting|haste|blinking|might|agility|fog|fear)
####################
### Menu options ###
####################
# Set Alias
menu := menu_colour
# Clear defaults
menu =
# Variables
$decent := white
$mp := lightcyan
$interface := cyan
$danger := lightred
$item_dmg := red
$warning := yellow
$boring := darkgrey
$negative := brown
$positive := green
$good := lightblue
$verypositive := lightgreen
$awesome := lightmagenta
menu += $boring:club
# General
menu += $boring:(melded)
menu += $boring:.*useless_item.*
menu += $item_dmg:.*evil_item.*
menu += $danger:[^n]cursed
menu += inventory:$danger:[^n]cursed
menu += inventory:$interface:.*equipped.*
menu += $decent:.*artefact.*
menu += $negative:shield of the gong
menu += $danger:.*artefact.* cursed
menu += $awesome:manual
menu += $warning:^unidentified .*(jewellery|potion|scroll|wand).*
menu += $good:^unidentified .*weapon.*(runed|glowing)
menu += $good:^unidentified .*armour.*(runed|glowing|embroidered)
menu += $good:^unidentified .*armour.*(shiny|dyed)
# Staves
menu += $positive:[^r]staff of
# Wands
menu += $boring:wand of (random effects)
menu += $decent:wand of (flame|paralysis|polymorph|disintegration|enslavement|iceblast)
menu += $good:wand of (acid|digging|scattershot)
# Scrolls
menu += $danger:scrolls? of torment
menu += $boring:scrolls? of (noise|random)
menu += $decent:scrolls? of (amnesia|holy word|identify|immolation|remove curse)
menu += $good:scrolls? of (fear|fog|silence|summoning|vulnerability)
menu += $positive:scrolls? of (brand|enchant|magic mapping)
menu += $verypositive:scrolls? of acquirement
menu += $awesome:scrolls? of (blinking|teleportation)
# Potions
menu += $danger:potions? of berserk
menu += magenta:potions? of mutation
menu += $decent:potions? of (flight|lignification|ambrosia)
menu += $good:potions? of (agility|brilliance|cancellation|invisibility|might|resistance)
menu += $positive:potions? of curing
menu += $mp:potions? of magic
menu += $verypositive:potions? of (haste|heal wounds)
menu += $awesome:potions? of experience
# Amulets
menu += $boring:amulet of (inaccuracy|harm)
menu += $good:amulet of (guardian spirit|the acrobat|the gourmand)
menu += $positive:amulet of (faith|rage|reflection|magic regeneration)
menu += $verypositive:amulet of (regeneration)
# Rings
menu += $negative:ring of (attention|teleportation)
menu += $negative:ring of \-.*(dexterity|evasion|intelligence|protection|slaying|strength)
menu += $warning:ring of (fire|ice|stealth)
menu += $decent:ring of flight
menu += $verypositive:ring of (.*slaying)
menu += $positive:ring of (poison resistance|protection from cold|protection from fire|protection from magic|see invisible|resist corrosion)
menu += $good:ring of (.*evasion|.*protection|magical power|wizardry)
#menu += $awesome:
# Misc items
menu += blue:inert
menu += $good:throwing net
menu += $good:fan of gales
menu += $good:lamp of fire
menu += $good:phial of floods
menu += $good:lightning rod
menu += $decent:box of beasts
menu += $decent:sack of spiders
menu += $decent:Horn of Geryon
menu += $mp:Staff of Wucad Mu
menu += $awesome:Figurine of a ziggurat
# Deck colouring
menu += $verypositive:deck of escape
menu += $positive:deck of summoning
menu += $danger:deck of destruction
-- To use this create a macro with the following function call in game
-- ===HDAtravel
-- This file can be included in your rc file with the following line:
-- include += HDAtravel.rc
# This still has plenty of bugs, submit them at:
# https://github.com/HilariousDeathArtist/DCSSConfigFile
# or find me on crawl.s-z.org
##################
# HDAtravel #
##################
-- Rests up to at least 75% hp (or missing at least 30hp) and 50% mp (or missing at least 20mp)
-- Channels MP if you worship Sif
-- Casts regen out of combat
-- TODO: Fix up for Vampire, Ghoul, and possibly Spriggan/Mummy
: function HDAtravel()
: local mp, max_mp = you.mp()
: local hp, max_hp = you.hp()
: local first_monster = next(getMonsterList())
: local already_checked = (no_results() or dont_know_how_to_get_there())
: local you_are_barbed = (have_barbs() and not removed_barbs())
: local is_safe = (first_monster == nil)
: local missing_mp = (mp < max_mp)
: local missing_hp = (hp < max_hp)
: local need_to_recover = should_rest(hp, mp, max_hp, max_mp)
: local you_are_sif = string.find(you.god(), "Sif")
: local you_are_yred = string.find(you.god(), "Yred")
: local you_are_zin = string.find(you.god(), "Zin")
: local you_are_good = string.find(you.god(), "Shining") or string.find(you.god(), "Elyvilon") or you_are_zin
: local sacrifice_god = you_worship_sacrifice_god()
: local you_are_mummy = string.find(you.race(), "Mummy")
: local you_are_vampire = string.find(you.race(), "Vampire")
: local you_are_bloodless = you.hunger_name() == "bloodless"
: local you_are_ghoul = string.find(you.race(), "Ghoul")
: local you_are_bloodless = you.hunger_name() == "bloodless"
: local you_do_not_eat = string.find(you.race(), "Spriggan") or you_are_mummy
: local lichform = string.find(you.transform(), "lich")
: local bladehands = string.find(you.transform(), "blade")
: local dragonform = string.find(you.transform(), "dragon")
: local melded_weapon = (bladehands or dragonform)
: local you_are_regen = you.regenerating()
: local you_know_sublimation = known_spells["Sublimation of Blood"] and (spells.fail("Sublimation of Blood") < 20) and (mp>3)
: local you_know_animate_skeleton = known_spells["Animate Skeleton"] and (spells.fail("Animate Skeleton") < 20) and (mp>1)
: local you_know_animate_dead = known_spells["Animate Dead"] and (spells.fail("Animate Dead") < 20) and (mp>4)
: local distort_weapon = is_weapon("distort")
: local vamp_weapon = is_weapon("vamp")
: local have_a_weapon = weapon_in_inventory()
: local ghoul_missing_hp = you_are_ghoul and ((hp < (max_hp - 5)) or you.rot() > 0)
: local have_potion_of_blood = is_in_inventory("potion of blood") or is_in_inventory("potions of blood")
: local should_channel_mp = ((max_mp - mp) > 5)
: local can_cast_regen = known_spells["Regeneration"] and (mp>3) and (spells.fail("Regeneration") < 20)
: local you_have_regen_ring = is_in_inventory("regeneration")
: local regen_ring_letter = find_item_letter("regeneration")
: local regen_ring_is_equipped = is_ring("regeneration")
: local should_regen_hp = (not (you_are_good or you_are_regen or lichform)) and ((hp/max_hp) < 0.80) and (you_have_regen_ring or can_cast_regen) and not you_are_bloodless
: local should_sublimate = (not (you_are_good or lichform)) and ((mp/max_mp) < 0.60) and you_know_sublimation and mp>2 and ((hp/max_hp) > 0.95)
: local should_animate_skeleton = (not you_are_good) and you_know_animate_skeleton and mp>1 and (not can_not_animate())
: local should_animate_dead = (not you_are_good) and you_know_animate_dead and mp>4 and (not can_not_animate())
: --crawl.mpr(string.format("you.piety_rank() is: %s", you.piety_rank()))
: --crawl.mpr(string.format("ghoul_missing_hp is: %s", ghoul_missing_hp and "True" or "False"))
: --crawl.mpr(string.format("can_cast_regen is: %s", can_cast_regen and "True" or "False"))
: --crawl.mpr(string.format("you_are_not_ghoul is: %s", you_are_not_ghoul and "True" or "False"))
: if (is_safe) then
: if you_are_barbed then
: rest()
: elseif should_sublimate and not (you_are_vampire or lichform) then
: crawl.mpr("Autocasting Sublimation of Blood.")
: sendkeys('zm')
: --elseif should_channel_mp and you_are_sif and (you.piety_rank() > 0) then
: --crawl.mpr("Autochanneling using Sif.")
: --sendkeys('aa')
: elseif should_regen_hp and can_cast_regen then
: crawl.mpr("Autocasting Regen.")
: --This assumes casting regen is bound to zz
: sendkeys('zz')
: elseif (weapon_in_slot_a() or uses_unarmed()) and (no_weapon() and have_a_weapon) then
: if uses_unarmed() then
: crawl.mpr("Switching to unarmed.")
: sendkeys('w-')
: else
: crawl.mpr("Switching to main weapon.")
: sendkeys('wa')
: end
: elseif you_are_yred and (you.piety_rank() >= 3) and (item_in_view("corpse") or item_in_view("skeleton") or on_corpses()) and not recently_mass_animated() then
: crawl.mpr("Autocasting Mass Animate Remains.")
: sendkeys('aa')
: elseif (not sacrifice_god) and (item_in_view("corpse") or item_in_view("skeleton") or on_corpses()) and should_animate_dead and not already_animated() then
: crawl.mpr("Autocasting Animate Dead.")
: sendkeys('zA')
: elseif (not sacrifice_god) and on_corpses() and should_animate_skeleton then
: crawl.mpr("Autocasting Animate Skeleton.")
: sendkeys('zA')
: elseif you_are_yred and (you.piety_rank() >= 1) and on_corpses() then
: crawl.mpr("Autocasting Animate Remains.")
: sendkeys('aa')
: --This does the general travelling
: else
: autoexplore()
: end
: else
: --This will provide the "foo is nearby" message
: autoexplore()
: end
: end
<
function sendkeys(command)
crawl.flush_input()
crawl.sendkeys(command)
coroutine.yield(true)
crawl.flush_input()
end
function should_rest(hp, mp, max_hp, max_mp)
local you_are_mummy = string.find(you.race(), "Mummy")
local you_are_deep_dwarf = string.find(you.race(), "Deep Dwarf")
return (mp < (max_mp*0.80) or ((max_mp-mp) > 20)
or ((hp < (max_hp*0.80)) or ((max_hp-hp) > 30)
and not you_are_deep_dwarf)
or you.slowed()
or you.poisoned()
or you.confused()
or you.exhausted()
or (((hp < max_hp) or (mp < max_mp)) and you_are_mummy))
end
function autoexplore()
sendkeys('o')
end
function have_barbs()
return string.find(crawl.messages(10), escape("The barbed spikes become lodged in your body"))
or string.find(crawl.messages(10), escape("The barbed spikes dig painfully into your body as you move"))
end
function already_animated()
return string.find(crawl.messages(20), escape("Autocasting Animate Dead"))
end
function removed_barbs()
return string.find(crawl.messages(10), escape("You carefully extract the manticore spikes from your body"))
or string.find(crawl.messages(10), escape("The manticore spikes snap loose"))
end
function no_results()
return string.find(crawl.messages(10), escape("Can't find anything matching that"))
or string.find(crawl.messages(10), escape("You may need something to eat soon"))
end
function dont_know_how_to_get_there()
return string.find(crawl.messages(10), escape("know how to get there"))
or string.find(crawl.messages(10), escape("Have to go through"))
end
function can_not_animate()
return string.find(crawl.messages(10), escape("There is nothing here that can be animated"))
end
function can_not_bottle()
return string.find(crawl.messages(10), escape("There isn't anything to bottle here"))
end
function recently_mass_animated()
return string.find(crawl.messages(10), escape("Autocasting Mass Animate Remains"))
end
function can_not_butcher()
return string.find(crawl.messages(10), escape("anything suitable to butcher here"))
or string.find(crawl.messages(10), escape("isn't edible"))
end
function can_not_eat_that()
return string.find(crawl.messages(10), escape("You can't eat that"))
--These strings don't seem to show up in messages
--or string.find(crawl.messages(10), escape("Not only inedible but also greatly harmful"))
--or string.find(crawl.messages(10), escape("It is caustic"))
end
function rest()
sendkeys('5')
end
function is_in_inventory(str)
for it in inventory() do
if string.find(it.name(), str) then
return true
end
end
return false
end
function weapon_in_inventory()
for it in inventory() do
if string.find(it.class(true), "weapon") then
return true
end
end
return false
end
function weapon_in_slot_a()
local it = items.inslot(0)
if it then
return string.find(it.class(true), "weapon")
else
return false
end
end
function find_item_letter(str)
for i = 0,51 do
it = items.inslot(i)
if it then
if string.find(it.name(), str) then
return items.index_to_letter(i)
end
end
end
return false
end
function you_worship_sacrifice_god()
return string.find(you.god(), "Trog")
--or string.find(you.god(), "Oka")
--or string.find(you.god(), "Makhleb")
or string.find(you.god(), "Beogh")
or string.find(you.god(), "Lugonu")
--or string.find(you.god(), "Nemelex")
end
function you_are_not_ghoul()
return not (string.find(you.race(), "Ghoul"))
end
function you_are_not_troll()
return not (string.find(you.race(), "Troll"))
end
function you_are_not_felid()
return not (string.find(you.race(), "Felid"))
end
function you_are_not_octopode()
return not (string.find(you.race(), "Octopode"))
end
function inventory()
return iter.invent_iterator:new(items.inventory())
end
function floor_items()
return iter.invent_iterator:new(you.floor_items())
end
function no_weapon()
return (items.equipped_at("Weapon") == nil) and not uses_unarmed()
end
function uses_unarmed()
return not you_are_not_ghoul()
or not you_are_not_troll()
or not you_are_not_felid()
or (you.skill("Unarmed Combat") >= 3)
end
function is_weapon(str)
local weapon = items.equipped_at("Weapon")
if weapon then
return string.find(weapon.name(), str)
else
return false
end
end
function is_ring(str)
local ring1 = items.equipped_at("Left Ring")
local ring2 = items.equipped_at("Right Ring")
if ring1 and ring2 then
return string.find(ring1.name(), str) or string.find(ring2.name(), str)
elseif ring1 then
return string.find(ring1.name(), str)
elseif ring2 then
return string.find(ring2.name(), str)
else
return false
end
end
function item_in_view(str)
local x,y
for x = -8,8 do
for y = -8,8 do
if not (x == 0 and y == 0) then
local pile = items.get_items_at(x,y)
if pile ~= nil then
for it in iter.invent_iterator:new(pile) do
if string.find(it.name(), str) and you.see_cell_no_trans(x,y) then
return true
end
end
end
end
end
end
return false
end
-- Returns a table where the key is the monster description and value is the total number of that mob in your vision
function getMonsterList()
local monsters = {}
for x = -7,7 do
for y = -7,7 do
m = monster.get_monster_at(x, y)
local attitude_hostile = 0
if m and (m:attitude() == attitude_hostile) and not (m:is_firewood()) then
desc = m:desc()
if (monsters[desc] == nil) then
monsters[desc] = 1
else
monsters[desc] = monsters[desc] + 1
end
end
end
end
return monsters
end
--Escapes the special characters in a string for pattern matching
function escape(str)
--Escapes parens and dash "()-"
local escaped = str:gsub('[%(%)%-]','%\%1')
--Removes any coloration parts of the string
return (escaped:gsub('<[^<]*>',''))
end
local function init_spells()
local spell_list = {}
for _, spell_name in ipairs(you.spells()) do
spell_list[spell_name] = true
end
return spell_list
end
known_spells = init_spells()
>
###############
# 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")) then
max_hp_decreased = true
elseif (current_form:find("dragon") or
current_form:find("statue") or
current_form:find("tree") or
current_form:find("ice")) 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
>
#############
# Interface #
#############
allow_self_target = no
easy_confirm = safe
# auto_butcher = true
: if you.race() == "Ghoul" then
auto_butcher = true
: end
confirm_butcher = never
auto_butcher=engorged
autofight_throw_nomove = true
autofight_caught = true
hp_warning = 50
hp_colour = 100:green, 99:lightgray, 75:yellow, 50:lightred, 25:red
mp_colour = 100:green, 99:lightgray, 75:yellow, 50:lightred, 25:red
stat_colour = 3:red, 7:lightred
show_inventory_weights = true
default_manual_training = true
small_more = true
easy_quit_item_prompts = true
show_gold_turns = true
show_game_turns = true
fire_order = launcher, rock, return, javelin,
fire_order += tomahawk, dart, stone, net
fire_order += inscribed
enable_recast_spell = false
# Spellcasting spam reduction by monqy
{
local function generic_cast_spell(cmd)
crawl.mpr('Cast which spell?')
crawl.flush_prev_message()
crawl.process_keys(cmd)
end
function cast_spell()
generic_cast_spell('z')
end
function force_cast_spell()
generic_cast_spell('Z')
end
}
##############
# Autopickup #
##############
autopickup = $?!:"/%|\
ae := autopickup_exceptions
ae += useless_item
ae += evil_item
ae += (amulet|staff|tome) of
ae += scrolls? of (torment|noise|amnesia|vulnerability)
ae += potions? of (flight)
ae += potions? of (degeneration)
ae += wand of (random effects|flame|polymorph)
#ae += royal jell.*
ae += staff of .*
ae += ring of (flight|fire|ice)
ae += ring of (strength|intelligence|dexterity|protection from .*)
ae += ring of (positive energy|stealth|loudness)
ae += ring of (see invisible|magical power|wizardry)
ae += <(phial|lamp|fan) of
ae += 2) or armourname:find("dragon") or armourname:find("troll") then
return it.artefact
else
return it.artefact or it.branded or it.ego
end
end
return true
end
if (sub_type == "shield") then
if equipped_item then
if equipped_item.artefact or equipped_item.branded or equipped_item.ego or (equipped_item.plus > 2) then
return it.artefact or it.branded or it.ego
else
return true
end
else
return it.artefact or it.branded or it.ego
end
end
end
end)
}
####################
# Autoinscriptions #
####################
show_god_gift = unident
ai := autoinscribe
ai += (bad|dangerous)_item.*potion:!q
ai += (bad|dangerous)_item.*scroll:!r
ai += potions? of berserk rage:!q
ai += scrolls? of silence:!r
ai += of faith:!P
ai += atropa-tipped darts:Blind-Conf
ai += datura-tipped darts:Frenzy
ai += manual of:!d
ai += staff of (Wucad Mu|energy|wizardry|power|conjuration|summoning):!a
ai += (large rock|throwing net|curare|of dispersal):=f
# Convenient shortcuts
ai += curing:@q1
ai += potions? of heal wounds:@q2
ai += potions? of haste:@q3
ai += scrolls? of teleportation:@r4
ai += identify:@r1
ai += remove curse:@r2
#ai += blowgun:@w1
ai += ( ration):@e1
: if you.race() == "Spriggan" then
autoinscribe += porridge:!q
:end
: if you.god() == "Fedhas" then
autoinscribe += fruit:!e
: end
#########
# Notes ##############################################################
#########
user_note_prefix=--
dump_message_count = 50
dump_order = header,hiscore,stats,misc,mutations,skills,spells,inventory
dump_order += messages,screenshot,monlist,kills,notes,vaults,action_counts
dump_order += skill_gains
ood_interesting = 6
note_hp_percent = 40
note_all_spells = true
note_all_skill_levels = true
note_messages += protects you from harm
note_messages += You fall through a shaft
dump_item_origins = artefacts, rods, ego_arm, ego_weap
note_chat_messages = true
note_dgl_messages = true
#################
# More messages #############################################
#################
more := force_more_message
more =
# Important features
: if you.god() == "Ashenzari" then
more += You have a vision of.*gates?
: else
more += interdimensional caravan
more += distant snort
: end
more += You feel a terrible weight on your shoulders
more += a bailey
more += wave of frost
more += Ru believes you are ready to make a new sacrifice.
more += hiss of flowing sand
more += sound of rushing water
more += heat about you
more += crackle.*arcane power
more += Found a gateway leading out of the Abyss
more += Found a gateway leading deeper into the Abyss
more += Found .* abyssal rune of Zot
more += The mighty Pandemonium lord .* resides here
# Interrupts
more += You don't.* that spell
more += You fail to use your ability
more += You miscast
more += You can't (read|drink|do) that
more += You are too berserk
more += That item cannot be evoked
more += This wand has no charges
more += You are held in a net
more += You have disarmed
more += You don't have any such object
more += do not work when you're silenced
more += You can't unwield
more += enough magic points
more += You feel your control is inadequate
# Bad things
more += Your surroundings flicker
more += sense of stasis
more += Your amulet of stasis
more += You cannot teleport right now
more += The writing blurs in front of your eyes
more += You fall through a shaft
more += You fall into a shaft
more += A huge blade swings out and slices into you
more += (blundered into a|invokes the power of) Zot
more += Ouch! That really hurt!
more += dispelling energy hits you
more += You convulse
more += You are blasted by holy energy!
more += You are (blasted|electrocuted)!
more += You are( more)? (confused)
more += flesh start
more += (starving|devoid of blood)
more += god:(sends|finds|silent|anger)
more += lose consciousness
more += You are too injured to fight blindly
more += Green shoots are pushing up through the earth
more += calcifying dust hits
more += Space warps horribly around you
more += hits you.*distortion
more += wielding.*distortion
more += Space warps.*around you
more += Space bends around you\.
more += watched by something
more += The dungeon rumbles around
more += The air twists around and violently strikes you in flight
more += flickers and vanishes
# Hell effects
more += hell_effect:
# Expiring effects
more += You feel yourself slow down
more += less insulated
more += You are starting to lose your buoyancy
more += You lose control over your flight
more += Your hearing returns
more += Your transformation is almost over
more += You have a feeling this form
more += You feel yourself come back to life
more += uncertain
more += time is quickly running out
more += life is in your own hands
more += is no longer charmed
more += shroud falls apart
more += You start to feel a little slower
# Others
more += You have reached level
more += You have finished your manual of
more += Your scales start
more += You feel monstrous
more += Jiyva alters your body
: if you.god() == "Xom" then
more += god:
: end
more += Deactivating autopickup
more += oklob.*come
more += (Agnes|Aizul|Antaeus|Asmodeus|Asterion|Azrael|Blork the orc|Boris|Cerebov|Crazy Yiuf|Dispater|Dissolution|Donald|Dowan|Duvessa|Edmund|the Enchantress|Ereshkigal|Erica|Erolcha|Eustachio|Fannar|Frances|Frederick|Gastronok|Geryon|Gloorx Vloq|Grinder|Grum|Harold|Ignacio|Ijyb|Ilsuiw|Jessica|Jorgrun|Jory|Joseph|Josephine|Khufu|Kirke|Lamia|the Lernaean hydra|Lom Lobon|Louise|Mara|Margery|Maud|Maurice|Menkaure|Mennas|Mnoleg|Murray|Natasha|Nergalle|Nessos|Nikola|Norris|Pikel|Plog|Polyphemus|Prince Ribbit|Psyche|Purgy|Robin|Roxanne|the royal jelly|Rupert|Saint Roka|the Serpent of Hell|Sigmund|Snorg|Sonja|Terence|Tiamat|Urug|Vashnia|Wiglaf|Xtahua|*ghost of).*into view
###############
# Spell/Abilities Slots #
###############
# Move off `aa` so we don't miss-trigger it.
ability_slot += Berserk:k
ability_slot += Fly|flight:lF
ability_slot += Stop Flying:L
ability_slot += Breathe:t
ability_slot += Blink:IB
ability_slot += Invisibility:iv
# Weak conjurations and damage
spell_slot += freeze:asd
spell_slot += magic dart:asd
spell_slot += flame tongue:asd
spell_slot += pain:asd
spell_slot += shock:asd
spell_slot += sandblast:asd
spell_slot += sting:asd
spell_slot += throw frost:asd
spell_slot += throw flame:asd
spell_slot += searing ray:asd
spell_slot += conjure flame:cdf
spell_slot += mephitic cloud:mdf
spell_slot += vampiric draining:asdf
spell_slot += static discharge:dasf
#strong conjurations and damage
spell_slot += force bolt:qer
spell_slot += dazzling spray:sdq
spell_slot += fulminant prism:wer
spell_slot += dispel undead:er
spell_slot += stone arrow:qer
spell_slot += iskenderun's mystic blast:qer
spell_slot += sticky flame:qer
spell_slot += throw icicle:qer
spell_slot += agony:er
spell_slot += lee's rapid deconstruction:wer
spell_slot += iron shot:qer
spell_slot += poison arrow:qer
spell_slot += orb of destruction:er
spell_slot += lehudib's crystal spear:qer
spell_slot += chain lightning:wer
spell_slot += fire storm:QWER
spell_slot += glaciate:QWER
spell_slot += shatter:QWER
spell_slot += tornado:QWER
spell_slot += poisonous cloud:wer
spell_slot += freezing cloud:wer
spell_slot += conjure ball lightning:QWER
spell_slot += fireball:wer
spell_slot += airstrike:qer
spell_slot += bolt:qwer
spell_slot += Singularity:werQWER
# full AOE spells
spell_slot += ozocubu's refrigeration:QWER
spell_slot += aura of abjuration:ASDFgtGT
spell_slot += corpse rot:ASDFgtGT
spell_slot += forceful dismissal:ASDFgtGT
spell_slot += ignite poison:ASDFgtGT
spell_slot += metabolic englaciation:ASDFgtGT
spell_slot += olgreb's toxic radiance:ASDFgtGT
spell_slot += alistair's intoxication:ASDFgtGT
#summoning
spell_slot += summon small mammals:asdfASDF
spell_slot += animate skeleton:kasdfASDF
spell_slot += summon butterflies:asdfASDF
spell_slot += sticks to snakes:asdfASDF
spell_slot += call imp:asdfASDF
spell_slot += call canine familiar:casdfASDF
spell_slot += animate dead:asdfASDF
spell_slot += summon guardian golem:asdfASDF
spell_slot += summon ice beast:asdfASDF
spell_slot += summon scorpions:asdfASDF
spell_slot += summon elemental:asdfASDF
spell_slot += summon lightning spire:lasdfASDF
spell_slot += shadow creatures:asdfASDF
spell_slot += summon forest:asdfASDF
spell_slot += tukima's dance:asdfASDF
spell_slot += twisted resurrection:asdfASDF
spell_slot += summon demon:asdfASDF
spell_slot += monstrous menagerie:asdfASDF
spell_slot += death channel:asdfASDF
spell_slot += simulacrum:asdfASDF
spell_slot += summon hydra:QWER
spell_slot += haunt:QWER
spell_slot += spellforged servitor:asdfASDF
spell_slot += summon greater demon:asdfASDF
spell_slot += summon horrible things:QWER
spell_slot += malign gateway:QWER
spell_slot += dragon's call:QWER
spell_slot += abjuration:sdf
spell_slot += recall:sdf
#transformations and UC
spell_slot += beastly appendage:asdf
spell_slot += spider form:qwer
spell_slot += ice form:qwer
spell_slot += blade hands:qwer
spell_slot += statue form:QWER
spell_slot += necromutation:QWER
spell_slot += dragon form:QWER
spell_slot += confusing touch:sdf
#charms - superspammy
spell_slot += shroud of golubria:zxcvZXCV
spell_slot += ozocubu's armour:zxcvZXCV
spell_slot += stoneskin:zxcvZXCV
spell_slot += phase shift:zxcvZXCV
spell_slot += Cigotuvi's Embrace:zxcvZXCV
spell_slot += repel missiles:zxcvZXCV
spell_slot += deflect missiles:zxcvZXCV
spell_slot += regeneration:zxcvZXCV
#charms - misc
spell_slot += infusion:asdf
spell_slot += iskenderun's battlesphere:asdfgt
spell_slot += spectral weapon:asdfgt
spell_slot += sublimation of blood:vVgtGT
spell_slot += song of slaying:sdfgt
spell_slot += control teleport:sdfgt
spell_slot += sure blade:sdfgt
spell_slot += condensation shield:sdfgt
#charms - brands
spell_slot += lethal infusion:asdfgt
spell_slot += fire brand:asdfgt
spell_slot += freezing aura:asdfgt
spell_slot += poison weapon:asdfgt
spell_slot += warp weapon:asdfgt
spell_slot += excruciating wounds:asdfgt
#charms - dangerous and should not be accidentally cast
spell_slot += ring of flames:ZXCV
spell_slot += haste:ZXCV
spell_slot += invisibility:ZXCV
spell_slot += silence:gGtTVCXZ
spell_slot += flight:gGtTVCXZ
spell_slot += swiftness:hgGtTVCXZ
spell_slot += invisibility:gtGTVCXZ
#hexes
spell_slot += ensorcelled hibernation:esd
spell_slot += confuse:cwsd
spell_slot += corona:adf
spell_slot += slow:sdf
spell_slot += Gell's Gravitas:qwsdf
spell_slot += petrify:qwsdf
spell_slot += teleport other:qwsdf
spell_slot += inner flame:qwsdf
spell_slot += leda's liquefaction:ASDF
spell_slot += mass confusion:QWER
spell_slot += discord:QWER
#utility and escape
spell_slot += portal projectile:AgtGTSDF
spell_slot += passwall:gtGT
spell_slot += passage of golubria:gdf
spell_slot += controlled blink:B
spell_slot += blink:b
spell_slot += disjunction:gtGT
spell_slot += dispersal:gtGT
spell_slot += apportation:psdfASDF
spell_slot += cause fear:sdfASDF
spell_slot += darkness:gtGT
spell_slot += control undead:sdfASDF
spell_slot += cure poison:sdfASDF
spell_slot += delayed fireball:DFgtGT
spell_slot += borgnjor's revivification:UIOP
spell_slot += death's door:UIOP
# Use defaults that don't intersect other assignments
spell_slot += .*:tgbTGByhnYHNujmUJMikIKolOLpP
##################
### Item slots ###
##################
## In order of letter used.
item_slot += amulet of harm : A
item_slot += amulet of rage : B
item_slot += ring of (ice|protection from cold) : Cc
item_slot += amulet of (warding|dismissal) : D
item_slot += \+[0-9]+ ring of evasion : Ee
item_slot += ring of .*fire : Ff
item_slot += amulet of regeneration : g
item_slot += amulet of guardian spirit : G
item_slot += amulet of faith : H
item_slot += \+[0-9]+ ring of intelligence : Ii
item_slot += ring of flight : L
item_slot += ring of protection from magic : Mm
item_slot += ring of positive energy : Nn
item_slot += \+[0-9]+ ring of protection : Oo
item_slot += ring of poison resistance : P
item_slot += ring of stealth : Qq
item_slot += ring of resist corrosion : R
item_slot += amulet of mana regeneration : r
item_slot += \+[0-9]+ ring of strength : Ss
item_slot += ring of teleportation : t
item_slot += amulet of gourmand : U
item_slot += ring of see invisible : v
item_slot += ring of magical power : Ww
item_slot += \+[0-9]+ ring of dexterity : Xx
item_slot += \+[0-9]+ ring of slaying : Yy
item_slot += ring of wizardry : Zz
: function autofight_minor_destruction()
: local hp, max_hp = you.hp()
: local know_minor_destruction = known_ability["Minor Destruction"]
: local can_autofight = hp > max_hp * 0.70
: --crawl.mpr("HP ".. hp .. "/" .. max_hp .. " .")
: --crawl.mpr(string.format("know_minor_destruction is: %s", know_minor_destruction and "True" or "False"))
: if can_autofight and know_minor_destruction then -- If we have more than 60% hp and know the ability minor destruction
: --crawl.mpr("Casting minor destruction")
: sendkeys('aaf'); -- autocast minor destruction
: elseif can_autofight then
: --crawl.mpr("Normal autofight")
: sendkeys('\t'); -- normal autofight
: else
: crawl.mpr("Dangerous to autofight")
: end
: end
<
local function init_ability()
local ability_list = {}
for _, ability_name in ipairs(you.abilities()) do
ability_list[ability_name] = true
end
return ability_list
end
known_ability = init_ability()
>