forked from rpherbig/dr-scripts
-
Notifications
You must be signed in to change notification settings - Fork 0
/
boggle_blast.lic
161 lines (147 loc) · 5.36 KB
/
boggle_blast.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
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
=begin
Documentation: https://elanthipedia.play.net/Lich_script_repository#boggle_blast
=end
custom_require.call(%w[common common-healing common-items common-money common-travel])
class BoggleBlast
def initialize
settings = get_settings
@stow_container = settings.boggle_stow_container # set this to be your main default storage container - i.e. the one used in STORE LIST set to default
@full_container = settings.boggle_full_container # this container is used to store full 100k HE ticket stacks, set it to a DIFFERENT container than the default
@withdraw = settings.boggle_withdraw
@portal_room = if settings.hometown == 'Shard'
2780
else
932
end
@cash = settings.boggle_cash_on_hand
@trash_items = settings.boggle_junk
@danger_items = ['doll'] # TODO: add this in to trash_items?
@fake_pumpkins = ['wooden pumpkins', 'cambrinth pumpkin']
do_boggle_crap
end
def do_boggle_crap
loop do
heal_up
DRCI.stow_hands
ditch_pumpkins
empty_hands
check_money
go_play
check_prize
end
end
def heal_up
DRCH.check_health
return unless bleeding?
DRCT.walk_to(19_104)
move('go path')
pause 5 # assumes quick spider travel option purchased
DRC.wait_for_script_to_complete('safe-room')
pause
DRCT.walk_to(@portal_room)
move('go path')
pause 5 # assumes quick spider travel option purchased
DRCT.walk_to(10_584)
pause
end
def check_money
get_money if DRCM.check_wealth('dokoras') < 200 && @withdraw
end
def get_money
DRCT.walk_to(10_358)
case DRC.bput("withdraw #{@cash} dokoras", 'The clerk counts out', 'The clerk tells you', 'You must be at')
when 'The clerk counts out'
echo 'got cash'
return
else
echo 'Out of cash!'
exit
end
end
def go_play
DRCT.walk_to(10_584)
unless DRC.bput('give farmer 200 dokoras', 'The farmer takes your money', 'Sorry, the game rooms are all full right now') == 'The farmer takes your money'
while (line = get)
next unless line =~ /^The pumpkin farmer (beams happily|grins) at/
response = DRC.bput('give farmer 200 dokoras', 'The farmer takes your money', 'Sorry, the game rooms are all full right now')
next if response =~ /Sorry, the game rooms are all full right now/
break if response =~ /The farmer takes your money/
end
end
5.times do
@true_pumpkin = false
get_pumpkin until @true_pumpkin
case DRC.bput('load slingshot', 'You carefully load', 'You need to have a pumpkin')
when 'You need to have a pumpkin'
DRCI.stow_hands
@true_pumpkin = false
get_pumpkin until @true_pumpkin
DRC.bput('load slingshot', 'You carefully load')
end
case DRC.bput('fire slingshot', 'You position the slingshot', 'You let loose', 'You carefully aim the', 'You really should be standing to play', 'You fire the slingshot and awkwardly', 'You take careful aim')
when 'You really should be standing to play'
DRC.fix_standing
DRC.bput('fire slingshot', 'You position the slingshot', 'You let loose', 'You carefully aim the', 'You fire the slingshot and awkwardly', 'You take careful aim')
end
pause
end
pause
case DRC.bput('go door', 'Obvious exits', 'You must be standing to do that')
when 'You must be standing to do that'
DRC.fix_standing
DRC.bput('go door', 'Obvious exits')
end
DRC.bput('get prize', 'The pumpkin farmer beams happily at you', 'The pumpkin farmer grins at you')
pause
end
def get_pumpkin
@true_pumpkin = false
case DRC.bput('get pumpkin', 'You help yourself', 'You pick up')
when 'You pick up'
if @fake_pumpkins.any? { |item| Regexp.new(item) =~ DRC.right_hand }
DRCI.stow_hands
else
@true_pumpkin = true
end
else
@true_pumpkin = true
end
end
def check_prize
if @trash_items.any? { |item| Regexp.new(item) =~ DRC.right_hand }
DRC.bput("put my #{righthand} in bucket", 'You put', 'You drop')
elsif @danger_items.any? { |item| Regexp.new(item) =~ DRC.right_hand }
pause
DRC.bput('put my doll in bucket', 'An odd sort of noise comes from your doll')
elsif DRC.right_hand.include?('wallet')
DRC.bput("put my wallet in my #{@stow_container}", 'You put')
elsif DRC.right_hand.include?('fan')
DRC.bput('close my fan', 'With a practiced')
DRC.bput("put my #{DRC.right_hand} in bucket", 'You put', 'You drop')
elsif DRC.right_hand.include?('ticket') && DRCI.inside?('ticket', @stow_container)
DRC.bput("get ticket in my #{@stow_container}", 'You get')
case DRC.bput('combine my ticket', 'You combine', "You can't have")
when "You can't have"
DRC.bput('stow right', 'You put')
pause
DRC.bput("put my ticket in my #{@full_container}", 'You put')
end
DRC.bput('stow my ticket', 'You put')
else
DRC.bput('stow right', 'You put', 'You open')
end
fput 'dump junk'
end
def ditch_pumpkins
@ditch = true
while @ditch
case DRC.bput("get pumpkin from my #{@stow_container}", 'You get', 'What were you')
when 'You get'
DRC.bput('put my pumpkin in bucket', 'You put', 'You drop')
else
@ditch = false
end
end
end
end
BoggleBlast.new