summaryrefslogtreecommitdiffstats
path: root/crawlrc
blob: 7841cfaa6df076542838eec9dc90720155526494 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
# 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      = <regex>:<path to sound file>
# }}}
# 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 = <potion.*mutation
autopickup_exceptions = <scroll.*torment
# XXX: hack, since i can't disable ae excludes
#include                = autopickup_exceptions.txt
# Contents of autopickup_exceptions.txt {{{
ae := autopickup_exceptions
ae = <curare-tipped
ae = useless_item
ae = inedible
# XXX: disabled
ae = dangerous_item
ae = amulet of (inaccuracy|the gourmand|controlled flight|warding)
ae = amulet of (resist .*|clarity|rage|conservation)
ae = ring of (see invisible|levitation|poison resistance|hunger)
ae = ring of (fire|ice|sustenance|invisibility)
ae = ring of (magical power|regeneration)
< do
local old_ch_autopickup = ch_autopickup or function() return true end
function ch_autopickup(it)
    return you.where() ~= "Abyss" and old_ch_autopickup(it)
end
end >
# }}}
#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 = <filename>
#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 >