# use_animations -= beam, range, hp, monster_in_sight, pickup, monster, player, branch_entry explore_auto_rest = true rest_wait_percent = 100 tile_show_threat_levels = tough nasty # Crawl Init file show_more=false auto_butcher=true ##################### ### Tiles options ### ##################### tile_window_width = 1300 tile_window_height = 700 tile_full_screen = false tile_map_pixels = 3 ## To set up RandomTiles, you need (1) the include below and (2) to add/modify ## the ready() function in your rc. See my ready() section below and the ## project page: https://github.com/gammafunk/dcss-rc#randomtiles ## include += RandomTiles.rc ############################ ### Interface & Commands ### ############################ bindkey = [ ] CMD_AUTOFIGHT_NOMOVE bindkey = [4] CMD_REST bindkey = [6] CMD_REST runrest_stop_message += Your transformation is almost over. default_manual_training = true easy_eat_chunks = true equip_unequip = true sort_menus = true:equipped,identified,basename,art,ego,glowing,qualname,curse,charged,slot ability_menu = false autofight_stop = 50 autofight_caught = true autofight_wait = false ########################## ### Messages & Display ### ########################## view_delay = 300 hp_colour = 100:green, 99:lightgray, 75:yellow, 50:lightred, 25:red mp_colour = 100:green, 99:lightgray, 75:yellow, 50:lightred, 25:red hp_warning = 50 monster_list_colour = monster_list_colour += friendly:green,neutral:brown monster_list_colour += good_neutral:brown,strict_neutral:brown monster_list_colour += trivial:darkgrey,easy:lightgrey monster_list_colour += tough:yellow,nasty:lightred more := force_more_message : if you.god() == "Ashenzari" then more += You have a vision of.*gates? : end more += The mighty Pandemonium lord .* resides here # Interrupts more += You don't .* that spell more += You fail to use your ability more += You miscast.*(Blink|Borgnjor|Door|Haste|Invisibility) more += You can't (read|drink|do) more += You cannot .* while unable to breathe more += You cannot .* in your current state more += when .*silenced more += too confused more += There's something in the way more += There's nothing to (close|open) nearby more += not good enough to have a special ability more += You are too berserk more += no means to grasp 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 += You can't unwield more += enough magic points more += You don't have the energy to cast that spell more += You are unable to access your magic # Bad things more += Your surroundings flicker more += You cannot teleport right now 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 += dispelling energy hits you more += You are blasted by holy energy! more += You are (blasted|electrocuted)! more += You are.*(confused|poisoned) more += flesh rotting more += (starving|devoid of blood) more += god:(sends|finds|silent|anger) more += You feel a surge of divine spite more += disloyal to dabble more += lose consciousness more += You are too injured to fight blindly more += calcifying dust hits more += Space warps.*around you more += Space bends around you more += watched by something more += flickers and vanishes! more += doesn't seem very happy more += is no longer charmed # Hell effects more += hell_effect: # 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 have a feeling this form more += You feel yourself come back to life more += time is quickly running out more += life is in your own hands more += Your shroud falls apart more += You start to feel a little slower more += You feel less protected from missiles # Others 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 # Problematic monsters more += (giant eyeball|shining eye|cacodemon|neqoxec|guardian serpent|flayed ghost|greater mummy|mummy priest|hell sentinel|fiend|tzitzimitl|tormentor|hellion|lich|executioner|orb of fire|death cob|juggernaut|moth of wrath|ghost moth|curse toe|curse skull|draconian shifter).*into view ## Any uniques and any pan lords more += (?-i:[A-Z]).* comes? into view ## 0.17 more += the royal jelly.* comes? into view ########################## ### Autopickup options ### ########################## # Add staves, rods, misc; note you can't use += with this option. autopickup = $?!:"/%}|\ ae := autopickup_exceptions # Inclusions ae += deck : end # Tend to not use these. ae += >scrolls? of silence ae += >(crystal ball of energy|disc of storm) # Don't ever need a second stave ae += staff of .* { -- Equipment autopickup (by Medar and various others) local function pickup_equipment(it, name) if it.is_useless then return end local class = it.class(true) if class == "armour" then local good_slots = {cloak="Cloak", helmet="Helmet", gloves="Gloves", boots="Boots"} st, _ = it.subtype() -- Autopickup found aux armour if 1) we don't have any or 2) it's artefact, -- or 3) if we don't have artefact or ego armour, and the found armour is -- ego. if good_slots[st] ~= nil then if good_slots[st] == "Gloves" and you.has_claws() > 0 then return end if it.artefact then return true end local cur = items.equipped_at(good_slots[st]) if cur == nil then return true end if cur.branded or cur.artefact then return end if it.branded then return true end -- Autopickup found body armour of the same kind we're wearing, according -- to conditions (2) and (3) above used for aux slots. elseif st == "body" then local cur = items.equipped_at("armour") if cur == nil then return end if cur.name("qual") ~= it.name("qual") then return end if it.artefact then return true end if cur.branded or cur.artefact then return end if it.branded then return true end end end return end add_autopickup_func(pickup_equipment) } ######################## ### 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 += ( rod ):!a ai += manual of:!d ai += staff of (Wucad Mu|energy|channeling|wizardry|power|conjuration|summoning):!a ai += (large rock|throwing net|curare|of dispersal):=f # From simm's rc, helpful for realtime. 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 += (meat|bread) ration:@e1 ai += (beef jerk|fruit|pizza):@e2 ai += royal jell:@e3 ######### # Notes # ######### note_items += experience,of resistance, Archmagi note_items += crystal plate armour,dragon armour note_items += artefact,wand of (heal wounds|hasting|teleportation) note_messages += You feel monstrous note_messages += You pass through the gate note_messages += cast .* Abyss # Nasty undead. note_monsters += lich,curse skull,greater mummy # Some enemies it's good to note for Vaults note_monsters += tengu reaver,storm dragon,titan # Depths # 0.17 note_monsters += octopode crusher note_monsters += juggernaut,irong giant,caustic shrike # Zot note_monsters += killer klown,electric golem,curse toe note_hp_percent = 10 note_all_skill_levels = true ############################ ### Travel & Exploration ### ############################ rest_wait_both = true auto_sacrifice = true travel_delay = -1 explore_delay = -1 rest_delay = -1 show_travel_trail = false explore_stop += greedy_items ################ ### Messages ### ################ stop := runrest_stop_message ignore := runrest_ignore_message :if you.god() == "Xom" then stop += god: :else ignore += god: :end # Bad things stop += A huge blade swings out and slices into you stop += (starving|devoid of blood) stop += wrath finds you stop += lose consciousness stop += hell_effect: # Expiring effects stop += You feel yourself slow down stop += You are starting to lose your buoyancy stop += Your hearing returns stop += Your transformation is almost over stop += back to life stop += time is quickly running out stop += life is in your own hands stop += is no longer charmed : if you.race() == "Ghoul" then stop += smell.*(rott(ing|en)|decay) stop += something tasty in your inventory : end # Annoyances ignore += grinding sound ignore += contamination has completely ignore += rod.*has recharged ignore += your breath back ignore += pray: ignore += talk: ignore += talk_visual: ignore += friend_spell: ignore += friend_enchant: ignore += friend_action: ignore += sound: ########################### ### Spell/Ability slots ### ########################### # Move off `aa` so we don't mistrigger it, especially with macro on `1`. 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 # Use z for L1 damage/buff spells in starting books. # Prefer to use letters in a word of the spell name at (1) beginning, (2) end, # (3) anywhere, or (4) at the beggining of a school of the spell, in order of # preference. # Use vowels+s,r for self-enchantments or escape spells, all other available # letters for remaining spells. Use upper-case letters for spells like Blink # that are dangerous to miskey. spell_slot += Alistair's intoxication:txc spell_slot += Apportation:aoi spell_slot += Airstrike:ktA spell_slot += Aura of abjuration:uio spell_slot += Agony:yng spell_slot += Animate dead:q spell_slot += Animate skeleton:l spell_slot += Beastly appendage:a spell_slot += Blade hands:bdt spell_slot += Blink:BJ spell_slot += Bolt of cold:bcd spell_slot += Bolt of draining:bdg spell_slot += Bolt of fire:bft spell_slot += Bolt of magma:bmt spell_slot += Borgnjor's revivification:BOE spell_slot += Call canine familiar:fcn spell_slot += Call imp:cpu spell_slot += Cause fear:xcf spell_slot += Controlled blink:oie spell_slot += Corona:a spell_slot += Chain lightning:cn spell_slot += Cigutovi's embrace:eio # 0.17 spell_slot += Condensation shield:eio spell_slot += Confusing touch:oxc spell_slot += Confuse:cfn spell_slot += Conjure flame:cfj spell_slot += Control undead:cld spell_slot += Corpse rot:ctp spell_slot += Cure poison:ieu spell_slot += Dazzling spray:dyz spell_slot += Darkness:EAS spell_slot += Death channel:dcn spell_slot += Death's door:EAS spell_slot += Deflect missiles:pd spell_slot += Discord:DCH spell_slot += Disjunction:iou spell_slot += Dispel undead:ndp spell_slot += Dispersal:dxp spell_slot += Dragon form:dfm spell_slot += Dragon's call:dcl spell_slot += Ensorcelled hibernation:sc spell_slot += Excruciating wounds:wxd spell_slot += Fire storm:fmt spell_slot += Fireball:o spell_slot += Flame tongue:a spell_slot += Force lance:flc spell_slot += Freezing cloud:fcd spell_slot += Freeze:a spell_slot += Fulminant prism:fpt spell_slot += Gell's Gravitas:gvt spell_slot += Glaciate:gct spell_slot += Haste:h spell_slot += Haunt:g spell_slot += Hydra form:hym spell_slot += Ice form:i spell_slot += Iron shot:k spell_slot += Infusion:ofn spell_slot += Inner flame:fxn spell_slot += Invisibility:vyx spell_slot += Irradiate:tdD spell_slot += Iskenderun's battlesphere:e spell_slot += Iskenderun's mystic blast:fk spell_slot += Leda's Liquefaction:lqd spell_slot += Lee's rapid deconstruction:xo spell_slot += Lehudib's crystal spear:kt spell_slot += Lightning bolt:lbt spell_slot += Magic dart:adf spell_slot += Malign gateway:wyt spell_slot += Mass confusion:mcf spell_slot += Mephitic cloud:mpc spell_slot += Metabolic englaciation:mgt spell_slot += Monstrous menagerie:mgt spell_slot += Necromutation:nmt spell_slot += Olgreb's toxic radiance:pxt spell_slot += Orb of destruction:dbt spell_slot += Ozocubu's armour:oua spell_slot += Ozocubu's refrigeration:cbz spell_slot += Pain:a spell_slot += Passage of golubria:uoi spell_slot += Passwall:wpP spell_slot += Petrify:pyt spell_slot += Phase shift:eai spell_slot += Poison arrow:pwn spell_slot += Poisonous cloud:pcd spell_slot += Portal projectile:oei spell_slot += Recall:eaR spell_slot += Regeneration:r spell_slot += Repel missiles:p spell_slot += Ring of flames:fmn spell_slot += Sandblast:a spell_slot += Searing ray:ygn spell_slot += Shadow creatures:wcd spell_slot += Shatter:TSH spell_slot += Shock:zok spell_slot += Shroud of golubria:c spell_slot += Simulacrum:cnm spell_slot += Silence:CN spell_slot += Slow:wox spell_slot += Song of slaying:oia spell_slot += Spectral weapon:wox spell_slot += Spellforged servitor:vto spell_slot += Spider form:s spell_slot += Static discharge:tdc spell_slot += Statue form:toS spell_slot += Sticks to snakes:vt spell_slot += Sticky flame:kj spell_slot += Sting:zpt spell_slot += Stone arrow:fdk spell_slot += Stoneskin:ieo spell_slot += Summon butterflies:UEI spell_slot += Summon demon:dmn spell_slot += Summon forest:ftm spell_slot += Summon greater demon:gdn spell_slot += Summon guardian golem:gdn spell_slot += Summon horrible things:htg spell_slot += Summon hydra:hyd spell_slot += Summon ice beast:bct spell_slot += Summon lightning spire:ltp spell_slot += Summon mana viper:vmp spell_slot += Summon small mammal:a spell_slot += Swiftness:sie spell_slot += Teleport other:tpT spell_slot += Throw frost:ftw spell_slot += Throw flame:fmw spell_slot += Throw icicle:cwt spell_slot += Tornado:TDN spell_slot += Tukima's Dance:dkc spell_slot += Vampiric draining:k spell_slot += Venom bolt:bvm spell_slot += Warp weapon:wpn spell_slot += Yara's violent unraveling:yvg # Default letters spell_slot += .*:XYZ ################## ### Item slots ### ################## ## In order of letter used. # 0.17 item_slot += amulet of (stasis|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 # 0.17 item_slot += amulet of clarity : K 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 # 0.17 item_slot += (amulet|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 += ring of sustain attributes : T item_slot += amulet of gourmand : U # 0.17 item_slot += amulet of resist mutation : u item_slot += ring of see invisible : v # 0.17 item_slot += ring of invisibility : 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 ############ ## Macros ## ############ bindkey = [~] CMD_LUA_CONSOLE # macros += M e ===safe_eat macros += M S ===save_with_message macros += M 1 aa macros += M 3 zz macros += M 6 ===one_turn_rest macros += M 7 ===start_resting macros += M 8 ===new_random_tile macros += M 9 ===set_tile_by_name macros += M 0 ===toggle_tile_timer macros += M - ===toggle_random_tile macros += M ] ===set_target_skill ###################### ### Morgue options ### ###################### dump_message_count = 30 dump_order = header,hiscore,stats,misc,mutations,skills,spells,inventory dump_order += overview,screenshot,monlist,messages,skill_gains,action_counts dump_order += vaults,notes,kills note_hp_percent = 10 note_all_skill_levels = true note_chat_messages = false user_note_prefix = >> ############################### ### Menu and Message colors ### ############################### # These should match the item_glyph colours exactly when possible. # For menu_colour, the first match ignores subsequent matches. menu := menu_colour menu = # Many of the entries below come from dat/defaults/menu_colours.txt, # which we have to duplicate here since we want only some of the # entries from that file. menu += notes:white:Reached XP level ### General Inventory### # Items currently not affecting you. menu += darkgrey:(melded) # Items disliked by your god. menu += red:forbidden # Useless items, comes here to override artefacts etc. menu += darkgrey:.*useless.* # Handle cursed and equipped items early to override other colour settings. menu += lightred:.*equipped.* cursed menu += red: (a|the) cursed menu += inventory:lightgreen:.*equipped.* # Colouring of autoinscribed god gifts menu += pickup:lightred:god gift # Highlight (partly) selected items menu_colour += inventory:white:\w \+\s menu_colour += inventory:white:\w \#\s ### Food ### # Color chunks, put ordinary ones on lightgrey. menu += red:evil_eating.*chunk menu += blue:mutagenic.*chunk menu += darkgrey:inedible menu += lightgrey: +(chunks?$|chunks? +) # These are analogous to chunks : if you.race() == "Vampire" then menu += lightgrey:potions? of blood : end # Other food menu += brown:fruit menu += yellow:(pizza|jerky|jerkies) menu += green:royal jell menu += lightgreen:bread ration menu += lightred:meat ration ### Potions ### # Generally harmful menu += blue:potions? of.*(lignification|(?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 starting on the next line. --LUA INCLUDE-- ----------------------------- ---- Begin char_defaults ---- ----------------------------- -- See README.md for documentation. weapon_skills = {"Unarmed Combat", "Short Blades", "Long Blades", "Axes", "Maces & Flails", "Polearms", "Staves"} ranged_skills = {"Throwing", "Bows", "Crossbows", "Slings"} other_skills = {"Fighting", "Armour", "Dodging", "Shields", "Spellcasting", "Conjurations", "Hexes", "Charms", "Summonings", "Necromancy", "Translocations", "Transmutations", "Fire Magic", "Ice Magic", "Air Magic", "Earth Magic", "Poison Magic", "Invocations", "Evocations","Stealth"} skill_glyphs = { [1] = "+", [2] = "*" } chdat = nil char_combo = you.race() .. you.class() loaded_attempted = 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 save_default_target_skill(quiet) if not c_persist.target_skill or not have_defaults() then return end c_persist.char_defaults[char_combo].target_skill = c_persist.target_skill if not quiet then mpr("Set default target skill for " .. char_combo .. ": " .. c_persist.target_skill) end end function skill_message(prefix, skill, skill_type, value) local msg = "" if prefix then msg = prefix .. ";" end if skill_type then msg = msg .. skill_type .. "(" .. skill .. "):" .. value else msg = msg .. skill .. ":" .. value end return msg end function save_char_defaults(quiet) if you.class() == "Wanderer" then return end if not c_persist.char_defaults then c_persist.char_defaults = { } end c_persist.char_defaults[char_combo] = { } chdat = c_persist.char_defaults[char_combo] local msg = nil local have_weapon = false for _,sk in ipairs(weapon_skills) do if you.train_skill(sk) > 0 then chdat["Weapon"] = you.train_skill(sk) msg = skill_message(nil, sk, "Weapon", skill_glyphs[chdat["Weapon"]]) have_weapon = true break end end if not have_weapon then chdat["Weapon"] = nil end local have_ranged = false for _,sk in ipairs(ranged_skills) do if you.train_skill(sk) > 0 then chdat["Ranged"] = you.train_skill(sk) msg = skill_message(msg, sk, "Ranged", skill_glyphs[chdat["Ranged"]]) have_ranged = true break end end if not have_ranged then chdat["Ranged"] = nil end for _,sk in ipairs(other_skills) do if you.train_skill(sk) > 0 then chdat[sk] = you.train_skill(sk) msg = skill_message(msg, sk, nil, skill_glyphs[chdat[sk]]) else chdat[sk] = nil end end if target_skill then chdat["target_skill"] = nil if not need_target_skill and c_persist.target_skill then chdat["target_skill"] = c_persist.target_skill msg = skill_message(msg, "Target", nil, c_persist.target_skill) end end if not quiet then mpr("Saved default for " .. char_combo .. ": " .. msg) end end function have_defaults() return you.class() ~= "Wanderer" and c_persist.char_defaults and c_persist.char_defaults[char_combo] end function load_char_defaults(quiet) if not have_defaults() then return end local msg = nil local found_weapon = false chdat = c_persist.char_defaults[char_combo] for _,sk in ipairs(weapon_skills) do if you.base_skill(sk) > 0 and chdat["Weapon"] then you.train_skill(sk, chdat["Weapon"]) msg = skill_message(msg, sk, "Weapon", skill_glyphs[chdat["Weapon"]]) found_weapon = true else you.train_skill(sk, 0) end end if chdat["Weapon"] and not found_weapon then you.train_skill("Unarmed Combat", chdat["Weapon"]) msg = skill_message(msg, "Unarmed Combat", "Weapon", skill_glyphs[chdat["Weapon"]]) end local found_ranged = false for _,sk in ipairs(ranged_skills) do if you.base_skill(sk) > 0 and chdat["Ranged"] then you.train_skill(sk, chdat["Ranged"]) msg = skill_message(msg, sk, "Ranged", skill_glyphs[chdat["Ranged"]]) found_ranged = true else you.train_skill(sk, 0) end end if chdat["Ranged"] and not found_ranged then you.train_skill("Throwing", chdat["Ranged"]) msg = skill_message(msg, "Throwing", "Ranged", skill_glyphs[chdat["Ranged"]]) end for _,sk in ipairs(other_skills) do if chdat[sk] then you.train_skill(sk, chdat[sk]) msg = skill_message(msg, sk, nil, skill_glyphs[chdat[sk]]) else you.train_skill(sk, 0) end end if target_skill then if chdat["target_skill"] then c_persist.target_skill = chdat["target_skill"] msg = skill_message(msg, "Target", nil, c_persist.target_skill) need_target_skill = false record_current_skills(c_persist.target_skill) else -- Called by target_skill() trigger setting a skill target. We call -- it here here since setting it skips the skills menu, which we -- don't want that. This means the call to char_defaults() should -- come before target_skill() in ready() init_target_skill() end end if not quiet and msg ~= "" then mpr("Loaded default for " .. char_combo .. ": " .. msg) end end function char_defaults(quiet) if you.turns() ~= 0 then return end if not load_attempted then load_char_defaults(quiet) load_attempted = true end -- Save defaults if target_skill is loaded and has already been called if need_target_skill ~= nil and need_target_skill ~= true and not have_defaults() then save_char_defaults(quiet) end end --------------------------- ---- End char_defaults ---- --------------------------- --------------------------------------- ---- Begin conditional force_mores ---- --------------------------------------- -- See README.md for documentation. 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 = "maxhp", cutoff = 20, name = "20mhp"}, {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 ---- ---------------------------- -- 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 .. "") 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 target_skill ---- ---------------------------- -- See README.md for documentation. 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 char_dump ---- ------------------------- -- See README.md for documentation. local dump_count = you.turns() local dump_period = 1000 function char_dump() if you.turns() >= dump_count then dump_count = dump_count + dump_period crawl.dump_char() end end ----------------------- ---- End char_dump ---- ----------------------- function ready() -- Enable char default skills; this must come before target_skill(). char_defaults() -- Enable skill target settings. target_skill() -- Enable persistent messages. load_message() -- Dynamic force-mores. force_mores() -- Char dumps every 1k turns. char_dump() end }