From 7d82b3c17736dd6cff5ad9517196f0de668c99d4 Mon Sep 17 00:00:00 2001 From: Ale32bit Date: Thu, 24 Dec 2015 16:18:58 +0100 Subject: [PATCH] Create store --- src/apps/store | 43 +++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 43 insertions(+) create mode 100644 src/apps/store diff --git a/src/apps/store b/src/apps/store new file mode 100644 index 0000000..73de53c --- /dev/null +++ b/src/apps/store @@ -0,0 +1,43 @@ +sPhone.winOk("Work In","Progress") + +local host = "https://raw.githubusercontent.com/Sertex-Team/sPhone-Store/master/" +local index = host.."index.lua" +local apps = host.."apps/" +local save = "/.sPhone/apps/storeApps/" +local appsL = {} +local w, h = term.getSize() + +term.setBackgroundColor(colors.white) +term.setTextColor(colors.black) +term.clear() +term.setCursorPos(1,1) +term.setTextColor(colors.white) +paintutils.drawLine(1,1,w,1,colors.orange) +visum.align("right","X",false,1) +visum.align("center"," Store",false,1) +term.setTextColor(colors.black) +term.setBackgroundColor(colors.white) +term.setCursorPos(1,3) + +local c = http.get(index).readAll() + +local appsIndex = textutils.unserialize(c) + +for k, v in pairs(appsIndex) do + local aa = http.get(apps..v.."/sPhone-Main.lua").readAll() + local a = textutils.unserialize(aa) + table.insert(appsL,a) +end +for i = 1, #appsL do + print(appsL[i].name) +end + + + +while true do + local _, _, x, y = os.pullEvent("mouse_click") + if x == w and y == 1 then + break + end + +end