Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local uri = "https://dis"
- local p = peripheral.find("warpdriveShipController")
- local name = p.name()
- local shipdim = p.isInHyperspace() and "Hyperspace"or"Space/Planet"
- local x,y,z = p.getLocalPosition()
- local mass = p.getShipSize()
- local energyStored, energyMax, energyUnits = p.getEnergyStatus()
- local text = x .. " "..y.." "..z; local oldText = ""
- if fs.exists(".profiles") then
- local f = fs.open(".profiles","r");
- oldText = f.readAll();
- f.close();
- end
- if oldText ~= text then
- local f2 = fs.open(".profiles","w");
- f2.write(text);
- if energyMax <= 2057142 then core = "Shuttle" elseif energyMax <= 41142857 then core = "Corvette" else core = "Frigate"
- end
- http.post(uri,"{\"content\":\"```yaml\\nShipname: "..name.." \\nType: "..core.." \\nDimension: "..shipdim.." \\nLocation: "..text.."\\nEnergy: "..energyStored.." "..energyUnits.."\\nTons: "..mass.."```\"}",{['content-type']="application/json"}); f2.close();
- end
- sleep(10)
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement