Advertisement
Hubnester

Rainbow Controller

Mar 16th, 2021 (edited)
71
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.00 KB | None | 0 0
  1. --local interface1 = peripheral.wrap("right")
  2. --local interface2 = peripheral.wrap("bottom")
  3. local autoClicker = peripheral.wrap("left")
  4.  
  5. local changeTime = 0.5 - 0.05 -- Change to be able to be set later
  6. local dyes = { -- Maybe change this to a table with k, v of readable name, internal name (when i make the colour changing customizable)
  7. { right = 10},
  8. { right = 11},
  9. { right = 12},
  10. { right = 13},
  11. { right = 14},
  12. { right = 15},
  13. { right = 16},
  14. { right = 17},
  15. { right = 18},
  16. { bottom = 10},
  17. { bottom = 11},
  18. { bottom = 12},
  19. { bottom = 13},
  20. { bottom = 14},
  21. { bottom = 15},
  22. { bottom = 16}
  23. }
  24. local i = 1
  25. local last = ""
  26.  
  27. while true do
  28. i = (i % #dyes) + 1
  29. local side, slot = next(dyes[i])
  30. if dyes[i] ~= last then
  31. if autoClicker.pullItems(side, slot, 1) > 0 then
  32. last = dyes[i]
  33. end
  34. end
  35. term.setCursorPos(1, 2)
  36. term.clearLine()
  37. term.write(side .. " : " .. slot)
  38. i = i + 1
  39. sleep(changeTime) -- Might need to do this differently to properly allow for inputs
  40. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement