Jump to content




Redstone event


  • You cannot reply to this topic
5 replies to this topic

#1 gheotic

  • Members
  • 64 posts
  • LocationDenmark

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 =)

#2 W00dyR

  • Members
  • 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

#3 Orwell

    Self-Destructive

  • Members
  • 1,091 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.computerc...ki/Os.pullEvent

#4 gheotic

  • Members
  • 64 posts
  • LocationDenmark

Posted 02 January 2013 - 11:48 AM

for some reason it stil dosnt make anything it doesn't see the redstone

#5 Orwell

    Self-Destructive

  • Members
  • 1,091 posts

Posted 02 January 2013 - 12:02 PM

Then you'll have to post your code for us to see the problem.

#6 Doyle3694

  • Members
  • 815 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






1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users