Advertisement
Guest User

Untitled

a guest
Jan 3rd, 2012
1,906
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.34 KB | None | 0 0
  1. --The time you have before everything blows up, needs to be higher than 15/16 because of the --time it takes for IC2 nukes to blow up after receiving a signal.
  2. seconds = 60
  3.  
  4. --This stuff here makes it hard to execute the program, you need the argument --"safetyprogramcheck" or else it won't run, so you can't just look trough the files on the --computer and run "exterminatus", either you need to run it trough the self-destruct program --or run it as "exterminatus safetyprogramcheck"
  5. tArgs = { ... }
  6. if #tArgs>0
  7. then
  8. check = tArgs[1]
  9. else
  10. check = "rawr"
  11. end
  12.  
  13. if check=="safetyprogramcheck"
  14. then
  15. --because it's a countdown it will repeat itself all the time, as you can see below (at the --until) it will continue until only 15 seconds are left (the time for IC2 nukes to detonate)
  16. repeat
  17.  
  18. --This block here makes it look like how it looks, clearing the screen and then using --term.setCursorPos(x,y) to put all the text in the right spot.
  19. term.clear()
  20. term.setCursorPos(13,5)
  21. print("Chicken Farm Self-Destruct")
  22. term.setCursorPos(24,9)
  23. print(seconds)
  24. term.setCursorPos(1,13)
  25. print("Press the button to the left to deactivate")
  26. print("This only works before the last 15 seconds")
  27.  
  28. --this causes this block of code (from repeat to until) to be done once every second --(sleep(1)), and every second the time left gets one second lower.
  29. seconds = seconds - 1
  30. sleep(1)
  31.  
  32.  
  33. --This is the interrupter code. If it gets redstone in the back (when you press the button) --it stops the program by shutting down the computer
  34. if redstone.getInput("back") == false
  35. then
  36. term.setCursorPos(5,16)
  37. print("Self-Destruct Aborted")
  38. term.setCursorPos(5,17)
  39. print("the chickens will live")
  40. sleep(10)
  41. os.shutdown()
  42. end
  43. until
  44. seconds == 15
  45.  
  46. --this sends a signal to the nukes.
  47. redstone.setOutput("left", true)
  48.  
  49. --Very similar to the previous repeat block. If you can figure out that one, this one --shouldn't be too hard.
  50. repeat
  51.  
  52. term.clear()
  53. term.setCursorPos(13,5)
  54. print("Chicken Farm Self-Destruct")
  55. term.setCursorPos(24,9)
  56. print(seconds)
  57. term.setCursorPos(1,13)
  58. print("15 second mark passed. Explosives activated.")
  59. print("Goodbye")
  60.  
  61. seconds = seconds - 1
  62. sleep(1)
  63. until
  64. seconds == -1
  65.  
  66. --This has to do with the "safetycheckprogram" thing I mentioned in the start.
  67. else
  68. print("needs to be run trough the self-destruct program")
  69. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement