56 posts
Posted 27 December 2012 - 04:29 AM
The title says it, i cant seem to figue out how to make my output pulse, at a diffrent rates based on user input. example: i select the number of item pulls to be 5 how do i make it pulse 5? at a rate of 0.8 sec delay between pulses? im useing butons as the user input not direct input by right clicking the computer, idk if that helps.
tekkit 3.1.2
2088 posts
Location
South Africa
Posted 27 December 2012 - 04:43 AM
print("How many pulses?")
pulses = tonumber(read())
print("Length of each pulse?")
length = tonumber(read())
for i = 1, pulses do
rs.setOutput("back", true)
sleep(length)
rs.setOutput("back", false)
sleep(length)
end
56 posts
Posted 27 December 2012 - 07:18 AM
can i do the pulse at a pre-set rate like this,
pulses = tonumber(read()
length = tonumber (0.8)
8543 posts
Posted 27 December 2012 - 07:30 AM
Yep, though you don't need the second tonumber; length = 0.8 would work just fine.