Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- colr = Color()
- function Username()
- local f = xs.ReadAll("/XynSoft/Data/User/Username")
- return f
- end
- xs.Block(2,1,11,19,true,colr)
- page = 1
- function WrtPg(pg)
- Write("< "..pg.." >",2,11,colr,colors.lightGray)
- end
- WrtPg(page)
- usr = Username()
- app_list = fs.list("/Users/"..usr.."/Applecations")
- function initapps()
- apps = table.len(app_list)
- appevnt = {}
- y = 1
- a = 0
- for app = 1,apps do
- a = a + 1
- flist = xs.ReadAll("/Users/"..usr.."/Applecations/"..app)
- name = flist["name"]
- run = flist["run"]
- table.insert(y,run,appevnt)
- if a > 17 then
- a = 0
- p = p + 1
- end
- if page == p then
- xs.CP(2,y)
- xs.BC(colr)
- xs.TC(colors.white)
- term.write(name)
- if string.len(name) > 9 then
- xs.BC(colors.white)
- CP(12,y)
- for i = 12,12 + (string.len(name) - 9) do
- term.write(" ")
- end
- CP(10,y)
- term.write("...")
- end
- end
- end
- end
- t1 = true
- while t1 do
- if ShellEventAdv("mouse_click",2,2,19,19)
- if page == 1 then
- page = 1
- else
- page = page - 1
- initapps()
- WrtPg(page)
- end
- elseif ShellEventAdv("mouse_click",11,11,19,19)
- page = page + 1
- initapps()
- WrtPg(page)
- end
- button,x,y = xs.ShellEvent("mouse_click")
- if (x < 2) or (x > 11) then
- t1 = true
- elseif (x >= 2) and (x <= 11) then
- shell.run(appevnt[y])
- t1 = false
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment