-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathunflagUnusedBots.code
142 lines (111 loc) · 3 KB
/
unflagUnusedBots.code
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
135
136
137
138
139
140
141
142
// free unused bots:
// important code that will check all bots to free them
// if a bot is flagged without being controled by a processor, will flag it back to 0
import time
import msg
set message message1
// units that could be useful to control and need to be checked for freeing them:
// ubind @dagger // nice transport short distance, 30x speed 0.5
// ubind @mace
// ubind @nova
// ubind @pulsar // can mine
// ubind @quasar // mine even more
// ubind @crawler // super nice transport 30x speed 1
// ubind @atrax
// ubind @flare // flying transport 20x speed 3
// ubind @horizon // slower 30x speed 1.7
// ubind @zenith // super 80x speed 1.8
// ubind @antumbra // super big transport, but slow
// ubind @mono // starting mining guy, 20x speed 1.5
set typeId 0
#ref NextBotType
op add typeId typeId 1
if typeId == 1
set type @dagger // nice transport short distance, 30x speed 0.5
elif typeId == 2
set type @mace
elif typeId == 3
set type @nova
elif typeId == 4
set type @pulsar // can mine
elif typeId == 5
set type @quasar // mine even more
elif typeId == 6
set type @crawler // super nice transport 30x speed 1
elif typeId == 7
set type @atrax
elif typeId == 8
set type @flare // flying transport 20x speed 3
elif typeId == 9
set type @horizon // slower 30x speed 1.7
elif typeId == 10
set type @zenith // super 80x speed 1.8
elif typeId == 11
set type @antumbra // super big transport, but slow
elif typeId == 12
set type @mono // starting mining guy, 20x speed 1.5
// the rest of the bots:
elif typeId == 13
set type @fortress
elif typeId == 14
set type @scepter
elif typeId == 15
set type @reign
elif typeId == 16
set type @vela
elif typeId == 17
set type @corvus
elif typeId == 18
set type @spiroct
elif typeId == 19
set type @arkyid
elif typeId == 20
set type @toxopid
elif typeId == 21
set type @eclipse
elif typeId == 22
set type @poly
elif typeId == 23
set type @mega
elif typeId == 24
set type @quad
elif typeId == 25
set type @oct
else
end
set botsQuantity 24
set count 0
set lastSeenFlag -1
#ref typeLoop
op add count count 1
if count > botsQuantity
// we have passed the maximum limit of bot of one kind
jump NextBotType
ubind type
if @unit == false
print "no bots of the type:\n"
print "[grey] "
print type
printflush message
jump NextBotType
sensor flag @unit @flag
if flag == 0
jump typeLoop
if lastSeenFlag == flag
jump NextBotType
if lastSeenFlag == -1
set lastSeenFlag flag
sensor owner @unit @controller
sensor botType owner @type
// if controller is not player or proc, return type
if botType == type
// bot not controled by processors or players, it return itself
ucontrol flag 0 null null null null
print "flagged bot: "
print flag
msg.printAndWait("[green] free !", message)
elif owner == @this
msg.printAndWait("It's me ! Mario", message)
else
msg.printAndWait("flagged bot is owned, everything alright", message)
jump typeLoop