|
|
@ -51,7 +51,7 @@ module DFHack
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
|
|
SaplingToTreeAge = 120960
|
|
|
|
SaplingToTreeAge = 120960
|
|
|
|
def cuttrees(material=nil, count_max=100)
|
|
|
|
def cuttrees(material=nil, count_max=100, quiet=false)
|
|
|
|
if !material
|
|
|
|
if !material
|
|
|
|
# list trees
|
|
|
|
# list trees
|
|
|
|
cnt = Hash.new(0)
|
|
|
|
cnt = Hash.new(0)
|
|
|
@ -62,7 +62,7 @@ module DFHack
|
|
|
|
}
|
|
|
|
}
|
|
|
|
cnt.sort_by { |mat, c| c }.each { |mat, c|
|
|
|
|
cnt.sort_by { |mat, c| c }.each { |mat, c|
|
|
|
|
name = @raws_tree_name[mat]
|
|
|
|
name = @raws_tree_name[mat]
|
|
|
|
puts " #{name} #{c}"
|
|
|
|
puts " #{name} #{c}" unless quiet
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else
|
|
|
|
else
|
|
|
|
cnt = 0
|
|
|
|
cnt = 0
|
|
|
@ -78,11 +78,11 @@ module DFHack
|
|
|
|
break if cnt == count_max
|
|
|
|
break if cnt == count_max
|
|
|
|
end
|
|
|
|
end
|
|
|
|
}
|
|
|
|
}
|
|
|
|
puts "Updated #{cnt} plant designations"
|
|
|
|
puts "Updated #{cnt} plant designations" unless quiet
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
|
|
def growtrees(material=nil, count_max=100)
|
|
|
|
def growtrees(material=nil, count_max=100, quiet=false)
|
|
|
|
if !material
|
|
|
|
if !material
|
|
|
|
# list plants
|
|
|
|
# list plants
|
|
|
|
cnt = Hash.new(0)
|
|
|
|
cnt = Hash.new(0)
|
|
|
@ -93,7 +93,7 @@ module DFHack
|
|
|
|
}
|
|
|
|
}
|
|
|
|
cnt.sort_by { |mat, c| c }.each { |mat, c|
|
|
|
|
cnt.sort_by { |mat, c| c }.each { |mat, c|
|
|
|
|
name = @raws_tree_name[mat]
|
|
|
|
name = @raws_tree_name[mat]
|
|
|
|
puts " #{name} #{c}"
|
|
|
|
puts " #{name} #{c}" unless quiet
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else
|
|
|
|
else
|
|
|
|
cnt = 0
|
|
|
|
cnt = 0
|
|
|
@ -104,7 +104,7 @@ module DFHack
|
|
|
|
cnt += 1
|
|
|
|
cnt += 1
|
|
|
|
break if cnt == count_max
|
|
|
|
break if cnt == count_max
|
|
|
|
}
|
|
|
|
}
|
|
|
|
puts "Grown #{cnt} saplings"
|
|
|
|
puts "Grown #{cnt} saplings" unless quiet
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|