Advertisement
CaptainSpaceCat

Play

Jun 7th, 2015
317
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.79 KB | None | 0 0
  1. local tArgs = {...}
  2. os.loadAPI("noteutils")
  3. rs.setAnalogOutput("front", 0)
  4. rs.setAnalogOutput("left", 0)
  5. rs.setAnalogOutput("back", 0)
  6. rs.setAnalogOutput("right", 0)
  7. local music = noteutils.loadMusic(tostring(tArgs[1]))
  8. for i, v in pairs(music) do
  9.   for k, e in pairs(v) do
  10.     --print(i .. " " .. k .. " " .. e)
  11.     if e ~= "0" then
  12.       if k == 1 then
  13.         rs.setAnalogOutput("front", 1)
  14.       end
  15.       if k == 2 then
  16.         rs.setAnalogOutput("left", 1)
  17.       end
  18.       if k == 3 then
  19.         rs.setAnalogOutput("back", 1)
  20.       end
  21.       if k == 4 then
  22.         rs.setAnalogOutput("right", 1)
  23.       end
  24.     end
  25.   end
  26.   sleep(.5)
  27.   rs.setAnalogOutput("front", 0)
  28.   rs.setAnalogOutput("left", 0)
  29.   rs.setAnalogOutput("back", 0)
  30.   rs.setAnalogOutput("right", 0)
  31.   sleep(.1)
  32. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement