forked from brycole/gemstone
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathjailbox.lic
44 lines (41 loc) · 1.43 KB
/
jailbox.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
#!/usr/bin/env ruby
# Gets your stuff out of your possession box after being arrested (just automates the tedious "get blah from (myname) box", "wear blah" -- nothing more)
# Can also do the same thing for something you provide... if you start the script without any command-line parameters, it'll default to a target of "(yourname) box", but if you enter something when starting the script, it targets whatever you enter.
while true
if script.vars.empty?
fput "look in #{checkname} box"
else
fput "look in #{script.vars[0]}"
end
line = waitfor "In the", "could not find", "open", "closed"
if line =~ /could not find/
respond "... I see no #{checkname} box here. I think you're in the wrong place..."
exit
elsif line =~ /open|closed/
if script.vars.empty?
fput "open #{checkname} box"
else
fput "open #{script.vars[0]}"
end
break
else
break
end
end
items = line.scan(/\w+(?=\.|,| and a| and some)/)
items.each { |item|
if script.vars.empty?
fput "take #{item} from #{checkname} box"
else
fput "take #{item} from #{script.vars[0]}"
end
if item =~ /ring/i
echo
echo "To avoid accidentally teleporting away before all your stuff is back in your possession, I'm going to leave this ring for you to handle."
echo
pause
else
fput "wear my #{item}"
end
}
echo "There, that should do it. Don't forget to take one last peek in your box to make sure I really got it all (I'm a smart script, but I'm just a script)!"