Trying to set up an item detector.

  • Please make sure you are posting in the correct place. Server ads go here and modpack bugs go here
  • The FTB Forum is now read-only, and is here as an archive. To participate in our community discussions, please join our Discord! https://ftb.team/discord

Furious1964

Well-Known Member
Nov 10, 2012
1,436
70
63
Already done, thanks.[DOUBLEPOST=1375658759][/DOUBLEPOST]
A much simpler solution

In the new 1.5.2 packs, Buildcraft adds a redstone pipe which emits a redstone signal if an item is in it, so just have to make the 32 pipes out of those and you're all set for your sequencer

You may have to replace some of those with golden pipes however to get the item to the end of your sequence, in which case you could perhaps feed the signal from the pipe beforehand through a delay of some sort (choose whichever method you wish)

There's a problem with that: I've timed the original video of what I want to build and those pistons fire every 10 or so seconds. Travel through a Cobblestone Transport Pipe take less then 6 seconds.

EDIT: looking over the LUA coding and how to program Turtles and it brings me back to my old DOS Programming days. GOOD GOD, that was a nightmare!

EDIT 2: Any idea on how to activate the turtle with a redstone signal? The redstone API doesn't have any info on the code I need.
 

Furious1964

Well-Known Member
Nov 10, 2012
1,436
70
63
Well, I'm completely stumped now. Can't for the life of me figure out how to get this to work with a redstone signal.

So far, here's the updated code:
Code:
if os.pullEvent("redstone") = true then
  sleep(1)
end
 
local num = 32
local delay = 3
num = num -1
redstone.setOutput("right", true)
for i = 1, num do
  sleep(delay)
  turtle.forward()
end
sleep(delay)
redstone.setOutput("right", false)
for i = 1, num do
  turtle.back()
end
 
redstone.setOutput("back", true)
sleep(3)
redstone.setOutput("back", false)
 
 
print "Checking fuel..."
if turtle.getFuelLevel() < 1000 then
  turtle.refuel(54294)
  print "Refueling..."
else
  print "No Fuel Necessary"
end

Any help with the top part (which is supposed to get this to work with redstone, would be a help at this point. Is that the right code I need?

Edit 3: SOLVED! I used the following code the run it on a redstone signal:
Code:
while true do
  while rs.getInput ("top") do
    shell.run("Programs/Runtime/piston_firing")
    sleep(0.7)
  end
  sleep(2)
end

It's kept active until a redstone signal and then runs the main program when it receives one. And I removed the first three lines from the main program too.