-
Notifications
You must be signed in to change notification settings - Fork 12
/
D0S.Asteroid_Farm
68 lines (56 loc) · 1.95 KB
/
D0S.Asteroid_Farm
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
; Claims and deletes the first asteroid, and then scans for another.
; Meant to be used on some kind of timer-loop.
isopen("mine")
key.a()
; All layouts have two modes: "Widescreen" and "tallscreen". The dividing
; line between them is 16:9 aspect ratio.
#wide_or_tall(wide, tall) if(width.d() * 0.5625 > height.d(), {wide}, {tall})
#click_clusters click({wide_or_tall(\
vec(width.d() * 0.5 + height.d() * 0.365, height.d() * 0.78),\
vec(width.d() * 0.7, width.d() * -0.123 + height.d())\
)})
#claim_rewards click({wide_or_tall(\
vec(width.d() * 0.5 + height.d() * 0.87, height.d() * 0.67),\
vec(width.d() * 0.98, width.d() * 0.1 + height.d() * 0.5)\
)})
#click_stairs click({wide_or_tall(\
vec(height.d() * 0.18, height.d() * 0.09),\
vec(width.d() * 0.1, width.d() * 0.05)\
)})
; The middle of the screen is always in the asteroids list, regardless of
; aspect ratio.
#scroll_asteroids_list(pos) scrollbar(\
vec(width.d() * 0.5, height.d() * 0.5),\
-1., {pos})
:local int i
; We don't know whether we were on the proper part of the stairs or not,
; so try both. If we're on the wrong side, the worst that happens is we
; mine a tile.
loop_claim:
{click_clusters}
; Vertical directions are reversed from what you would expect!
{scroll_asteroids_list(1.)}
; Click the first asteroid.
click({wide_or_tall(\
vec(height.d(), height.d() * 0.62),\
vec(width.d() * 0.5, height.d() - width.d() * 0.215)\
)})
{claim_rewards}
{click_stairs}
i = (i + 1) % 2
gotoif(loop_claim, i != 0)
remove(1)
; We have to try scanning twice, too. Only one of them will be on the proper
; side of the stairs, so we'll only scan once. We can't combine this with
; the loop above, because we have to remove first, and that functions
; regardless of which screen we're on.
loop_scan:
{click_clusters}
; Scan a new asteroid
click({wide_or_tall(\
vec(height.d() * 0.95, height.d() * 0.054),\
vec(width.d() * 0.534, width.d() * 0.032)\
)})
{click_stairs}
i = (i + 1) % 2
gotoif(loop_scan, i != 0)