Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- os.loadAPI("rnc2")
- os.loadAPI("ldb2")
- local prg = shell.getRunningProgram()
- local label = os.getComputerLabel()
- print(prg)
- if label == nil then
- return
- end
- rnc2.setTimeOut(prg, 99)
- rnc2.setPort(prg, 1000)
- rnc2.setIdenty(prg, 100)
- while true do
- rnc2.setIdenty(100)
- local res = rnc2.resive(prg)
- if res == "r." .. label then
- rnc2.setIdenty(prg, 101)
- rnc2.send(prg,label .. "> Restarted!")
- rnc2.setIdenty(prg, 100)
- os.reboot()
- elseif res == "l." .. label then
- local x,y,z = gps.locate(2, false)
- local lmsg = label .. "> x:" .. x .. " | y:" .. y .. " | z:" .. z
- rnc2.setIdenty(prg, 101)
- rnc2.send(prg, lmsg)
- rnc2.setIdenty(prg, 100)
- elseif res ~= nil then
- print("res:" .. res)
- end
- end
- sleep(10)
Add Comment
Please, Sign In to add comment