Jump to content




Chest redstone output


6 replies to this topic

#1 Xixili

  • Members
  • 65 posts
  • LocationChina

Posted 19 April 2014 - 07:23 PM

Hello everyone,

I have a little problem.

I have a chest that collects Near depleted uranium cells.

What I like to get is everytime a cell arrives in the chest a short redstone pulse comes off the chest.
Im only getting this working with a full chest or empty chest.

Im using a computer (doh) and a gate reader and the code I have so far is:

while true do
  m = peripheral.wrap("top")
  data = m.get()
  if data["Inventory Empty"] then
   rs.setOutput("left", true)
   sleep(3)
   rs.setOutput("left", false)
  end
  sleep(1)
end


#2 RoD

  • Members
  • 313 posts

Posted 19 April 2014 - 09:01 PM

Doesn't the trap chest triger a redstone output when a item is added? or is it only when the player opens the chest? And you can try to use a hppper :)

#3 Xixili

  • Members
  • 65 posts
  • LocationChina

Posted 19 April 2014 - 10:19 PM

View PostRoD, on 19 April 2014 - 09:01 PM, said:

Doesn't the trap chest triger a redstone output when a item is added? or is it only when the player opens the chest? And you can try to use a hppper :)
No other solutions?

#4 RoD

  • Members
  • 313 posts

Posted 19 April 2014 - 11:28 PM

View PostXixili, on 19 April 2014 - 10:19 PM, said:

View PostRoD, on 19 April 2014 - 09:01 PM, said:

Doesn't the trap chest triger a redstone output when a item is added? or is it only when the player opens the chest? And you can try to use a hppper :)
No other solutions?
I didng get if you are using a peripheral. But if you are not using there may be some that do that ( i dont use peripherals, so i don't know much about them ). If you are are planing to play only with cc then i think that there are no other options...

#5 Xixili

  • Members
  • 65 posts
  • LocationChina

Posted 20 April 2014 - 12:12 AM

A computer should pulse a redstone singal for 1 second when an item arrives in the chest.

#6 RoD

  • Members
  • 313 posts

Posted 20 April 2014 - 12:20 AM

i use:
redstone.setOutput("left", true)
instead of:
rs.setOutput("left", true)
But i dont think it makes any diference... Only if there's a bug...

#7 Bomb Bloke

    Hobbyist Coder

  • Moderators
  • 7,099 posts
  • LocationTasmania (AU)

Posted 20 April 2014 - 01:18 AM

Since no events fire when items enter adjacent chests, if you specifically want to plonk a computer directly next to one and get redstone signals from there, I guess you'd need to devise a system whereby the computer reads the full contents of the chest into a table, then re-reads that content every now and then (according to a timer) while checking for differences. A bit of a hack job, but it could be done.

Since you're using a gate reader though, I'll assume you're using Buildcraft pipes to fill the chest, which is handy since my method would involve putting a gate in the pipe that outputs to the chest. Configure THAT to perform a redstone pulse when items go through it and forget about using ComputerCraft for this job.

If you don't like the duration, a vanilla repeater can be used to increase it somewhat, or a computer can be programmed to extend it.





1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users