Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local uri = "https://discordapp.com/api/webhooks/637811261756669982/HfY1i560CI6weZFv9Je4MR4DWZaVAAoRv8W6rMRVQZ68lHJXK3Zsx_FW4K9ZfC-d2odv"
- while true do local p = peripheral.find("warpdriveShipCore")
- 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("lastpos") 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"
- else if energyMax == "41142857" then core = "Corvette"
- else if energyMax == "411428576" then core = "Frigate"
- 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
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement