forked from brycole/gemstone
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbackroom.lic
More file actions
52 lines (51 loc) · 1.58 KB
/
backroom.lic
File metadata and controls
52 lines (51 loc) · 1.58 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
=begin
Backroom access script
Because I'm sick of people asking for it...
I'm also sick of doing a command line script for it
So... directions are... ;backroom # where # is the # of the item you want to buy
(Item should be least expensive item in the shop)
Must start script with empty hands.
Must have coins on you to afford 100 of the item you're intending to purchase to get backroom access
If script fails, you can enter a second script variable to purchase a specific number of the item...
Secondary usage is... ;backroom <item number> <amount to buy> (;backroom 1 25) to buy 25 of item #1
author: Gibreficul
tags: backroom, utility, purchase
=end
if script.vars.empty?
echo "Please enter an item number to purchase"
echo "SCRIPT EXITING"
exit
elsif GameObj.right_hand.name !~ /empty/i
echo "RIGHT HAND FULL, PLEASE CLEAR IT"
echo "SCRIPT EXITING"
exit
elsif GameObj.left_hand.name !~ /empty/i
echo "LEFT HAND FULL, PLEASE CLEAR IT"
echo "SCRIPT EXITING"
exit
else
num = script.vars[1]
if script.vars[2]
repetitions = script.vars[2].to_i
else
repetitions = 100
end
iterations = 0
repetitions.times{
put "order #{num}"
put "buy"
t = Time.now
wait_until{GameObj.right_hand.name !~ /empty/i || Time.now > t + 5}
if Time.now > t + 5
echo "TIMEOUT, YOU MIGHT BE OUT OF COINS, OR TOO ENCUMBERED TO GET THE ITEM"
echo "SCRIPT BOUGHT #{iterations} ITEMS"
echo "SCRIPT EXITING"
exit
else
put "Drop right"
wait_until{GameObj.right_hand.name =~ /empty/i}
iterations += 1
end
}
fput "order"
end