16 posts
Posted 12 March 2016 - 10:54 AM
Is there a way to make a program that pulses a redstone signal but asks how many times it should pulse before and then pulses the amount of times. Im planning to use this with redpower transposers so i can specify the amount i want of a certain item.
7083 posts
Location
Tasmania (AU)
Posted 12 March 2016 - 12:57 PM
16 posts
Posted 12 March 2016 - 01:58 PM
I have this already
print("How many:")
redstone.setBundledOutput("back", colors.blue)
sleep(1)
redstone.setBundledOutput("back", colors.blue)
os.reboot()
Its how i should repeat the pulse and i used bundled cable instead of redstone just so i could have different items on the same computer.
I have renamed multible programs to a ingot name and changed the bundled cable output color on the programs so its semi working
Edited on 12 March 2016 - 01:07 PM
2679 posts
Location
You will never find me, muhahahahahaha
Posted 12 March 2016 - 03:46 PM
If you want it to pulse a specific amount of times, better use a for loop:
for i=1, times do
--pulse code
end
If you want it to run for infinity, use a while true do loop:
while true do
-- pulse code
end
16 posts
Posted 12 March 2016 - 03:59 PM
If you want it to pulse a specific amount of times, better use a for loop:
for i=1, times do
--pulse code
end
If you want it to run for infinity, use a while true do loop:
while true do
-- pulse code
end
I did this
print("How many:")
for i=read(), times do
redstone.setBundledOutput("back", colors.red)
sleep(1)
redstone.setBundledOutput("back", colors.red)
end
os.reboot()
but get this error
2679 posts
Location
You will never find me, muhahahahahaha
Posted 12 March 2016 - 04:14 PM
You change the times variable:
print("Times: ")
for i=1, tonumber(read()) do -- both i and times have to be numbers.
end