rednet.open("bottom")
local gate = peripheral.wrap("back")
while true do
local data = gate.get()
while not data["Work Done"] do
sleep(10)
data = gate.get()
end
rednet.send(55, "quarryDone")
end
This is a read-only snapshot of the ComputerCraft forums,
taken in April 2020.
I need something like os.pullevent for the gate reader... ideas?
Started by Novakis, 15 April 2013 - 10:06 AMPosted 15 April 2013 - 12:06 PM
I want to use a gate reader to detect when a quarry is complete, which works great, but as it is now I use a sleep command and have the computer check every 10 seconds. Is there a better way to do this? Here is the code I have so far:
Posted 15 April 2013 - 05:00 PM
I dont believe there is but if you might want to start a quarry that is really small and set computer with gate reader and just have it print all events and see if gate reader gives off any events.
Posted 15 April 2013 - 07:50 PM
No there is no better way you could do that sorry :(/> you could try putting the delay down to the max of 0.05
Posted 16 April 2013 - 04:47 PM
I was hoping not to do that because of the possible lag to the server… oh well.No there is no better way you could do that sorry :(/> you could try putting the delay down to the max of 0.05
Posted 16 April 2013 - 04:52 PM
.-. it dosent lag that much
and why would you need to check that fast?
its a quarry, your supposed to let it run for a long time
and why would you need to check that fast?
its a quarry, your supposed to let it run for a long time
Posted 16 April 2013 - 05:35 PM
I have a system that benefits from knowing when the quarry is finished as soon as possible..-. it dosent lag that much
and why would you need to check that fast?
its a quarry, your supposed to let it run for a long time
Posted 16 April 2013 - 05:39 PM
Only way i can think of is when it stops spiting out items check to see if its done not perfect but would limit number of times checking
Posted 16 April 2013 - 05:46 PM
less efficient than just reading pipe wireOnly way i can think of is when it stops spiting out items check to see if its done not perfect but would limit number of times checking
Posted 16 April 2013 - 05:51 PM
Hmmm that just gave me an idea.less efficient than just reading pipe wire
- Quarry
- Gate on pipe with hasWork conditional outputting to pipe wire
- Pipe wire connect to redstone which connects to the computer
- then computer has os.pullEvent('redstone')
Posted 16 April 2013 - 06:04 PM
less efficient than just reading pipe wireOnly way i can think of is when it stops spiting out items check to see if its done not perfect but would limit number of times checking
Ok i havnt used buildcraft in like 6 months so have no idea what pipe wire can do :P/>
Posted 16 April 2013 - 06:07 PM
if you put a gate on a pipe next to the quarry, then run the pipe wire along all the pipe to the computer, then set the gate to hasWork output the pipe wire signal.Ok i havnt used buildcraft in like 6 months so have no idea what pipe wire can do :P/>
Posted 16 April 2013 - 06:34 PM
you put an AND/OR gate on the pipe connected to the computer (make sure it has the pipe wire)
then you right click the gate, then click the top left box until you see the setting you want
then click the top right one until you see the redstone torch
now use this code:
this method requires no gate readers
then you right click the gate, then click the top left box until you see the setting you want
then click the top right one until you see the redstone torch
now use this code:
rednet.open("bottom")
while true do
local p={os.pullEvent()}
if p[1]=="redstone" and rs.getInput(side) then
rednet.send(55, "quarryDone")
end
end
and put the side where gate is instead of sidethis method requires no gate readers
Posted 16 April 2013 - 06:52 PM
if you put a gate on a pipe next to the quarry, then run the pipe wire along all the pipe to the computer, then set the gate to hasWork output the pipe wire signal.Ok i havnt used buildcraft in like 6 months so have no idea what pipe wire can do :P/>
you put an AND/OR gate on the pipe connected to the computer (make sure it has the pipe wire)
then you right click the gate, then click the top left box until you see the setting you want
then click the top right one until you see the redstone torch
now use this code:and put the side where gate is instead of siderednet.open("bottom") while true do local p={os.pullEvent()} if p[1]=="redstone" and rs.getInput(side) then rednet.send(55, "quarryDone") end end
this method requires no gate readers
If those posts are for my benefit no need if i start using bc ill watch direwolf tutorial (Epic dude of great knowledge) if not continue :P/>.
Posted 16 April 2013 - 06:56 PM
For everything except programming in Lua.Epic dude of great knowledge
EDIT: Also don't expect to say you don't know how to do it and then not have people try and help you
Edited on 16 April 2013 - 04:57 PM
Posted 16 April 2013 - 07:53 PM
Yes but knowledgable about mods like bc, and i know thats why i told you that you didn't need to so you didn't take time trying to explain it when i wasn't really reading thoroughly.
Posted 17 April 2013 - 02:51 PM
Hmmm that just gave me an idea.less efficient than just reading pipe wire
- Quarry
- Gate on pipe with hasWork conditional outputting to pipe wire
- Pipe wire connect to redstone which connects to the computer
- then computer has os.pullEvent('redstone')
you put an AND/OR gate on the pipe connected to the computer (make sure it has the pipe wire)
then you right click the gate, then click the top left box until you see the setting you want
then click the top right one until you see the redstone torch
now use this code:and put the side where gate is instead of siderednet.open("bottom") while true do local p={os.pullEvent()} if p[1]=="redstone" and rs.getInput(side) then rednet.send(55, "quarryDone") end end
this method requires no gate readers
My problem with the logic pipes is they become non-functional when they move on a frame, which is needed. The gate reader continues running after moving so it seems to be the only choice. There is just no way it interact with it except with the computer.