Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- --This program asks for RGB values and sets a Glowstone Illuminator, that placed on top of the computer, to the color entered. It keeps setting the color every 1.5 seconds until terminated. This way you don't have to keep entering values and can change the color of a bunch at once.
- r = 0
- g = 0
- b = 0
- c = peripheral.wrap("top")
- term.clear()
- term.setCursorPos(1,1)
- print("Enter RED value (0-255): ")
- r = tonumber(read())
- print("Enter GREEN value (0-255): ")
- g = tonumber(read())
- print("Enter BLUE value (0-255): ")
- b = tonumber(read())
- form = string.format("%02x%02x%02x", r, g, b)
- sub = string.gsub(form, ", ", "")
- dec = tonumber(sub, 16)
- while true do
- c.setColor(dec)
- sleep(1.5)
- end
Add Comment
Please, Sign In to add comment