Jump to content




How to make the output pulse


3 replies to this topic

#1 Learning_inpaired

  • New Members
  • 77 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

#2 remiX

  • Members
  • 2,076 posts
  • LocationSouth 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


#3 Learning_inpaired

  • New Members
  • 77 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)

#4 Lyqyd

    Lua Liquidator

  • Moderators
  • 8,465 posts

Posted 27 December 2012 - 07:30 AM

Yep, though you don't need the second tonumber; length = 0.8 would work just fine.





1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users