RapsyJigo

Sus scanner

Dec 22nd, 2023 (edited)
13,306
1
Never
1
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.68 KB | None | 1 0
  1. scanner = peripheral.wrap("back")
  2.  
  3. while true do
  4. term.clear()
  5. term.setCursorPos(1, 1)
  6. blocks, err = scanner.scan(16)
  7. found = false
  8.  
  9. for id, block in pairs(blocks) do
  10.     if block["name"] == "minecraft:suspicious_sand" or block["name"] == "minecraft:suspicious_gravel" or block["name"] == "allthemodium:suspicious_soul_sand" or block["name"] == "allthemodium:suspicious_clay" then
  11.     found = true
  12.     term.setTextColor(color.green)
  13.     term.write(block["name"])
  14.     term.setTextColor(color.white)
  15.     term.write(" at ")
  16.     term.setTextColor(color.blue)
  17.     print(string.format("x:%d z:%d y:%d", block["x"], block["z"], block["y"]))
  18. end
  19. end
  20. if not found then
  21. print("Nothing found")
  22. end
  23. sleep(5)
  24. end
Advertisement
Comments
  • Endern3x
    1 year (edited)
    # text 0.11 KB | 0 0
    1. Just a heads up but the lines that set the text color need to be updated to term.setTextColor(colors.YourColorHere)
    2.  
Add Comment
Please, Sign In to add comment