Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- -- Microcraft Market -- Based on Microcraft NExplorer API --
- local function s(...) return sleep(...) end
- local function aw(...) return write(...) end
- local function p(...) return print(...) 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 pliki(sciezka)
- arg = {}
- local files = fs.list(sciezka)
- y = 1
- for i,file in ipairs(files) do
- arg[y] = file
- y = y+1
- end
- a = 1
- scp(1,10)
- arg[y+1] = y
- return arg
- end
- function ile_plikow(sciezka)
- local files = fs.list(sciezka)
- ile = 0
- for i,file in ipairs(files) do
- ile = ile+1
- end
- return ile
- end
- function wyswietl_pliki()
- sbc(colors.black)
- tc()
- sbc(colors.black)
- stc(colors.white)
- pfb(1,1,w,1,colors.blue)
- stc(colors.white)
- scp(1,1)
- p("Microcraft Market")
- sbc(colors.black)
- local files = fs.list("/listings/")
- x = 2
- y = 3
- loop = 0
- for i,file in ipairs(files) do
- if y<h-2 then
- scp(x+5*loop,y)
- if not fs.isDir(file) then
- term.write(file)
- end
- else
- y = 3
- loop = loop+1
- end
- y = y+1
- end
- end
- wyswietl_pliki()
- s(3)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement