Advertisement
Guest User

troll

a guest
Oct 31st, 2014
166
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.55 KB | None | 0 0
  1. cBox = peripheral.wrap("left")
  2. nBlock = peripheral.wrap("right")
  3.  
  4. isPlaying = true
  5.  
  6. nLeft = 0
  7. maxNotes = 20
  8. delay = .0025
  9.  
  10. while true do
  11.   if isPlaying then
  12.     ins = math.random(0,6)
  13.     note = math.random(0,24)
  14.     nBlock.playNote(ins, note)
  15.     nLeft = nLeft - 1
  16.     if nLeft == 0 then
  17.       isPlaying = false
  18.     end
  19.     os.sleep(delay)
  20.   else
  21.     myEvent, person, message = os.pullEvent("chat_message")
  22.     if person == "tterrag1098" or message == "Commence." then
  23.       isPlaying = true
  24.       nLeft = maxNotes
  25.     end
  26.   end
  27. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement