Edited by Peter110, 27 December 2013 - 04:44 PM.
Please delete
#1
Posted 17 August 2012 - 06:02 PM
#2
Posted 17 August 2012 - 06:08 PM
while true do
if turtle.getItemCount(1)~=1 then
rs.setOutput("bottom",true)
else
rs.setOutput("bottom",false)
end
sleep(0.25)
end
#3
Posted 17 August 2012 - 06:13 PM
if turtle.getItemCount( 1 ) > 1 then -- If the item count in slot 1 is > 1. repeat rs.setOutput( "bottom", true ); -- Set a redstone signal. sleep( 0.1 ); -- Keep the loop from running to fast. until turtle.getItemCount( 1 ) <= 1 -- Loop until the count is <= 1; else rs.setOutput( "bottom", false ); end
If you have any questions, feel free to PM me.
Hope I helped!
#4
Posted 17 August 2012 - 06:20 PM
EDIT: sorry only after one full cycle (being one and then changing) would it stop
#5
Posted 17 August 2012 - 07:40 PM
Edited by Peter110, 27 December 2013 - 04:44 PM.
#6
Posted 17 August 2012 - 09:05 PM
Try this:
while true do
if turtle.getItemCount(1) > 1 then -- if the item count for slot 1 is more than 1
rs.setOutput("down", true) -- send current
sleep(0.5) -- pause
rs.setOutput("down", false) -- stop current
end -- end condition
sleep(0.5) -- pause that occurs unconditionally to avoid an error
end
Bear in mind this will only work for slot 1 and to terminate it you must hold Ctrl+T.
#7
Posted 17 August 2012 - 09:08 PM
#8
Posted 17 August 2012 - 09:14 PM
KaoS, on 17 August 2012 - 09:08 PM, said:
EDIT: Ha, Pharap Ninja'd me, and I didn't see his code. His should work.
#9
Posted 17 August 2012 - 09:53 PM
craniumkid22, on 17 August 2012 - 09:14 PM, said:
KaoS, on 17 August 2012 - 09:08 PM, said:
EDIT: Ha, Pharap Ninja'd me, and I didn't see his code. His should work.
I hope there is a code ninja status
#12
Posted 17 August 2012 - 10:11 PM
#14
Posted 18 August 2012 - 09:25 AM
Edited by Peter110, 27 December 2013 - 04:44 PM.
#15
Posted 18 August 2012 - 10:52 AM
Quote
Which one does send out a rs signal until the count in slot 1 is 1 and then stops the loop?
You never mentioned stopping the loop before.
The edited version:
while true do if turtle.getItemCount(1) &gt; 1 then -- if the item count for slot 1 is more than 1 rs.setOutput(&quot;down&quot;, true) -- send current sleep(0.5) -- pause rs.setOutput(&quot;down&quot;, false) -- stop current else break -- exit loop end -- end condition sleep(0.5) -- pause that occurs unconditionally to avoid an error end<br>
#16
Posted 18 August 2012 - 02:13 PM
Edited by Peter110, 27 December 2013 - 04:45 PM.
#17
Posted 18 August 2012 - 02:31 PM
while true do
if turtle.getItemCount(1) == 1 then -- if the item count for slot 1 is more than 1
rs.setOutput("bottom", true) -- send current
sleep(0.5) -- pause
rs.setOutput("bottom", false) -- stop current
else
break -- exit loop
end -- end condition
sleep(0.5) -- pause that occurs unconditionally to avoid an error
end
That should look right.
#18
Posted 18 August 2012 - 02:46 PM
Edited by Peter110, 27 December 2013 - 04:45 PM.
#19
Posted 18 August 2012 - 03:45 PM
craniumkid22, on 18 August 2012 - 02:31 PM, said:
while true do
if turtle.getItemCount(1) == 1 then -- if the item count for slot 1 is more than 1
rs.setOutput("bottom", true) -- send current
sleep(0.5) -- pause
rs.setOutput("bottom", false) -- stop current
else
break -- exit loop
end -- end condition
sleep(0.5) -- pause that occurs unconditionally to avoid an error
end
That should look right.I thought I'd fixed it all.
Don't know why but for some reason the forums seem to be having an issue with relapsing into bb-code/html.
I've seen it happen to someone else before me, so I'm not sure why it's happening.
#20
Posted 18 August 2012 - 04:19 PM
Edited by Peter110, 27 December 2013 - 04:45 PM.
1 user(s) are reading this topic
0 members, 1 guests, 0 anonymous users











