Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- -- local x1 = -352
- -- local y1 = 61
- -- local z1 = 1764
- -- local x2 = -273
- -- local y2 = 70
- -- local z2 = 1804
- -- local storageX = -303
- -- local storageY = 67
- -- local storageZ = 1758
- local x1 = -85
- local y1 = 55
- local z1 = -1831
- local x2 = -81
- local y2 = 58
- local z2 = -1825
- local storageX = -88
- local storageY = 56
- local storageZ = -1832
- local p = peripheral.wrap("top")
- function takeSapling()
- p.addArea(storageX, storageY, storageZ)
- p.clearWhitelistItemFilter()
- p.addWhitelistItemFilter("Forestry:sapling", 0, false, false, false, false)
- p.setSides(true, true, true, true, true, true)
- p.setUseCount(true)
- p.setCount(64)
- p.setAction("inventoryImport")
- p.clearArea()
- waitDone()
- end
- function noSapling()
- p.clearWhitelistItemFilter()
- p.addWhitelistItemFilter("Forestry:sapling", 0, false, false, false, false)
- setOperator("=")
- setCount(0)
- setAction("droneConditionItem")
- waitDone()
- return evaluateCondition()
- end
- function canPlant(x, y, z)
- p.addArea(x, y, z)
- p.showArea()
- p.clearWhitelistItemFilter()
- p.addWhitelistItemFilter("minecraft:grass", 0, false, false, false, false)
- p.addWhitelistItemFilter("minecraft:dirt", 0, false, false, false, false)
- p.setIsAndFunction(true)
- p.setAction("conditionBlock")
- p.clearArea()
- waitDone()
- return evaluateCondition()
- end
- function plantSapling(x, y, z)
- p.addArea(x, y, z)
- p.setSide("top", true)
- p.setAction("blockRightClick")
- p.clearArea()
- waitDone()
- end
- function waitDone()
- while not p.isActionDone() do
- sleep(1)
- end
- end
- while true do
- for x = x1, x2 do
- for y = y1, y2 do
- for z = z1, z2 do
- if noSapling then
- print("taking saplings")
- takeSapling()
- end
- print("check can plant saplings")
- if canPlant(x, y, z) then
- print("plant saplings")
- plantSapling(x, y, z)
- end
- end
- end
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement