-
Notifications
You must be signed in to change notification settings - Fork 8
/
Copy pathmarkchargable.lic
76 lines (65 loc) · 2.3 KB
/
markchargable.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
=begin
This script might take gems out of a container, loresing to them for their purpose,
mark them as unsellable if they're mage rechargable, and put them back in the container.
https://github.com/matt-lowe/lich-scripts
=end
unless Char.prof == 'Bard'
echo "You're a jerk and I hate you."
exit
end
unless script.vars[1]
respond "\nUsage: #{$clean_lich_char}#{script.name} <container name>\n\n"
exit
end
unless container = GameObj.inv.find { |obj| obj.noun.downcase == script.vars[1].downcase }
unless container = GameObj.inv.find { |obj| obj.name =~ /#{script.vars[1..-1].join(' ')}$/ }
unless container = GameObj.inv.find { |obj| obj.name =~ /#{script.vars[1..-1].join('.*?')}/ }
echo "error: can't find container \"#{script.vars[1..-1].join(' ')}\""
exit
end
end
end
if container.contents.nil?
open_result = dothistimeout "open ##{container.id}", 5, /^You open|^That is already open\.$/
unless open_result =~ /^You open/
dothistimeout "look in ##{container.id}", 5, /In .*? you see/
if container.contents.nil?
echo "error: failed to find contents of container \"#{container.name}\""
exit
end
end
end
gem_list = container.contents.find_all { |obj| obj.type =~ /gem/ }
if gem_list.empty?
echo "error: no gems found in container \"#{container.name}\""
exit
end
checked = 0
found = 0
dothistimeout 'speak bard', 3, /^You are now/
empty_hands
for gem in gem_list
if (mana < 10)
echo "waiting for mana..."
wait_until { mana >= 10 }
end
waitrt?
waitcastrt?
dothistimeout "get ##{gem.id}", 5, /^You remove/
result = dothistimeout "loresing #{gem.noun.capitalize} I see so true;Your purpose I ask from you", 5, /^From the pitch of the vibration/
waitrt?
if result.nil?
result = dothistimeout "loresing #{gem.noun.capitalize} I see so true;Your purpose I ask from you", 5, /^From the pitch of the vibration/
waitrt?
end
checked += 1
if result =~ /pulses strongly/
dothistimeout "mark ##{gem.id}", 3, /^You carefully/
found += 1
end
dothistimeout "_drag ##{gem.id} ##{container.id}", 5, /^You put/
echo "#{checked} gem#{'s' unless checked == 1} checked. #{found} mage rechargable#{'s' unless found == 1} found. #{gem_list.length - checked} gem#{'s' unless (gem_list.length - checked) == 1} remaining."
end
fill_hands
dothistimeout 'speak common', 3, /^You are now/