Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- --Variables
- newAppName="AppName"
- --Design
- paintutils.drawFilledBox(1,1,51,19,colors[col])
- paintutils.drawFilledBox(2,2,50,18,colors[colWind])
- paintutils.drawBox(2,2,50,18,colors.black)
- term.setTextColor(colors.black)
- term.setBackgroundColor(colors.red)
- term.setCursorPos(50,2)
- write("X")
- term.setBackgroundColor(colors.lightGray)
- term.setTextColor(colors[colText])
- term.setCursorPos(36,3)
- write(" browse App ")
- term.setCursorPos(3,3)
- write(" list Apps ")
- term.setBackgroundColor(colors[colWind])
- term.setCursorPos(6,7)
- write("App-name")
- term.setCursorPos(23,7)
- write("creator")
- term.setCursorPos(39,7)
- write("pastebin")
- term.setCursorPos(5,16)
- print("path: maxintosh/"..currentUser.."/programs/"..newAppName)
- term.setBackgroundColor(colors.green)
- term.setTextColor(colors.black)
- term.setCursorPos(22,11)
- write(" install ")
- term.setCursorPos(19,13)
- write("install via code")
- --Click
- while true do
- event,n,x,y=os.pullEvent("mouse_click")
- --X
- if x==50 and y==2 then
- error()
- end
- -----Instant-Install----
- if y==13 then
- term.setBackgroundColor(colors[colWind])
- term.setTextColor(colors[colText])
- term.setCursorPos(19,14)
- write("code: ")
- code=read()
- sleep(0.5)
- paintutils.drawBox(19,14,40,14,colors[colWind])
- term.setCursorPos(19,14)
- write("name: ")
- name=read()
- sleep(0.5)
- term.setTextColor(colors[colWind])
- term.setCursorPos(5,8)
- shell.run("pastebin get",code,"maxintosh/"..currentUser.."/programs/"..name)
- term.setTextColor(colors[colText])
- paintutils.drawBox(19,14,40,14,colors[colWind])
- term.setCursorPos(22,14)
- write("success")
- sleep(1)
- paintutils.drawBox(19,14,40,14,colors[colWind])
- end
- --Browse
- if x>35 and y==3 then
- paintutils.drawBox(36,3,49,3,colors.lightGray)
- term.setTextColor(colors[colText])
- term.setCursorPos(37,3)
- newAppName=read()
- if fs.exists("maxintosh/appData/"..newAppName) then
- f=fs.open("maxintosh/appData/"..newAppName,"r")
- newAppName=f.readLine()
- newAppCreator=f.readLine()
- newAppCode=f.readLine()
- f.close()
- term.setCursorPos(6,9)
- paintutils.drawBox(3,9,49,9,colors[colWind])
- term.setTextColor(colors[colText])
- term.setBackgroundColor(colors[colWind])
- term.setCursorPos(6,9)
- write(newAppName)
- term.setCursorPos(23,9)
- write(newAppCreator)
- term.setCursorPos(39,9)
- write(newAppCode)
- paintutils.drawBox(5,16,49,16,colors[colWind])
- term.setCursorPos(5,16)
- print("path: maxintosh/"..currentUser.."/programs/"..newAppName)
- else
- sleep(1)
- paintutils.drawBox(36,3,49,3,colors.lightGray)
- term.setTextColor(colors.red)
- term.setCursorPos(4,3)
- write(newAppName.." not found")
- end
- end
- --Install
- if y==11 and not(newAppName=="appName") then
- term.setCursorPos(4,4)
- term.setBackgroundColor(colors[colWind])
- term.setTextColor(colors[colWind])
- shell.run("pastebin get ",newAppCode, "maxintosh/"..currentUser.."/programs/"..newAppName)
- term.setCursorPos(4,4)
- term.setTextColor(colors.green)
- sleep(1)
- print("succesfully installed "..newAppName)
- end
- --List Apps
- if y==3 and x<25 then
- paintutils.drawFilledBox(4,4,48,16,colors[colWind])
- paintutils.drawBox(4,4,48,16,colors.black)
- term.setBackgroundColor(colors.red)
- term.setTextColor(colors.black)
- term.setCursorPos(48,4)
- write("X")
- appList={}
- appList=fs.list("maxintosh/appData")
- max=table.maxn(appList)
- i=1
- y=1
- while i<max do
- term.setTextColor(colors[colText])
- term.setBackgroundColor(colors[colWind])
- term.setCursorPos(6,y+5)
- write(appList[i])
- term.setCursorPos(21,y+5)
- write(tostring(appList[i+1]))
- term.setCursorPos(36,y+5)
- write(tostring(appList[i+2]))
- i=i+3
- y=y+2
- end
- notXed=true
- while notXed==true do
- event,n,x,y=os.pullEvent("mouse_click")
- if x==48 and y==4 then
- notXed=false
- shell.run("maxintosh/"..currentUser.."/programs/appStore")
- error()
- end
- end
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement