This is a read-only snapshot of the ComputerCraft forums, taken in April 2020.
gheotic's profile picture

Redstone event

Started by gheotic, 02 January 2013 - 09:26 AM
gheotic #1
Posted 02 January 2013 - 10:26 AM
Hello everyone who is reading this :)/>
im trying to make a program that checks if the redstone signal underneath it is on if its on its gonna place a block in top of it
at the moment nothing happen

any help would be appreciated =)
W00dyR #2
Posted 02 January 2013 - 10:31 AM
Using something like


while redstone.getInput("bottom") do
   stuff to place a block
end

will get you far, but it will most likely time out, so you can add a sleep() function in there, although that will take away the "immediatly" part
Orwell #3
Posted 02 January 2013 - 10:39 AM
I'd suggest using

os.pullEvent('redstone')
This will wait for a redstone change, read the wiki page for more info: http://www.computercraft.info/wiki/Os.pullEvent
gheotic #4
Posted 02 January 2013 - 11:48 AM
for some reason it stil dosnt make anything it doesn't see the redstone
Orwell #5
Posted 02 January 2013 - 12:02 PM
Then you'll have to post your code for us to see the problem.
Doyle3694 #6
Posted 02 January 2013 - 01:31 PM
usually, a good code snippet, just for checking redstone, let's say on the bottom:

while true do
   os.pullEvent("redstone")
   if rs.getInput("back") then
	  turtle.placeUp()
   end
end