MastaC729

Disco Floor Reset to All On

Aug 23rd, 2015
134
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.70 KB | None | 0 0
  1. function split(toSplit, pattern, results)
  2.  if not results then
  3.   results = {}
  4.  end
  5.  local start = 1
  6.  local splitStart, splitEnd = string.find(toSplit, pattern, start)
  7.  while splitStart do
  8.   table.insert(results, string.sub(toSplit, start, splitStart-1))
  9.   start = splitEnd+1
  10.   splitStart, splitEnd = string.find(toSplit, pattern, start)
  11.  end
  12.  table.insert(results, string.sub(toSplit, start))
  13.  return results
  14. end
  15.  
  16. function main()
  17.  rednet.open("bottom")
  18.  
  19.  local leave
  20.  
  21.  speed = 0.1   -- Time in seconds between each light change
  22.  allOn = {}
  23.  
  24.  allOn[1] = "allOn"
  25.  
  26.  for j=1, 15 do
  27.         rednet.broadcast(allOn,tostring(j))
  28.         sleep(speed)
  29.  end
  30.  
  31. end -- end main()
  32.  
  33. main()
Advertisement
Add Comment
Please, Sign In to add comment