Advertisement
Guest User

miner.lua

a guest
Feb 22nd, 2020
76
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.46 KB | None | 0 0
  1. local component = require("component")
  2. local sides = require("sides")
  3. local robot = require("robot")
  4.  
  5. local g = component.generator
  6.    g.insert()
  7.    print(g.count())
  8.  
  9. robotMovedBlock = 0
  10.  
  11.   for i = 63,1,-1
  12.     do
  13.       if robot.detect() == true then
  14.       robot.swing(sides.front)
  15.       robot.forward(1)
  16.       robotMovedBlock = robotMovedBlock +1
  17.       print(robotMovedBlock)
  18.       else robot.forward(1) robotMovedBlock = robotMovedBlock + 1 print(robotMovedBlock)
  19.    end
  20.  
  21. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement