Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local moni = peripheral.wrap("left")
- moni.setTextScale(1)
- local x, y = moni.getSize()
- local kleurtje
- local colorCount = {{},{},{},{},{},{},{},{},{},{},{},{},{},{}}
- local bluePrint = {}
- for i = 1, 60 do
- bluePrint[i] = {}
- for j = 1, 25 do
- bluePrint[i][j] = {}
- for d = 1, 35 do
- bluePrint[i][j][d] = colors.blue
- end
- end
- end
- for i = 1, #colorCount do colorCount[i] = 0 end
- print("X: "..x ..",Y: "..y)
- while true do
- moni.clear()
- for i = 1, #colorCount do colorCount[i] = 0 end
- for i = 2 , #bluePrint do
- for j = 2, #bluePrint[i] do
- moni.setCursorPos(i,j)
- --moni.setTextColor(bluePrint[i][j][1])
- --moni.write("0")
- moni.setBackgroundColor(bluePrint[i][j][1])
- moni.write(" ")
- moni.setBackgroundColor(colors.black)
- if bluePrint[i][j][1] == colors.white then colorCount[1] = colorCount[1] + 1 end
- if bluePrint[i][j][1] == colors.orange then colorCount[2] = colorCount[2] + 1 end
- if bluePrint[i][j][1] == colors.magenta then colorCount[3] = colorCount[3] + 1 end
- if bluePrint[i][j][1] == colors.lightBlue then colorCount[4] = colorCount[4] + 1 end
- if bluePrint[i][j][1] == colors.yellow then colorCount[5] = colorCount[5] + 1 end
- if bluePrint[i][j][1] == colors.lime then colorCount[6] = colorCount[6] + 1 end
- if bluePrint[i][j][1] == colors.pink then colorCount[7] = colorCount[7] + 1 end
- if bluePrint[i][j][1] == colors.gray then colorCount[8] = colorCount[8] + 1 end
- if bluePrint[i][j][1] == colors.lightGray then colorCount[9] = colorCount[9] + 1 end
- if bluePrint[i][j][1] == colors.cyan then colorCount[10] = colorCount[10] + 1 end
- if bluePrint[i][j][1] == colors.purple then colorCount[11] = colorCount[11] + 1 end
- if bluePrint[i][j][1] == colors.brown then colorCount[12] = colorCount[12] + 1 end
- if bluePrint[i][j][1] == colors.green then colorCount[13] = colorCount[13] + 1 end
- if bluePrint[i][j][1] == colors.red then colorCount[14] = colorCount[14] + 1 end
- end
- end
- moni.setCursorPos(63,2) moni.setBackgroundColor(colors.white) moni.write(" "..colorCount[1].." ")
- moni.setCursorPos(63,3) moni.setBackgroundColor(colors.orange) moni.write(" "..colorCount[2].." ")
- moni.setCursorPos(63,4) moni.setBackgroundColor(colors.magenta) moni.write(" "..colorCount[3].." ")
- moni.setCursorPos(63,5) moni.setBackgroundColor(colors.lightBlue) moni.write(" "..colorCount[4].." ")
- moni.setCursorPos(63,6) moni.setBackgroundColor(colors.yellow) moni.write(" "..colorCount[5].." ")
- moni.setCursorPos(63,7) moni.setBackgroundColor(colors.lime) moni.write(" "..colorCount[6].." ")
- moni.setCursorPos(63,8) moni.setBackgroundColor(colors.pink) moni.write(" "..colorCount[7].." ")
- moni.setCursorPos(63,9) moni.setBackgroundColor(colors.gray) moni.write(" "..colorCount[8].." ")
- moni.setCursorPos(63,10) moni.setBackgroundColor(colors.lightGray) moni.write(" "..colorCount[9].." ")
- moni.setCursorPos(63,11) moni.setBackgroundColor(colors.cyan) moni.write(" "..colorCount[10].." ")
- moni.setCursorPos(63,12) moni.setBackgroundColor(colors.purple) moni.write(" "..colorCount[11].." ")
- moni.setCursorPos(63,13) moni.setBackgroundColor(colors.brown) moni.write(" "..colorCount[12].." ")
- moni.setCursorPos(63,14) moni.setBackgroundColor(colors.green) moni.write(" "..colorCount[13].." ")
- moni.setCursorPos(63,15) moni.setBackgroundColor(colors.red) moni.write(" "..colorCount[14].." ")
- moni.setCursorPos(63,16) moni.setBackgroundColor(colors.blue) moni.write(" ")
- moni.setCursorPos(63,17) moni.setBackgroundColor(colors.blue) moni.write(" ")
- moni.setBackgroundColor(colors.black)
- event, side, xPos, yPos = os.pullEvent("monitor_touch")
- if (tonumber(xPos) == 1) and (tonumber(yPos) == 1) then
- kleurtje = colors.blue
- end
- if (tonumber(xPos) == 1) and (tonumber(yPos) == 2) then
- kleurtje = colors.yellow
- end
- if (tonumber(xPos) == 1) and (tonumber(yPos) == 3) then
- kleurtje = colors.red
- end
- if (tonumber(xPos) == 1) and (tonumber(yPos) == 4) then
- kleurtje = colors.green
- end
- bluePrint[xPos][yPos][1] = kleurtje
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement