Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- --[[
- Name = Shop/ShopInstaller.lua
- Version = 1.1
- Date = 2/12/2021
- Time = 15:40
- Author = Jetro
- ]]
- -- Variables
- local Serverfiles = {
- {"Shop/Server.lua","fy0T5iPx"},
- {"Shop/ShopInstaller.lua","FP0yRNS7"},
- {"Base64.api","zAKYhveJ"},
- }
- local Clientfiles = {
- {"Base64.api","zAKYhveJ"},
- {"screen.api","uSzxUdLg"},
- {"Shop/Client.lua","xZe3hbqP"},
- {"Shop/ShopInstaller.lua","FP0yRNS7"},
- }
- local InvFile = "Shop/Inventory.cfg"
- local WaitTime = 10
- local Inv = {
- a = {
- 0,
- 0,
- },
- }
- -- Main
- shell.run("clear")
- print("What do you want to install?")
- print("[1] Server")
- print("[2] Client")
- parallel.waitForAny(
- function()
- input = read()
- end,
- function()
- repeat
- term.setCursorPos(30,1)
- print("("..WaitTime..") ")
- WaitTime = WaitTime - 1
- term.setCursorPos(1,4)
- sleep(1)
- until WaitTime == 0
- input = "1"
- end
- )
- if input == nil then
- input = 1
- end
- if input == "1" or input == "Server" then
- for i = 1, #Serverfiles do
- if fs.exists(Serverfiles[i][1]) then
- fs.delete(Serverfiles[i][1])
- end
- shell.run("pastebin get "..Serverfiles[i][2].." "..Serverfiles[i][1])
- end
- if fs.exists(InvFile) == false then
- myInv = fs.open(InvFile,"w")
- myInv.write("-- FORMAT { amount, price }\n")
- myInv.write(textutils.serialise(Inv))
- myInv.close()
- end
- elseif input == "2" or input == "Client" then
- for i = 1, #Clientfiles do
- if fs.exists(Clientfiles[i][1]) then
- fs.delete(Clientfiles[i][1])
- end
- shell.run("pastebin get "..Clientfiles[i][2].." "..Clientfiles[i][1])
- end
- end
- os.reboot()
Add Comment
Please, Sign In to add comment