Advertisement
Lukyrouge22

Untitled

Jun 2nd, 2016
54
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.64 KB | None | 0 0
  1. w = peripheral.wrap("left")
  2.  
  3. function split(string, delimiter)
  4. local result = { }
  5. local from = 1
  6. local delim_from, delim_to = string.find( string, delimiter, from )
  7. while delim_from do
  8. table.insert( result, string.sub( string, from , delim_from-1 ) )
  9. from = delim_to + 1
  10. delim_from, delim_to = string.find( string, delimiter, from )
  11. end
  12. table.insert( result, string.sub( string, from ) )
  13. return result
  14. end
  15. function printTable(table)
  16. for k, v in pairs(table) do
  17. print(k, v)
  18. end
  19. end
  20. function msg()
  21. w.open(1)
  22. local event, message = os.pullEvent("modem_message")
  23.  
  24. split(message, ",")
  25.  
  26. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement