Play Home Contribute GitHub Join Us Discourse Staff Members GitHub Contribution Guides Team

Code gets stuck summoning


while True:
enemy = self.findNearest(self.findEnemies())
friend = self.findNearest(self.findFriends())
flag = self.findNearest(self.findItems())
distance = self.distanceTo(enemy)

#code gets stuck here summoning burl after running through the first loop.

if self.isReady("summon-burl"):

if enemy:

if < self.maxHealth:
    self.cast("regen", self)
if friend and < friend.maxHealth and self.isReady("regen"):
    self.cast("regen", friend)
if self.isReady("grow") and self.hasEffect("grow") == False:
    self.cast("grow", friend)

if friend and <= 100 and self.isReady("invisibility"):
    self.cast("invisibility", friend)
if enemy and self.isReady("chain-lightning"):
    enemyPos = enemy.pos
    enemyX = enemyPos.x
    enemyY = enemyPos.y
    self.cast("chain-lightning", enemy)
if enemy and enemy.hasEffect("grow") and self.isReady("shrink"):
    self.cast("shrink", enemy)
if enemy and self.isReady("shrink"):
    self.cast("shrink", enemy)

what am i doing wrong?
This is the Defend the Garrison level


try using self.canCast


thank you, i replaced all of the .isReady with .canCast and that fixed where it was getting stuck at summoning burl, but then had issues with:

if self.isReady(“grow”) and self.hasEffect(“grow”) == False:
self.cast(“grow”, friend)

I actually removed self.hasEffect(“grorw”) == False:
and then like i said changed isReady to canCast, but it still had issues… works perfectly like i want it to when i just comment out this little section though.


I think you need to restart the game. Meaning re-fresh the page. If that doesn’t work then I don’t know. Maybe try creating different code. Thanks for your time brother.


yeah thats right brother