XSilent_DevilX

Block Testing - Turtle

May 14th, 2021 (edited)
408
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 1.56 KB | None | 0 0
  1. rednet.open("right")
  2. function testBlock()
  3.     PC = 21
  4.     local success, data = turtle.inspect()
  5.     if success then
  6.     print("Block:", data.name)
  7.         if data.name == "minecraft:white_wool" then
  8.         rednet.send(PC, "G")
  9.         elseif data.name == "minecraft:orange_wool" then
  10.         rednet.send(PC, "1")
  11.         elseif data.name == "minecraft:magenta_wool" then
  12.         rednet.send(PC, "2")
  13.         elseif data.name == "minecraft:light_blue_wool" then
  14.         rednet.send(PC, "3")
  15.         elseif data.name == "minecraft:yellow_wool" then
  16.         rednet.send(21, "4")
  17.         elseif data.name == "minecraft:lime_wool" then
  18.         rednet.send(PC, "5")
  19.         elseif data.name == "minecraft:pink_wool" then
  20.         rednet.send(PC, "6")
  21.         elseif data.name == "minecraft:gray_wool" then
  22.         rednet.send(PC, "7")
  23.         elseif data.name == "minecraft:light_gray_wool" then
  24.         rednet.send(PC, "8")
  25.         elseif data.name == "minecraft:cyan_wool" then
  26.         rednet.send(PC, "9")
  27.         elseif data.name == "minecraft:purple_wool" then
  28.         rednet.send(PC, "10")
  29.         elseif data.name == "minecraft:blue_wool" then
  30.         rednet.send(PC, "11")
  31.         elseif data.name == "minecraft:brown_wool" then
  32.         rednet.send(PC, "12")
  33.         elseif data.name == "minecraft:green_wool" then
  34.         rednet.send(PC, "13")
  35.         elseif data.name == "minecraft:red_wool" then
  36.         rednet.send(PC, "14")
  37.         elseif data.name == "minecraft:black_wool" then
  38.         rednet.send(PC, "15")
  39.  
  40.         end
  41.     end
  42. end
  43.  
  44. testBlock()
  45.  
Add Comment
Please, Sign In to add comment