forked from elanthia-online/dr-scripts
-
Notifications
You must be signed in to change notification settings - Fork 0
/
find-darkbox.lic
127 lines (112 loc) · 4.07 KB
/
find-darkbox.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
# quiet
=begin
Documentation: https://elanthipedia.play.net/Lich_script_repository#find-darkbox
=end
custom_require.call(%w[events common-travel common common-items])
arg_definitions = [
[
{ name: 'override', regex: /override/i, optional: true, description: 'Use remedies instead of herbs if herbs defined in yaml and passed into heal-remedy.' }
]
]
args = parse_args(arg_definitions)
override = args.override
settings = get_settings
trash_items = settings.hollow_eve_junk.map { |x| /\b#{x}\b/i }
darkbox_stop_on_wounded = settings.darkbox_stop_on_wounded
he_use_herbs_remedies = settings.he_use_herbs_remedies
hollow_eve_loot_container = settings.hollow_eve_loot_container
if Script.running?('roomnumbers')
stop_script('roomnumbers')
before_dying { start_script('roomnumbers') }
end
rooms = [16_150, 16_153, 16_154, 16_276, 16_277, 16_278, 16_290, 16_291, 16_292, 16_293,
16_294, 16_295, 16_296, 16_159, 16_161, 16_166, 16_169, 16_174, 16_185, 16_217,
16_221, 16_224, 16_226, 16_227, 16_235, 16_188, 16_195, 16_203, 16_204, 16_205,
16_208, 16_238, 16_240, 16_241, 16_242, 16_244, 16_248, 16_249, 16_263,
16_264, 16_267, 16_268, 16_318, 16_256, 16_257]
fput("stop play") # In case you were playing a song.
if UserVars.last_darkbox && rooms.include?(UserVars.last_darkbox)
rooms.rotate! until rooms.first == UserVars.last_darkbox
end
rooms.each do |id|
pause 20 if reget(5, 'You try, but')
break if DRRoom.room_objs.any? { |x| /Darkbox/ =~ x }
break if Map.last_seen_objects.include?('Darkbox')
DRCT.walk_to(id)
end
UserVars.last_darkbox = Room.current.id
Flags.add('darkbox-drop', 'Your .* falls to the ground')
Flags.add('darkbox-gone', 'Without warning, the Darkbox simply vanishes')
Flags.add('darkbox-wounded', 'Your injury increases the difficulty of the game, but you press on')
Flags.add('darkbox-no-money', /You try to play the Darkbox, but realize you don't have the 200 Kronars required. How depressing./)
loop do
if Flags['darkbox-gone']
UserVars.last_darkbox = nil
break
end
Flags.reset('darkbox-drop')
fput('stand') unless checkstanding
break if darkbox_stop_on_wounded && Flags['darkbox-wounded']
fput('play dark')
pause 1
if reget(5, "What type of song did you want to play?")
DRC.message("*** Darkbox not found in any of the rooms! ***")
exit
end
#break if Flags['darkbox-no-money']
if Flags['darkbox-no-money']
DRC.message("*** You are out of money. Heading to bank to get more! ***")
DRCT.walk_to(16_315)
case DRC.bput('withdraw 3 platinum', 'we are not lending money at this time', 'The clerk counts out')
when 'we are not lending money at this time'
exit
end
fput('balance')
Flags.reset('darkbox-no-money')
DRCT.walk_to(UserVars.last_darkbox)
end
if reget(10, 'your wounds make it impossible')
if he_use_herbs_remedies
if override
DRC.wait_for_script_to_complete('heal-remedy', ['quick', 'override'])
else
DRC.wait_for_script_to_complete('heal-remedy', ['quick'])
end
if reget(3, 'What were')
DRC.message("*** Out of herbs or remedies! Seek out more or an Empath! ***")
break
end
pause 65 # Gives time for herbs to work so you do not receive the feel nasua message
else
break
end
end
[DRC.left_hand, DRC.right_hand]
.compact
.each do |in_hand|
if in_hand
case in_hand
when *trash_items
DRC.bput("put my #{in_hand} in bucket", 'You put', 'You drop', 'What were', 'Stow what?')
else
# Coil rope so we can store it
if /\brope\b/ =~ in_hand
fput("coil my #{in_hand}")
end
if !DRCI.put_away_item?(in_hand, hollow_eve_loot_container)
DRC.message("*** The item is either too big to fit or no more room in the container(s)! ***")
DRC.beep
exit
end
end
end
end
waitrt?
end
DRCT.walk_to(16_150)
before_dying do
Flags.delete('darkbox-drop')
Flags.delete('darkbox-gone')
Flags.delete('darkbox-wounded')
Flags.delete('darkbox-no-money')
end