This commit is contained in:
kepler155c
2017-10-11 15:07:32 -04:00
parent 980c635037
commit f5dede540e
3 changed files with 14 additions and 7 deletions

View File

@@ -11,15 +11,15 @@ local multishell = _ENV.multishell
multishell.setTitle(multishell.getCurrent(), 'Music')
if not turtle then
error('This program can only be run on a turtle')
end
local radio = device.drive or error('No drive attached')
if radio.side ~= 'top' and radio.side ~= 'bottom' then
error('Disk drive must be above or below turtle')
end
if not turtle then
error('This program can only be run on a turtle')
end
UI:configure('Music', ...)
UI.Button.defaults.backgroundFocusColor = colors.gray

View File

@@ -1,4 +1,4 @@
local injector = requireInjector or load(http.get('https://raw.githubusercontent.com/kepler155c/opus/master/sys/apis/injector.lua').readAll())()
local injector = _G.requireInjector or load(http.get('https://raw.githubusercontent.com/kepler155c/opus/develop/sys/apis/injector.lua').readAll())()
injector()
local Canvas = require('ui.canvas')
@@ -7,6 +7,7 @@ local Util = require('util')
local colors = _G.colors
local os = _G.os
local peripheral = _G.peripheral
local printError = _G.printError
local shell = _ENV.shell
local term = _G.term
local window = _G.window

View File

@@ -83,7 +83,10 @@ local function loadAPI(url, env)
apiEnv.shell = nil
apiEnv.multishell = nil
setmetatable(apiEnv, { __index = _G })
local fn = Util.loadUrl(url, apiEnv)
local fn, m = Util.loadUrl(url, apiEnv)
if not fn then
error(m)
end
fn()
return apiEnv
end
@@ -91,7 +94,10 @@ end
bbpack = loadAPI('http://pastebin.com/raw/PdrJjb5S', getfenv(1))
GIF = loadAPI('http://pastebin.com/raw/5uk9uRjC', getfenv(1))
Util.runUrl(getfenv(1), 'http://pastebin.com/raw/cUYTGbpb', 'get', 'CnLzL5fg')
local s, m = Util.runUrl(getfenv(1), 'http://pastebin.com/raw/cUYTGbpb', 'get', 'CnLzL5fg')
if not s then
error(m)
end
-- 'Y0eLUPtr')
-- CnLzL5fg
local function snooze()