-
Notifications
You must be signed in to change notification settings - Fork 0
/
runtest.rb
42 lines (32 loc) · 966 Bytes
/
runtest.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
require './lib/dbdefinitions.rb'
require './lib/botcalculation.rb'
Mongoid.load!("config/mongo.yml", :development)
=begin
FarmBot.where(:active => true).order_by([:name,:asc]).each do |farmbot|
puts farmbot.inspect
farmbot.crops.each do |crop|
puts crop.inspect
end
end
=end
FarmBot.where(:active => true).order_by([:name,:asc]).each do |farmbot|
farmbot.crops.each do |crop|
crop.scheduled_commands.each do |command|
command.delete
end
end
end
calc = BotScheduleCalculation.new
calc.calculateAllBots()
puts ''
FarmBot.where(:active => true).order_by([:name,:asc]).each do |farmbot|
farmbot.crops.each do |crop|
puts "bot: #{farmbot.name}"
crop.scheduled_commands.each do |command|
puts " command scheduled at #{command.execution_time}"
command.scheduled_command_lines.each do |line|
puts " do #{line.action} at #{line.coord_x} / #{line.coord_y} / #{line.coord_z} amount #{line.amount}"
end
end
end
end