-
Notifications
You must be signed in to change notification settings - Fork 12
/
D0S.AsteroidClick
30 lines (24 loc) · 994 Bytes
/
D0S.AsteroidClick
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
:global int asteroid_count
:local double row
:local double offset
:local double x
:local double y
isopen("mine")
key.z()
asteroid_count = asteroid_count + 1
; This launches 17 copies, meaning 18 total. 3 will have the same number
; at the end and double-click the last row.
execute(if(asteroid_count < 18, "D0S.AsteroidClick", ""))
offset = if(height.d() > width.d() * 0.5625, 0.0305 * width.d(), 0.0542 * height.d())
; asteroid_count is incremented 3 times before we reach this line, once by
; "our" script and twice by launched scripts.
x = i2d(asteroid_count - 2) * offset + if(height.d() > width.d() * 0.5625, 0.4254 * width.d(), 0.5 * width.d() - 0.1327 * height.d())
y = if(height.d() > width.d() * 0.5625, 0.5 * height.d() - 0.2406 * width.d(), 0.0723 * height.d())
loop:
click(vec(x, y + row * offset))
click(vec(x, y + (row + 1.) * offset))
click(vec(x, y + (row + 2.) * offset))
click(vec(x, y + (row + 3.) * offset))
row = row + 4.
gotoif(loop, row <= 8.)
gu("asteroid_count")