Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local functions = { -- PUT RCM OPTIONS HERE (ALL LOWERCASE AND WITH NO SPACES)
- debug = function() return error("Debug in function") end,
- reboot = function() setBack("red") setText("white") clr() cp(1,1) write("Re-Booting") sleep(3) os.reboot() end
- shutdown = function() setBack("orange") setText("white") clr() cp(1,1) write("Shutting Down") sleep(3) os.shutdown() end
- }
- running = true
- update = true
- function runtime()
- setRcmMenu({"Debug", "Reboot", "Shutdown"})
- setBack("yellow") clr()
- while running do
- if update then
- update = false
- paintutils.drawImage(desktop_img,1,1)
- paintutils.drawLine(1,h,w,h,colors.white)
- paintutils.drawPixel(1,h,colors.blue)
- local current = term.current()
- for i=1, #window do
- if window[i].display then
- local current2 = term.current()
- term.redirect(current)
- paintutils.drawPixel(i+2,h,colors.lightGray) cp(i+2,h) write("^")
- local wx,wy = term.getSize()
- paintutils.drawLine(1,0,wx,0,colors.white)
- term.redirect(current2)
- else
- local current2 = term.current()
- term.redirect(current)
- paintutils.drawPixel(i+2,h,colors.gray) cp(i+2,h) write("-")
- term.redirect(current2)
- end
- end
- term.redirect(current)
- if rcm_data.active == true then
- rcm(rcm_data.x,rcm_data.y,rcm_data.menu,w,h-1)
- end
- end
- a,i,x,y = pullEvents("mouse_click", "mouse_drag")
- if a == "mouse_click" then
- if i == 1 then
- if rcm_data.active then
- if rcm_click(x,y) then
- if notnil(functions[string.lower(rcm_data.menu[y-rcm_data.y+1] or "")]) then functions[string.lower(rcm_data.menu[y-rcm_data.y+1])]() end
- end
- rcm_data.active = false update = true setBack("yellow") clr()
- else
- end
- elseif i == 2 then
- setBack("yellow") clr() rcm_data.active = true rcm_data.x,rcm_data.y = x,y update = true
- end
- elseif a == "mouse_drag" then
- end
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement