forked from brycole/gemstone
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdeath_potions.lic
More file actions
230 lines (229 loc) · 6.27 KB
/
death_potions.lic
File metadata and controls
230 lines (229 loc) · 6.27 KB
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
=begin
death_potions
Written by Gibreficul, with a little help from my friends.
You probably aren't one of them.
Just start the script.
Updated to remove CON penalty.
If I hate you, the script will exit.
The script will buy potions until you've got no sting and full CON or no silvers. (or it should)
author: Gibreficul
tags: death, recovery, potions, utility
=end
def find_nearest(target_list)
#You probably have this method somewhere already, it's recycled in a ton of scripts, but it's here if you don't.
start_room = Room.current
least_time = nil
least_target = nil
previous, shortest_distances = Map.dijkstra(start_room.id)
for target in target_list
return target if start_room.id == target
est_time = shortest_distances[target]
if !est_time.nil? and (least_time.nil? or least_time > est_time)
least_target = target
least_time = est_time
end
end
least_target = nil unless least_target
return least_target
end
def checksting
array = []
done = false
action = proc{ |lines|
if lines =~ /Experience/
lines =~ /Death's Sting.\s+(\w+)/
$sting = $1
nil
elsif lines =~ /Recent Death/
lines =~ /Recent Deaths.\s+(\d)/
$recentdeath = $1
nil
elsif lines =~ /\<prompt time\=/
done = true
nil
else
nil
end
}
DownstreamHook.add('exper', action)
status_tags
$_SERVER_.puts "exp"
t=Time.now
wait_until {done or t+3<Time.now}
DownstreamHook.remove('exper')
status_tags
if $sting =~ /none/i
return(false)
else
return($sting)
end
end
def check_con
done = false
con_potions ||= 0
action = proc{|lines|
case lines
when /Constitution.*?(\d+)\s\((\d+)\).*?\<pushBold\/\>(\d+)\<popBold\/\>\s\(\<pushBold\/\>(\d+)\<popBold\/\>\)/
realcon = $1.to_i
enhcon = $3.to_i
con_potions = realcon - enhcon
nil
when /Constitution.*?(\d+)\s\((\d+)\).*?\<pushBold\/\>(\d+)\<popBold\/\>.*?/
realcon = $1.to_i
enhcon = $3.to_i
con_potions = realcon - enhcon
nil
when /Name\: \<a exist/
nil
when /Gender\:/
nil
when /Normal \(Bonus\)/
nil
when /Strength|Constitution|Dexterity|Agility|Discipline|Aura|Logic|Intuition|Wisdom|Influence|Mana/
nil
else
lines
end
}
DownstreamHook.add('infocon', action)
status_tags
$_SERVER_.puts "info"
t=Time.now
wait_until {done or t+3<Time.now}
DownstreamHook.remove('infocon')
status_tags
return(con_potions)
end
def mymove(room = false)
fput "out" if checkroom =~ /table/i
if room
if hiding?
start_script("go2",['typeahead=0', room, '_disable_confirm_'])
wait_while{running?("go2")}
else
start_script("go2",[room, '_disable_confirm_'])
wait_while{running?("go2")}
end
else
end
end
def calcpotions
case $sting
when "Crushing"
sting = 32
when "Piercing"
sting = 20
when "Harsh"
sting = 16
when "Sharp"
sting = 8
when "Moderate"
sting = 4
when "Light"
sting = 2
else
sting = 0
end
potions = (check_con) + sting
#respond "Script will withdraw enough for #{potions} potions, ;send goon to continue"
#matchtimeout(60, "goon")
return(potions)
end
def gobank(room = false)
mymove 'bank'
room ||= Room.current.id
fput "depo all"
x = false
if calcpotions == 0
mymove "town"
echo "NO STING"
exit
end
fput "withdraw #{calcpotions * (750 + 150 * Char.level)} silver"
x = matchtimeout(1, "that much in the account|silver you've already got in the bank|debt collect")
if x =~ /debt collect/
respond "Gibreficul has documented that you are a deadbeat lowlife, however your debts are now paid."
return gobank(room)
elsif x =~ /that much silver in the account/
respond "Gibreficul doesn't think you have enough for a normal withdrawl. I'm gunna take it ALL and see what we have when it's all said and done."
result = false
until result =~ /that much in the account/
fput "withdraw #{750 + Char.level * 150} silver"
result = matchtimeout(1, "that much in the account|silver you've already got in the bank|debt collect")
break unless result
break if result =~ /that much in the account/
end
elsif x
mymove 'town'
echo "NO CASH"
exit
end
mymove room unless room == Room.current.id
unless GameObj.npcs.find{|npc| npc.noun =~ /priestess/i}
mymove 'town'
unless checkpaths
start_script 'step2',["#{room}"];wait_while{running? 'step2'}
end
findpriestess
end
end
def findpriestess
if checkpaths
walk until GameObj.npcs.find{|npc| npc.noun =~ /priestess/i}
else
fput "go walk"
return findpriestess
end
end
def sting_potions
x = 750 + 150 * Char.level
fput "give ##{GameObj.npcs.find{|npc| npc.noun == 'priestess'}.id} #{x}"
z = matchwait /You count your coins and realize that you don't have that much money|flask with a clear fluid|is it you're trying/
if z =~ /flask with a clear fluid/
fput "drink my flask"
y = matchwait /feel somehow changed|sweet, like an orange|but you feel somehow changed/
if y =~ /like an orange/
unless checksting
mymove "bank"
fput "depo all"
mymove "town"
return
end
end
elsif z =~ /is it you're trying/
findpriestess
else
room = Room.current.id
gobank(room)
end
end
i_hate_you = ["Aizare", "Rupaul"]
if checksting && !i_hate_you.include?(Char.name)
unless GameObj.right_hand.name == 'Empty' || GameObj.left_hand.name == 'Empty'
respond "You need to empty your hands to procede"
wait_until("EMPTY ONE OF YOUR HANDS"){GameObj.right_hand.name == 'Empty' || GameObj.left_hand.name == 'Empty'}
end
gobank
while checksting
sting_potions
end
mymove "bank"
fput "depo all"
mymove "town"
elsif check_con >= 2 && !i_hate_you.include?(Char.name)
respond "CON BONUS SUCKS, BUYING #{check_con} POTIONS"
unless GameObj.right_hand.name == 'Empty' || GameObj.left_hand.name == 'Empty'
respond "You need to empty your hands to procede"
wait_until("EMPTY ONE OF YOUR HANDS"){GameObj.right_hand.name == 'Empty' || GameObj.left_hand.name == 'Empty'}
end
gobank
while check_con > 0
sting_potions
end
mymove "bank"
fput "depo all"
mymove "town"
else
respond "YOU don't seem to have death's sting, unless it's CON loss, in which case, who gives a shit?" unless i_hate_you.include?(Char.name)
respond "I hate you" if i_hate_you.include?(Char.name)
end