G2A Many GEOs
SHARE
TWEET

wormminer_proto

kssr3951 Aug 29th, 2014 232 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. local ARMSG__WORM_TEST      = 5
  2. local ARMSG__PLACED_FORWARD = 5
  3. local ARMSG__PLACED_BACK    = 6
  4. local ARMSG__PLACED_UP      = 7
  5. local ARMSG__PLACED_DOWN    = 8
  6. local ARMSG__PLACED_LEFT    = 9
  7. local ARMSG__PLACED_RIGHT   = 10
  8.  
  9. local BOX_DEPTH = 5
  10.  
  11. local function IamPlacedTurtle()
  12.   local arInput = rs.getAnalogInput("back")
  13.   if arInput == ARMSG__PLACED_FORWARD or
  14.      arInput == ARMSG__PLACED_BACK or
  15.      arInput == ARMSG__PLACED_LEFT or
  16.      arInput == ARMSG__PLACED_RIGHT then
  17.     return true
  18.   end
  19.   arInput = rs.getAnalogInput("up")
  20.   if arInput == ARMSG__PLACED_DOWN then
  21.     return true
  22.   end
  23.   arInput = rs.getAnalogInput("down")
  24.   if arInput == ARMSG__PLACED_UP then
  25.     return true
  26.   end
  27.   return false
  28. end
  29.  
  30. if ARMSG__WORM_TEST == rs.getAnalogInput("back") then
  31.   turtle.dig()
  32.   turtle.turnLeft()
  33.   turtle.turnLeft()
  34.   for i = 1, 16 do
  35.     turtle.suck()
  36.   end
  37.   local notFound = true
  38.   for i = 1, 16 do
  39.     if 0 == turtle.getItemCount(i) then
  40.       notFound = false
  41.       turtle.select(1)
  42.       turtle.transferTo(i)
  43.       break
  44.     end
  45.   end
  46.   if notFound then
  47.     turtle.select(1)
  48.     turtle.drop()
  49.   end
  50.   turtle.select(1)
  51.   turtle.dig()
  52.   turtle.turnRight()
  53.   turtle.turnRight()
  54.   rs.setAnalogOutput("front", ARMSG__WORM_TEST)
  55.   turtle.place()
  56.   peripheral.call("front", "turnOn")
  57. else
  58.   turtle.select(1)
  59.   rs.setAnalogOutput("front", ARMSG__WORM_TEST)
  60.   turtle.place()
  61.   peripheral.call("front", "turnOn")
  62. end
RAW Paste Data
Ledger Nano X - The secure hardware wallet
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Top