rdalkire

startup for sortAndBlock

Dec 30th, 2014
305
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.69 KB | None | 0 0
  1. --[[ Runs a script for redstone
  2. events. ]]
  3.  
  4. local EVENT_DESCRIPTION =
  5.     "Open the source chest"
  6. local SKIP = 1
  7. local SCRIPT = {"srt"}
  8.  
  9. local goOn = true
  10. local count = 0
  11.  
  12. while goOn do
  13.  
  14.   print()
  15.   print(EVENT_DESCRIPTION.. " to run,")
  16.   print("or press any key to cancel.")
  17.  
  18.   local event = os.pullEvent()
  19.  
  20.   if "redstone" == event then
  21.     count = count + 1
  22.    
  23.     -- To skip every so many
  24.     if count % (SKIP + 1) == 0 then
  25.       shell.run("clear")
  26.       shell.run( unpack(SCRIPT) )
  27.     end
  28.   elseif "key" == event then
  29.     print("Canceling.  "..
  30.         "Run startup to continue.")
  31.     goOn = false
  32.   else
  33.     print("(event: "..event..")")
  34.   end
  35.  
  36. end
Advertisement
Add Comment
Please, Sign In to add comment