This is a read-only snapshot of the ComputerCraft forums, taken in April 2020.
Noxiousxx's profile picture

[WANTED] On/Off timer for Mob Spawner

Started by Noxiousxx, 04 October 2015 - 01:02 PM
Noxiousxx #1
Posted 04 October 2015 - 03:02 PM
Hi,
I need a program to run my spawner for 2 mins, then turn off for 5 mins.

If this is possible, I would be greatly appreciative.

P.S If its not too much to ask - could I have it semi customizable so I can change the time intervals?

Thanks so much!
Lyqyd #2
Posted 04 October 2015 - 07:36 PM
Moved to General.
Noxiousxx #3
Posted 05 October 2015 - 04:04 AM
Thanks Lyqyd.
Bomb Bloke #4
Posted 05 October 2015 - 07:53 AM
Well, assuming you're hooking your mobspawner up to your computer via redstone, you might do something like this:

while true do  -- Start a loop that repeats indefinitely.
  rs.setOutput("right", true)  -- Enable a redstone signal out the right side of the computer.
  sleep(120)  -- Yield for a couple of minutes.
  rs.setOutput("right", false)  -- Disable the signal.
  sleep(300)  -- Sleep for five minutes.
end  -- Marks the end of the loop.

You can read more about redstone control here.
Waitdev_ #5
Posted 05 October 2015 - 07:55 AM
you can also use dispensers & water for the mob farm