Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- serverid = 3
- side = "back"
- if fs.exists("bin/crazyapi")==false then
- print("This program requires crazyapi")
- print("Installing crazyapi with cc-get...")
- shell.run("cc-get", "install", "crazyapi")
- end
- shell.run("crazyapi")
- networkOpen(side)
- while true do
- clearTerm()
- tOptions = {"Get file", "Send file", "List", "Exit"}
- selected = selectWindow(1, 1, "What would you like to do?", tOptions, 1)
- clearTerm()
- if selected == 1 then
- print("What file do you want to get?")
- name = read()
- print("Where do you want to save it?")
- path = read()
- networkSendToID(serverid, "!!get"..name)
- data = networkReceive()
- file = io.open(path, "w")
- file:write(data)
- file:close()
- print("Done")
- sleep(0.5)
- elseif selected == 2 then
- print("What file would you like to send?")
- path = read()
- print("What do you want the file to be named?")
- name = read()
- file = io.open(path, "r")
- data = file:read("*a")
- file:close()
- networkSendToID(serverid, "sendd"..data)
- networkSendToID(serverid, name)
- print(networkReceive())
- elseif selected == 3 then
- networkSendToID(serverid, "!list")
- print(networkReceive())
- print("Press any key to continue")
- pressAnyKey()
- elseif selected == 4 then
- shell.run("shell")
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement