Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local internet=require("internet")
- local m=internet.open("http://skylarker.net/craft.html",80)
- local g=require("geolyzer")
- local thisDrone="001"
- function split(data, pat)
- local ret = {}
- for i in string.gmatch(data,pat) do
- table.insert(ret,i)
- end
- return ret
- end
- function receive()
- line = m:read
- linesplt = split(line,"[^:]+")
- while true do
- if string.find(linesplt[1],thisDrone) == true
- then
- return load(linesplt[2])
- m:write("roger")
- end
- end
- end
- while true do
- local reason=recieve()
- if reason~=""
- then
- m:write(reason)
- else
- m:write("roger wilco")
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement