Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- -- Microcraft NextUI Device Manager --
- local function aw(...) return write(...) end
- local function p(...) return print(...) end
- local function s(...) return sleep(...) end
- local function tw(...) return term.write(...) end
- local function scp(...) return term.setCursorPos(...) end
- local function sbc(...) return term.setBackgroundColor(...) end
- local function stc(...) return term.setTextColor(...) end
- local function tc(...) return term.clear(...) end
- local function tcl(...) return term.clearLine(...) end
- local function r(...) return shell.run(...) end
- local function sp(...) return textutils.slowPrint(...) end
- local function sw(...) return textutils.slowWrite(...) end
- local function fse(...) return fs.exists(...) end
- local function pul(...) return paintutils.loadImage(...) end
- local function pud(...) return paintutils.drawImage(...) end
- local function pfb(...) return paintutils.drawFilledBox(...) end
- local function su(...) return os.shutdown(...) end
- local function re(...) return os.reboot(...) end
- local function pdp(...) return paintutils.drawPixel(...) end
- w, h = term.getSize()
- function nilToBrak(str)
- if str == nil then str = "Brak" end
- return str
- end
- function mysz()
- local event, button, x, y = os.pullEvent("mouse_click")
- klik = {x, y, button}
- return klik
- end
- function findPeripherals()
- peripherals = {}
- peripherals[1] = nilToBrak(peripheral.getType("top"))
- peripherals[2] = nilToBrak(peripheral.getType("bottom"))
- peripherals[3] = nilToBrak(peripheral.getType("left"))
- peripherals[4] = nilToBrak(peripheral.getType("right"))
- peripherals[5] = nilToBrak(peripheral.getType("front"))
- peripherals[6] = nilToBrak(peripheral.getType("back"))
- return peripherals
- end
- function devMgr()
- pfb(1,1,w,1,colors.blue)
- stc(colors.white)
- scp(1,1)
- p("NextUI Device Manager")
- pdp(w,1,colors.red)
- stc(colors.white)
- scp(w,1)
- p("X")
- pfb(1,2,w,h,colors.black)
- scp(1,2)
- stc(colors.white)
- p("NextUI Compatible PC")
- local char1 = "\149"
- p(char1)
- p(char1)
- local char2 = "\131"
- for i = 5,14 do
- scp(1,i)
- p(char1)
- end
- peripheralsFound = findPeripherals()
- scp(2,5)
- p(char2,"Top ", peripheralsFound[1])
- scp(2,7)
- p(char2, "Bottom", peripherals[2])
- scp(2,9)
- p(char2, "Left", peripherals[3])
- scp(2,11)
- p(char2, "Right", peripherals[4])
- scp(2,13)
- p(char2, "Front", peripherals[5])
- scp(2,15)
- p(char2, "Back", peripherals[6])
- while true do
- klik = mysz()
- if klik[1] == w and klik[2] == 1 then break end
- end
- end
- devMgr()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement