Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local args = {...}
- local component = require("component")
- local robot = require("robot")
- local computer = require("computer")
- function light() --places torces to the right on the block beside it
- count = 1
- if count >= 10 then
- count = 0
- robot.select(14)
- robot.turnRight()
- robot.place()
- robot.turnLeft()
- else
- count = count+1
- print(count)
- end
- end
- function chkFull() --checks to see if the inventory is full
- end
- function chkFuel()--checks on the fuel level and adds coal as needed
- local g = component.generator
- print(g.count())
- robot.select(16)
- if g.count() == 0 then g.insert(1) end
- if g.count() <= 10 then
- g.insert(10 - g.count())
- end
- end
- function mainLoop() -- main digging function
- robot.swing()
- robot.forward()
- robot.turnLeft()
- robot.swing()
- robot.swingUp()
- robot.up()
- robot.swing()
- robot.swingUp()
- robot.up()
- robot.swing()
- robot.turnLeft()
- robot.turnLeft()
- robot.swing()
- robot.down()
- robot.swing()
- robot.down()
- robot.swing()
- robot.turnLeft()
- end
- robot.select(16)
- if args[1] == nil then args[1] = 1 end
- for i = 1,args[1] do
- print("Interation: "..tostring(i).." of "..tostring(args[1]))
- chkFuel()
- --chkFull()
- mainLoop()
- light()
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement