Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- -- oil rig robot
- -- pastebin -f get kZz5xtJg rig
- local component = require("component")
- local robot = require("robot")
- local computer = require("computer")
- function chargeup()
- robot.use()
- robot.turnLeft()
- robot.forward()
- os.sleep(10)
- robot.back()
- robot.turnRight()
- robot.use()
- end
- function turnR()
- robot.turnRight()
- end
- function turnL()
- robot.turnLeft()
- end
- function goFwd(x)
- for i = 1, x do
- robot.forward()
- end
- end
- function wait(x)
- os.sleep(x)
- end
- function beep(z)
- for i = 1, z do
- computer.beep()
- end
- end
- -- charge up for 10 secs
- chargeup()
- -- route after charging
- turnL()
- turnL()
- goFwd(31)
- turnL()
- goFwd(11)
- wait(3)
- -- inspecting the reactor
- beep(2)
- wait(2)
- beep(1)
- wait(1)
- turnL()
- goFwd(7)
- turnR()
- goFwd(7)
- wait(5)
- -- checking the capacitor bank
- beep(2)
- wait(1)
- turnL()
- turnL()
- goFwd(5)
- turnR()
- goFwd(4)
- robot.up()
- goFwd(10)
- turnL()
- goFwd(2)
- turnR()
- goFwd(2)
- robot.up()
- goFwd(1)
- wait(1)
- -- adjusting the drill pipe
- beep(1)
- wait(1)
- turnL()
- goFwd(3)
- robot.down()
- goFwd(5)
- turnR()
- goFwd(4)
- robot.down()
- goFwd(3)
- turnL()
- goFwd(3)
- turnR()
- -- parked at the charger
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement