Advertisement
infiniteblock

Untitled

Oct 26th, 2019
146
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.07 KB | None | 0 0
  1. local uri = "https://discordapp.com/api/webhooks/637811261756669982/HfY1i560CI6weZFv9Je4MR4DWZaVAAoRv8W6rMRVQZ68lHJXK3Zsx_FW4K9ZfC-d2odv"
  2. while true do local p = peripheral.find("warpdriveShipCore")
  3. local name = p.name()
  4. local shipdim = p.isInHyperspace() and "Hyperspace"or"Space/Planet"
  5. local x,y,z = p.getLocalPosition()
  6. local mass = p.getShipSize()
  7. local energyStored, energyMax, energyUnits = p.getEnergyStatus()
  8. local text = x .. " "..y.." "..z
  9. local oldText = ""
  10. if fs.exists("lastpos") then local f = fs.open(".profiles","r")
  11. oldText = f.readAll(); f.close() end if oldText ~= text then local f2 = fs.open(".profiles","w")
  12. f2.write(text)
  13. if energyMax == "2057142" then core = "Shuttle"
  14. else if energyMax == "41142857" then core = "Corvette"
  15. else if energyMax == "411428576" then core = "Frigate"
  16. http.post(uri,"{\"content\":\"```yaml\\nShipname: "..name.."\\nType"..core.." \\nDimension: "..shipdim.." \\nLocation: "..text.."\\nEnergy: "..energyStored.." "..energyUnits.."\\nTons: "..mass.."```\"}",{['content-type']="application/json"})
  17. f2.close() end
  18. sleep(10)
  19. end
  20. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement