Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- sgscanning off.
- wait 0.
- set lastpos to latlng(90,90).
- set sgmax to addons:scansat:resourceat(body, lastpos , "ore").
- set sgstep to 10.
- set sgd to 4.6e3.
- set sgh to -sgstep.
- set sgi to 20.
- set sgmaxgap to 2500.
- sgscanning on.
- when sgscanning then {
- set sgh to sgh + sgstep.
- if sgh > 360 { set sgd to sgd + 1000. set sgh to -sgstep.}
- print ("scanning " + sgh:tostring():padright(6) + " range " + sgd:tostring()):padright(terminal:width) at (0, sgi).
- local pos is body:Geopositionof(heading(sgh,0):vector * sgd).
- local gap is (pos:position-lastpos):mag.
- print ("Gap at " + round(gap)):tostring():padright(terminal:width) at (0,sgi + 1).
- if (gap > sgmaxgap) {
- set sgstep to sgstep / 2.
- print "Gap too big, step now " + sgstep.
- }
- set lastpos to pos:position.
- local sgore to addons:scansat:resourceat(body, pos, "ore").
- if sgore > sgmax {
- set sgmax to sgore.
- print char(7).
- set maxpos to pos.
- print "Found at " + round(maxpos:distance):tostring() + "m away".
- print sgore.
- }
- return sgscanning.
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement