Guest User

startup

a guest
Mar 22nd, 2013
56
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.69 KB | None | 0 0
  1. digtime = 40
  2. recovertime = 5
  3.  
  4. while true do
  5.   if redstone.getInput("left") then
  6.     -- dig first
  7.     redstone.setOutput("back", true)
  8.     sleep(digtime)
  9.     -- stop digging and recover miners
  10.     redstone.setOutput("back", false)
  11.     sleep(recovertime)
  12.     -- Move frame machine
  13.     redstone.setOutput("right", true)
  14.     sleep(0.4)
  15.     redstone.setOutput("right", false)
  16.     sleep(0.8)
  17.     -- Check if still on and enable digging if so
  18.     if redstone.getInput("left") then
  19.       redstone.setOutput("back", true)
  20.     end
  21.     -- Inchworm second motor
  22.     redstone.setOutput("front", true)
  23.     sleep(0.4)
  24.     redstone.setOutput("front", false)
  25.     sleep(0.4)
  26.   end
  27.   sleep(0.4)
  28. end
Advertisement
Add Comment
Please, Sign In to add comment