added bundled redstone info for redstone program when it is available

This commit is contained in:
Florian Nücke 2013-12-12 15:50:08 +01:00
parent 5c975fb1c6
commit a6915ff2bb

View File

@ -1,15 +1,17 @@
local rs = component.redstone
local args, options = shell.parse(...) local args, options = shell.parse(...)
if #args < 1 then if #args < 1 then
print("Usage: redstone <side> [<value>]") if rs.setBundledOutput then
print("Usage: redstone <side> [-b <color>] [<value>]")
else
print("Usage: redstone <side> [<value>]")
end
return return
end end
local rs = component.redstone
local side = sides[args[1]] local side = sides[args[1]]
if not side then if not side then
print("Invalid side.") error("Invalid side.")
return
end end
if type(side) == "string" then if type(side) == "string" then
side = sides[side] side = sides[side]
@ -17,13 +19,11 @@ end
if options.b then if options.b then
if not rs.setBundledOutput then if not rs.setBundledOutput then
print("Bundled redstone not available.") error("Bundled redstone not available.")
return
end end
local color = colors[args[2]] local color = colors[args[2]]
if not color then if not color then
print("Invalid color.") error("Invalid color.")
return
end end
if type(color) == "string" then if type(color) == "string" then
color = colors[color] color = colors[color]