-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMoonMission1.txt
More file actions
134 lines (123 loc) · 3.23 KB
/
MoonMission1.txt
File metadata and controls
134 lines (123 loc) · 3.23 KB
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
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
extern void object::MoonOre()
{
object rdr;
int counter = 0;
float range = 0;
int errcode = 0;
errmode(0);
if(category == WheeledGrabber)
{
// Build and put Powercell in ResearchCenter - tested and OK!
rdr = radar(ResearchCenter);
if(rdr == null) message("Waiting for Researchcenter to be built.");
object item = radar(Titanium);
goto(item.position);
grab();
goto(22.73,-38.23);
drop();
build(ResearchCenter);
while(rdr == null) rdr = radar(ResearchCenter);
errcode = goto(rdr.position);
while(errcode != 0) errcode = goto(rdr.position);
drop();
rdr = radar(PowerCell);
errcode = goto(rdr.position);
while(errcode != 0) errcode = goto(rdr.position);
grab();
rdr = radar(ResearchCenter);
goto(rdr.position);
drop();
message("Researchcenter is powered.");
//Do Research WingedBot
// ToDo as soon as possible
// Build BotFactory - Tested and OK!
rdr = radar(BotFactory);
if(rdr == null) message("Waiting for Botfactory to be built.");
object rdr = radar(Titanium);
goto(rdr.position);
grab();
goto(35.14,-42.41);
drop();
build(BotFactory);
message("BotFactory is built.");
//Build a WingedGrabber - need to complete and test!
rdr = radar(Titanium);
errcode = goto(rdr.position);
while(errcode != 0)
{
rdr = radar(Titanium);
errcode = goto(rdr.position);
}
grab();
while(rdr == null) rdr = radar(BotFactory);
errcode = goto(rdr.position);
while(errcode != 0)
{
turn(direction(rdr.position));
move(distance2d(position, rdr.position));
errcode = goto(rdr.position);
}
drop();
message("Titanium loaded into BotFactory");
rdr = radar(PowerCell);
errcode = goto(rdr.position);
while(errcode != 0) errcode = goto(rdr.position);
grab();
rdr = radar(WingedGrabber);
if(rdr == null) message("Waiting for Wingedgrabber to be built.");
while(rdr == null) rdr = radar(WingedGrabber);
wait(5);
errcode = goto(rdr.position);
while(errcode != 0) errcode = goto(rdr.position);
drop();
message("Wingedgrabber ready.");
move(-6);
rdr = radar(Titanium); //Get the extra Titanium out of the way
if(rdr != null)
{
errcode = goto(rdr.position);
while(errcode != 0) errcode = goto(rdr.position);
grab();
errcode = goto(space(position));
while(errcode != 0) errcode = goto(space(position));
drop();
}
message("Waiting for ore to be delivered.");
while(counter < 4)
{
counter = 0;
rdr = radar(TitaniumOre,0,360,range,100);
while(rdr != null)
{
counter++;
range = distance2d(position, rdr.position) + 0.01;
rdr = radar(TitaniumOre,0,360,range,100);
}
range = 0;
}
rdr = radar(SpaceShip);
errcode = goto(rdr.position);
while(errcode != 0) errcode = goto(rdr.position);
}
else
{
for(counter = 0; counter < 4; counter++)
{
rdr = radar(TitaniumOre,0,360,100,1000);
errcode = goto(rdr.position);
while(errcode != 0) errcode = goto(rdr.position);
grab();
rdr = radar(SpaceShip);
errcode = goto(rdr.position);
while(errcode != 0) errcode = goto(rdr.position);
errcode = drop();
while(errcode != 0)
{
turn(-45);
errcode = drop();
}
message("Delivered " + (counter +1) + " ore samples.");
}
}
message(category + ": Mission Complete.");
}