Advertisement
charonme

inspect test

Feb 23rd, 2017
107
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.75 KB | None | 0 0
  1. local success
  2. local data
  3. local wasEmpty = false
  4. while true do
  5.     success, data = turtle.inspect()
  6.     if success then
  7.         wasEmpty = false
  8.         if data.name=="ComputerCraft:CC-TurtleAdvanced" then
  9.             print("it's a turtle !")
  10.         elseif data.name=="ComputerCraft:CC-Turtle" then
  11.             print("it's a turtle !")
  12.         elseif data.name=="BuildCraft|Builders:machineBlock" then
  13.             print("it's probably a quarry !")
  14.         elseif data.name=="ThermalExpansion:Cell" then
  15.             print("it's a thermal expansion cell !")
  16.         elseif data.name=="EnderStorage:enderChest" then
  17.             print("it's an ender chest !")
  18.         else
  19.             print("Block name: ", data.name)
  20.             print("Block metadata: ", data.metadata)
  21.         end
  22.     elseif not wasEmpty then
  23.         wasEmpty = true
  24.         print("empty")
  25.     end
  26.     os.sleep(2)
  27. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement