Xyzzy

CC Turtle Block Swapper

Mar 14th, 2016
86
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. --CC Turtle Block Swapper by wok86
  2. --Swaps the block on top of the turtle
  3.  
  4. local block1 = "BiomesOPlenty:hardSand"
  5. local block2 = "bluepower:lampinvertedwhite"
  6. local rsSide = "back"
  7.  
  8. while true do
  9.   if rs.getInput(rsSide) == true then
  10.     local block,type = turtle.inspectUp()
  11.     if type.name == block1 then
  12.       sleep(1)
  13.       term.clear()
  14.       term.setCursorPos(1,1)
  15.       print("Sand det")
  16.       turtle.select(1)
  17.       turtle.digUp()
  18.       turtle.select(16)
  19.       turtle.placeUp()
  20.     elseif type.name == block2 then
  21.       sleep(1)
  22.       term.clear()
  23.       term.setCursorPos(1,1)
  24.       print("Lamp det")
  25.       turtle.select(16)
  26.       turtle.digUp()
  27.       turtle.select(1)
  28.       turtle.placeUp()
  29.     end  
  30.   else
  31.     term.clear()
  32.     term.setCursorPos(1,1)
  33.     print("No RS")
  34.     sleep(0.5)
  35.   end
  36. end
RAW Paste Data

Adblocker detected! Please consider disabling it...

We've detected AdBlock Plus or some other adblocking software preventing Pastebin.com from fully loading.

We don't have any obnoxious sound, or popup ads, we actively block these annoying types of ads!

Please add Pastebin.com to your ad blocker whitelist or disable your adblocking software.

×