Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- --2.0 by Severino Aug-11-2015
- --based on the computercraft pastebin script.
- local code = {"WK68jh5d", "rJLuHR0g", "uzK5V1Kv", "YcDngWFp", "AE71CRnY", "BK6MCrZp", "tPKK0Vs3", "uwSCGam1", "bbz6S5Kw", "w4AGQE05", "h5n2gz7G", "ynVAgpaF", "d0hdE723", "f4rSnip8", "G6awvV8s", "FitDngkH", "meRmax76", "0JfKCUr1", "nna2VsZG", "uUPWBgPF", "EZqd0er1", "9GrQ8CT8","ZgGfdQkn","ZUiiQZHz","k2RpDss9","JxkPZ0FJ","ZLYJ9R4c","wC94sWss"}
- local file = {"TreeCutter", "TurtleFarm", "Marquee1", "Marquee2", "BigTreeFarm", "MinerInstall", "TreeFarm", "Monitor", "todolist", "WheatFarm", "Duties", "stairs", "TreeLogger", "RoomClear", "RoomMaker", "Quarry", "HouseBuilder", "TimberHouse", "TownHouse", "TouchScreen", "TreeFarmNoFuel", "inventorycontrol", "Server_Rules","Keycard","Schematica","Security_Code_Lock","File_Deleter","Bank_Installer"}
- function getSettings(file)
- local curSettings = file
- for i = 1, #curSettings do
- textutils.pagedPrint( tonumber( i ) .. " : " .. curSettings[i] )
- end
- end
- local input = nil
- local start = 0
- local stop = 0
- function clear()
- term.clear()
- term.setCursorPos(1,1)
- end
- if not http then
- print( "Pastebin requires http API" )
- print( "Set enableAPI_http to 1 in mod_ComputerCraft.cfg" )
- return
- end
- clear()
- print("Enter the corresponding number from the list or enter 0 to get all\n")
- while input == nil do
- for i=1, #file do
- write(i..":"..file[i].." ")
- end
- -- for i = 1, #file do
- -- textutils.pagedPrint( tonumber( i ) .. " : " .. file[i] )
- --end
- print("")
- input = tonumber(read())
- if input == 0 then
- start = 1
- stop = #code
- else
- start = input
- stop = input
- end
- if input == nil then
- clear()
- print("Try again, but this time enter the NUMBER, or enter 0 for all, or hold ctrl+t to exit.\n")
- end
- end
- for i=start, stop do
- -- Download a file from pastebin.com
- -- Determine file to download
- local sCode = code[i]
- local sFile = file[i]
- local sPath = shell.resolve( sFile )
- if fs.exists( sPath ) then
- --this will delete a script of the same name you are downloading to make room.
- --Good for updating scripts you have edited on pastebin.
- fs.delete( sPath )
- end
- -- GET the contents from pastebin
- write( "Connecting to pastebin.com... " )
- local response = http.get(
- "http://pastebin.com/raw.php?i="..textutils.urlEncode( sCode )
- )
- if response then
- print( "Success." )
- local sResponse = response.readAll()
- response.close()
- local file = fs.open( sPath, "w" )
- file.write( sResponse )
- file.close()
- term.clear()
- term.setCursorPos(1,1)
- print( "Downloaded as "..sFile )
- sleep(1)
- else
- print( "Failed." )
- end
- print( "Thank you for using Mr John Dowe's programs, have fun!" )
- sleep(1)
- shell.switchTab( shell.openTab(sFile) )
- --shell.run( sFile )
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement