Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function mouseCheck()
- while true do
- local event, button, xPos, yPos = os.pullEvent("mouse_click")
- if (yPos == y and xPos < 6) then
- if startMenu then
- drawDefault()
- startMenu = false
- else
- drawStart()
- startMenu = true
- end
- elseif yPos == 8 and xPos > 13 and xPos < 18 and startMenu then
- os.shutdown()
- elseif yPos == 10 and xPos > 1 and xPos < 18 and startMenu then
- shell.run("/DragonOS/Core/LegacyBrowser")
- elseif yPos == 12 and xPos > 1 and xPos < 18 and startMenu then
- shell.run("/DragonOS/DragonUpdate")
- elseif yPos == 14 and xPos > 1 and xPos < 18 and startMenu then
- shell.run("/DragonOS/Core/change")
- elseif yPos == 16 and xPos > 1 and xPos < 18 and startMenu then
- shell.run("cd","/")
- term.setBackgroundColor(colors.black)
- shell.run("clear")
- error()
- end
- end
- end
- function drawTime()
- while true do
- coroutine.resume(mouseevnt)
- term.setBackgroundColor(colors.blue)
- term.setCursorPos(x-7,y)
- term.write(textutils.formatTime(os.time(), false))
- term.setCursorPos(x,y)
- sleep(0.1)
- end
- end
- function drawDefault()
- paintutils.drawImage(screen,1,1)
- term.setBackgroundColor(colors.lime)
- term.setCursorPos(1,y)
- term.write("Start")
- term.setCursorPos(x,y)
- end
- function drawStart()
- paintutils.drawImage(start,1,1)
- term.setBackgroundColor(colors.cyan)
- term.setCursorPos(14,8)
- term.write("Off")
- term.setBackgroundColor(colors.orange)
- term.setCursorPos(2,10)
- term.write("Terminal >")
- term.setCursorPos(2,12)
- term.write("Update >")
- term.setCursorPos(2,14)
- term.write("Set usr/pass >")
- term.setCursorPos(2,16)
- term.write("CraftOS >")
- term.setCursorPos(x,y)
- end
- screen = paintutils.loadImage("/DragonOS/Core/Screen")
- start = paintutils.loadImage("/DragonOS/Core/Start")
- x,y = term.getSize()
- startMenu = false
- drawDefault()
- mouseevnt = coroutine.create(mouseCheck())
- drawTime()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement