Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- term.setBackgroundColor(colors.white)
- term.clear()
- term.setCursorPos(1, 5)
- term.setBackgroundColor(colors.blue)
- term.setTextColor(colors.white)
- print("This Desktop supports:")
- function ClD()
- term.setBackgroundColor(colors.white)
- term.clear()
- term.setBackgroundColor(colors.blue)
- term.clearLine()
- term.setCursorPos(1, 1)
- end
- term.setCursorPos(1, 5)
- term.clearLine()
- term.setBackgroundColor(colors.blue)
- term.setCursorPos(1, 20)
- term.clearLine()
- term.setCursorPos(1, 20)
- local text2 = "J:OS Beta 1.7"
- write(text2)
- term.setCursorPos(1, 3)
- local image3 = paintutils.loadImage("ASSETS/Desktop")
- paintutils.drawImage(image3, 6, 4)
- -- Draw the text
- local tx, ty = 3, 1
- local tx2, ty2 = 15, 1
- local tx3, ty3 = 27, 1
- local tx4, ty4 = 37, 1
- local tx5, ty5 = 3, 3
- local tx6, ty6 = 13, 3
- local tx7, ty7 = 25, 3
- local text2 = "[SETTINGS]"
- local text = "[CMD LINE]"
- local text3 = "[REBOOT]"
- local text4 = "[BROWSER]"
- local text5 = "[UPDATE]"
- local text6 = "[DOWNLOAD]"
- local text7 = "[AntiFile]"
- term.setBackgroundColor(colors.red)
- term.setCursorPos(1,1)
- term.clearLine()
- term.setCursorPos(1,2)
- term.clearLine()
- term.setCursorPos(1,3)
- term.clearLine()
- term.setCursorPos(1,4)
- term.clearLine()
- term.setBackgroundColor(colors.green)
- term.setCursorPos(tx, ty)
- write(text)
- term.setCursorPos(tx2,ty2)
- write(text2)
- term.setCursorPos(tx3,ty3)
- write(text3)
- term.setCursorPos(tx4,ty4)
- write(text4)
- term.setCursorPos(tx5,ty5)
- write(text5)
- term.setCursorPos(tx6,ty6)
- write(text6)
- term.setCursorPos(tx7,ty7)
- write(text7)
- -- Event loop
- while true do
- local sides = {"top","bottom","back","front","left","right"}
- local disk1 = disk.isPresent(sides[1])
- if disk == true then
- disk.eject(sides)
- end
- local e, but, cx, cy = os.pullEvent()
- if e == "mouse_click" then
- if cx >= tx and cx <= tx + text:len() and cy == ty then
- term.setBackgroundColor(colors.black)
- shell.run("os/shell")
- break
- elseif cx >= tx2 and cx <= tx2 + text:len() and cy == ty2 then
- dofile("/os/settings")
- break
- elseif cx >= tx3 and cx <= tx3 + text:len() and cy == ty3 then
- os.reboot()
- elseif cx >= tx4 and cx <= tx4 + text:len() and cy == ty4 then
- dofile("/os/browser")
- break
- elseif cx >= tx5 and cx <= tx5 + text:len() and cy == ty5 then
- term.clear()
- term.setCursorPos(1,1)
- shell.run("/sys/update-scr.lua")
- os.reboot()
- elseif cx >= tx6 and cx <= tx6 + text:len() and cy == ty6 then
- dofile("/os/download")
- break
- elseif cx >= tx7 and cx <= tx7 + text:len() and cy == ty7 then
- dofile("/os/antifile")
- break
- end
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment