# setting file for DCSS 0.30 (2023-09-13) ######## Generic ######################## combo = DECj hp_colour =85:lightgreen, 67:lightcyan, 50:yellow, 33:lightmagenta, 15:red rest_wait_percent = 65 explore_auto_rest = false show_more = false prompt_menu = false #auto_butcher = hungry default_manual_training = true cloud_status = true travel_delay = -1 travel_key_stop = true explore_delay = -1 explore_wall_bias = 0 explore_key_stop = true view_delay = 300 tile_font_crt_family = D2Coding tile_font_stat_family = D2Coding tile_font_msg_family = D2Coding tile_font_lbl_family = D2Coding #msg_min_height = 7 #msg_max_height = 10 #msg_webtiles_height = 10 note_skill_levels = 11,15,18,22,27 note_chat_messages = true #tile_realtime_anim = true #tile_water_anim = true always_show_zot = true ######## Force More ######################## more := force_more_message more += (?-i:[A-Z]).* comes? into view more += (?-i:[A-Z]).* opens? the more += You feel yourself slow down more += dispelling energy hits you more += You convulse more += Space .* around you more += .*orbs? of fire.* comes? into view more += ((floating|shining) eye|dream sheep|doom hound).*into view more += .*(s|player) ghost.* comes? into view more += It is wielding.*of distortion more += She is wielding.*of distortion more += He is wielding.*of distortion more += Found .* abyssal rune of Zot more += (blundered into a|invokes the power of) Zot more += Deactivating autopickup more += Ouch! That really hurt! more += A sentinel's mark forms upon you more += calcifying dust hits more += watched by something more += You feel less protected from missiles more += You hear a zap more += Found a staircase to the Ecumenical Temple more += You fail to use your ability more += You miscast.*(Blink|Borgnjor|Door|Invisibility) more += Your thoughts seem clearer ######## Autoexplore Interruption ######################## stop := runrest_stop_message stop += Your transformation is almost over ######## Flash Warning ######################## ;flash_screen_message += carrying a wand of .* ######## Annoyances ######################## ;ignore += grinding sound ;ignore += contamination has completely ;ignore += your breath back runrest_ignore_message += fire vortex .* runrest_ignore_message ^= fire vortex .* ######## Autoinscriptions ######################## ai := autoinscribe #ai += staff of .*(wizardry|conjuration|Battle):!a ai += staff.*Wucad Mu:!a!d #ai += \brations?\b:!d autoinscribe += .*faith:!P autoinscribe += figurine:=g autoinscribe += .*Vines:=g autoinscribe += .*finger necklace:=g #autoinscribe += .*Four Winds:=g autoinscribe += .*moon troll leather armour:=g autoinscribe += .*Mage:=g #autoinscribe += .*Elemental Staff:=g autoinscribe += potion.*invisibility:!q!d autoinscribe += potion.*magic:!q!d autoinscribe += potion.*lignification:!d autoinscribe += potion.*ambrosia:!q!d autoinscribe += potion.*resistance:!q!d autoinscribe += potion.*heal wounds:!q!d autoinscribe += potion.*haste:!q!d autoinscribe += potion.*curing:!q!d autoinscribe += potion.*brilliance:!q!d autoinscribe += potion.*berserk rage:!q autoinscribe += potion.*cancellation:!q!d #autoinscribe += (bad|dangerous)_item.*scroll:!r #autoinscribe += (bad|dangerous)_item.*potion:!q autoinscribe += potion.*mutation:!d #autoinscribe += scroll.*torment:!r autoinscribe += scroll.*silence:!r autoinscribe += scroll.*fear:!r autoinscribe += scroll.*holy word:!r!d autoinscribe += scroll.*immolation:!d autoinscribe += scroll.*blinking:!d autoinscribe += scroll.*identify:!d autoinscribe += scroll.*teleportation:!d #autoinscribe += scroll.*magic mapping:!r!d autoinscribe += scroll.*revelation:!r!d autoinscribe += shield.*resistance:!d autoinscribe += throwing net:!f ######## Autopickup ######################## autopickup = $?!:/| ae := autopickup_exceptions ae += >scrolls? of silence ae += >scrolls? of brand weapon ae += >scrolls? of enchant weapon ae += >scrolls? of poison ae += >scrolls? of vuln.* ae += >potions? of attraction ae += >potions? of lignification ae += >staff of .* ae ^= You only need two turns to die......") else return end end if you.god() == "Gozag" then Gozag = true end } { function spell_init() local spell_list = {} for _, spell_name in ipairs(you.spells()) do spell_list[spell_name] = true end return spell_list end spells_known = spell_init() } { function control(c) return string.char(string.byte(c) - string.byte('a') + 1) end function magic(command) crawl.process_keys(command) end } --this function is module, so don't change its name { function c_answer_prompt(prompt) if prompt:find("vortices") or prompt:find("vortex") or prompt:find("friend") then return true end if prompt:find("That beam") and you.res_fire() == 0 and not you.status("death's door") then if crawl.yesno("REALLY cast on yourself without fire resistance?",false,'n') then return end end if prompt:find("Really attack while wielding") then return false end if prompt == "Really attack near your battlesphere?" then return true end if prompt:find("cloud of flame") and you.res_fire() < 1 and not you.status("death's door") then if crawl.yesno("REALLY go through flame without fire resistance?",false,'n') then return end end if prompt:find("freezing vapour") and you.res_cold() < 1 and not you.status("death's door") then if crawl.yesno("REALLY go through icy clouds without cold resistance?",false,'n') then return end end end } --this function is module, so don't change its name { function choose_stat_gain() if DECj then return "i" else return end end } { function prompt(str) crawl.formatted_mpr(str, "prompt") return crawl.c_input_line() end } { function set_option() opt = prompt("Set which option? ") val = prompt("Input value to configure: " .. opt .. "=") if (opt == nil) or (val == nil) then crawl.mpr("Configuration cancelled.") else crawl.setopt(opt .. "=" .. val) crawl.mpr("Set option '" .. opt .. "=" .. val .. "'.") end end } { function confirmed_rest() if Hp_percent() == 100 and Mp_percent() == 100 then if crawl.yesno("Really wait turns while HP and MP are full?", true, 'n') == 1 then crawl.process_keys("5") else return crawl.mpr("Rest command was denied by confirmation process.") end else crawl.process_keys("5") end end } { function autobanish() if you.xl() == 27 then if crawl.yesno("Really attempt to banish yourself?",true,'n') then crawl.sendkeys("w-iiwYw-Y") else return crawl.mpr("Autobanish macro was denied by confirmation process.") end else crawl.mpr("You must become XL 27 to use autobanish macro.") end end } --the function requires at least 5 ?amnesia in slot 'X' to work properly { function automemo() if you.xl() == 27 then if crawl.yesno("Really execute automemo?",false,'n') then crawl.sendkeys("rXay") crawl.sendkeys("rXpy") crawl.sendkeys("rXmy") crawl.sendkeys("rXiy") crawl.sendkeys("M" .. control('f') .. "yara\ray") crawl.sendkeys("M" .. control('f') .. "wall\ray") crawl.sendkeys("M" .. control('f') .. "disj\ray") crawl.sendkeys("M" .. control('f') .. "frig\ray") crawl.sendkeys("M" .. control('f') .. "coup\ray") else return crawl.mpr("Automemo macro was denied by confirmation process.") end else crawl.mpr("You must become XL 27 to use automemo macro.") end end } { function Hp_percent() a,b=you.hp() return 100*a/b end } { function Mp_percent() a,b=you.mp() return 100*a/b end } { function Petrifying_Check() if you.petrifying() then crawl.yesno("You are now being petrified so your action will be checked. (Y or N to confirm.)", false, false, true, true) crawl.mpr("Consider using tele/blink, Yara, cancellation or other emergency measures......") end end } { local speed = true function Slowed_Check() if speed and string.find(crawl.messages(8), "yourself slow down") and you.status("in death's door (expiring)") then crawl.yesno("Warning: You are slowed while DDoor running out! (Y or N to confirm.)", false, false, true, true) speed = false end if not speed and not you.status("in death's door (expiring)") then speed = true end end } { local scro = true function Blurry_Check() if scro and you.mutation("blurry vision") > 0 and you.status("in death's door (expiring)") and you.mp() < 8 then crawl.yesno("Warning: Your reading rate is slowed while standing at death's door! (Y or N to confirm.)", false, false, true, true) scro = false end if not scro and not you.status("in death's door (expiring)") then scro = true end end } { local wand = true function Wand_Check() if you.xl() <= 12 and wand and string.gmatch(crawl.messages(5), "carrying a wand")() then crawl.yesno("Warning: an enemy near you is armed with a wand! (Y or N to confirm.)", false, false, true, true) crawl.mpr("Neutralize or avoid the wand carrier ASAP!") wand = false end if string.gmatch(crawl.messages(1), "restored")() then wand = true end end } { local throw = true function Throw_Check() if you.xl() <= 6 and throw and string.gmatch(crawl.messages(5), "quivering")() then crawl.yesno("Warning: an enemy near you is armed with missiles! (Y or N to confirm.)", false, false, true, true) crawl.mpr("Neutralize or avoid the thrower ASAP!") throw = false end if string.gmatch(crawl.messages(1), "restored")() then throw = true end end } { local manu = true function Manual_Check() if manu and string.gmatch(crawl.messages(30), "toss it away")() then crawl.yesno("Your manual has been consumed. (Y or N to confirm.)", false, false, true, true) crawl.mpr("Re-allocate skill distribution!") manu = false end if not manu and not string.gmatch(crawl.messages(30), "toss it away")() then manu = true end end } { local early = true function HpWarning_Early() if you.hp() < 21 and Hp_percent() < 30 and you.xl() < 12 and early then crawl.yesno("Low HP: Be careful! (Y or N to confirm.)", false, false, true, true) crawl.mpr("The dice are ABSOLUTELY not on your side......") early = false end if you.hp() > 20 and Hp_percent() > 29 and you.xl() < 12 then early = true end end } { local mid = true function HpWarning_Mid() if you.hp() < 51 and you.xl() < 21 and you.xl() > 11 and mid then crawl.yesno("Low HP: Be careful! (Y or N to confirm.)", false, false, true, true) crawl.mpr("Consider to using tele/blink, potion or other emergency measures......") mid = false end if you.hp() > 50 and you.xl() < 21 and you.xl() > 11 then mid = true end end } { local late = true function HpWarning_Late() if you.hp() < 60 and you.xl() == 27 and not you.status("in death's door") and not you.status("in death's door (expiring)") and late then crawl.yesno("Low HP: Be careful! (Y or N to confirm.)", false, false, true, true) crawl.mpr("Keep playing prudently even on late-game......") late = false end if you.hp() > 59 and you.xl() == 27 then late = true end end } { local previous_hp = 0 local previous_mp = 0 local previous_form = "" local was_berserk_last_turn = false function AnnounceDamage() local current_hp, max_hp = you.hp() local current_mp, max_mp = you.mp() --Things that increase hp/mp temporarily really mess with this local current_form = you.transform() local you_are_berserk = you.berserk() local max_hp_increased = false local max_hp_decreased = false if (current_form ~= previous_form) then if (previous_form:find("dragon") or previous_form:find("statue") or previous_form:find("tree") or previous_form:find("ice")) then max_hp_decreased = true elseif (current_form:find("dragon") or current_form:find("statue") or current_form:find("tree") or current_form:find("ice")) then max_hp_increased = true end end if (was_berserk_last_turn and not you_are_berserk) then max_hp_decreased = true elseif (you_are_berserk and not was_berserk_last_turn) then max_hp_increased = true end --crawl.mpr(string.format("previous_form is: %s", previous_form)) --crawl.mpr(string.format("current_form is: %s", current_form)) --crawl.mpr(string.format("max_hp_increased is: %s", max_hp_increased and "True" or "False")) --crawl.mpr(string.format("max_hp_decreased is: %s", max_hp_decreased and "True" or "False")) --crawl.mpr(string:format("you_are_berserk is: %s", you_are_berserk and "True" or "False")) --crawl.mpr(string:format("was_berserk_last_turn is: %s", was_berserk_last_turn and "True" or "False")) 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 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 } { local door = true function DDoorWarning() if you.status("in death's door (expiring)") and door then crawl.yesno("DDoor is almost expired! (Y or N to confirm.)", false, false, true, false) crawl.mpr("It will be ended in 5-10 turns...... ") door = false end if not you.status("in death's door (expiring)") then door = true end end } { local counter = you.turns() function DDoorCounter() if you.status("in death's door (expiring)") then crawl.mpr("Count "..you.turns() - counter.."......") end if not you.status("in death's door (expiring)") then counter = you.turns()+1 end end } { local gaunt = true function NoticeGa() if string.find(crawl.messages(4), "gauntlet on this level") and gaunt then gaunt = false crawl.yesno("Hurry, A gateway to the gauntlet has been detected! (Y or N to confirm.)", false, false, true, true) end end } { local bail = true function NoticeBa() if string.find(crawl.messages(4), "bailey on this level") and bail then bail = false crawl.yesno("Hurry, A gateway to a bailey has been detected! (Y or N to confirm.)", false, false, true, true) end end } { local cave = true function NoticeIc() if string.find(crawl.messages(4), "cave on this level") and cave then cave = false crawl.yesno("Hurry, A gateway to an ice cave has been detected! (Y or N to confirm.)", false, false, true, true) end end } { local needgold = true function GoldLimiter() if needgold and you.gold() > 5000 and not Gozag then crawl.setopt("autopickup_exceptions ^= >gold piece") needgold = false end end } { --Never use autopickup_exceptions without ^ or +. otherwise, rest of autopickup settings will be nullified. local PhaseA = true local PhaseB = true local PhaseC = true local PhaseD = true local PhaseE = true function XL_DEWz() if you.xl() >= 9 and PhaseA then crawl.setopt("rest_wait_percent = 80") crawl.setopt("autopickup_exceptions ^= >poisoned") crawl.setopt("autopickup_exceptions ^= = 14 and PhaseB then crawl.setopt("autopickup_exceptions ^= >potion.*might") crawl.setopt("autopickup_exceptions ^= >potion.*berserk rage") crawl.setopt("autopickup_exceptions ^= >wand.*random effects") crawl.setopt("autopickup_exceptions ^= >wand.*polymorph") crawl.setopt("autopickup_exceptions ^= >curare") crawl.setopt("autopickup_exceptions ^= >throwing net") PhaseB = false end if you.num_runes() >= 2 and PhaseC then crawl.setopt("autopickup_exceptions ^= >wand.*flame") crawl.setopt("autopickup_exceptions ^= >wand.*charming") crawl.setopt("autopickup_exceptions ^= >phantom mirror") crawl.setopt("autopickup_exceptions ^= >box of beasts") PhaseC = false end if ((spells.memorised("Death's Door") and spells.fail("Death's Door") <= 15) or you.skill("fighting") >= 18) and PhaseD then crawl.setopt("rest_wait_percent = 50") crawl.setopt("autopickup_exceptions ^= >wand.*mindburst") crawl.setopt("autopickup_exceptions ^= >scroll.*fear") crawl.setopt("autopickup_exceptions ^= >scroll.*summoning") crawl.setopt("autopickup_exceptions ^= = 21 and PhaseE then crawl.setopt("autopickup_exceptions ^= >gold piece") crawl.mpr("testmessage") PhaseE = false end end } ######## Macros ######################## macros += M 5 ===confirmed_rest macros += M \{-265} zj macros += M \{-267} \{6}@artef\{32}&&\{32}!!book\{13} macros += M \{-268} ===automemo macros += M \{-269} ===autobanish macros += M \{-270} ===set_option ######## Miscellaneous Data ######################## #! means you did 7-17 damage. 2!!: 18-35. 3!!!: 36-71. 4!!!!: 72-143. 5!!!!!: 144-287. 6!!!!!!: 288+; and so on. Yikes! #<6: 288-575, 7: 576-1151, 8: 1152-2303, 9: 2304-4607> #The difference between the <> and {} is when the code gets executed. #Code {}, it is executed right away. Other Lua code is executed only after the entire init file is read in. #If a ready() function exists within the rcfile, DCSS will execute it at the beginning of every turn. #Non-ready() functions will be executed once when the game loaded and reads the rcfile. #So function with variable conditions (for example, player XL.) should be supported by ready() function. #If not, the function won't do well without rcfile refreshing (which is annoying). always_show_gems = true more_gem_info = true