-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathscreeps.txt
116 lines (107 loc) · 2.1 KB
/
screeps.txt
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
Screeps
Main
create room in memory
Create links in memory
create repairs in memory
create storage in memory
Fill
containers
Find containers and storage with free Capacity
if none
be a builder
else
find targets with open space
if none
DEPRECATED METHODS
fill last container in targets
if team 0
else if team 1
links
check if a Link is assigned to creep
if not
display to console error
else
attempt to transfer energy to link assocaited with creep
if good
do nothing
if not in range
move to
if link doesnt exist
dispaly Error
if link is full
find links with energy
fill a container instead (should fill closest container)
else
display error
terminals
Find terminal
Attempt to transfer mineral to Terminal (should change to whatever is in creep)
if good
do nothing
if no mineral
try to transfer energy
if not in range
move to
if bad arguments
display error
else
display error
Collect
containers
look for dropped energy greater than 1000
if dropped res exists
sort by location
try to pickup closest
if not in range
move to
if ERR_NO_PATH and a second dropped res exists
go next closest droppedres
else
find structures with more than 50 energy
sort by closest
if structures exist
withdraw/move to closest
else
collect from sources
links
check if creep has link in memory
if it does not
display error
else
create link from memory using id
try to withdraw from link
if good
do nothing
if out of range
move to
if not enough in link
if upgrader
wait for more energy
else
find links with more than 50 and not upgrade link
sort links by most energy
send energy from link with most energy to creep's link
else
display error
sources
find sources
sort by closest
harvest/move to source
Roles
builder
defender
Find Hostile creeps
if they exist
attack hostile creep
filler
harvester
importer
linkfiller
linkupgrader
miner
recoverer
repairer
scavenger
settler
sourceFarmer
upgrader