Advertisement
Guest User

xray.lua

a guest
Jul 21st, 2019
3,265
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 1.65 KB | None | 0 0
  1. --local range = 8
  2. local scale = 0.125
  3. local interval = 0.03
  4.  
  5. local xrayBlocks = {
  6.     ["minecraft:gold_ore"] = true,
  7.     ["minecraft:iron_ore"] = true,
  8.     ["minecraft:coal_ore"] = true,
  9.     ["minecraft:lapis_ore"] = true,
  10.     ["minecraft:diamond_ore"] = true,
  11.     ["minecraft:redstone_ore"] = true,
  12.     ["minecraft:emerald_ore"] = true,
  13.     ["minecraft:quartz_ore"] = true,
  14.     ["appliedenergistics2:quartz_ore"] = true,
  15.     ["appliedenergistics2:charged_quartz_ore"] = true,
  16.     ["draconicevolution:draconium_ore"] = true,
  17.     ["immersiveengineering:ore"] = true,
  18.     ["mysticalagriculture:prosperity_ore"] = true,
  19.     ["rftools:dimensional_shard_ore"] = true,
  20.     ["thaumcraft:ore_amber"] = true,
  21.     ["thaumcraft:ore_cinnabar"] = true
  22. }
  23.  
  24. local offset = 0--scale / -2
  25.  
  26. local modules = peripheral.wrap("back")
  27.  
  28. local canvas3d = modules.canvas3d().create()
  29.  
  30. print("Starting xray Program, there should be a way to hide this altogether dammit")
  31. --parallel.waitForAny(function()
  32. while true do
  33.     canvas3d.clear()
  34.     canvas3d.recenter()
  35.     local offsetX, _, offsetZ = gps.locate()
  36.    
  37.     offsetX = offsetX % 1 * 0.5
  38.     offsetZ = offsetZ % 1 * 0.5
  39.     for _, block in pairs(modules.scan()) do
  40.         if xrayBlocks[block.name] then
  41.             canvas3d.addItem({
  42.             (block.x - offsetX) * scale + offset,
  43.             block.y * scale + offset, -- having an offset for y is difficult due to crouching
  44.             (block.z - offsetZ) * scale + offset
  45.             }, block.name,
  46.             0, scale)
  47.         end
  48.     end
  49.     os.sleep(interval)
  50.     --print("h")
  51. end
  52. --[[end,
  53. function()
  54. os.pullEvent("key")
  55. end)]]
  56.  
  57. canvas3d.clear()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement