Posted 01 June 2012 - 01:15 PM
I wanna make it so that when the computer recieves a redstone signal at the 'back' side, it will output a message saying something like 'signal recieved'. How would i do this?
while true do
event, param = os.pullEvent()
if event=="redstone" then
if param=="back" then
print("signal recieved")
break
end
end
end
local loop, HadPower = true, redstone.getInput("back")
while loop do
local e = os.pullEvent("redstone")
if e=="redstone" then --Just in case, should always be true
local power = redstone.getInput("back")
if power and not HadPower then
--We got a pulse
elseif (not power) and HadPower then
--We lost a pulse
end
HadPower = power --Nearly forgot this bit :)/>/>
end
end