Advertisement
mathiaas

tune

Apr 30th, 2024 (edited)
903
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.65 KB | None | 0 0
  1. -- About: This script is used for tuning ender chests to a certain channel
  2.  
  3. local args = {...}
  4. local scriptName = "tune"
  5. dofile("constants")
  6.  
  7. if #args < 1 then
  8.     print("Usage: " .. scriptName .. " <channel>")
  9.     return
  10. end
  11.  
  12. local success, data = turtle.inspect()
  13. if not success or data.name ~= BLOCKS.enderChest.name then
  14.     print("Place an ender chest in front of the turtle")
  15.     return
  16. end
  17.  
  18. local enderChest = peripheral.wrap("front")
  19. if enderChest == nil then
  20.     print("Failed to connect to ender chest")
  21.     return
  22. end
  23.  
  24. enderChest.setColors(unpack(COLOR_CHANNELS[args[1]]))
  25. print("Ender chest is now tuned to : '" .. args[1] .. "'")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement