Librarian Tactitian

I’m struggling badly with this one level in CloudDrip and I’ve looked for help in a lot of sources. I’m about done with the level and I want to just solve it right now. Can anyone lend me a hand?

Can you show us your code?

Sure. This is what I have so far.

while True:
def commandSoldier(soldier, soldierIndex, numSoldiers):
angle = Math.PI * 2 * soldierIndex/numSoldiers
defendPos = {“x”: 41, “y”: 40}
DefendPos = {“x”: 42, “y”: 40}
defendPos.x += 10 * Math.cos(angle)
defendPos.y += 10 * Math.sin(angle)
if soldier.health > 40:
hero.command(soldier, “defend”, defendPos);
else:
hero.command(soldier, “defend”, DefendPos)
def findStrongestTarget():
mostHealth = 0
bestTarget = None
enemies = hero.findEnemies()
enemyIndex = 0
while len(enemies) > enemyIndex:
enemy = enemies[enemyIndex]
if enemy:
enemyIndex += 1
for enemy in enemies:
if enemy.health > mostHealth:
mostHealth = enemy.health
bestTarget = enemy
if bestTarget and bestTarget.health > 15:
return bestTarget
else:
return None
archerTarget = None
def commandArcher(archer):
nearest = archer.findNearestEnemy()
if archerTarget:
hero.command(archer, “attack”, archerTarget)
elif nearest:
hero.command(archer, “attack”, nearest)
while True:
if hero.gold > hero.costOf(“soldier”):
hero.summon(“soldier”)
if not archerTarget or archerTarget.health <= 0:
archerTarget = findStrongestTarget()
friends = hero.findFriends()
soldiers = hero.findByType(“soldier”)
archers = hero.findByType(“archers”)
for a, soldier in enumerate(soldiers):
commandSoldier(soldier, a, len(soldiers));
for a in range(len(archers)):
archer = archers[a]
commandArcher(archer)

We’ve already got the right topic that you’ve posted in for help so please keep your questions there and we’ll close this topic, @Chaboi_3000?

what do you mean @enPointe77 ?

Hold on a second and let me find it.

Just view the latest topics and you’ll see it.

1 Like

see what? Is there already a solution to it that I missed?

1 Like

oop, found the post. i’ll go on that one

1 Like

No, but if we keep making new topics for the same problem it clutters up the forum.

You both got me confused.

I’ve replied on your first post in the other topic

Sorry, please talk about your code in the first topic and don’t make another one.

1 Like

uh someone is allowed to make duplicate topics as long as at least one of these is true so not the same level the same problem and same user and code that created the topic so people should be left reasonably free to make their own topic or put their problem on another topic on the same level.

If it is about the same level and it is level help no your not supposed to make dup threads.

2 Likes

but people should be left reasonably free to do that and create the same threads AS LONG AS it’s NOT THE SAME PERSON MAKING THE TOPICS.

Yes. Then its fine. But same person no.

2 Likes

What everyone is saying @EnderMarkoth is if you already made a topic for help then there is no need for another one.

1 Like