
ComputerCraft - Mass Fabricator v0.2
By:
Eleri on
Jun 16th, 2012 | syntax:
Lua | size: 1.09 KB | hits: 86 | expires: Never
--[[
Mass Fabricator
]]
local VERSION = 0.2
term.clear()
-- Clear any extraneous redstone commands
redstone.setBundledOutput( "right", 0 )
-- Define variables
local cPulse
local nCount = 0
local nTimer = 2
local timer = os.startTimer(nTimer)
-- Redpower 2 requires pulses, so every time a redstone signal is sent it's pulsed once
function bundledPulse( sSide, nColors )
redstone.setBundledOutput( sSide, nColors )
statusScreen()
sleep(0.2)
redstone.setBundledOutput( sSide, 0 )
end
-- Visual feedback and check of the system
function banner()
term.clear()
term.setCursorPos(1,1)
print( "Mass Fabricator Program, Version "..VERSION )
print( "" )
end
function statusScreen()
banner()
print("Running...I hope...")
end
while true do
local event
event = os.pullEvent()
if event == "timer" then
if nCount == 2 then
nCount = 1
else
nCount = nCount + 1
end
timer = os.startTimer(nTimer)
cPulse = colors.white
if nCount % 2 == 0 then
cPulse = colors.combine( cPulse + colors.black )
end
bundledPulse( "right", cPulse )
end
end