Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local op = 1
- local mm = 0
- function clear()
- term.setBackgroundColor(colors.blue)
- term.clear()
- term.setCursorPos(1,1)
- print("Cozy File Grabber Select An Option Below And Insert Disk!")
- end
- local menu = {
- --[" Cozy UI "]
- ["Cozy File"] = {x=20,y=8,offset=1,url="4tt1J2D3", name="startup"};
- ["Cozy Mail"] = {x=20,y=9,offset=2,url="Tsjq5eVa",name = "startup"};
- ["Cozy Chat"] = {x=20,y=10,offset=3,url="7xs20hhW",name = "startup"};
- [" RedDisk "] = {x=20,y=11,offset=4,url="Snj31Zwt",name = "startup"};
- }
- for k, v in pairs(menu) do mm = mm + 1 end
- function makeDisk()
- for k, v in pairs(menu) do
- if(op == v.offset)then
- if(disk.isPresent("bottom"))then
- shell.run("pastebin","get",v.url,".tmp")
- if(v.url2)then shell.run("pastebin","get",v.url2,".tmp2") end
- fs.move(".tmp","disk/"..v.name)
- if(v.url2)then fs.move(".tmp2","disk/"..v.name2) end
- print("Install Disk Created!")
- print("press any key to continue.")
- os.pullEvent("key")
- disk.eject("bottom")
- else
- print("Please Insert Disk In Bottom Drive")
- print("press any key to continue.")
- os.pullEvent("key")
- makeDisk()
- end
- end
- end
- end
- function drawMenu()
- for k, v in pairs(menu) do term.setCursorPos(v.x,v.y) if(op == v.offset)then print("> "..k.." <") else print(" "..k.." ") end end
- end
- function updateMenu()
- m = {os.pullEvent("key")}
- if(m[2] == keys.up and op > 1)then op = op - 1 end
- if(m[2] == keys.down and op < mm)then op = op + 1 end
- if(m[2] == keys.enter)then makeDisk() end
- end
- while true do
- sleep(0.01)
- clear()
- drawMenu()
- updateMenu()
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement