-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathffi_macros.rb
68 lines (58 loc) · 1.16 KB
/
ffi_macros.rb
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
require_relative 'keys'
# Overloads for ease of use
class Object
def is_number?
true if Float(self) rescue false
end
end
class Object
def is_integer?
true if Integer(self) rescue false
end
end
# Testing
commands = Commands.new
getting_input = true
running = true
while(running)
while(getting_input)
system("clear")
system("cls")
puts "Utils:"
puts "(GC) Buy"
puts "(Re)peat Craft"
puts "E(x)it"
print ">"
input = gets.chomp
puts ""
case input.upcase
when "X", "EXIT"
puts "Closing Program ..."
getting_input = false
running = false
when "GC", "GC BUY"
quantity = 0
while( !quantity.is_integer? or quantity.to_i < 1)
system("clear")
system("cls")
print "Quantity: "
quantity = gets.chomp
end
sleep(15)
commands.GCBuy(quantity)
when "RE", "REPEAT CRAFT"
quantity = 0
while( !quantity.is_integer? or quantity.to_i < 1)
system("clear")
system("cls")
print "Quantity: "
quantity = gets.chomp
end
sleep(15)
commands.RepeatCraft(quantity)
else
puts "Invalid input. Please use a listed command."
system("PAUSE")
end
end
end