Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local component = require("component")
- local sides = require("sides")
- local robot = require("robot")
- rawget(getmetatable(o) or {}, "__ev")
- --[[local g = component.generator
- robot.select(2)
- g.untinsert()
- print(g.co())]]
- function turnRobot(turnedLeft)
- if turnedLeft == 1
- then
- robot.turnRight()
- while i < 3 do
- robot.swing(sides.front)
- robot.forward(1)
- end
- robot.turnRight()
- turnedleft = 0
- elseif turnedLeft == 0
- then
- robot.turnLeft()
- while i < 3 do
- robot.swing(sides.front)
- robot.forward(1)
- end
- robot.turnLeft()
- turnedLeft = 1
- end
- return turnedleft;
- end
- rmb = 0 -- Means Robot moved block
- turnedLeft = 0 -- Boolean that means at 1 that the robot turned left last 25 Blocks
- for i = 200,1,-1 do
- --Check when the Robot has moved 12 Blocks
- if (rmb % 12 == 0)
- then print("Es ist durch 12 teilbar")
- end
- if (rmb % 25 == 0)
- then turnrobot
- print(turnedLeft)
- end
- --[[end
- if (rmb == 175) then robot.turnRight()
- elseif (rmb == 172) then robot.turnRight()
- elseif (rmb == 147) then robot.turnLeft()
- elseif (rmb == 144) then robot.turnLeft()
- elseif (rmb == 119) then robot.turnRight()
- elseif (rmb == 116) then robot.turnRight()
- elseif (rmb == 91) then robot.turnLeft()
- elseif (rmb == 88) then robot.turnLeft()
- elseif (rmb == 63) then robot.turnRight()
- elseif (rmb == 60) then robot.turnRight()
- elseif (rmb == 35) then robot.turnLeft()
- elseif (rmb == 32) then robot.turnLeft()
- elseif (rmb == 7) then robot.turnRight()
- end]]
- if robot.detect() == true
- then
- robot.swing(sides.front)
- robot.forward(1)
- print(rmb)
- else
- robot.forward(1)
- print(rmb)
- end
- rmb = rmb + 1
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement