Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local l = peripheral.getNames()
- term.clear()
- function getPeripherals(sType)
- local t = {}
- for _,name in pairs(l) do
- if peripheral.getType(name) == sType then
- t[#t + 1] = peripheral.wrap(name)
- end
- end
- return t
- end
- function setColour()
- local t = getPeripherals("cofh_thermalexpansion_lamp")
- for i = 1, #t do
- t[i].setColour(colour)
- currColour = colour:gsub("0x","")
- end
- term.clear()
- end
- while true do
- if currcolour then
- term.setCursorPos(1,1)
- term.write("Current Colour: ",currcolour)
- term.setCursorPos(1,2)
- print("Enter Colour (hexcode: RRGGBB) :")
- colour = read()
- colour = tonumber("0x"..colour)
- setColour()
- else
- term.setCursorPos(1,1)
- term.write("Enter Colour (hexcode: RRGGBB):")
- term.setCursorPos(1,2)
- colour = read()
- colour = tonumber("0x"..colour)
- setColour()
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement