## 1- Starting Screen. ## ----------------------------------------------------------------------- type = normal restart_after_game = true restart_after_save = true name_bypasses_menu = true default_manual_training = true game_seed = none pregen_dungeon = incremental suppress_startup_errors = false ## 3- Interface. ## ----------------------------------------------------------------------- # autopickup = $?!+"/%| autopickup = $?!+"/ default_autopickup = true pickup_thrown = true level_map_cursor_step = 8 ae := autopickup_exceptions # ae = ae += <((curare|datura|atropa)-tipped|poisoned) dart ae += dart of disjunction ae += >uselessness ae += >inaccuracy ## Available maxium view width in terminal. view_max_width = 81 view_max_height = 41 view_lock_x = true view_lock_y = true travel_delay = 20 # travel_delay = -1 explore_greedy_visit = artefacts,glowing_items,stacks rest_wait_both = false rest_wait_percent = 100 explore_auto_rest = true travel_open_doors = approach easy_unequip = false equip_unequip = false easy_confirm = safe simple_targeting = false prompt_menu = false ability_menu = true spell_menu = true easy_floor_use = false sort_menus = true autofight_stop = 50 autofight_fires = false autofight_nomove_fires = false autofight_caught = false autofight_wait = false warn_hatches = true single_column_item_menus = true hp_warning = 30 clear_messages = false show_more = false small_more = false messages_at_top = true view_delay = 300 equip_bar = false mlist_allow_alternative_layout = false monster_item_view_coordinates = false msg_min_height = 12 msg_max_height = 50 show_travel_trail = true default_show_all_skills = true reduce_animations = false show_blood = false always_show_zot = true always_show_gems = true more_gem_info = true show_god_gift = yes fail_severity_to_confirm = 0 fail_severity_to_quiver = 5 ## 4- Dump. ## ----------------------------------------------------------------------- dump_on_save = true dump_kill_places = all dump_item_origins = all dump_message_count = 200 note_messages += [bB]anish.*Abyss note_messages += Your scales start note_chat_messages = true 5- Miscellaneous. ## ----------------------------------------------------------------------- use_modifier_prefix_keys = false # language = en use_terminal_default_colours = false use_fake_cursor = true ## - Macros. ## ----------------------------------------------------------------------- flush.failure = false ## Space to close menus. macros += K \{32} \{27} macros += K1 \{32} \{27} macros += K2 \{32} \{27} macros += K4 \{32} \{27} # macro += K t . # macros += M \{32} x ## c is unequip armours, change to rest. macros += M c 5 # macros += M ` 5 ## f for fight melee enemy. bindkey = [\{Tab}] CMD_AUTOFIGHT_NOMOVE bindkey = [f] CMD_AUTOFIGHT_NOMOVE # macros += f \{Tab} # macros += M ; x macros += K2 ; x macros += M ; o # macros += M t f # macros += M w t bindkey = [t] CMD_FIRE bindkey = [w] CMD_SHOUT macros += M o wt macros += M o ===safe_shout # macros += M \{Tab} \{Tab}o # macros += M f \{Tab} # macros += M \{Tab} f macros += M 1 ===zap_spell_1 macros += M 2 ===zap_spell_2 macros += M 3 ===zap_spell_3 macros += M 4 ===zap_spell_4 macros += M 5 ===zap_spell_5 macros += M 6 ===zap_spell_6 macros += M 7 ===zap_spell_7 macros += M 8 ===zap_spell_8 macros += M 9 ===zap_spell_9 macros += M 0 ===zap_spell_0 ## 5- Menu colour. ## ----------------------------------------------------------------------- menu := menu_colour # menu = $decent := white $mp := lightcyan $interface := cyan $danger := lightred $item_dmg := red $warning := yellow $boring := darkgrey $negative := brown $positive := green $good := lightblue $verypositive := lightgreen $awesome := lightmagenta ## 6- Message color. ## ----------------------------------------------------------------------- $danger := lightred $item_dmg := red $warning := yellow $boring := darkgrey $negative := brown $good := lightblue $positive := green $verypositive := lightgreen $awesome := lightmagenta $interface := cyan $takesaction := blue $godaction := magenta $mp := lightcyan msc := message_colour # msc = ## 7- Force more message. ## ----------------------------------------------------------------------- fsm := flash_screen_message fsm = fmm := force_more_message # fmm = fmm ^= have enough gold to fund merchants fmm ^= ribbon worm comes into view fmm ^= You are caught in a web fmm ^= has recharged fmm ^= breathes a plume of calcifying fmm ^= You are caught in a web fmm ^= Found a staircase to the Ecumenical Temple fmm ^= Move or burn fmm ^= shatters for extra damage fmm ^= Training target.*reached fmm ^= You miscast fmm ^= Your pack is full fmm ^= flickers and vanishes fmm ^= You can no longer fmm ^= You fail to use your ability fmm ^= wielding.* of .* fmm ^= wielding.*heavy.* fmm ^= cannot cast spells while unable to breathe fmm ^= You feel the corruption within you wane completely fmm ^= is duplicated fmm ^= evaporates and reforms as fmm ^= flies into a frenzy fmm ^= seems to speed up fmm ^= seems to grow stronger fmm ^= seems more resistant fmm ^= throws miasma at you fmm ^= The foul vapour engulfs you fmm ^= You are engulfed in dark miasma fmm ^= You feel yourself slow down fmm ^= Something hits you -- Kikubaaqudgha grants you gift of spell knowledge. fmm ^= forbidden knowledge -- Jiyva mutate you. fmm ^= Jiyva alters your body -- Felid get an extra life. fmm ^= Extra life -- Death's Door ends. fmm ^= Your life is in your own.*again -- Cooldown ends so able to cast Death's Door again. fmm ^= You step away from death's doorway -- Detect runes in pandemonion. fmm ^= They guard the.*rune fmm ^= The heavenly storm settles fmm ^= shining eye comes into view fmm ^= death talisman rsm := runrest_stop_message rsm ^= Your hearing returns ## 8- Lua code. ## ----------------------------------------------------------------------- # lua_file = main.lua { function zap_spell(index) local spell = you.spells()[index] if spell == nil then crawl.mpr("No spell " .. tostring(index) .. " existed.") return end crawl.mpr("You cast " .. spell .. ".") spells.cast(spell, 0, 0, true) end function zap_spell_1(index) zap_spell(1) end function zap_spell_2(index) zap_spell(2) end function zap_spell_3(index) zap_spell(3) end function zap_spell_4(index) zap_spell(4) end function zap_spell_5(index) zap_spell(5) end function zap_spell_6(index) zap_spell(6) end function zap_spell_7(index) zap_spell(7) end function zap_spell_8(index) zap_spell(8) end function zap_spell_9(index) zap_spell(9) end function zap_spell_0(index) zap_spell(0) end -- add_autopickup_func(function(it, name) -- if it.is_useless then -- return -- end -- if it.class(true) == "armour" then -- local good_slots = {cloak="Cloak", helmet="Helmet", gloves="Gloves", -- boots="Boots"} -- st, _ = it.subtype() -- if good_slots[st] ~= nil and items.equipped_at(good_slots[st]) == nil then -- return true -- end -- end -- end) add_autopickup_func(function(it, name) if it.is_useless then return false end if name:find("dispersal") and name:find("boomerang") then return true end if name:find("throwing net") then return true end local class = it.class(true) local armour_slots = {cloak="Cloak", helmet="Helmet", gloves="Gloves", boots="Boots", body="body Armour", shield="Shield"} if (class == "armour") then local sub_type = it.subtype() local equipped_item = items.equipped_at(armour_slots[sub_type]) -- crawl.mpr("armour: " .. sub_type) -- if equipped_item ~= nil then crawl.mpr(" equipped: " .. equipped_item) end if (sub_type == "cloak") or (sub_type == "helmet") or (sub_type == "gloves") or (sub_type == "boots") then if (you.race() == "Octopode") then if sub_type == "helmet" then return it.artefact or it.branded or it.ego end return false end if you.race() == "Minotaur" then if sub_type == "helmet" then return it.artefact or it.branded or it.ego end end if you.race() == "Felid" then return false end if not equipped_item then return true else return it.artefact or it.branded or it.ego end end if (sub_type == "body") then if you.race():find("Draconian") then return false end if you.race() == "Felid" then return false end if you.race() == "Octopode" then return false end if equipped_item then local armourname = equipped_item.name() if equipped_item.artefact or equipped_item.branded or equipped_item.ego or (equipped_item.plus > 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 false end if (sub_type == "shield") then if equipped_item then if equipped_item.artefact or equipped_item.branded or equipped_item.ego or (equipped_item.plus > 2) then return it.artefact or it.branded or it.ego else return true end else return it.artefact or it.branded or it.ego end end end end) -- add_autopickup_func(function(it, name) -- local talismans = {"death talisman", "granite talisman", "storm talisman"} -- if it:subtype() ~= nil and not util.contains(talismans, it:subtype()) then -- return true -- end -- local inv = items.inventory() -- for k, v in ipairs(inv) do -- -- crawl.mpr(tostring(v:name()) .. ": " .. tostring(v:subtype())) -- if v:subtype() ~= nil and v:subtype() == it:subtype() then -- return false -- end -- end -- return true -- end) local need_skills_opened = true function open_skills() if you.turns() == 0 and need_skills_opened then need_skills_opened = false crawl.sendkeys("m") end end local previous_hp = 0 local previous_mp = 0 local previous_form = "" local was_berserk_last_turn = false function announce_damage() 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")) --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!!") alert("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 function alert(message, channel) channel = channel or 5 crawl.mpr(message, channel) crawl.more() end function warn_hp() local hp, max_hp = you.hp() local hp_ratio_warning = 0.30 local hp_warning = 5 if (hp / max_hp <= hp_ratio_warning or hp <= hp_warning) and not you.feel_safe() then -- alert("LOW HP!!! STOP AND THINK CAREFULLY BEFORE ACTIONS!!!") end end local warn_unique_times = 3 function warn_danger() -- crawl.mpr("warning danger") -- dump(c_persist['seen_uniques']) -- crawl.mpr("dumped") local los = you.los() for i = -los,los do for j = -los,los do local mm = monster.get_monster_at (i,j) if mm then if not mm:is_safe() then local mon_threat = mm:threat() local mon_name = mm:name() if mm:is_unique() then -- crawl.mpr("1") if c_persist['seen_uniques'] == nil then -- crawl.mpr("2") c_persist['seen_uniques'] = {} end -- crawl.mpr("3") -- crawl.mpr(":" .. tostring(c_persist['seen_uniques'][mon_name]) .. ":") if c_persist['seen_uniques'][mon_name] == nil or c_persist['seen_uniques'][mon_name] < warn_unique_times then -- crawl.mpr("4") alert("UNIQUE: " .. mon_name .. "!!!", 5) end -- crawl.mpr("5") c_persist['seen_uniques'][mon_name] = 1 + (c_persist['seen_uniques'][mon_name] or 0) elseif mon_threat == 3 then -- crawl.mpr("DANGER! " .. mon_name .." !!!!!!", 5) elseif mon_threat == 2 then -- crawl.mpr(mon_name, 5) end end -- if mm:res_poison() then -- crawl.mpr("The " .. mm:name() .. " resists poison!", 5) -- end -- crawl.mpr(mm:target_desc()) end end end end local previous_teleport_time = -1 function announce_teleport() if previous_teleport_time < 0 and you.teleporting() then previous_teleport_time = you.time() end if not you.teleporting() then if previous_teleport_time >= 0 then crawl.mpr("The teleport costs " .. ((you.time() - previous_teleport_time) / 10) .. " decaAuts.") end previous_teleport_time = -1 end end function init_c_persist() if you.turns() == 0 then c_persist['seen_uniques'] = {} c_persist['last_shout_turn'] = 0 end end function ready() init_c_persist() open_skills() announce_damage() announce_teleport() warn_danger() warn_hp() end -- local sound_from_creatures = { -- ["intelligent creature"] = "hear.*shout", -- ["bullfrog"] = "deep croak"} -- -- for k, v in pairs(sound_from_creatures) do -- sound_from_creatures[k] = crawl.regex(v) -- end -- function c_message(text, channel) -- for being, pat in pairs(sound_from_creatures) do -- if pat:matches(text) then -- crawl.mpr("There're " .. being .. " neraby.") -- end -- end -- end function dump(o) if type(o) == 'table' then local s = '{ ' for k,v in pairs(o) do if type(k) ~= 'number' then k = '"'..k..'"' end s = s .. '['..k..'] = ' .. dump(v) .. ',' end return s .. '} ' else return tostring(o) end end local shout_keys = "wt" function shout() crawl.sendkeys(shout_keys) end function safe_shout() if not you.feel_safe() then -- local insisted = crawl.yesno("You don't feel safe! Still shout? (y/n)", true, "n") local insisted = false while true do crawl.mpr("You don't feel safe! Still shout? (f/space)", "prompt") crawl.flush_prev_message() local ch = crawl.getch() -- crawl.mpr(tostring(ch)) -- keycode for f if ch == 102 then insisted = true break end -- keycode for space and n if ch == 27 or ch == 110 then insisted = false break end end if insisted then shout() end return end shout() end function safe_contiguous_shout() local turn = you.turns() local last_shout_turn = c_persist['last_shout_turn'] if last_shout_turn ~= nil and last_shout_turn == turn - 1 then -- TODO: cannot return boolean. if safe_shout() then c_persist['last_shout_turn'] = turn end else shout() c_persist['last_shout_turn'] = turn end end local prev_hp = you.hp() function c_message(text, channel) local hp = you.hp() if hp < prev_hp then crawl.flush_prev_message() crawl.mpr("It deals " .. tostring(prev_hp - hp) .. " damage.", "monster_damage") crawl.flush_prev_message() end prev_hp = hp end }