forked from rpherbig/dr-scripts
-
Notifications
You must be signed in to change notification settings - Fork 0
/
better-book.lic
44 lines (35 loc) · 1.19 KB
/
better-book.lic
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
custom_require.call(%w[drinfomon events common])
class BetterBook
include DRC
def initialize
arg_definitions = [
[
# { name: 'item', regex: /\w+|\w+\s\w+/, variable: true, description: 'item to steal' },
# { name: 'container', regex: /.+/i, variable: true, description: 'Where the item is to steal e.g in catalog, on counter' }
]
]
parse_args(arg_definitions)
settings = get_settings
@writing_instrument = settings.writing_instrument
start_book
end
def start_book
pages = []
bput('turn register to content', 'You flip', 'But a ')
fput('read register')
loop do
case get
when /(\d+) --/
pages << Regexp.last_match(1)
when /Maximum/
_respond(pages.map { |d| "<d cmd='turn register to page #{d}'>#{d}</d>" }.join(' '))
pages = []
when /You flip your deed register to page (\d+)/, /You think the item/
_respond("<d cmd='read register'>Read</d> <d cmd='tap register'>Pull</d> <d cmd='turn register to content'>Contents</d>")
when /You flip your deed register to the contents page/, /But a deed register/
fput('read register')
end
end
end
end
BetterBook.new