Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- -- This program harvests industrialcraft melon crops, will not work with normal ones.
- local robot = require("robot")
- local os = require("os")
- local argv = {...}
- local melon_tower_levels = tonumber(argv[1])
- local function collectMoveForward()
- while true do
- robot.useDown()
- robot.suckDown()
- if not robot.forward() then
- break
- end
- end
- end
- local function clearLevel()
- collectMoveForward()
- robot.turnRight()
- robot.forward()
- robot.turnRight()
- collectMoveForward()
- robot.turnLeft()
- robot.forward()
- robot.turnLeft()
- collectMoveForward()
- robot.turnRight()
- robot.forward()
- robot.turnRight()
- collectMoveForward()
- robot.turnRight()
- robot.forward()
- robot.forward()
- robot.forward()
- robot.turnRight()
- end
- while true do
- for l=1, melon_tower_levels do
- for i=1, l - 1 do
- robot.up()
- robot.up()
- robot.up()
- end
- clearLevel()
- for i=1, l - 1 do
- robot.down()
- robot.down()
- robot.down()
- end
- robot.turnAround()
- for s=1, 16 do
- if robot.count(s) > 0 then
- robot.select(s)
- robot.drop()
- end
- end
- robot.turnAround()
- end
- os.sleep(30)
- end
Add Comment
Please, Sign In to add comment