Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local moni = peripheral.wrap("top")
- local color1 = 1
- local color2 = 1
- local color3 = 1
- local Tcolor1
- local Tcolor2
- local Tcolor3
- function backColor(num,colorgroup)
- local colored
- if num == 0 then colored= colors.white end
- if num == 1 then colored= colors.white end
- if num == 2 then colored= colors.orange end
- if num == 3 then colored= colors.magenta end
- if num == 4 then colored= colors.lightBlue end
- if num == 5 then colored= colors.yellow end
- if num == 6 then colored= colors.lime end
- if num == 7 then colored= colors.pink end
- if num == 8 then colored= colors.gray end
- if num == 9 then colored= colors.lightGray end
- if num == 10 then colored= colors.cyan end
- if num == 11 then colored= colors.purple end
- if num == 12 then colored = colors.blue end
- if num == 13 then colored = colors.brown end
- if num == 14 then colored= colors.green end
- if num == 15 then colored= colors.red end
- if num == 16 then colored= colors.black end
- if colorgroup == 1 then Tcolor1 = colored end
- if colorgroup == 2 then Tcolor2 = colored end
- if colorgroup == 3 then Tcolor3 = colored end
- end
- function backNum(num,colorgroup)
- local colored
- if num == colors.white then colored = 1 end
- if num == colors.orange then colored = 2 end
- if num == colors.magenta then colored = 3 end
- if num == colors.lightBlue then colored = 4 end
- if num == colors.yellow then colored = 5 end
- if num == colors.lime then colored = 6 end
- if num == colors.pink then colored = 7 end
- if num == colors.gray then colored = 8 end
- if num == colors.lightGray then colored = 9 end
- if num == colors.cyan then colored = 10 end
- if num == colors.purple then colored = 11 end
- if num == colors.blue then colored = 12 end
- if num == colors.brown then colored = 13 end
- if num == colors.green then colored = 14 end
- if num == colors.red then colored = 15 end
- if num == colors.black then colored = 16 end
- if colorgroup == 1 then color1 = colored end
- if colorgroup == 2 then color2 = colored end
- if colorgroup == 3 then color3 = colored end
- end
- backColor(color1,1)
- backColor(color2,2)
- backColor(color3,3)
- moni.setTextColor(colors.red)
- moni.clear()
- moni.setCursorPos(1,1)
- moni.write(" < ")
- moni.setBackgroundColor(tonumber(Tcolor1))
- moni.write(" ")
- moni.setBackgroundColor(colors.black)
- moni.write(" > ")
- moni.setCursorPos(1,2)
- moni.write(" < ")
- moni.setBackgroundColor(tonumber(Tcolor2))
- moni.write(" ")
- moni.setBackgroundColor(colors.black)
- moni.write(" > ")
- moni.setCursorPos(1,3)
- moni.write(" < ")
- moni.setBackgroundColor(tonumber(Tcolor3))
- moni.write(" ")
- moni.setBackgroundColor(colors.black)
- moni.write(" > ")
- moni.setCursorPos(1,4)
- moni.setTextColor(colors.white)
- moni.write(" [?] ")
- moni.setCursorPos(1,5)
- moni.write("GET|SET")
- while (true) do
- event, side, xPos, yPos = os.pullEvent("monitor_touch")
- if (tonumber(xPos) <= 3) and (tonumber(yPos) == 1) then
- if color1 <= 1 then
- color1 = 16
- else
- color1 = color1 - 1
- end
- end
- if (tonumber(xPos) >= 5) and (tonumber(yPos) == 1) then
- if color1 >= 16 then
- color1 = 1
- else
- color1 = color1 + 1
- end
- end
- if (tonumber(xPos) <= 3) and (tonumber(yPos) == 2) then
- if color2 <= 1 then
- color2 = 16
- else
- color2 = color2 - 1
- end
- end
- if (tonumber(xPos) >= 5) and (tonumber(yPos) == 2) then
- if color2 >= 16 then
- color2 = 1
- else
- color2 = color2 + 1
- end
- end
- if (tonumber(xPos) <= 3) and (tonumber(yPos) == 3) then
- if color3 <= 1 then
- color3 = 16
- else
- color3 = color3 - 1
- end
- end
- if (tonumber(xPos) >= 5) and (tonumber(yPos) == 3) then
- if color3 >= 16 then
- color3 = 1
- else
- color3 = color3 + 1
- end
- end
- if ((tonumber(xPos) >= 3) and (tonumber(xPos) <= 5) ) and (tonumber(yPos) == 4) then
- color1 = math.random(1,16)
- color2 = math.random(1,16)
- color3 = math.random(1,16)
- end
- backColor(color1,1)
- backColor(color2,2)
- backColor(color3,3)
- if ((tonumber(xPos) >= 5) and (tonumber(xPos) <= 7) ) and (tonumber(yPos) == 5) then
- local ender = peripheral.wrap("right")
- if ender ~= nil then
- if string.find(string.lower(peripheral.getType("right")), "chest") then
- ender.setColors(tonumber(Tcolor1),tonumber(Tcolor2),tonumber(Tcolor3))
- elseif string.find(string.lower(peripheral.getType("right")), "tank") then
- ender.setColors(tonumber(Tcolor3),tonumber(Tcolor2),tonumber(Tcolor1))
- end
- end
- end
- if ((tonumber(xPos) >= 1) and (tonumber(xPos) <= 3) ) and (tonumber(yPos) == 5) then
- local ender = peripheral.wrap("right")
- if ender ~= nil then
- local getcol1
- local getcol2
- local getcol3
- if string.find(string.lower(peripheral.getType("right")), "chest") then
- getcol1, getcol2, getcol3 = ender.getColors()
- elseif string.find(string.lower(peripheral.getType("right")), "tank") then
- getcol3, getcol2, getcol1 = ender.getColors()
- end
- backNum(getcol1,1)
- backNum(getcol2,2)
- backNum(getcol3,3)
- backColor(color1,1)
- backColor(color2,2)
- backColor(color3,3)
- end
- end
- moni.setTextColor(colors.red)
- moni.clear()
- moni.setCursorPos(1,1)
- moni.write(" < ")
- moni.setBackgroundColor(tonumber(Tcolor1))
- moni.write(" ")
- moni.setBackgroundColor(colors.black)
- moni.write(" > ")
- moni.setCursorPos(1,2)
- moni.write(" < ")
- moni.setBackgroundColor(tonumber(Tcolor2))
- moni.write(" ")
- moni.setBackgroundColor(colors.black)
- moni.write(" > ")
- moni.setCursorPos(1,3)
- moni.write(" < ")
- moni.setBackgroundColor(tonumber(Tcolor3))
- moni.write(" ")
- moni.setBackgroundColor(colors.black)
- moni.write(" > ")
- moni.setCursorPos(1,4)
- moni.setTextColor(colors.white)
- moni.write(" [?] ")
- moni.setCursorPos(1,5)
- moni.write("GET|SET")
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement