forked from rpherbig/dr-scripts
-
Notifications
You must be signed in to change notification settings - Fork 0
/
card-collector.lic
37 lines (31 loc) · 1.2 KB
/
card-collector.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
# Takes cards from a bag of freshly acquired cards and places them in your collector's cases
custom_require.call(%w[common common-items])
class Cards
def initialize
settings = get_settings
unless settings.card_bags
DRC.message("No bags defined in your yaml, please run this script with argument 'help' for more information.")
exit
end
fresh = settings.card_bags['fresh']
duplicates = settings.card_bags['duplicates']
DRCI.stow_hands
cards_add(fresh, duplicates)
end
def cards_add(fresh, duplicates)
unless /referring/i =~ DRC.bput("get my collector case", 'You get', 'You are already', 'What were you referring to')
DRC.bput('swap', 'You move') unless DRC.right_hand == "collector's case"
loop do
unless /referring/i =~ DRC.bput("get card from my #{fresh}", 'You get', 'What were you referring')
next unless /You don't have room/i =~ DRC.bput('cards add', 'You slide', "You don't have room")
DRC.bput("put my card in my #{duplicates}", 'You put')
next
end
break
end
DRC.bput('cards count', 'You have')
DRC.bput("put my case in my #{duplicates}", 'You put')
end
end
end
Cards.new