Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- --Varibles
- version = "1.2.6"
- running = true
- --Colors
- colTaskBar = colors.red
- colBackground = color.black
- --Images
- _dt = paintutils.loadImage("/os/.backgrounds/dt")
- --Booleans
- _ms = 0
- _rcm = 0
- --Functions
- clear = function()
- term.setBackgroundColor(colors.black)
- term.clear()
- term.setCursorPos(1, 1)
- end
- drawRightClickMenu = function()
- term.setBackgroundColor( colors.white )
- term.setTextColor( colors.blue )
- term.setCursorPos(x, y)
- term.write(" LUA ")
- term.setCursorPos(x, y+1)
- term.write(" IDE ")
- local event, button, xPos, yPos = os.pullEvent("mouse_click")
- while true do
- if button == 1 and yPos == y and xPos <= (x+6) and xPos >= x then
- running = false
- clear()
- term.setTextColor( colors.red )
- print("You are now in Command Pronpt")
- print("OS will shutdown after exiting LUA Prompt")
- print("Any function of the OS is in the LUA functions now.")
- shell.run("lua")
- break
- elseif button == 1 and yPos == (y+1) and xPos <= (x+6) and xPos >= x then
- shell.run("edit", "/Gui")
- init()
- break
- else
- redraw()
- break
- end
- end
- _rcm = 0
- drawMenu1 = function()
- term.setCursorPos(1, 2)
- term.setBackground Color( colors.white )
- term.setTextColor( colors.red)
- print("Power")
- end
- redraw = function()
- drawDeskTop()
- drawTaskBar()
- end
- drawTaskBar = function()
- term.setCursorPos(1, 1)
- term.setBackgroundColor(colTaskBar)
- term.clearLine()
- term.setCursorPos(1, 1)
- term.setBackgroundColor(colors.red)
- term.setTextColor( colors.white )
- term.write("Menu")
- end
- stop = function()
- clear()
- running = false
- term.setTextColor( colors.blue )
- print("Thanks for using Ironist Teck OS")
- exit()
- end
- drawDeskTop = function()
- term.setBackgroundColor(colBackground)
- term.clear()
- term.setCursorPos(1, 1)
- paintutils.drawImage(_dt, 1, 1)
- end
- LoadConfig = function
- runTime = function()
- while running do
- event, button, x, y = os.pullEvent("mouse_click")
- if _ms == 0 and button == 1 and x < 5 and y == 1 then
- drawMenu1()
- _ms = 1 (<-- the computer says that this is the problem but I don't know how to fix it)
- elseif _ms == 1 and button == and y == 2 and x > 5 then
- stop()
- elseif _ms == 1 and button == 1 and x < 5 and y == 1 then
- init()
- elseif _ms == 0 and _rcm == 0 and button == 2 then
- _rcm = 1
- drawRightClickMenu(x ,y)
- end
- end
- end
- init = function()
- _ms = 0
- drawDeskTop()
- drawTaskBar()
- runTime()
- end
- --Main Stuff
- init()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement