forked from elanthia-online/dr-scripts
-
Notifications
You must be signed in to change notification settings - Fork 0
/
boggle_blast.lic
166 lines (152 loc) · 5.25 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
162
163
164
165
166
=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 drinfomon])
class BoggleBlast
include DRC
include DRCH
include DRCI
include DRCM
include DRCT
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
stow_hands
ditch_pumpkins
empty_hands
check_money
go_play
check_prize
end
end
def heal_up
check_health
return unless bleeding?
walk_to(19_104)
move('go path')
pause 5 # assumes quick spider travel option purchased
wait_for_script_to_complete('safe-room')
pause
walk_to(@portal_room)
move('go path')
pause 5 # assumes quick spider travel option purchased
walk_to(10_584)
pause
end
def check_money
get_money if check_wealth('dokoras') < 200 && @withdraw
end
def get_money
walk_to(10_358)
case 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
walk_to(10_584)
unless 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 = 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 bput('load slingshot', 'You carefully load', 'You need to have a pumpkin')
when 'You need to have a pumpkin'
stow_hands
@true_pumpkin = false
get_pumpkin until @true_pumpkin
bput('load slingshot', 'You carefully load')
end
case 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'
fix_standing
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 bput('go door', 'Obvious exits', 'You must be standing to do that')
when 'You must be standing to do that'
fix_standing
bput('go door', 'Obvious exits')
end
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 bput('get pumpkin', 'You help yourself', 'You pick up')
when 'You pick up'
if @fake_pumpkins.any? { |item| Regexp.new(item) =~ right_hand }
stow_hands
else
@true_pumpkin = true
end
else
@true_pumpkin = true
end
end
def check_prize
if @trash_items.any? { |item| Regexp.new(item) =~ right_hand }
bput("put my #{righthand} in bucket", 'You put', 'You drop')
elsif @danger_items.any? { |item| Regexp.new(item) =~ right_hand }
pause
bput('put my doll in bucket', 'An odd sort of noise comes from your doll')
elsif right_hand.include?('wallet')
bput("put my wallet in my #{@stow_container}", 'You put')
elsif right_hand.include?('fan')
bput('close my fan', 'With a practiced')
bput("put my #{right_hand} in bucket", 'You put', 'You drop')
elsif right_hand.include?('ticket') && inside?('ticket', @stow_container)
bput("get ticket in my #{@stow_container}", 'You get')
case bput('combine my ticket', 'You combine', "You can't have")
when "You can't have"
bput('stow right', 'You put')
pause
bput("put my ticket in my #{@full_container}", 'You put')
end
bput('stow my ticket', 'You put')
else
bput('stow right', 'You put', 'You open')
end
fput 'dump junk'
end
def ditch_pumpkins
@ditch = true
while @ditch
case bput("get pumpkin from my #{@stow_container}", 'You get', 'What were you')
when 'You get'
bput('put my pumpkin in bucket', 'You put', 'You drop')
else
@ditch = false
end
end
end
end
BoggleBlast.new