# TEAMNAME I Think You're an Unrand 😳 # TEAMMEMBERS poseidemic turntechcatfish ISplatSpriggans ################# ### Interface ### ################# explore_auto_rest_status += -Berserk tile_misc_anim = true tile_realtime_anim = true # wow that's bad! # tile_water_anim = true tile_player_tile = playermons # tile_player_tile=tile:todo # tile_player_tile = mons:angel # Keep consumables seperate show_paged_inventory = true # disable everything we can about mouse input. Doesn't work as well offline sadly. tile_tooltip_ms = 0 mouse_input = false tile_web_mouse_control = false # depends on my colour scheme but this is better about half the time use_terminal_default_colours=true # show prompts in the message log rather than an overlay box prompt_menu = false more_gem_info = true msg_max_height = 20 show_blood = false # big chonky tiles, enable only 1 # tile_cell_pixels = 64 # tile_viewport_scale = 2 # game_scale = 2 # tile_full_screen = true # Local Tiles fonts. Default VeraMono.ttf # tile_font_crt_file = Monocraft.ttf # tile_font_stat_file = Monocraft.ttf # tile_font_msg_file = Monocraft.ttf # tile_font_tip_file = Monocraft.ttf # Not mono by default? Probably leave it as it # tile_font_lbl_file = Vera.ttf # Web Tiles fonts #tile_font_crt_family = Monocraft #tile_font_stat_family = Monocraft #tile_font_msg_family = Monocraft #tile_font_lbl_family = Monocraft # auto training? In the year of our dungeon ? default_manual_training = true # unequip items the same way you equip them equip_unequip = true # prompt for swap even if wearing 2 of the same ring # I build a muscle memory and my fingers expect more keys for the action jewellery_prompt = true sort_menus = true:equipped,identified,basename,art,ego,glowing,qualname,charged,slot ability_menu = true spell_menu = true autofight_stop = 69 autofight_caught = true ##################### ### Sound Support ### ##################### # For use with DWEM. CNC, CRG, and CBRG servers have this built in. # To get sounds on other servers you need to install tampermonkey or greasemonkey and the DWEM script. # https://github.com/refracta/dcss-webtiles-extension-module/tree/main/modules/sound-support # Recommended settings sounds_on = true # I only use the background music, the effects aren't to my taste sound_pack += https://sound-packs.nemelex.cards/DCSS-UST/v1.0.1.zip # sound_pack += https://osp.nemelex.cards/build/latest.zip:["init.txt"] one_SDL_sound_channel = true sound_fade_time = 0.5 -- why is everything so damn loud? bgm_volume = 0.01 sound_volume = 0.01 ######################### ### Keybinds & Macros ### ######################### # Don't use quiver with autofight_nomove, which we bind to shift+tab # Now you can hold shift+tab to melee without moving or using quiver # When a gap is created instead of stepping into the gap, the command does nothing # By default shift+tab fires your quiver but p also does this by default so it's fine to rebind # If you want to continue using shift+tab for your quiver, bindkey to something else. autofight_nomove_fires = false bindkey = [\{-233}] CMD_AUTOFIGHT_NOMOVE bindkey = [~] CMD_LUA_CONSOLE # bind - to change display mode lua (local tiles only) macros += M - ===cycle_display_mode # bind < and > to left and right arrow keys, in the menu context only macros += K4 > \{-251} macros += K4 < \{-252} # Give us info about unid'd consumables when we use stairs # Lua functions must be defined (check the lua section) macros += M < ===id_warn_up macros += M > ===id_warn_down # shift S waits but only if we are channelling a spell # Lua functions must be defined (check the lua section) macros += M S ===safe_channel ############################ ### Travel & Exploration ### ############################ # shift-walking only to tiles you can see longwalk_range = visible rest_wait_both = true travel_delay = -1 explore_delay = -1 rest_delay = -1 show_travel_trail = true explore_stop += greedy_items ################## ### Autopickup ### ################## autopickup_search = true # In addition to the defaults, autopickup staves, misc, ammo, talismans and baubles # note you can't use += with this option. autopickup = $?!+"/♦|(}% # Don't ever need a second stave, no longer works # autopickup_exceptions += staff of .* ################ ### Messages ### ################ show_newturn_mark = false channel.multiturn = mute msc := message_colour msc += mute:wall.*burn.*your msc += mute:you swap places msc += mute:your.*(struggles|tears|pulls away).*(web|net) msc += mute:your foxfire dissipates more := force_more_message # Interrupts more += You don't .* that spell more += You fail to use your ability more += You miscast.*(Clockwork Bee|Coupling|Searing Ray|Flame Wave) more += You cannot teleport right now # Bad things more += Your surroundings flicker more += A sentinel's mark forms upon you more += (blundered into a|invokes the power of) Zot more += enter a teleport trap more += Ouch! That really hurt! more += You are.*confused more += calcifying dust hits more += Space warps.*around you more += Space bends around you more += watched by something more += flickers and vanishes! more += is no longer charmed more += A malevolent force more += You.*as fragile as glass more += You are covered in liquid fire more += lethally more += hell_effect:v more += reforms as a # See poison_warn() more += You are seriously poisoned # There's a default force more for banes let's make them flash too flash_screen_message += befalls you\. # Expiring effects more += You feel yourself slow down # Notifications more += You have a vision of.*gates? more += The mighty Pandemonium lord .* resides here more += You have reached level more += You rejoin the land of the living more += You have finished (your manual|forgetting about) more += Your scales start more += You feel monstrous more += Jiyva alters your body : if you.god() == "Xom" then more += god: : end more += runelight more += wielding.*(distortion|electrocution) more += goes berserk # skyshark more += blood-rage # it's over force more. This is printed when we drop below a certain hp ratio. Lua at the end of the file. more += it's so over # I like to read procedurally generated fountain graffiti when I autoexplore over it more += graffiti # miscasts of channeled spells so I don't wait several turns like a fool :) more += miscast Maxwell's Capacitive Coupling more += miscast Flame Wave more += miscast Searing Ray monster_alert = uniques # unusual item enemies monster_alert += unusual # red tier enemies. # Some enemies are always red at any XL but duplicating matches doesn't hurt monster_alert += nasty monster_alert += pandemonium lord monster_alert += orb of fire, orb of winter, orb of entropy monster_alert += death cob, ancient lich, killer klown, dread lich, protean progenitor monster_alert += draconian shifter, draconian monk, draconian annihilator monster_alert += quicksilver dragon, purple draconian, monster_alert += wretched star, dream sheep, death drake monster_alert += air elemental monster_alert += deep elf master archer, deep elf sorcerer, deep elf demonologist, deep elf blademaster monster_alert += tormentor, curse toe, hell sentinel, hellion, tzitzimitl, ice fiend, monster_alert += shard shrike, caustic shrike, caustic shrike simulacrum, shard shrike simulacrum monster_alert += vampire knight monster_alert += sphinx, great orb of eyes monster_alert += flayed ghost, greater mummy, mummy priest monster_alert += merfolk avatar, merfolk siren, merfolk javelineer monster_alert += entropy weaver, torpor snail monster_alert += vault warden, vault sentinel, ironbound convoker, ironbound thunderhulk monster_alert += guardian serpent, salamander tyrant # this is case sensitive unusual_monster_items += Sniper unusual_monster_items += dark maul unusual_monster_items += sceptre of Torment # Highlight these brands but only until XL13 # we need vulnerable even for devious because the :13 part won't work without it unusual_monster_items += vulnerable:devious:13 unusual_monster_items += vulnerable:venom:13 unusual_monster_items += vulnerable:electrocution:13 stop := runrest_stop_message ignore := runrest_ignore_message # Note: this is checked when the character is loaded. Starting a CK should be fine # but if you worship xom mid-run you should save and reload to trigger this. :if you.god() == "Xom" then stop += god: :end ########################### ### Spell/Ability slots ### ########################### ability_slot += Fly|flight:lF ability_slot += Stop Flying:L ability_slot += Breathe:t ability_slot += Invisibility:iv ability_slot += Blink:IB ability_slot += Berserk:k ability_slot += Corrupt:C ability_slot += Enter the Abyss:E ability_slot += Light the Black Torch:L ability_slot += Hurl Torchlight:H ability_slot += Bind Soul:B # 4 letters from words of the spell name at (1) beginning, (2) end, # of words in the spell, (3) anywhere from the spell name, or (4) from the # names of the spell schools, in order of preference. spell_slot += Airstrike:arstrk spell_slot += Alistair's Intoxication:ailstrsntxctn spell_slot += Alistair's Walking Alembic:awalstrslknglmbc spell_slot += Anguish:angsh spell_slot += Animate Dead:adnmtd spell_slot += Apportation:apprttn spell_slot += Arcjolt:arcjlt spell_slot += Awaken Armour:aawknrmr spell_slot += Blink:blnk spell_slot += Bombard:bmbrd spell_slot += Borgnjor's Revivification:BRRGNJRSVVFCTN spell_slot += Borgnjor's Vile Clutch:bvcrgnjrslltch spell_slot += Brom's Barrelling Boulder:bbbrmsrrllngldr spell_slot += Call Canine Familiar:cfnnmlr spell_slot += Call Imp:imp spell_slot += Cause Fear:cfsr spell_slot += Chain Lightning:CLHNGHTNNG spell_slot += Cigotuvi's Putrefaction:cpgtvstrfctn spell_slot += Confusing Touch:CTNFSNGCH spell_slot += Conjure Ball Lightning:cblnjrllghtnng spell_slot += Construct Spike Launcher:cslnstrctpknchr spell_slot += Curse of Agony:carsgny spell_slot += Death Channel:dcthhnnl spell_slot += Death's Door:ddthsr spell_slot += Detonation Catalyst:dctntntlyst spell_slot += Diamond Sawblades:dsmndwblds spell_slot += Dimensional Bullseye:dbmnsnlllsy spell_slot += Discord:dscrd spell_slot += Disjunction:dsjnctn spell_slot += Dispel Undead:dusplndd spell_slot += Dispersal:dsprsl spell_slot += Dragon Veins:dvrgnns spell_slot += Dragon's Call:DRGNS spell_slot += Enfeeble:enfbl spell_slot += Ensorcelled Hibernation:ehnsrclldbrntn spell_slot += Eringya's Noxious Bog:enbrngysxsg spell_slot += Eringya's Surprising Crocodile:escrngysrprsngrcdl spell_slot += Fire Storm:fsrtrm spell_slot += Fireball:frbll spell_slot += Flame Wave:fwlmv spell_slot += Forge Blazeheart Golem:bglzhrtlm spell_slot += Forge Lightning Spire:lsghtnngpr spell_slot += Forge Monarch Bomb:mbnrchmb spell_slot += Forge Phalanx Beetle:pbhlnxtl spell_slot += Fortress Blast:fbrtrsslst spell_slot += Foxfire:fxfr spell_slot += Freeze:frz spell_slot += Freezing Cloud:fcrzngld spell_slot += Frozen Ramparts:frrznmprts spell_slot += Fugue of the Fallen:ffglln spell_slot += Fulminant Prism:fplmnntrsm spell_slot += Fulsome Fusillade:fflsmslld spell_slot += Gell's Gavotte:ggllsvtt spell_slot += Gloom:glm spell_slot += Grave Claw:gcrvlw spell_slot += Hailstorm:hlstrm spell_slot += Haunt:hnt spell_slot += Hellfire Mortar:hmllfrrtr spell_slot += Hoarfrost Cannonade:hcrfrstnnnd spell_slot += Ice Thorns:itchrns spell_slot += Ignite Poison:ipgntsn spell_slot += Ignition:igntn spell_slot += Infestation:infsttn spell_slot += Inner Flame:ifnnrlm spell_slot += Irradiate:irrdt spell_slot += Iskenderun's Battlesphere:bttlsphr spell_slot += Iskenderun's Mystic Blast:mbystclst spell_slot += Jinxbite:jnxbt spell_slot += Kinetic Grapnel:kgntcrpnl spell_slot += Kiss of Death:kdssth spell_slot += Launch Clockwork Bee:lcbnchlckwrk spell_slot += Leda's Liquefaction:lldsqfctn spell_slot += Lee's Rapid Deconstruction:lrdspdcnstrctn spell_slot += Lehudib's Crystal Spear:lcshdbsrystlpr spell_slot += Lesser Beckoning:bcknng spell_slot += Magic Dart:mdgcrt spell_slot += Magnavolt:mgnvlt spell_slot += Malign Gateway:MGLGNTWY spell_slot += Manifold Assault:manfldsslt spell_slot += Martyr's Knell:mkrtyrsnll spell_slot += Maxwell's Capacitive Coupling:MCCXWLLSPCTVPLNG spell_slot += Maxwell's Portable Piledriver:mppxwllsrtblldrvr spell_slot += Mephitic Cloud:mcphtcld spell_slot += Mercury Arrow:marcryrrw spell_slot += Metabolic Englaciation:metblcnglctn spell_slot += Momentum Strike:msmntmtrk spell_slot += Nazja's Percussive Tempering:nptzjsrcssvmprng spell_slot += Olgreb's Toxic Radiance:otrlgrbsxcdnc spell_slot += Orb of Destruction:odrbstrctn spell_slot += Ozocubu's Armour:oazcbsrmr spell_slot += Ozocubu's Refrigeration:orzcbsfrgrtn spell_slot += Passage of Golubria:pgssglbr spell_slot += Passwall:psswll spell_slot += Permafrost Eruption:permfrstrptn spell_slot += Petrify:ptrfy spell_slot += Plasma Beam:pblsmm spell_slot += Platinum Paragon:ppltnmrgn spell_slot += Poisonous Vapours:pvsnsprs spell_slot += Polar Vortex:PVLRRTX spell_slot += Rending Blade:rbndngld spell_slot += Rimeblight:rmblght spell_slot += Sandblast:sndblst spell_slot += Scorch:scrch spell_slot += Sculpt Simulacrum:ssclptmlcrm spell_slot += Searing Ray:srrngy spell_slot += Shatter:shttr spell_slot += Shock:shck spell_slot += Sigil of Binding:sbglndng spell_slot += Silence:slnc spell_slot += Sirocco:srcc spell_slot += Slow:slw spell_slot += Soul Splinter:sslplntr spell_slot += Spellspark Servitor:sspllsprkrvtr spell_slot += Sphinx Sisters:ssphnxstrs spell_slot += Splinterfrost Shell:ssplntrfrsthll spell_slot += Starburst:strbrst spell_slot += Static Discharge:sdttcschrg spell_slot += Sticky Flame:sftckylm spell_slot += Stone Arrow:satnrrw spell_slot += Sublimation of Blood:sbblmtnld spell_slot += Summon Cactus Giant:cgctsnt spell_slot += Summon Forest:frst spell_slot += Summon Horrible Things:htrrblhngs spell_slot += Summon Hydra:hydr spell_slot += Summon Ice Beast:ibcst spell_slot += Summon Mana Viper:mvnpr spell_slot += Summon Seismosaurus Egg:sesmsrsgg spell_slot += Summon Small Mammal:smmllmml spell_slot += Swiftness:SWFTNSS spell_slot += Teleport Other:tolprtthr spell_slot += Tukima's Dance:tdkmsnc spell_slot += Vampiric Draining:vdmprcrnng spell_slot += Vhi's Electric Charge:vechslctrchrg spell_slot += Volatile Blastmotes:vbltllstmts spell_slot += Yara's Violent Unravelling:yvurslntnrvllng # Default letters spell_slot += .*:XYZ ################## ### Item slots ### ################## ## Rings, in order of letter used. item_slot += ring of dexterity : Dd item_slot += ring of evasion : Ee item_slot += ring of .*fire : Ff item_slot += ring of (ice|protection from cold) : Cc item_slot += ring of intelligence : Ii item_slot += ring of flight : L item_slot += ring of magical power : Mm item_slot += ring of positive energy : Nn item_slot += ring of poison resistance : P item_slot += ring of resist corrosion : R item_slot += ring of strength : Ss item_slot += ring of see invisible : v item_slot += ring of willpower: Ww # Need numeric match to not trigger for rF/rC rings item_slot += \+[0-9]+ ring of protection : Tt item_slot += ring of slaying : Yy item_slot += ring of wizardry : Zz ######################## ### Autoinscriptions ### ######################## show_god_gift = unident ai := autoinscribe ai += potions? of berserk rage:!q ai += scrolls? of silence:!r ai += of faith:!P # Prevent melee with all staves; if we want to melee with one, it's safe to # require removing the annotation. ai += magical staff:!a ai += (large rock|throwing net|curare|of dispersal):=f ai += baubble:!V ai += talisman:!P # Convenient shortcuts ai += curing:@q1 ai += potions? of heal wounds:@q2 ai += potions? of haste:@q3 ai += scrolls? of teleportation:@r2 ai += identify:@r1 # Evocations breakpoint ai += gravitambourine:9.5 23.2 ############## ### Morgue ### ############## note_hp_percent = 10 note_all_skill_levels = true note_chat_messages = false user_note_prefix = >> note_items += experience,of resistance,Archmagi note_items += crystal plate armour,pearl dragon scales note_items += artefact note_messages += You feel monstrous note_messages += You pass through the gate note_messages += cast .* Abyss # I use custom lua for faded altars. See c_message below # note_messages += This altar belongs to # Noteable monsters # Undead note_monsters += ancient lich,curse skull,curse toe,greater mummy # Depths note_monsters += caustic shrike,alderking,wyrmhole # Special hall_of_zot spawns note_monsters += killer klown,electric golem,orb of fire,orb of winter,orb of entropy dump_message_count = 100 ######################## ### Lua ### ######################## { --------------------------------- --- Utility --- --------------------------------- function getOrDefault(table, key, default) if table[key] ~= nil then return table[key] else return default end end --------------------------------- --- Autopickup aux armor --- --------------------------------- -- 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", barding="Barding"} 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 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) --------------------------------- --- Autopickup Reject Dupes --- --------------------------------- -- Don't pick up duplicate talismans/staves except for artifacts -- This doesn't cause talismans/staves to be picked up, it only rejects duplicates -- if they are already set to be picked up. -- We set autopickup = $?!+"/♦|(}% which includes % (talismans) and | (staves) function reject_autopickup_dupes(candidate) -- pass if the item is an artefact or something other than talisman or magical staff if candidate.artefact then return nil end if not (candidate.class(true) == "talisman" or candidate.class(true) == "magical staff") then return nil end -- reject if you already have one (or 2 if you're a coglin and it's a staff) local function is_same_type(it) return it.class(true) == candidate.class(true) and it.subtype() == candidate.subtype() end local count = #util.filter(is_same_type, items.inventory()) -- I'll let coglins pickup 2 staves and assume they'll never sacrifice hand if (you.species() == "Coglin" and candidate.class(true) == "magical staff" and count < 2) or count < 1 then return nil -- don't affect the outcome else return false -- reject duplicates end end add_autopickup_func (reject_autopickup_dupes) --------------------------------- --- Vaults 5 Stairs Warning --- --------------------------------- -- Automatically add an annotation to V5 so you don't go down by accident -- Make sure to include "annotate_v5()" in your ready function or this won't work -- check to see if "annotated_v5" was already initialized by chk_lua_save -- If it was we need to make sure it's added to chk_lua_save again if annotated_v5 ~= true then annotated_v5 = false else table.insert(chk_lua_save, function () return "annotated_v5 = true" end) end function annotate_v5() if (not annotated_v5) and (you.branch() == "Vaults") then crawl.sendkeys("!v5" .. string.char(13) .. "!vaults warning" .. string.char(13)) annotated_v5 = true -- also set this to true anytime this save is loaded table.insert(chk_lua_save, function () return "annotated_v5 = true" end) end end --------------------------------- --- HP Warnings & Notes --- --------------------------------- -- Print a message and take note when hp goes above or below a certain ratio -- "force_more_message += it's so over" will pause the game when at low hp -- Must include "evaluate_wellbeing()" in your ready() function or this won't work -- Set these two variables as desired -- (currently warning at 30% and celebration at 70%) itsoverratio = .30 werebackratio = .70 function hp_ratio() local hp, mhp = you.hp() return hp / mhp end itsover = hp_ratio() <= itsoverratio -- initializing this in case save is loaded at low hp function evaluate_wellbeing() if itsover and hp_ratio() >= werebackratio then crawl.take_note("We're so back!") crawl.mpr("we're so back!") itsover = false elseif not itsover and hp_ratio() <= itsoverratio then local hp, mhp = you.hp() crawl.take_note(string.format("It's so over! %d/%d", hp, mhp)) crawl.mpr("it's so over!") itsover = true end end --------------------------------- --- Felid Lives-based Tile --- --------------------------------- -- change felid tile based on number of lives left -- Must include "update_felid_tile()" in your ready() function or this won't work -- see https://github.com/crawl/crawl/tree/master/crawl-ref/source/rltiles/player/felids for felid tiles -- below is how file names map to tile names. -- for instance if you want the cat9.png file, you should use tile:felid_6 --cat1 felid --cat2 felid_1 --cat4 felid_2 --cat5 felid_3 --cat7 felid_4 --cat8 felid_5 --cat9 felid_6 --cat3 felid_silly --cat6 felid_silly_1 --cat10 felid_silly_2 felid_tiles = {"tile:felid_5", "tile:felid_silly", "mons:manticore"} -- 0 lives, 1 life, 2 lives function update_felid_tile() if you.race() == "Felid" then crawl.setopt("tile_player_tile = " .. felid_tiles[you.lives() + 1]) end end --------------------------------- --- Tile display mode toggle --- --------------------------------- -- (local tiles only, not webtiles) -- bind a key to cycle_display_mode display_mode = "tiles" function cycle_display_mode() -- Bound to a key near the top of the file if display_mode == "tiles" then display_mode = "glyphs" elseif display_mode == "glyphs" then display_mode = "hybrid" else display_mode = "tiles" end crawl.mpr("Switching to " .. display_mode .. " display mode.") crawl.setopt("tile_display_mode = " .. display_mode) end --------------------------------- --- Count stairs failure --- --------------------------------- -- Print how many times you tried to go the wrong direction when using stairs -- Must include "c_message" function in the API Hook section or this won't work -- Must include "print_stairs_failures()" in the ready() function or this won't work stairs_updated = false function print_stairs_failures() if stairs_updated then crawl.mpr("Stair failure counter: " .. c_persist["stairs failures"]) stairs_updated = false end end --------------------------------- --- Poison Warning --- --------------------------------- -- Print a warning message when poison reaches a certain percent of remaining hp -- Must include "poison_warn()" in the ready() function or this won't work -- A force_more_message for "You are seriously poisoned" is added above -- triggers if poison is at least 35% remaining hp poison_warn_hp_ratio = .35 function poison_warn() local hp, mhp = you.hp() local threshold = hp * (1 - poison_warn_hp_ratio) if you.poison_survival() <= threshold then crawl.mpr("You are seriously poisoned!") end end --------------------------------- --- Identification Notify --- --------------------------------- -- Print a warning when going downstairs if it looks like you need to ID items. -- We bind this above with [macros += M < ===id_warn_up] and [macros += M > ===id_warn_down] function id_warn(keycode) -- return early if we're not on stairs (you use <> for portals and shops too) local standing_on = view.feature_at(0,0) if standing_on == "enter_shop" or (not (standing_on:find("stairs") or standing_on:find("hatch") or standing_on:find("enter") or standing_on:find("exit"))) then crawl.sendkeys(keycode) return end -- look for unidentified items return early if there are none local function is_unid(item) return not item.is_identified end local unid = util.filter(is_unid, items.inventory()) if unid == nil or #unid == 0 then crawl.sendkeys(keycode) return end -- print how many unidentified items we have local potions = 0 local potion_stack = 0 local scrolls = 0 local scroll_stack = 0 for i,it in ipairs(unid) do if it.class() == "Scrolls" then scrolls = scrolls + it.quantity scroll_stack = scroll_stack + 1 elseif it.class() == "Potions" then potions = potions + it.quantity potion_stack = potion_stack + 1 end end if scrolls > 0 then crawl.mpr(string.format("You have %d unidentified scrolls in %d stacks.", scrolls, scroll_stack)) end if potions > 0 then crawl.mpr(string.format("You have %d unidentified potions in %d stacks.", potions, potion_stack)) end -- prompt the user if we also have ID scrolls local function is_id(item) return item.subtype() == "identify" end if util.exists(items.inventory(), is_id) then -- Ask the user if they wish to proceed without reading ID and abort if they say no. local proceed = crawl.yesno("You have ID scrolls. Proceed anyway? (y/n)", true) if not proceed then crawl.mpr("Okay then.") return end end -- If they agreed to the prompt or there were no ID scrolls, just do the action crawl.sendkeys(keycode) end function id_warn_up() return id_warn("<") end function id_warn_down() return id_warn(">") end --------------------------------- --- Safe Channel Macro --- --------------------------------- -- Wait but only if you're channeling a spell. -- We bind this above with macros += M S ===safe_channel function safe_channel() if you.channelled_spell() then crawl.sendkeys("s") else crawl.mpr("You are not channelling a spell!") end end --------------------------------- --- API Hook functions --- --------------------------------- local track_hp = you.hp() local hp_diff_print_ratio = 0.15 local msg_count = 0 -- Called when a message is logged function c_message(text, channel) msg_count = msg_count + 1 -- See "Count stairs failure" section above if text:find("can't go up here!") or text:find("can't go down here!") then c_persist["stairs failures"] = getOrDefault(c_persist, "stairs failures", 0) + 1 stairs_updated = true end -- Note faded altar offerings if text:find("This altar belongs to") then a, b, c = text:match("%(a%) ([%w%s]+), %(b%) ([%w%s]+) or %(c%) ([%w%s]+),") crawl.take_note(string.format("Faded altar: %s, %s, %s", a, b, c)) end local hp, mhp = you.hp() if track_hp ~= hp then local hp_diff = hp - track_hp local colour = "" if hp_diff < 0 then colour = "" else colour = "" end if math.abs(hp_diff) >= mhp * hp_diff_print_ratio then crawl.mpr(colour .. "HP: " .. track_hp .. " -> " .. hp .. " (" .. hp_diff .. ")") end track_hp = hp end end -- auto answer prompts that contain these patterns -- pass has priority over no, which has priority over yes prompt_pass = {"penance"} -- answer these manually prompt_no = {} prompt_yes = {"arc blade's discharge", "freezing cloud near yourself"} function c_answer_prompt(prompt) local function found_any(text, patterns) return util.exists( patterns, function (patt) return text:find(patt) end ) end if found_any(prompt, prompt_pass) then return nil elseif found_any(prompt, prompt_no) then return false elseif found_any(prompt, prompt_yes) then return true end end last_turn_ready = -1 -- Called when it is your turn to act function ready() print_stairs_failures() -- Open skill screen on turn 0. if not skills_set and you.turns() == 0 then crawl.sendkeys("m") skills_set = true end -- We only do most things on new turns. Return early if it's the same turn. if you.turns() == last_turn_ready then return end last_turn_ready = you.turns() annotate_v5() evaluate_wellbeing() update_felid_tile() poison_warn() if msg_count > 0 then crawl.mpr("------------------------------------------------------------") msg_count = 0 end end }