Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- m = peripheral.wrap('left')
- p = peripheral.wrap('top')
- color = colors.red
- function screen()
- m.setBackgroundColor(colors.black)
- m.clear()
- p.setBackgroundColor(colors.black)
- p.clear()
- term.redirect(p)
- paintutils.drawPixel(1,1,colors.gray)
- paintutils.drawPixel(2,1,colors.black)
- paintutils.drawPixel(3,1,colors.red)
- paintutils.drawPixel(4,1,colors.yellow)
- paintutils.drawPixel(1,2,colors.white)
- term.setCursorPos(1,2)
- term.setTextColor(colors.black)
- term.write("T")
- term.setTextColor(colors.white)
- paintutils.drawPixel(3,2,colors.purple)
- term.setCursorPos(1,5)
- x, y = m.getSize()
- term.setBackgroundColor(colors.black)
- term.write(x..";"..y)
- term.restore()
- term.redirect(m)
- end
- screen()
- while true do
- event, side, xPos, yPos = os.pullEvent()
- if event == "monitor_resize" then
- term.restore()
- screen()
- end
- if event == "monitor_touch" then
- p.setCursorPos(1,3)
- p.write("X: " .. tostring(xPos))
- p.setCursorPos(1,4)
- p.write("Y: " .. tostring(yPos))
- if side == "top" then
- if xPos == 1 and yPos == 1 then
- m.setBackgroundColor(colors.black)
- m.clear()
- elseif yPos == 1 and xPos == 2 then
- color = colors.black
- elseif yPos == 1 and xPos == 3 then
- color = colors.red
- elseif yPos == 1 and xPos == 4 then
- color = colors.yellow
- elseif yPos == 2 and xPos == 1 then
- side = "lol"
- while side ~= "left" do
- event, side, xPos, yPos = os.pullEvent("monitor_touch")
- end
- paintutils.drawPixel(xPos, yPos, colors.green)
- term.restore()
- print("Text : ")
- text = read()
- term.redirect(m)
- term.setCursorPos(xPos,yPos)
- term.setBackgroundColor(color)
- term.write(text)
- elseif yPos == 2 and xPos == 3 then
- term.restore()
- print("cmd : ")
- text = read()
- if text == "exit" then exit() end
- if text == "screen" then screen()
- elseif text == "rien" then
- else
- m.setTextScale(tonumber(text))
- end
- term.redirect(m)
- end
- else
- paintutils.drawPixel(xPos, yPos, color)
- end
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement