Posted 22 September 2017 - 01:54 AM
Hi Guys
I hope someone would be kind enough to help. I have zero expertise with lua so please bare with me on this one.
Basically my requirement is something like this
when the program runs for the first time I would like it to pulse some cables in a particular order, which I think works with the code below. After this is where I have no clue where to look.
What I would like to happen is this.
When the program starts, it pulses the cables in a particular order, which are connected to retreivers, which are in turn connected to chests, then when a pulse is received on a different color (could be any color) from an item detector, it then pulses white, but it only needs to do this on 10 occasions, so I know i need some kind of counting mechanism, but I have no idea how to incorporate that.
After 10 pulses from an item detector, I then need the program to wait until a pulse is received via the bundled cable on an entirely different color cable and then restart the program again. So i am guessing I need a while clause of some sort, but……… :S
Can someone point me in the right direction at all?
This is how far I got
I hope someone would be kind enough to help. I have zero expertise with lua so please bare with me on this one.
Basically my requirement is something like this
when the program runs for the first time I would like it to pulse some cables in a particular order, which I think works with the code below. After this is where I have no clue where to look.
What I would like to happen is this.
When the program starts, it pulses the cables in a particular order, which are connected to retreivers, which are in turn connected to chests, then when a pulse is received on a different color (could be any color) from an item detector, it then pulses white, but it only needs to do this on 10 occasions, so I know i need some kind of counting mechanism, but I have no idea how to incorporate that.
After 10 pulses from an item detector, I then need the program to wait until a pulse is received via the bundled cable on an entirely different color cable and then restart the program again. So i am guessing I need a while clause of some sort, but……… :S
Can someone point me in the right direction at all?
This is how far I got
term.clear()
term.SetCursorPos(1, 1)
print "Beginning Sort"
rs.SetBundledOutput("back", 1)
sleep "1"
rs.SetBundledOutput("back", 4)
sleep "1"
rs.SetBundledOutput("back", 4)
sleep "1"
rs.SetBundledOutput("back", 1)
sleep "1"
rs.SetBundledOutput("back", 1)
sleep "1"
rs.SetBundledOutput("back", 1)
sleep "1"
rs.SetBundledOutput("back", 4)
print "Ended sorting output"
Edited on 22 September 2017 - 12:57 AM