# Thank you RumpyFlump for showing me this awesome rc file! # this is copied from nilsbloodaxe, thank you nils! #include += HDAMessageColors.rc #include += HDAForceMore.rc ################## ### UI options ### ################## travel_delay = 1 explore_delay = 2 rest_delay = 1 view_delay = 300 runrest_ignore_poison = 2:10 runrest_ignore_monster += ^butterfly$:1 runrest_ignore_monster += ^rat$:1 runrest_stop_message += Your battlesphere expends the last of its energy. runrest_stop_message += You feel the bond with your battlesphere wane. runrest_stop_message += Your transformation is almost over. show_travel_trail = true confirm_butcher = never easy_eat_chunks = true auto_eat_chunks = true auto_drop_chunks = yes hp_colour = 100:green, 75:yellow, 50:red, 25:lightred mp_colour = 100:green, 75:yellow, 50:red, 25:lightred hp_warning = 30 mp_warning = 20 autofight_stop = 50 auto_sacrifice = true autofight_throw = false autofight_throw_nomove = true autofight_fire_stop = true fire_order = launcher, return fire_order += javelin, rock , tomahawk , stone bindkey = [~] CMD_LUA_CONSOLE bindkey = [;] CMD_AUTOFIGHT_NOMOVE flash_screen_message += distortion ###################### ### Morgue options ### ###################### dump_message_count = 30 dump_order = header,hiscore,stats,misc,mutations,skills,spells,inventory dump_order += screenshot,monlist,messages,action_counts,vaults,notes,kills note_hp_percent = 10 note_all_skill_levels = true note_chat_messages = false user_note_prefix = >> #################### ### Menu options ### #################### drop_filter += useless_item ### Menu colorings ### ## These should match the item_glyph colours exactly when possible. menu := menu_colour menu = ### General colorings ### ## These two need to come first to override any entries below. menu += darkgrey:.*useless.* menu += red:.*evil_item.* menu += pickup:lightcyan:god gift menu += inventory:white:\w \#\s menu += notes:white:Reached XP level menu += inventory:white:\w \+\s menu += darkgrey:(melded) menu += lightred: cursed menu += inventory:lightgreen:.*equipped.* ### Food ### menu += red:evil_eating.*chunk menu += magenta:mutagenic.*chunk menu += green:poisonous.*chunk menu += darkgrey:(rotting.*chunk|inedible|rot-inducing) menu += brown:contaminated.*chunk menu += lightgrey: +(chunks?$|chunks? +) menu += brown:fruit menu += yellow:(pizza|jerky|jerkies|royal jell) menu += lightcyan:(meat ration|bread ration) ### Potions ### menu += darkgrey:potions? of.*(poison) ## buffs menu += green:potions? of.*(berserk|agility|brilliance|might|flight) menu += lightgreen:potions? of.*(resistance|invisibility|haste) ## healing menu += brown:potions? of.*curing menu += yellow:potions? of.*heal wounds ## "magic" menu += magenta:potions? of.*(cancellation|ambrosia) menu += lightmagenta:potions? of.*magic ## "really good" or restorative menu += cyan:potions? of.*(restore abilities|cure mutation) menu += lightcyan:potions? of.*(beneficial mutation|experience) ## food potions : if you.race() == "Vampire" then menu += lightred:potions? of blood menu += lightgrey:potions? of coagulated blood : else menu += darkgrey:potions? of.*blood : end ### Scrolls ### ## "equipment/spells" menu += brown:scroll.*(amnesia|curse) menu += yellow:scroll.*(identify) ## Enchant menu += green:scroll.*enchant weapon menu += lightgreen:scroll.*(enchant armour|brand weapon|enchant weapon III) ## Escape menu += magenta:scroll.*(fog|teleport) menu += lightmagenta:scroll.*(fear|blink) ## Damaging scrolls : if you.race() == "Vampire" or you.race() == "Mummy" : or you.race() == "Ghoul" then menu += blue:scroll.*(holy word) menu += lightred:scroll.*(torment) : else menu += lightred:scroll.*(holy word) menu += blue:scroll.*(torment) : end menu += lightred:scroll.*summoning ## tactical and the really good stuff (mmap for speedruns) menu += cyan:scroll.*(silence|noise|vulnerability|immolation) menu += lightcyan:scroll.*(acquire|recharging|magic map) ### Wands ### menu += lightcyan:wand of.*heal wounds ## hexes menu += green:wand of.*(slowing|confusion|random effects) menu += lightgreen:wand of.*(polymorph|paralysis|enslavement) ## escape menu += magenta:wand of.*(digging|disintegration|teleportation) menu += lightmagenta:wand of.*(hasting|invisibility) ## damage menu += brown:wand of.*(flame|frost|magic dart) menu += yellow:wand of.*(lightning|draining|cold|fire) menu += blue:.*dangerous_item.* ## Identification menu += lightmagenta:unidentified.*artefact.*jewellery menu += white:.*artefact menu += lightblue:unidentified .*(potion|scroll|wand|jewellery|book|rod|magical staff) menu += magenta:.*known.*ring of (dexterity|strength|intelligence|slaying|evasion|protection(?! from)) menu += inventory:lightgray:.*(book|jewellery|magical staff) menu += lightblue:unidentified .*weapon.*(runed|glowing|enchanted) menu += lightblue:unidentified .*armour.*(runed|glowing|embroidered|shiny|dyed) sort_menus += inv: true : equipped, charged ######################## ### Glyphs and colors ## ######################## item := item_glyph ## Reasonable defaults item += potion:lightgrey item += scroll:lightgrey item += dangerous_item:blue ### Potions ### item += potions? of.*(poison):darkgrey item += potions? of.*(berserk|agility|brilliance|might|flight):green item += potions? of.*(resistance|invisibility|haste):lightgreen item += potions? of.*(cancellation|ambrosia):magenta item += potions? of.*magic:lightmagenta item += potions? of.*heal wounds:yellow item += potions? of.*curing:brown item += potions? of.*(restore abilities|cure mutation):cyan item += potions? of.*(beneficial mutation|experience):lightcyan : if you.race() == "Vampire" then item += potions? of blood:lightred item += potions? of coagulated blood:lightgrey : else item += potions? of.*blood:darkgrey : end ### Scrolls ### item += scroll.*(amnesia|curse):brown item += scroll.*identify:yellow item += scroll.*enchant weapon:green item += scroll.*(enchant armour|brand weapon|enchant weapon III):lightgreen item += scroll.*(fog|teleport):magenta item += scroll.*(fear|blink):lightmagenta : if you.race() == "Vampire" or you.race() == "Mummy" : or you.race() == "Ghoul" then item += scroll.*(holy word):red item += scroll.*(torment):lightred : else item += scroll.*(holy word):lightred item += scroll.*(torment):red : end item += scroll.*(summoning):lightred item += scroll.*(vulnerability|noise|silence|immolation):cyan item += scroll.*(acquire|recharging|magic map):lightcyan item += ( rod ):yellow ### Identification item += (book|jewellery|magical staff):brown item += unidentified.*(potion|scroll|jewellery|book|wand|rod|magical staff).*:lightblue item += known.*ring of (dexterity|strength|intelligence|slaying|evasion|protection(?! from)):magenta item += identified.*artefact.*jewellery:white item += unidentified.*artefact.*jewellery.*:lightmagenta item += (a )?stones?$:lightgray ### Food ### item += chunks?.*flesh:lightgrey item += contaminated.*chunk:brown item += mutagenic.*chunk:magenta item += evil_eating.*chunk:red item += (inedible|rotting.*chunk):darkgrey item += poisonous.*chunk:green item += fruit:brown item += (pizza|jerky|jerkies|royal jell):yellow item += (meat ration|bread ration):lightcyan ### Wands ### item += wand of.*heal wounds:lightcyan item += wand of.*(slowing|confusion|random effects):green item += wand of.*(polymorph|paralysis|enslavement):lightgreen item += wand of.*(digging|disintegration|teleportation):magenta item += wand of.*(hasting|invisibility):lightmagenta item += wand of.*(flame|frost|magic dart):brown item += wand of.*(lightning|draining|cold|fire):yellow ## Want this to override anything above item += useless.*(food|book|potion|scroll|missile|armour|weapon|jewellery|rod):darkgrey item += evil_item:red ## Monsters that can be easy to miss mons := mon_glyph mons ^= dancing weapon : cyan { mons ^= spectral weapon : lightcyan { mons ^= * : ✱ ## For 0.16 mons ^= death cob : yellow z mons ^= curse toe : lightgreen z mons ^= ancient champion : lightcyan z mons ^= curse skull : lightmagenta z ## Wall glyphs, requires a font and terminal that can render these. feature += crystal wall {░} ## For 0.16 feature += green crystal {░} feature += stone wall {▒} feature += metal wall {▓} feature += unnaturally hard rock wall {█} feature += altar {⚑} ######################### ### Interface options ### ######################### ability_menu = false default_manual_training = true allow_self_target = prompt ######################## ### Autopick options ### ######################## ## Add staves and rods; note you can't use += with this option. autopickup = $?!+"/%|\ ae := autopickup_exceptions ## Don't ever need a second stave ae += staff of .* ae += useless_item, dangerous_item, evil_item # Autopickup artefacts 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 return it.artefact or it.branded or it.ego end end end if (class == "weapon") then if it.is_useless then return false end if (you.xl() < 12) or (you.god():find("Nemelex") or (you.god():find("Yred")) or (you.god():find("Beogh"))) then if it.branded and not (it.name() == "club") then return false end end local weapon = items.equipped_at("Weapon") if weapon then if (weapon.branded or weapon.artefact) then return false else local weapon_name = weapon.name() local sb = you.skill("Short Blades") local lb = you.skill("Long Blades") local axe = you.skill("Axes") local mf = you.skill("Maces & Flails") local pole = you.skill("Polearms") local staff = you.skill("Staves") if sb > 6 then if name:find("quick blade") then return true end end if lb > 8 then if name:find("demon blade") then return true end if name:find("bastard sword") then return true end if name:find("double sword") then return true end end if lb > 14 then if name:find("claymore") then return true end if name:find("triple sword") then return true end end if axe > 8 and mf <= 8 then if name:find("battleaxe") then return true end if name:find("broad axe") then return true end if name:find("war axe") then return true end if name:find("executioner") then return true end end if axe > 18 then if name:find("executioner") then return true end end if mf > 8 and staff <= 8 and axe <= 8 then if name:find("eveningstar") then return true end if name:find("demon whip") then return true end if name:find("sacred scourge") then return true end if name:find("dire flail") then return true end end if mf > 14 and staff <= 14 and axe <= 14 then if name:find("great mace") then return true end end if pole > 8 and staff <= 8 then if name:find("trident") then return true end if name:find("demon trident") then return true end if name:find("trishula") then return true end end if pole > 14 and staff <= 14 then if name:find("glaive") then return true end if name:find("bardiche") then return true end end if staff > 8 then if name:find("lajatang") then return true end end end elseif (you.skill("Unarmed Combat") < 3) then return true end end end) } #################### ### Autoinscribe ### #################### ai := autoinscribe ai += (bad|dangerous)_item.*potion:!q ai += (bad|dangerous)_item.*scroll:!r ai += potion.*(berserk rage):!q ai += potion.*(cure mutation):!q ai += scroll.*blinking:!r ai += scroll.*(magic mapping):!r ai += scroll.*recharging:!r ai += of faith:!P ai += ( rod ):!a ai += manual of:!d ai += staff of (Wucad Mu|channeling|wizardry|conjuration|summoning):!a ai += staff of air:rElec ai += staff of cold:rC+ ai += staff of death:rN+ ai += staff of energy:+MP, hungerless spells, !a ai += staff of fire:rF+ ai += staff of poison:rPois ai += staff of power:MP+17, !a ## from simm's rc ai += curing:@q1 ai += potions? of heal wounds:@q2 ai += wand of heal wounds:@v2 ai += potions? of haste:@q3 ai += wand of hasting:@v3 ai += scrolls? of teleportation:@r4 ai += wand of teleportation:@v4 ai += identify:@r1 ai += remove curse:@r2 ai += blowgun:@w1 ai += (curare|dispersal):!f ai += throwing net:=f ai += (meat|bread) ration:@e1 ai += (beef jerk|pizza):@e2 ai += royal jell:@e3 ai += fruit:@e4 # Save fruit for abilities under Fedhas : if you.god() == "Fedhas" then ai += fruit:!e : end # Inscribe potions of blood if you are a vampire : if you.race() == "Vampire" then ai += potion.*blood:@q4 : end # Inscribe distortion weapons if you are not worshipping Lugonu : if you.god() ~= "Lugonu" then ai += distortion:!w ai += (Sonja|Psyche):!w : end # Body Armour ai += fire dragon (armour|hide):rF++, rC- ai += gold dragon (armour|hide):rC+, rF+, rPois ai += ice dragon (armour|hide):rC++, rF- ai += mottled dragon (armour|hide):rSticky ai += pearl dragon (armour|hide):rN+ ai += quicksilver dragon armour:MR+ ai += shadow dragon (armour|hide):Stlth++++ ai += steam dragon (armour|hide):rSteam ai += storm dragon (armour|hide):rElec ai += swamp dragon (armour|hide):rPois ai += troll (hide|leather armour):regen show_god_gift = unident ######### # Notes # ######### note_items += acquirement, of Zot note_messages += You pass through the gate note_messages += cast .* Abyss note_messages += Your scales start note_messages += protects you from harm note_messages += You fall through a shaft ## Nasty undead from Vaults and Tomb note_monster += lich,ancient lich,curse skull,greater mummy ## Some enemies it's good to note for Vaults:5 note_monsters += tengu reaver,storm dragon,titan ## Depths note_monsters += octopode crusher,juggernaut,caustic shrike ## Zot note_monsters += killer klown,electric golem,death cob,curse toe,orb of fire ##################### ### More messages ### ##################### more := force_more_message # Important features : if you.god() == "Ashenzari" then more += You have a vision of.*gates? : else more += interdimensional caravan more += distant snort more += Found a gateway leading out of the Abyss : end more += Found .* abyssal rune of Zot more += You feel a terrible weight on your shoulders # 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 += That item cannot be evoked more += This wand has no charges more += You are held in a net 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 += You cannot teleport right now more += The writing blurs in front of your eyes more += You fall through a shaft 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|electrocuted)! more += You are (more )?confused more += You are (more |lethally )?poisoned more += wrath finds you more += lose consciousness more += Space warps horribly around you more += hits you.*distortion 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 # Expiring effects more += You feel yourself slow down more += You are starting to lose your buoyancy more += Your hearing returns more -= Your transformation is almost over more += You feel yourself come back to life more += uncertain # Others more += You have reached level more += You have finished your manual of more += Deactivating autopickup ## Problematic monsters more += (giant eyeball|shining eye|cacodemon|neqoxec|guardian serpent|flayed ghost|greater mummy|mummy priest|hell sentinel|fiend|tormentor|hellion|lich|executioner|orb of fire|death cob|juggernaut|moth of wrath|ghost moth|curse toe|curse skull|draconian shifter).*into view ## Uniques 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).*into view ##### Fake Language ######################################################## : if (you.god() == "Trog") then : if (you.race() == "Troll" or you.race() == "Ogre") then fake_lang = wide,grunt : elseif (you.race() == "Deep Dwarf") then fake_lang = dwarven,grunt : else fake_lang = grunt : end #: elseif (you.race() == "Mummy") then #fake_lang = runes #: elseif (you.race() == "Vampire") then #fake_lang = jagerkin,kraut : else fake_lang = : end #fake_lang = kraut,jagerkin #fake_lang = jagerkin,kraut #fake_lang = kraut,dwarven,jagerkin #fake_lang = dwarven,kraut,jagerkin #fake_lang = dwarven,jagerkin,kraut #fake_lang = jagerkin,kraut,dwarven #fake_lang = kraut,jagerkin,dwarven #fake_lang = jagerkin,dwarven,kraut ############################## ## Lua and ready() function ## ############################## { -- 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 -- Note: My final rc file has the lua files from -- https://github.com/gammafunk/dcss-rc included on the line below. ----------------------------- ---- Begin target_skill ---- ----------------------------- -- Opens the skill screen automaticaly when a skill reaches a target level set -- by the player. To enable in your rc, add a lua code block with the contents -- of *target_skill.lua* and a call to `target_skill()` in your `ready()` -- function. Additionally you'll wand to assign a key to a macro with a target -- of `===set_target_skill` so can change the skill target on the fly. Original -- code by elliptic with some reorganization. skill_list = {"Fighting","Short Blades","Long Blades","Axes","Maces & Flails", "Polearms","Staves","Unarmed Combat","Bows","Crossbows", "Throwing","Slings","Armour","Dodging","Shields","Spellcasting", "Conjurations","Hexes","Charms","Summonings","Necromancy", "Translocations","Transmutations","Fire Magic","Ice Magic", "Air Magic","Earth Magic","Poison Magic","Invocations", "Evocations","Stealth"} need_target_skill = nil function record_current_skills(maxlev) c_persist.current_skills = { } for _,sk in ipairs(skill_list) do if you.train_skill(sk) > 0 and you.base_skill(sk) < (maxlev or 27) then table.insert(c_persist.current_skills, sk) end end end function check_skills() if not c_persist.current_skills or not c_persist.target_skill then return end for _,sk in ipairs(c_persist.current_skills) do if you.base_skill(sk) >= c_persist.target_skill then crawl.formatted_mpr(sk .. " reached " .. c_persist.target_skill .. ".", "prompt") crawl.more() set_new_skill_training() break end end end function init_target_skill() c_persist.target_skill = nil c_persist.current_skills = { } need_target_skill = true end function set_new_skill_training() init_target_skill() c_persist.target_skill = 0 crawl.sendkeys("m") end function set_target_skill() record_current_skills() local str = "Currently training: " local first_skill = true for _,sk in ipairs(c_persist.current_skills) do val = you.base_skill(sk) if first_skill then str = str .. sk .. "(" .. val .. ")" else str = str .. ", " .. sk .. "(" .. val .. ")" end first_skill = false end str = str .. "." crawl.formatted_mpr(str, "prompt") crawl.formatted_mpr("Choose a target skill level: ", "prompt") c_persist.target_skill = tonumber(crawl.c_input_line()) record_current_skills(c_persist.target_skill) -- Update the target skill for char_defaults if necessary. if save_default_target_skill and you.turns() == 0 then save_default_target_skill() end end function control(c) return string.char(string.byte(c) - string.byte('a') + 1) end -- Moved this to its own function to clean up ready() -gammafunk function target_skill() prev_need_target = need_target_skill -- Need to look at skills and then set a target skill if our -- need_target_skill variable is uninitialized and we're either at turn 0 or -- c_persist.target_skill also uninitialized. if prev_need_target == nil and (you.turns() == 0 or c_persist.target_skill == nil) then set_new_skill_training() end if prev_need_target then set_target_skill() need_target_skill = false elseif not need_target_skill then check_skills() end end -------------------------- ---- End target_skill ---- -------------------------- --------------------------------------- ---- Begin conditional force_mores ---- --------------------------------------- -- See README.md for details. last_turn = you.turns() -- Each entry must have a name field with a descriptive name, a pattern field -- giving the regexp matching the appropriate monster(s), a cond field giving -- the condition type, and a cutoff field giving the max value where the -- force-more is active. Possible values for cond are xl and maxhp. Note that -- the final pattern will be "(pattern).*into view" where pattern is the value -- from the entry. fm_patterns = { -- General early game threats {pattern = "adder|gnoll|hound", cond = "xl", cutoff = 2, name = "XL1"}, -- Problems for chars with 20, 60, 90, or 120 mhp {pattern = "orc|Ogre", cond = "20mhp", cutoff = 20, name = "20hp"}, {pattern = "orc priest", cond = "maxhp", cutoff = 40, name = "40mhp"}, {pattern = "centaur [^wzs]|drake|blink frog|spiny frog|basilisk" .. "|raven|komodo dragon|blink frog|snapping turtle|black mamba" .. "|(redback|trapdoor) spider|hill giant|deep elf (summoner|mage)" .. "|gargoyle|sixfirhy|sun demon", cond = "maxhp", cutoff = 60, name = "60mhp"}, {pattern = "hydra|death yak|tarantella|(wolf|orb|jumping) spider" .. "|alligator|catoblepas|(fire|ice) dragon|spriggan (rider|druid)" .. "|torpor|yaktaur|vault guard|manticore|harpy|faun|merfolk|siren" .. "|water nymph|mana viper|a wizard|[0-9]+ wizards|ogre mage" .. "|deep elf (knight|conjurer)|tengu conjurer|green death" .. "|shadow demon", cond = "maxhp", cutoff = 90, name = "90mhp"}, {pattern = "centaur warrior|yaktaur captain" .. "|(quicksilver|storm|shadow|iron) dragon|alligator snapping turtle" .. "|satyr|naga sharpshooter|merfolk avatar|anaconda|shock serpent" .. "|emperor scorpion(stone|frost|fire) giant|titan|entropy weaver" .. "|thorn hunter|sphinx|war gargoyle|preserver" .. "|vault (warden|sentinel)|convoker|monstrosity|tengu reaver" .. "|deep elf (master archer|blademaster|death mage" .. "|sorcerer|demonologist|annihilator)" .. "|octopode crusher|yaktaur captain|spriggan (defender|air mage)" .. "|reaper|balrug", cond = "maxhp", cutoff = 120, name = "120mhp"} } -- end fm_patterns active_fm = {} -- Set to true to get a message when the fm change notify_fm = false -- 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 .. "") end end function init_force_mores() for i,v in ipairs(fm_patterns) do active_fm[#active_fm + 1] = false end end function update_force_mores() local activated = {} local deactivated = {} local hp, maxhp = you.hp() for i,v in ipairs(fm_patterns) do local msg = "(" .. v.pattern .. ").*into view" local action = nil local fm_name = v.pattern if v.name then fm_name = v.name end if not v.cond and not active_fm[i] then action = "+" elseif v.cond == "xl" then if active_fm[i] and you.xl() >= v.cutoff then action = "-" elseif not active_fm[i] and you.xl() < v.cutoff then action = "+" end elseif v.cond == "maxhp" then if active_fm[i] and maxhp >= v.cutoff then action = "-" elseif not active_fm[i] and maxhp < v.cutoff then action = "+" end end if action == "+" then activated[#activated + 1] = fm_name elseif action == "-" then deactivated[#deactivated + 1] = fm_name end if action ~= nil then local opt = "force_more_message " .. action .. "= " .. msg crawl.setopt(opt) active_fm[i] = not active_fm[i] end end if #activated > 0 and notify_fm then mpr("Activating force_mores: " .. table.concat(activated, ", ")) end if #deactivated > 0 and notify_fm then mpr("Deactivating force_mores: " .. table.concat(deactivated, ", ")) end end local last_turn = nil function force_mores() if last_turn ~= you.turns() then update_force_mores() last_turn = you.turns() end end init_force_mores() ------------------------- ---- End force_mores ---- ------------------------- ---------------------------- ---- Begin load_message ---- ---------------------------- -- Leave a message on save that will be displayed next time the player -- loads the game. To enable in your rc, add a lua code block with the -- contents of *load_message.lua*, add a call to `load_message()` in -- your `ready()` function, and make a macro binding 'S' to -- `===save_with_message`. Original code by elliptic with some -- reorganization. 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 .. "") 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 ---- ----------------------------------- ------------------------ ---- Begin safe_eat ---- ------------------------ -- Prompt when eating in LOS of charmed tier-one demon, such as those made by -- summon greater demon, since they can become hostile mid-meal. To enable in -- your rc, add a lua code block with the contents of *force_mores.lua* and -- make a macro binding your 'e' key to `===safe_eat`. version = 0.15 if crawl.version then version = tonumber(crawl.version("major")) end los_range = version >= 0.17 and 7 or 8 function safe_eat() tier_one_demons = {["executioner"] = true, ["shadow fiend"] = true, ["ice fiend"] = true, ["brimstone fiend"] = true, ["hell sentinel"] = true} have_t1 = false for x = -los_range,los_range do for y = -los_range,los_range do m = monster.get_monster_at(x, y) if m and m:status("in your thrall") and tier_one_demons[m:desc():lower()] ~= nill then have_t1 = true t1_desc = m:desc() break end end end if have_t1 then crawl.formatted_mpr("Really eat with the " .. t1_desc .. " in view?", "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 end crawl.sendkeys("e") end ---------------------- ---- End safe_eat ---- ---------------------- function ready() -- Enable skill target settings. target_skill() -- Enable persistent messages. load_message() -- Dynamic force-mores. force_mores() end }