SHOW:
|
|
- or go back to the newest paste.
1 | - | set sgh to ship. |
1 | + | set sgh to vessel("hathi one"). |
2 | - | set sgsilent to false. |
2 | + | |
3 | - | set sgsearchdist to 20000. |
3 | + | set sgsearchdist to readjson("0:/json/sgsearchdist.json"). |
4 | - | set sgdist to sgsearchdist / (gala:radius * 2 * constant:pi/360). |
4 | + | set longsize to (gala:radius * 2 * constant:pi/360). |
5 | set sgdist to sgsearchdist / longsize. | |
6 | ||
7 | ||
8 | set searching to true. | |
9 | - | when true then { |
9 | + | |
10 | - | |
10 | + | until not searching { |
11 | - | for sgang in range(360) { |
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 | - | set sgsearchdist to sgsearchdist + 500. |
25 | + | |
26 | - | set sgdist to sgsearchdist / (gala:radius * 2 * constant:pi/360). |
26 | + | if sgang >= 360 { |
27 | set sgang to 0. | |
28 | - | if not sgsilent { |
28 | + | set sgsearchdist to sgsearchdist + 100. |
29 | - | print (sgsearchdist):tostring():padright(terminal:width) at (0,0). |
29 | + | set sgdist to sgsearchdist / longsize. |
30 | - | print (sgang):tostring():padleft(3):padright(terminal:width) at (0,1). |
30 | + | |
31 | print sgsearchdist. | |
32 | - | return searching. |
32 | + | |
33 | ||
34 | ||
35 | - | on throttle { |
35 | + | |
36 | - | set searching to false. |
36 | + | |
37 | - | } |
37 | + | |
38 |