mirror of
https://github.com/kepler155c/opus
synced 2025-01-03 20:30:28 +00:00
icon update
This commit is contained in:
parent
263a32094c
commit
e1fd4be3a5
@ -22,9 +22,9 @@ if not _ENV.multishell then
|
|||||||
end
|
end
|
||||||
|
|
||||||
local REGISTRY_DIR = 'usr/.registry'
|
local REGISTRY_DIR = 'usr/.registry'
|
||||||
local DEFAULT_ICON = NFT.parse("\03180\031711\03180\
|
local DEFAULT_ICON = NFT.parse("\0308\0317\153\153\153\153\153\
|
||||||
\031800\03171\03180\
|
\0307\0318\153\153\153\153\153\
|
||||||
\03171\031800\03171")
|
\0308\0317\153\153\153\153\153")
|
||||||
|
|
||||||
UI:configure('Overview', ...)
|
UI:configure('Overview', ...)
|
||||||
|
|
||||||
|
@ -1,14 +1,14 @@
|
|||||||
local function printUsage()
|
local function printUsage()
|
||||||
print( "Usages:" )
|
print( "Usages:" )
|
||||||
print( "pastebin put <filename>" )
|
print( "pastebin put <filename>" )
|
||||||
print( "pastebin get <code> <filename>" )
|
print( "pastebin get <code> <filename>" )
|
||||||
print( "pastebin run <code> <arguments>" )
|
print( "pastebin run <code> <arguments>" )
|
||||||
end
|
end
|
||||||
|
|
||||||
if not http then
|
if not http then
|
||||||
printError( "Pastebin requires http API" )
|
printError( "Pastebin requires http API" )
|
||||||
printError( "Set http_enable to true in ComputerCraft.cfg" )
|
printError( "Set http_enable to true in ComputerCraft.cfg" )
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
|
|
||||||
local pastebin = require('http.pastebin')
|
local pastebin = require('http.pastebin')
|
||||||
@ -17,98 +17,98 @@ local tArgs = { ... }
|
|||||||
local sCommand = tArgs[1]
|
local sCommand = tArgs[1]
|
||||||
|
|
||||||
if sCommand == "put" then
|
if sCommand == "put" then
|
||||||
-- Upload a file to pastebin.com
|
-- Upload a file to pastebin.com
|
||||||
|
|
||||||
if #tArgs < 2 then
|
if #tArgs < 2 then
|
||||||
printUsage()
|
printUsage()
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
|
|
||||||
-- Determine file to upload
|
-- Determine file to upload
|
||||||
local sFile = tArgs[2]
|
local sFile = tArgs[2]
|
||||||
local sPath = shell.resolve( sFile )
|
local sPath = shell.resolve( sFile )
|
||||||
if not fs.exists( sPath ) or fs.isDir( sPath ) then
|
if not fs.exists( sPath ) or fs.isDir( sPath ) then
|
||||||
print( "No such file" )
|
print( "No such file" )
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
|
|
||||||
print( "Connecting to pastebin.com... " )
|
print( "Connecting to pastebin.com... " )
|
||||||
|
|
||||||
local resp, msg = pastebin.put(sPath)
|
local resp, msg = pastebin.put(sPath)
|
||||||
|
|
||||||
if resp then
|
if resp then
|
||||||
print( "Uploaded as " .. resp )
|
print( "Uploaded as " .. resp )
|
||||||
print( "Run \"pastebin get "..resp.."\" to download anywhere" )
|
print( "Run \"pastebin get "..resp.."\" to download anywhere" )
|
||||||
|
|
||||||
else
|
else
|
||||||
printError( msg )
|
printError( msg )
|
||||||
end
|
end
|
||||||
|
|
||||||
elseif sCommand == "get" then
|
elseif sCommand == "get" then
|
||||||
-- Download a file from pastebin.com
|
-- Download a file from pastebin.com
|
||||||
|
|
||||||
if #tArgs < 3 then
|
if #tArgs < 3 then
|
||||||
printUsage()
|
printUsage()
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
|
|
||||||
local sCode = pastebin.parseCode(tArgs[2])
|
local sCode = pastebin.parseCode(tArgs[2])
|
||||||
if not sCode then
|
if not sCode then
|
||||||
return false, "Invalid pastebin code. The code is the ID at the end of the pastebin.com URL."
|
return false, "Invalid pastebin code. The code is the ID at the end of the pastebin.com URL."
|
||||||
end
|
end
|
||||||
|
|
||||||
-- Determine file to download
|
-- Determine file to download
|
||||||
local sFile = tArgs[3]
|
local sFile = tArgs[3]
|
||||||
local sPath = shell.resolve( sFile )
|
local sPath = shell.resolve( sFile )
|
||||||
if fs.exists( sPath ) then
|
if fs.exists( sPath ) then
|
||||||
printError( "File already exists" )
|
printError( "File already exists" )
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
|
|
||||||
print( "Connecting to pastebin.com... " )
|
print( "Connecting to pastebin.com... " )
|
||||||
|
|
||||||
local resp, msg = pastebin.get(sCode, sPath)
|
local resp, msg = pastebin.get(sCode, sPath)
|
||||||
|
|
||||||
if resp then
|
if resp then
|
||||||
print( "Downloaded as " .. sPath )
|
print( "Downloaded as " .. sPath )
|
||||||
else
|
else
|
||||||
printError( msg )
|
printError( msg )
|
||||||
end
|
end
|
||||||
|
|
||||||
elseif sCommand == "run" then
|
elseif sCommand == "run" then
|
||||||
-- Download and run a file from pastebin.com
|
-- Download and run a file from pastebin.com
|
||||||
|
|
||||||
if #tArgs < 2 then
|
if #tArgs < 2 then
|
||||||
printUsage()
|
printUsage()
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
|
|
||||||
local sCode = pastebin.parseCode(tArgs[2])
|
local sCode = pastebin.parseCode(tArgs[2])
|
||||||
if not sCode then
|
if not sCode then
|
||||||
return false, "Invalid pastebin code. The code is the ID at the end of the pastebin.com URL."
|
return false, "Invalid pastebin code. The code is the ID at the end of the pastebin.com URL."
|
||||||
end
|
end
|
||||||
|
|
||||||
print( "Connecting to pastebin.com... " )
|
print( "Connecting to pastebin.com... " )
|
||||||
|
|
||||||
local res, msg = pastebin.download(sCode)
|
local res, msg = pastebin.download(sCode)
|
||||||
if not res then
|
if not res then
|
||||||
printError( msg )
|
printError( msg )
|
||||||
return res, msg
|
return res, msg
|
||||||
end
|
end
|
||||||
|
|
||||||
res, msg = load(res, sCode, "t", _ENV)
|
res, msg = load(res, sCode, "t", _ENV)
|
||||||
if not res then
|
if not res then
|
||||||
printError( msg )
|
printError( msg )
|
||||||
return res, msg
|
return res, msg
|
||||||
end
|
end
|
||||||
|
|
||||||
res, msg = pcall(res, table.unpack(tArgs, 3))
|
res, msg = pcall(res, table.unpack(tArgs, 3))
|
||||||
if not res then
|
if not res then
|
||||||
printError( msg )
|
printError( msg )
|
||||||
end
|
end
|
||||||
else
|
else
|
||||||
|
|
||||||
printUsage()
|
printUsage()
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user