# Stupid duck won't stop blabbing

**URL:** <https://discourse.codecombat.com/t/stupid-duck-wont-stop-blabbing/30768>\
**Category:** Uncategorized\
**Created:** [September 30, 2021, 3:05pm UTC](https://discourse.codecombat.com/t/stupid-duck-wont-stop-blabbing/30768 "2021-09-30T15:05:41Z")\
**Posts on this page:** 20\
**Page:** 2

<div class="post-metadata">

**Author:** ![Coder3](https://sea2.discourse-cdn.com/flex016/user_avatar/discourse.codecombat.com/coder3/32/22935_2.png) [@Coder3](https://discourse.codecombat.com/u/Coder3)\
**Post date:** [September 30, 2021, 5:31pm UTC](https://discourse.codecombat.com/t/stupid-duck-wont-stop-blabbing/30768/21 "2021-09-30T17:31:21Z")

</div>

I will, in PM. Not where everybody is going to copy. I bet $5000 that there is **NO** error. And it is the duck’s **AI** error.

---

<div class="post-metadata">

**Author:** ![Eric\_Tang](https://sea2.discourse-cdn.com/flex016/user_avatar/discourse.codecombat.com/eric_tang/32/15310_2.png) [@Eric\_Tang](https://discourse.codecombat.com/u/Eric_Tang)\
**Post date:** [September 30, 2021, 5:32pm UTC](https://discourse.codecombat.com/t/stupid-duck-wont-stop-blabbing/30768/22 "2021-09-30T17:32:52Z")

</div>

Then JUST POST YOUR CODE IN A PM.

---

<div class="post-metadata">

**Author:** ![Coder3](https://sea2.discourse-cdn.com/flex016/user_avatar/discourse.codecombat.com/coder3/32/22935_2.png) [@Coder3](https://discourse.codecombat.com/u/Coder3)\
**Post date:** [September 30, 2021, 5:33pm UTC](https://discourse.codecombat.com/t/stupid-duck-wont-stop-blabbing/30768/23 "2021-09-30T17:33:43Z")

</div>

Ok, you test it out, NO such ERROR. THE DUCK’S AI ERROR.

---

<div class="post-metadata">

**Author:** ![Coder3](https://sea2.discourse-cdn.com/flex016/user_avatar/discourse.codecombat.com/coder3/32/22935_2.png) [@Coder3](https://discourse.codecombat.com/u/Coder3)\
**Post date:** [September 30, 2021, 5:34pm UTC](https://discourse.codecombat.com/t/stupid-duck-wont-stop-blabbing/30768/24 "2021-09-30T17:34:09Z")

</div>

Just have a bet, I will get nothing even if I’m correct if there is no bet.

---

<div class="post-metadata">

**Author:** ![Eric\_Tang](https://sea2.discourse-cdn.com/flex016/user_avatar/discourse.codecombat.com/eric_tang/32/15310_2.png) [@Eric\_Tang](https://discourse.codecombat.com/u/Eric_Tang)\
**Post date:** [September 30, 2021, 5:34pm UTC](https://discourse.codecombat.com/t/stupid-duck-wont-stop-blabbing/30768/25 "2021-09-30T17:34:14Z")

</div>

PosT. YOUR coicde.  
fdgvaffa

---

<div class="post-metadata">

**Author:** ![Coder3](https://sea2.discourse-cdn.com/flex016/user_avatar/discourse.codecombat.com/coder3/32/22935_2.png) [@Coder3](https://discourse.codecombat.com/u/Coder3)\
**Post date:** [September 30, 2021, 5:34pm UTC](https://discourse.codecombat.com/t/stupid-duck-wont-stop-blabbing/30768/26 "2021-09-30T17:34:32Z")

</div>

Just have a bet. Okay?

---

<div class="post-metadata">

**Author:** ![Eric\_Tang](https://sea2.discourse-cdn.com/flex016/user_avatar/discourse.codecombat.com/eric_tang/32/15310_2.png) [@Eric\_Tang](https://discourse.codecombat.com/u/Eric_Tang)\
**Post date:** [September 30, 2021, 5:35pm UTC](https://discourse.codecombat.com/t/stupid-duck-wont-stop-blabbing/30768/27 "2021-09-30T17:35:19Z")

</div>

JUST POST YOUR CODE IN A SF PM/  
Ffwsfsf

---

<div class="post-metadata">

**Author:** ![Coder3](https://sea2.discourse-cdn.com/flex016/user_avatar/discourse.codecombat.com/coder3/32/22935_2.png) [@Coder3](https://discourse.codecombat.com/u/Coder3)\
**Post date:** [September 30, 2021, 5:37pm UTC](https://discourse.codecombat.com/t/stupid-duck-wont-stop-blabbing/30768/28 "2021-09-30T17:37:25Z")

</div>

With a bet, bet with piggy coins.

---

<div class="post-metadata">

**Author:** ![Eric\_Tang](https://sea2.discourse-cdn.com/flex016/user_avatar/discourse.codecombat.com/eric_tang/32/15310_2.png) [@Eric\_Tang](https://discourse.codecombat.com/u/Eric_Tang)\
**Post date:** [September 30, 2021, 5:42pm UTC](https://discourse.codecombat.com/t/stupid-duck-wont-stop-blabbing/30768/29 "2021-09-30T17:42:40Z")

</div>

DUDE WHAT IS YOUR PROBLEM/ I’m not betting.  
so you don’t want anyhelp.

---

<div class="post-metadata">

**Author:** ![Coder3](https://sea2.discourse-cdn.com/flex016/user_avatar/discourse.codecombat.com/coder3/32/22935_2.png) [@Coder3](https://discourse.codecombat.com/u/Coder3)\
**Post date:** [September 30, 2021, 5:43pm UTC](https://discourse.codecombat.com/t/stupid-duck-wont-stop-blabbing/30768/30 "2021-09-30T17:43:23Z")

</div>

Nope, my code has no problem.

---

<div class="post-metadata">

**Author:** ![Coder3](https://sea2.discourse-cdn.com/flex016/user_avatar/discourse.codecombat.com/coder3/32/22935_2.png) [@Coder3](https://discourse.codecombat.com/u/Coder3)\
**Post date:** [September 30, 2021, 5:43pm UTC](https://discourse.codecombat.com/t/stupid-duck-wont-stop-blabbing/30768/31 "2021-09-30T17:43:51Z")

</div>

No bet, idc. I just want that duck to stop blabbing when everything is going well.

---

<div class="post-metadata">

**Author:** ![Coder3](https://sea2.discourse-cdn.com/flex016/user_avatar/discourse.codecombat.com/coder3/32/22935_2.png) [@Coder3](https://discourse.codecombat.com/u/Coder3)\
**Post date:** [September 30, 2021, 5:44pm UTC](https://discourse.codecombat.com/t/stupid-duck-wont-stop-blabbing/30768/32 "2021-09-30T17:44:23Z")

</div>

Look, I can even summon. There’s no error.  
 ![image](https://us1.discourse-cdn.com/flex016/uploads/codecombat/original/3X/3/c/3c987587afd7db1e74d637049b33d6dc6ab65944.png)

---

<div class="post-metadata">

**Author:** ![Coder3](https://sea2.discourse-cdn.com/flex016/user_avatar/discourse.codecombat.com/coder3/32/22935_2.png) [@Coder3](https://discourse.codecombat.com/u/Coder3)\
**Post date:** [September 30, 2021, 5:44pm UTC](https://discourse.codecombat.com/t/stupid-duck-wont-stop-blabbing/30768/33 "2021-09-30T17:44:53Z")

</div>

I closed the duck’s stupid post, but it will pop out again every time I re-run.

---

<div class="post-metadata">

**Author:** ![Eric\_Tang](https://sea2.discourse-cdn.com/flex016/user_avatar/discourse.codecombat.com/eric_tang/32/15310_2.png) [@Eric\_Tang](https://discourse.codecombat.com/u/Eric_Tang)\
**Post date:** [September 30, 2021, 5:45pm UTC](https://discourse.codecombat.com/t/stupid-duck-wont-stop-blabbing/30768/34 "2021-09-30T17:45:38Z")

</div>

I would help if you posted your code.  
But I gotta eat rn.

---

<div class="post-metadata">

**Author:** ![Vanessa](https://sea2.discourse-cdn.com/flex016/user_avatar/discourse.codecombat.com/vanessa/32/33899_2.png) [@Vanessa](https://discourse.codecombat.com/u/Vanessa)\
**Post date:** [September 30, 2021, 6:00pm UTC](https://discourse.codecombat.com/t/stupid-duck-wont-stop-blabbing/30768/35 "2021-09-30T18:00:01Z")

</div>

Post your code, the duck ONLY shows when there is an error dude.

---

<div class="post-metadata">

**Author:** ![enPointe77](https://sea2.discourse-cdn.com/flex016/user_avatar/discourse.codecombat.com/enpointe77/32/43632_2.png) [@enPointe77](https://discourse.codecombat.com/u/enPointe77)\
**Post date:** [September 30, 2021, 6:01pm UTC](https://discourse.codecombat.com/t/stupid-duck-wont-stop-blabbing/30768/36 "2021-09-30T18:01:36Z")

</div>

Eric’s trying to help @Coder3, post your code and he will. Vanessa’s right. The duck only shows when there’s an error.

---

<div class="post-metadata">

**Author:** ![Anonym](https://sea2.discourse-cdn.com/flex016/user_avatar/discourse.codecombat.com/anonym/32/47546_2.png) [@Anonym](https://discourse.codecombat.com/u/Anonym)\
**Post date:** [September 30, 2021, 6:05pm UTC](https://discourse.codecombat.com/t/stupid-duck-wont-stop-blabbing/30768/37 "2021-09-30T18:05:10Z")

</div>

Yes, AND think.If you post your CURRENT code online, nobody will copy it because it is faulty.If you post your RESULT code, it will be different situation.

---

<div class="post-metadata">

**Author:** ![Coder3](https://sea2.discourse-cdn.com/flex016/user_avatar/discourse.codecombat.com/coder3/32/22935_2.png) [@Coder3](https://discourse.codecombat.com/u/Coder3)\
**Post date:** [September 30, 2021, 6:35pm UTC](https://discourse.codecombat.com/t/stupid-duck-wont-stop-blabbing/30768/38 "2021-09-30T18:35:06Z")

</div>

I’m in this level, [CodeCombat - Coding games to learn Python and JavaScript](https://codecombat.com/play/level/sky-wars)  
And my code:

```python
summonOrder = ["trapper","paladin","paladin","paladin","paladin","necromancer","paladin","paladin","paladin","librarian","paladin","paladin","paladin","knight"]
summonIndex = 0

enemyBoss = hero.findByType("wizard-ninja", hero.findEnemies())[0]

if hero.team == "humans":
    targetPos = {"x": 72, "y": 32}
    safePos = {"x": 30, "y": 13}
    knightPos= {"x": 22,"y": 42}
else:
    targetPos = {"x": 10, "y": 32}
    safePos = {"x": 68, "y": 10}
    knightPos= {"x": 58,"y": 13}

def goliathLogic(goliath):
    enemy = goliath.findNearestEnemy()
    if enemy:
        if goliath.isReady("hurl"):
            hero.command(goliath, "hurl", enemy)
        # The hero has access to "stomp" and "warcry" as well:
        if goliath.isReady("stomp"):
            hero.command(goliath, "stomp", enemy)
        if goliath.isReady("warcry"):
            hero.command(goliath, "warcry", self)
        else:
            hero.command(goliath, "attack", enemy)

def trapperLogic(trapper):
    targets = hero.findByType("archer")
    nearest = hero.findNearest(targets, hero.findEnemies())
    assassin = hero.findNearest(hero.findByType("assassin"), hero.findEnemies())
    griffin = hero.findNearest(hero.findByType("griffin"), hero.findEnemies())
    trapper = hero.findNearest(hero.findByType("trapper"), hero.findEnemies())
    enemy = trapper.findNearestEnemy()
    if enemy:
        if trapper.distanceTo(enemy)<35:
            if trapper.isReady("scattershot"):
                hero.command(trapper, "scattershot", enemy)
            elif trapper.isReady("throw"):
                if nearest:
                    hero.command(trapper, "throw", nearest)
                elif griffin:
                    hero.command(trapper, "throw", griffin)
                elif assassin:
                    hero.command(trapper, "throw", assassin)
                else:
                    hero.command(trapper, "throw", enemy)
            else:
                hero.command(trapper, "attack", enemy)
    else:
        hero.command(trapper, "defend", safePos)

def knightLogic(knight):
    enemy = knight.findNearestEnemy()
    ready = knight.isReady("cleave")
    ready1 = knight.isReady("bash")
    if enemy and knight.distanceTo(enemy)<20:
        if ready and knight.distanceTo(enemy)<10:
            hero.command(knight, "cleave")
        elif ready1 and knight.distanceTo(enemy)<10:
            hero.command(knight, "bash", enemy)
        else:
            hero.command(knight, "shield")
    else:
        hero.command(knight, "move", knightPos)

def assassinLogic(assassin):
    enemy = assassin.findNearestEnemy()
    if enemy:
        if assassin.isReady("phase-shift"):
            hero.command(assassin, "phaseShift", enemyBoss)
        # The hero has access to "stomp" and "warcry" as well:
        if assassin.isReady("wall-of-darkness"):
            hero.command(assassin, "wallOfDarkness", [assassin.pos, enemyBoss.pos])
        if assassin.isReady("shadow-vortex"):
            targets = hero.findByType("knight")
            nearest = hero.findNearest(targets, assassin.findFriends)
            enemy = hero.findNearestEnemy()
            hero.command(assassin, "shadowVortex", enemy.pos, enemyBoss.pos)
        else:
            hero.command(assassin, "defend", safePos)

def necromancerLogic(necromancer):
    enemy = necromancer.findNearestEnemy()
    if necromancer.canCast("summon-undead"):
        hero.command(necromancer, "cast", "summon-undead")
    if enemy:
        # The hero has access to "stomp" and "warcry" as well:
        if necromancer.canCast("sacrifice"):
            hero.command(necromancer, "cast", "sacrifice", enemy)
        if necromancer.isReady("soul-link"):
            hero.command(necromancer, "cast", "soul-link", enemy)
        if necromancer.distanceTo(enemy)<20:
            hero.command(necromancer, "attack", enemy)
    else:
        hero.command(necromancer, "defend", safePos)

def paladinLogic(paladin):
    enemy = paladin.findNearestEnemy()
    leastHealth = 9999
    friendIndex = 0
    friends = hero.findFriends()
    if paladin.canCast("heal"):
        if hero.health<1734:
            hero.command(paladin, "cast", "heal", hero)
        else:
            while (friendIndex < friends.length):
                friend = friends[friendIndex]
                if (friend.health < leastHealth and friend.health != 30):
                    leastHealth = friend.health
                    weakestFriend = friend
                friendIndex += 1
            hero.command(paladin, "cast", "heal", weakestFriend)
    if enemy:
        hero.command(paladin, "attack", enemy)

def librarianLogic(librarian):
    hero.command(librarian, "move", safePos)
    enemy = librarian.findNearestEnemy()
    targets = hero.findByType("archer",hero.findFriends())
    nearest = hero.findNearest(targets)
    targets1 = hero.findByType("goliath",hero.findFriends())
    nearest1 = hero.findNearest(targets1)
    highestHealth = 1
    friendIndex = 0
    friends = hero.findFriends()
    while (friendIndex < friends.length):
        friend = friends[friendIndex]
        if (friend.health > highestHealth and friend.health != 30):
            highestHealth = friend.health
            strongestFriend = friend
        friendIndex += 1
    if enemy:
        if librarian.canCast("haste") and nearest:
            hero.command(librarian, "cast", "haste", nearest)
        # The hero has access to "stomp" and "warcry" as well:
        if librarian.canCast("grow") and strongestFriend:
            hero.command(librarian, "cast", "grow", strongestFriend)
        if librarian.isReady("force-bolt") and enemy and librarian.distanceTo(enemy)<10:
            hero.command(librarian, "cast", "force-bolt", enemy)
        else:
            hero.command(librarian, "defend", safePos)

hero.summon("assassin")
hero.summon("knight")
targets = hero.findByType("knight")
knight = hero.findNearest(targets, hero.findFriends())
hero.command(knight, "move", knightPos)
while True:
    nextUnit = summonOrder[summonIndex % summonOrder.length]
    if hero.costOf(nextUnit) <= hero.gold:
        hero.summon(nextUnit)
        summonIndex += 1
    friends = hero.findFriends()
    for friend in friends:
        if friend.type == "goliath":
            goliathLogic(friend)
        elif friend.type == "assassin":
            assassinLogic(friend)
        elif friend.type=='necromancer':
            necromancerLogic(friend)
        elif friend.type=='knight':
            knightLogic(friend)
        elif friend.type=='paladin':
            paladinLogic(friend)
        elif friend.type=='librarian':
            librarianLogic(friend)
        elif friend.type=='trapper':
            trapperLogic(friend)
        else:
            if friend.findNearestEnemy() and friend.type!='skeleton':
                hero.command(friend, "attack", friend.findNearestEnemy())

```

---

<div class="post-metadata">

**Author:** ![Coder3](https://sea2.discourse-cdn.com/flex016/user_avatar/discourse.codecombat.com/coder3/32/22935_2.png) [@Coder3](https://discourse.codecombat.com/u/Coder3)\
**Post date:** [September 30, 2021, 7:17pm UTC](https://discourse.codecombat.com/t/stupid-duck-wont-stop-blabbing/30768/39 "2021-09-30T19:17:06Z")

</div>

Any bugs? I tested a few times and the duck said same thing.

---

<div class="post-metadata">

**Author:** ![Coder3](https://sea2.discourse-cdn.com/flex016/user_avatar/discourse.codecombat.com/coder3/32/22935_2.png) [@Coder3](https://discourse.codecombat.com/u/Coder3)\
**Post date:** [September 30, 2021, 7:17pm UTC](https://discourse.codecombat.com/t/stupid-duck-wont-stop-blabbing/30768/40 "2021-09-30T19:17:23Z")

</div>

If you battle someone, say dreadthief908. That bug will appear.

[Previous page](https://discourse.codecombat.com/t/stupid-duck-wont-stop-blabbing/30768.md?page=1)

[Next page](https://discourse.codecombat.com/t/stupid-duck-wont-stop-blabbing/30768.md?page=3)
