# Dungeon Crawl Stone Soup 0.4.1 # Section 1: Starting Screen {{{ name = doy remember_name = true #use_old_selection_order = false #weapon = #book = #chaos_knight = #death_knight = #priest = #race = #class = #random_pick = false #good_random = true # }}} # Section 2: File System {{{ #crawl_dir = /home/doy/coding/src/stone_soup-trunk/crawl-ref/source #morgue_dir = morgue #save_dir = saves #macro_dir = settings/ #sound = : # }}} # Section 3: Lua Files {{{ lua_file = lua/chnkdata.lua lua_file = lua/safechnk.lua lua_file = lua/stash.lua lua_file = lua/wield.lua lua_file = lua/kills.lua lua_file = lua/runrest.lua lua_file = lua/gearset.lua lua_file = lua/eat.lua lua_file = lua/pickup.lua lua_file = lua/trapwalk.lua # }}} # Section 4: Interface {{{ # Section 4-a: Picking up and Dropping {{{ #autopickup = $?!+"/% autopickup_exceptions = # }}} #default_autopickup = true autopickup_no_burden = true #pickup_thrown = true #pickup_dropped = false #chunks_autopickup = true assign_item_slot = backward #drop_mode = multi pickup_mode = multi # XXX: make this select all non-worn items? #drop_filter = default_friendly_pickup = friend # }}} # Section 4-b: Targeting {{{ #target_zero_exp = false #target_oos = true #target_los_first = true #default_target = true #target_unshifted_dirs = false # }}} # Section 4-c: Passive Sightings {{{ #detected_monster_colour = lightred #detected_item_colour = green #remembered_monster_colour = darkgrey #colour_map = true #clean_map = false # }}} # Section 4-d: Branding {{{ friend_brand = hi:yellow neutral_brand = hi:darkgrey stab_brand = hi:blue may_stab_brand = hi:green heap_brand = reverse feature_item_brand = reverse trap_item_brand = reverse # }}} # Section 4-e: Level Map Functions {{{ #level_map_cursor_step = 7 #level_map_title = true #item_colour = true # }}} # Section 4-f: Viewport Options {{{ #view_max_width = 33 #view_max_height = 21 view_lock_x = false view_lock_y = false #view_lock = true #center_on_scroll = false symmetric_scroll = false #scroll_margin_x = 2 #scroll_margin_y = 2 #scroll_margin = 2 # }}} # Section 4-g: Travel and Exploration {{{ travel_delay = -1 #travel_avoid_terrain = #explore_greedy = true explore_stop = glowing_items,artefacts,runes,greedy_pickup explore_stop += stairs,shops,altars,gates #explore_improved = false #tc_reachable = blue #tc_dangerous = cyan #tc_disconnected = darkgrey #tc_excluded = lightmagenta #tc_exclude_circle = red include = travel_stoppers.txt travel_stop_message = duration: travel_stop_message = turns to flee # XXX: catch more 'about to expire' messages here runrest_ignore_message = pray: runrest_ignore_message = You feel.*sick runrest_ignore_message = disappears in a puff of smoke runrest_ignore_message = engulfed in a cloud of smoke runrest_ignore_message = safely over a trap runrest_ignore_message = merges.*into the air runrest_ignore_message = forms.*from the air runrest_ignore_poison = 2:30 runrest_ignore_monster = fish:2 runrest_ignore_monster = butterfly:1 runrest_ignore_monster = swamp worm:3 runrest_ignore_monster = lava worm:3 #trap_prompt = true trapwalk_safe_hp = dart:20,needle:15,arrow:35,bolt:45,spear:40,axe:45,blade:95 #rest_wait_both = false # }}} # Section 4-h: Stashes {{{ # XXX: look for other possibilities for this stash_filter = 14,4:21 annotate_item_class = true annotate_item_dropped = true # }}} # Section 4-i: Command Enhancements {{{ #auto_list = true #easy_open = true #easy_unequip = true #easy_confirm = safe #allow_self_target = prompt #easy_butcher = true #always_confirm_butcher = false #swap_when_safe = true #easy_quit_item_prompts = true #easy_exit_menu = true auto_eat_chunks = true sort_menus = true : equipped,identified,curse,art,ego,glowing,freshness,>qty,basename # }}} # Section 4-j: Messages and Display Enhancements {{{ hp_warning = 40 #mp_warning = 0 hp_colour = lightgrey,99:green,80:yellow,40:red mp_colour = lightgrey,99:green,80:yellow,40:red #status_caption_colour = yellow delay_message_clear = true show_inventory_weights = true show_gold_turns = true #show_beam = true item_stack_summary_minimum = 1 #list_rotten = true #mlist_min_height = 5 msg_max_height = 30 #mlist_allow_alternate_layout = false #mlist_targetting = false #classic_hud = false menu_colour_prefix_class = true # XXX: this priority order needs tweaking - especially the stuff that's marked # as lightgrey now menu_colour = white:\s\+\s menu_colour = white:\s\#\s menu_colour = magenta:artefact menu_colour = cyan:emergency_item menu_colour = cyan:potion.*berserk rage menu_colour = cyan:scroll.*fog menu_colour = yellow:gluggy white potion menu_colour = lightgrey:potion.*(restore abilities|might) menu_colour = magenta:good_item menu_colour = magenta:potion.*mutation menu_colour = lightred:dangerous_item menu_colour = pickup:magenta:god gift include = standard_colours.txt $evil := brown include = food_colouring.txt include = menu_colours.txt menu_colour = white:equipped message_colour = mute:You start (searching|resting) message_colour = mute:Done searching message_colour = mute:Your legs become a tail as you enter include = messages.txt force_more_message = You are starting to lose your buoyancy force_more_message = Space (bends|warps horribly) around force_more_message = danger: #msg_condense_repeats = true # }}} # Section 4-k: Firing Commands {{{ #fire_items_start = a #fire_order = launcher, return #fire_order += javelin / dart / stone / rock / spear / net / handaxe / dagger / club #fire_order += inscribed # }}} # Section 4-l: Channels {{{ # XXX: bug report - options_guide.txt claims that channel.multiturn is mute by #default #channel.CHANNEL_NAME = # }}} # Section 4-m: Inscriptions {{{ autoinscribe = distortion:!w autoinscribe = deck:!p autoinscribe = potion.*mutation:!q # }}} # Section 4-n: Macro related Options {{{ #flush.failure = true #flush.command = false #flush.message = false macro_meta_entry = false #additional_macro_file = #bindkey = # }}} # Section 4-o: Tile related Options {{{ include = tiles_options.txt # }}} # }}} # Section 5: Dump File {{{ # Section 5-a: Items and Kill List {{{ #kill_map = #dump_kill_places = single dump_item_origins = artifacts,ego_arm,ego_weap,jewellery dump_item_origin_price = 200 dump_message_count = 20 dump_order = header,hiscore,stats,inventory,skills,spells,mutations dump_order += overview,misc,screenshot,messages,notes,monlist,kills dump_order += turns_by_place,kills_by_place # }}} # Section 5-b: Notes {{{ user_note_prefix = doy: note_items = rune of,acquirement,Orb note_monsters = ^[A-Z],orb of fire,lich ood_interesting = 6 rare_interesting = 9 note_hp_percent = 5 note_skill_levels = 1,8,15,21,27 #note_all_skill_levels = false note_skill_max = true note_all_spells = true note_messages = You pass through the gate note_messages = [bB]anish.*Abyss note_messages = Your scales start note_messages = protects you from harm note_messages = You fall through a shaft # }}} # }}} # Section 6: Miscellaneous {{{ # Section 6-a: All OS {{{ #mouse_input = false wiz_mode = yes #char_set = ascii #classic_item_colours = false #colour.OLDCOLOUR = NEWCOLOUR #cset_ascii = #cset_ibm = #cset_dec = #cset_unicode = #cset_any = #feature = mon_glyph = _ : p mon_glyph = oklob plant : lightmagenta mon_glyph = Xtahua : lightmagenta mon_glyph = acid blob : lightmagenta mon_glyph = giant eyeball : cyan mon_glyph = greater mummy : lightmagenta mon_glyph = ancient lich : lightmagenta mon_glyph = curse skull : lightmagenta # }}} # Section 6-b: DOS and Windows {{{ #dos_use_background_intensity = false # }}} # Section 6-c: Unix {{{ #background = BLACK #use_fake_cursor = false # }}} # }}} fsim_mons = Dispater fsim_xl = 27 # greedy_autoexplore should stop not only for ego/arts, but also for armor that # i can wear that i don't currently own any of (normal cloaks are useful if i # don't have a cloak yet) : function pray_prompt() : crawl.formatted_mpr("Really pray?", "prompt") : local res = crawl.getch() : if string.lower(string.char(res)) == "y" then : crawl.sendkeys("p") : end : end < do -- globals {{{ local x, y = 1, 1 local map = { [1] = { [1] = 'f' } } local last_move = '' local turns = 0 local seen_a_monster = false -- }}} function vi_to_delta(key) -- {{{ local v2d = { y = {-1, 1}, k = {0, 1}, u = {1, 1}, h = {-1, 0}, l = {1, 0}, b = {-1, -1}, j = {0, -1}, n = {1, -1}, } return v2d[key] end -- }}} function delta_to_vi(dx, dy) -- {{{ local d2v = { [-1] = { [-1] = 'b', [0] = 'h', [1] = 'y'}, [0] = { [-1] = 'j', [1] = 'k'}, [1] = { [-1] = 'n', [0] = 'l', [1] = 'u'}, } return d2v[dx][dy] end -- }}} function reset() -- {{{ x, y = 1, 1 map = { [1] = { [1] = 'f' } } last_move = '' crawl.mpr("Reset!") end -- }}} function dijkstra() -- {{{ local stack = {} local dist = {} table.insert(stack, {pos = {x, y}, dist = 0, path = ''}) dist[x] = {[y] = 0} while #stack ~= 0 do table.sort(stack, function(a, b) return a.dist > b.dist end) local node = table.remove(stack) for _, deltas in pairs({{1,1},{1,0},{1,-1},{0,1},{0,-1},{-1,1},{-1,0},{-1,-1}}) do local dx, dy = unpack(deltas) local nx, ny = node.pos[1] + dx, node.pos[2] + dy local next_path = node.path .. delta_to_vi(dx, dy) local next_dist = node.dist + 1 map[nx] = map[nx] or {} dist[nx] = dist[nx] or {} if map[nx][ny] == nil then return next_path:sub(1, 1) elseif map[nx][ny] == 'f' and (dist[nx][ny] == nil or dist[nx][ny] > next_dist) then table.insert(stack, {pos = {nx, ny}, dist = next_dist, path = next_path}) dist[nx][ny] = next_dist end end end end -- }}} function update_turn() -- {{{ dt = you.turns() - turns turns = you.turns() local delta = vi_to_delta(last_move) if delta == nil then return end local dx, dy = unpack(delta) if dt == 0 then map[x + dx] = map[x + dx] or {} map[x + dx][y + dy] = 'w' else for i = 1, dt do map[x + i * dx] = map[x + i * dx] or {} map[x + i * dx][y + i * dy] = 'f' end x = x + dx * dt y = y + dy * dt end end -- }}} function minotaur_in_view() -- {{{ return seen_a_monster end -- }}} function step_solve_lab(coro) -- {{{ update_turn() last_move = dijkstra() if last_move == nil then crawl.mpr("nil move!"); return end --crawl.mpr("sending " .. last_move) crawl.sendkeys(last_move) if coro then return not minotaur_in_view() else return end end -- }}} function solve_lab() -- {{{ crawl.mpr("Solving lab...") while true do coroutine.yield(step_solve_lab(true)) end crawl.mpr("Minotaur!") end -- }}} local old_ch_mon_is_safe = ch_mon_is_safe function ch_mon_is_safe(...) -- {{{ seen_a_monster = true return old_ch_mon_is_safe(...) end -- }}} end > < function test1() crawl.sendkeys("j") coroutine.yield(true) crawl.sendkeys("j") coroutine.yield(false) end > < function test2() crawl.sendkeys("j") coroutine.yield(true) crawl.sendkeys("j") coroutine.yield(true) crawl.sendkeys("j") coroutine.yield(false) end > < function test3() crawl.sendkeys("j") coroutine.yield(true) crawl.sendkeys("j") coroutine.yield(true) crawl.sendkeys("j") coroutine.yield(true) crawl.sendkeys("j") coroutine.yield(false) end >