forked from brycole/gemstone
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdeed.lic
200 lines (172 loc) · 5 KB
/
deed.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
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
=begin
Landing, Ta'Illistim, and River's Rest deed script.
It will take you to the proper room but not return you
to the starting point.
It only uses gems and it only gets one deed at a time.
Usage is ;deed <gem1> <gem2> <gem3>...
It assumes the gems are on you and in an open container.
It will allow you to use coins in the Landing.
If you would like to know how many silvers you need for deeds,
or the minimum required value gems need to be, usage is
;deed calculate. This value is only as accurate as the
formula, which is 100 + 100(level + deeds) (divided by three
for gems).
04/8/2010-- Fixed a bug in Ta'Illistim.
~Annelie
=end
def count_deeds
deeds = nil
squelching = false
done = false
action = proc { |server_string|
if squelching
if server_string =~ /<output class=""\/>/
server_string
elsif server_string =~ /<prompt.*?>/
done = true
DownstreamHook.remove('count_deeds')
server_string
else
nil
end
else
if server_string =~ /^\s*Level: [0-9]+\s+Deeds: ([0-9]+)\s*$/
deeds = $1
squelching = true
nil
else
server_string
end
end
}
DownstreamHook.add('count_deeds', action)
$_SERVER_.puts 'exp'
wait_until { done }
DownstreamHook.remove('count_deeds')
if deeds.nil?
nil
else
deeds.to_i
end
end
def find_nearest(target_list)
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
return least_target
end
$deedroom = [ 10854, 4045, 745 ]
$level = Char.level
$deeds = count_deeds
if script.vars.empty?
echo "Usage for this script is ;deed <gem1> <gem2> <gem3>..."
echo "Or ;deed coins <number of coins>"
echo "You may use as few or as many gems as you need."
echo "You may type :deed calculate to determine how much deeds will cost you."
echo "It will only get you one deed at a time, however, and coins only work in the Landing."
echo
exit
end
if script.vars[1] =~ /calc|calculate|cost/i
puts "The minimum silver value per deed is:"
puts 101 + (100 * ($level + $deeds.to_i))
echo
puts "However, using gems the per deed cost is:"
puts (101 + (100 * ($level + $deeds.to_i)))/3
echo
puts "Please recall that this may be inaccurate. You should try and use a little more than the formula allows."
echo
exit
end
start_script 'go2', [ find_nearest($deedroom).to_s, '_disable_confirm_' ]
wait_while{running?('go2')}
if Room.current.id == 4045
fput "ring chime with mallet"
fput "ring chime with mallet"
fput "kneel"
fput "drop #{script.vars[2]} silvers"
fput "ring chime with mallet"
fput "out"
exit
end
#Landing
start_script 'go2', [ find_nearest($deedroom).to_s, '_disable_confirm_' ]
wait_while{running?('go2')}
if Room.current.id == 4045
fput"ring chime with mallet"
fput "ring chime with mallet"
fput "kneel"
script.vars[1..-1].each { |gem| fput "get my #{gem}"; fput "drop #{gem}" }
fput "ring chime with mallet"
fput "out"
exit
#River's Rest
elsif Room.current.id == 10854
fput "kneel"
multifput "look in pool", "look in pool"
fput "touch pool"
script.vars[1..-1].each { |gem| fput "get my #{gem}"; fput "drop #{gem} in pool"}
result = dothis "touch pool", /welcome to my garden|you must place a value on life/
if result =~ /you must place a value on life/
echo
respond "Not high enough value for a deed."
echo
exit
end
if result =~ /welcome to my garden/
fput "touch flower"
fput "get seed"
plant = dothis "plant seed", /^You/
if plant =~ /^How do you expect to plant that/
echo "WHAT HAPPENED HERE?"
exit
else
fput "out"
exit
end
end
#Ta'Illistim
elsif Room.current.id == 745
fput "open tome"
result = dothis "turn tome to illistim", /the image of a young man with summer-sun gold hair|the image of a mature woman in gossamer robes of light grey|pale man dressed in drab colors/
fput "east"
fput "go panel"
fput "get taper"
fput "light my taper with candle"
fput "go panel"
fput "west"
if result =~/the image of a mature woman in gossamer robes of light grey/
fput "north"
fput "go modwir door"
fput "kneel"
script.vars[1..-1].each { |gem| fput "get my #{gem}"; fput "put #{gem} on censer"}
fput "meditate"
fput "pray"
exit
elsif result =~/young man with summer-sun gold hair, blue eyes and a slight build/
fput "southeast"
fput "go maoral door"
fput "kneel"
script.vars[1..-1].each { |gem| fput "get my #{gem}"; fput "put #{gem} on censer"}
fput "meditate"
fput "pray"
exit
elsif result =~/pale man dressed in drab colors/
fput "southwest"
fput "go thanot door"
fput "kneel"
script.vars[1..-1].each { |gem| fput "get my #{gem}"; fput "put #{gem} on censer"}
fput "meditate"
fput "pray"
exit
end
end