Advertisement
sumguytwitches

find land

Aug 1st, 2023 (edited)
123
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.10 KB | None | 0 0
  1. set sgh to ship.
  2. set sgsilent to false.
  3. set sgsearchdist to 20000.
  4. set sgdist to sgsearchdist / (gala:radius * 2 * constant:pi/360).
  5.  
  6.  
  7. set searching to true.
  8. set sgang to 0.
  9. when true then {
  10.  
  11. for sgang in range(360) {
  12. set sglatoffset to sgdist * sin(sgang).
  13. set sglongoffset to sgdist * cos(sgang).
  14. set sgsearchgeo to gala:geopositionlatlng(sgh:geoposition:lat + sglatoffset , sgh:geoposition:lng + sglongoffset).
  15. if sgsearchgeo:terrainheight > 0 {
  16. print "LAND HO".
  17. print sgsearchgeo.
  18. set landgeo to sgsearchgeo.
  19. set searching to false.
  20. writejson(landgeo, "0:/json/landgeo.json").
  21. writejson(sgsearchdist, "0:/json/sgsearchdist.json").
  22. }
  23. }
  24.  
  25. set sgsearchdist to sgsearchdist + 500.
  26. set sgdist to sgsearchdist / (gala:radius * 2 * constant:pi/360).
  27.  
  28. if not sgsilent {
  29. print (sgsearchdist):tostring():padright(terminal:width) at (0,0).
  30. print (sgang):tostring():padleft(3):padright(terminal:width) at (0,1).
  31. }
  32. return searching.
  33. }
  34.  
  35. on throttle {
  36. set searching to false.
  37. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement