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