Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local robot = require("robot")
- local shell = require("shell")
- local component = require("component")
- print(" +----------MINERv2000----------+\n")
- print(" | Made by Habitus |\n")
- print(" +------------------------------+\n\n")
- print(" Did you give me a pickaxe ?\n")
- print(" I need torches in the Green slot!\n")
- print(" How far do you want me to go?\n")
- repeat
- lenght = io.read("*number")
- lenght_count = 0
- print(" How many lines do you want me to do?")
- row = io.read("*number")
- row_count = 0
- torch = 10
- torch_count = 0
- print(" +----------YES MASTER----------+\n")
- while lenght_count <= lenght do
- robot.swing()
- robot.forward()
- robot.swingDown()
- robot.swingUp()
- lenght_count = lenght_count+1
- print("-> Process = ",(lenght_count),"/", (lenght), "\n")
- end
- robot.turnRight()
- robot.turnRight()
- while lenght_count >= 0 do
- if torch_count < torch then
- robot.forward()
- lenght_count = lenght_count-1
- torch_count = torch_count+1
- end
- if torch_count == torch-1 then
- robot.turnRight()
- robot.swing()
- robot.select(1)
- robot.place()
- robot.turnLeft()
- torch_count = 0
- end
- end
- robot.turnRight()
- if robot.detect() then
- robot.swing()
- end
- robot.forward()
- if robot.detect() then
- robot.swing()
- end
- robot.forward()
- if robot.detect() then
- robot.swing()
- end
- robot.forward()
- robot.turnRight()
- robot.swing()
- robot.forward()
- row_count = row_count + 1
- lenght_count = 0
- until row_count == row
- print(row_count)
- --lenght = 0
- print(" +----------FINISHEDez----------+\n")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement