-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathAUTO_CONTAINERS.lic
More file actions
62 lines (52 loc) · 1.69 KB
/
AUTO_CONTAINERS.lic
File metadata and controls
62 lines (52 loc) · 1.69 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
=begin
This script emulates the containers function in Psinet
Ex:
'cloak' => 'look in my cloak'
'cloak item' => 'put item in my cloak'
update: a rename of containers2 to containers1. -thx to whoever upped containers2.
update: merged containers3 with my code (thanks to whoever did that one)
By Drafix
=end
hide_me
i_stand_alone
bags = [
'hat',
'back', 'backp', 'backpack', 'carry', 'carryall', 'hav', 'haversack', 'knap', 'knapsack', 'pack', 'ruck', 'rucksack', 'satch', 'satchel',
'cape', 'coat', 'cloak', 'great', 'greatcloak', 'jack', 'jacket', 'long', 'longcoat',
'bodice', 'robe', 'shirt', 'tunic', 'vest',
'glove',
'belt',
'harn', 'harness', 'quiv', 'quiver', 'scab', 'scabbard', 'sheath',
'bag', 'case', 'kit', 'pouch', 'purse', 'sack', 'tool', 'toolkit',
'kilt', 'pant', 'pants', 'trou', 'trousers',
'boot','shoe',
'beaker', 'disk', 'jar', 'sarc'
]
begin
action = proc { |client_string|
if client_string =~ /^(?:<c>)?\b(#{bags.join('|')})\b(.*)/o
container = $1
item = $2.strip
preposition = 'in'
preposition = 'on' if container == 'key'
if container == 'disk'
container = Char.name + ' ' + (GameObj["#{Char.name} disk"].noun || GameObj["#{Char.name} coffin"].noun || '')
elsif container == 'key'
container = "my keyring"
else
container = "my #{container}"
end
if item.empty?
"look #{preposition} #{container}"
else
"put #{item} #{preposition} #{container}"
end
else
client_string
end
}
UpstreamHook.add('containers', action)
loop { sleep 1 }
ensure
UpstreamHook.remove('containers')
end