Posted 03 September 2012 - 04:14 AM
Is there a way to make it go on forever?
local tArgs = { ... }
local sSide = tArgs[1]
if not sSide then
print("Usage: redpulse <side> <count> <period>")
return
end
local nCount = tonumber(tArgs[2]) or 1
local nPeriod = tonumber(tArgs[3]) or 0.5
if nCount==0 then
while true do
redstone.setOutput(sSide,true)
sleep(nPeriod/2)
redstone.setOutput(sSide,false)
sleep(nPeriod/2)
end
else
for n=1,nCount do
redstone.setOutput( sSide, true )
sleep( nPeriod / 2 )
redstone.setOutput( sSide, false )
sleep( nPeriod / 2 )
end
end