Advertisement
sumguytwitches

find land blocking

Aug 1st, 2023 (edited)
52
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. set sgh to vessel("hathi one").
  2.  
  3. set sgsearchdist to readjson("0:/json/sgsearchdist.json").
  4. set longsize to (gala:radius * 2 * constant:pi/360).
  5. set sgdist to sgsearchdist / longsize.
  6.  
  7.  
  8. set searching to true.
  9. set sgang to 0.
  10. until not searching {
  11.  
  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. print char(7).
  23. }
  24. set sgang to sgang + arcsin(100/sgsearchdist).
  25.  
  26. if sgang >= 360 {
  27. set sgang to 0.
  28. set sgsearchdist to sgsearchdist + 100.
  29. set sgdist to sgsearchdist / longsize.
  30. writejson(sgsearchdist, "0:/json/sgsearchdist.json").
  31. print sgsearchdist.
  32. }
  33.  
  34.  
  35.  
  36.  
  37. }
  38.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement