Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- w = peripheral.wrap("left")
- function split(string, delimiter)
- local result = { }
- local from = 1
- local delim_from, delim_to = string.find( string, delimiter, from )
- while delim_from do
- table.insert( result, string.sub( string, from , delim_from-1 ) )
- from = delim_to + 1
- delim_from, delim_to = string.find( string, delimiter, from )
- end
- table.insert( result, string.sub( string, from ) )
- return result
- end
- function printTable(table)
- for k, v in pairs(table) do
- print(k, v)
- end
- end
- function msg()
- w.open(1)
- local event, message = os.pullEvent("modem_message")
- split(message, ",")
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement