OK, I have the following code. The problem is that with the way the code is now, it gets broken with whichbot, or if a player 'tricks' it. Apparently (and I'm just guessing here) if an RT build fails, it still counts for get_build("alienresourcetower", 0).
Anyone know (or know how to get) the offset for this? The old offset was 27 (PRIVATE_ACTIVE_RES).
Code:
get_num_active_rt() {
//Poor mans hack to get number of RTs.
//gets all rts that have been attempted to be built
//so it breaks with WhichBot and if an RT build fails.
new num = get_build("alienresourcetower", 0)
/* REMOVED DUE TO BAD OFFSET.
new num
new numrt = get_build("alienresourcetower", 0)
for (new i = 1; i <= numrt; ++i) {
new id = get_build("alienresourcetower", i)
if ( get_private_i(id, PRIVATE_ACTIVE_RES, 4) ) // Resource towers have an activation time of about 5 secs after
num++ // they are built before they start giving res out.
}
*/
return num
}