64 posts
Location
Denmark
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 =)
135 posts
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
1054 posts
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
64 posts
Location
Denmark
Posted 02 January 2013 - 11:48 AM
for some reason it stil dosnt make anything it doesn't see the redstone
1054 posts
Posted 02 January 2013 - 12:02 PM
Then you'll have to post your code for us to see the problem.
818 posts
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