# Alchemic Power(Issue) Need Help

**URL:** <https://discourse.codecombat.com/t/alchemic-power-issue-need-help/20193>\
**Category:** Bugs\
**Created:** [February 5, 2020, 10:37pm UTC](https://discourse.codecombat.com/t/alchemic-power-issue-need-help/20193 "2020-02-05T22:37:16Z")\
**Posts on this page:** 11\
**Page:** 1

<div class="post-metadata">

**Author:** ![Mr.Wezi](https://sea2.discourse-cdn.com/flex016/user_avatar/discourse.codecombat.com/mr.wezi/32/11324_2.png) [@Mr.Wezi](https://discourse.codecombat.com/u/Mr.Wezi)\
**Post date:** [February 5, 2020, 10:37pm UTC](https://discourse.codecombat.com/t/alchemic-power-issue-need-help/20193/1 "2020-02-05T22:37:16Z")

</div>

There might be something wrong with this level. My bird is acting stupid. It fly’s out for no reason, then when it time to fetch, the stupid thing brings it half way then fly’s back.  
Here is my code–

def onHear(event):  
# Find the nearest potion.  
potion = pet.findNearestByType(“potion”)  
message = event.message  
# If the event’s message is “Fetch”  
if message is “Fetch”:  
# Have the pet fetch the potion.  
pet.fetch(potion)  
# Else (for any other messages):  
else:  
# Use pet.moveXY to return the pet to the red mark.  
pet.moveXY(53,34)

pet.on(“hear”, onHear)

# You don’t have to change the code below.

while True:  
enemy = hero.findNearest(hero.findEnemies())  
if enemy:  
hero.attack(enemy)  
else:  
hero.moveXY(40, 34)

---

<div class="post-metadata">

**Author:** ![dedreous](https://sea2.discourse-cdn.com/flex016/user_avatar/discourse.codecombat.com/dedreous/32/13849_2.png) [@dedreous](https://discourse.codecombat.com/u/dedreous)\
**Post date:** [February 5, 2020, 10:58pm UTC](https://discourse.codecombat.com/t/alchemic-power-issue-need-help/20193/2 "2020-02-05T22:58:46Z")

</div>

@Mr.Wezi, please format your code properly. Here’s how to do it: [[Essentials] How To Post/Format Your Code Correctly](https://discourse.codecombat.com/t/essentials-how-to-post-format-your-code-correctly/15521)

---

<div class="post-metadata">

**Author:** ![Mr.Wezi](https://sea2.discourse-cdn.com/flex016/user_avatar/discourse.codecombat.com/mr.wezi/32/11324_2.png) [@Mr.Wezi](https://discourse.codecombat.com/u/Mr.Wezi)\
**Post date:** [February 5, 2020, 11:13pm UTC](https://discourse.codecombat.com/t/alchemic-power-issue-need-help/20193/3 "2020-02-05T23:13:08Z")

</div>

ok  
\</\>def onHear(event):  
# Find the nearest potion.  
potion = pet.findNearestByType(“potion”)  
message = event.message  
# If the event’s message is “Fetch”  
if message is “Fetch”:  
# Have the pet fetch the potion.  
pet.fetch(potion)  
# Else (for any other messages):  
else:  
# Use pet.moveXY to return the pet to the red mark.  
pet.moveXY(53,34)

pet.on(“hear”, onHear)

# You don’t have to change the code below.

while True:  
enemy = hero.findNearest(hero.findEnemies())  
if enemy:  
hero.attack(enemy)  
else:  
hero.moveXY(40, 34) \</\>

---

<div class="post-metadata">

**Author:** ![Mr.Wezi](https://sea2.discourse-cdn.com/flex016/user_avatar/discourse.codecombat.com/mr.wezi/32/11324_2.png) [@Mr.Wezi](https://discourse.codecombat.com/u/Mr.Wezi)\
**Post date:** [February 5, 2020, 11:13pm UTC](https://discourse.codecombat.com/t/alchemic-power-issue-need-help/20193/4 "2020-02-05T23:13:30Z")

</div>

hold on that didnt work

---

<div class="post-metadata">

**Author:** ![Mr.Wezi](https://sea2.discourse-cdn.com/flex016/user_avatar/discourse.codecombat.com/mr.wezi/32/11324_2.png) [@Mr.Wezi](https://discourse.codecombat.com/u/Mr.Wezi)\
**Post date:** [February 5, 2020, 11:15pm UTC](https://discourse.codecombat.com/t/alchemic-power-issue-need-help/20193/5 "2020-02-05T23:15:08Z")

</div>

```python
def onHear(event):
    # Find the nearest potion.
    potion = pet.findNearestByType("potion")
    message = event.message
    # If the event's message is "Fetch"
    if message is "Fetch":
        # Have the pet fetch the potion.
        pet.fetch(potion)
    # Else (for any other messages):
    else:
        # Use pet.moveXY to return the pet to the red mark.
        pet.moveXY(53,34)

pet.on("hear", onHear)

# You don't have to change the code below.
while True:
    enemy = hero.findNearest(hero.findEnemies())
    if enemy:
        hero.attack(enemy)
    else:
        hero.moveXY(40, 34)

```

---

<div class="post-metadata">

**Author:** ![dedreous](https://sea2.discourse-cdn.com/flex016/user_avatar/discourse.codecombat.com/dedreous/32/13849_2.png) [@dedreous](https://discourse.codecombat.com/u/dedreous)\
**Post date:** [February 5, 2020, 11:39pm UTC](https://discourse.codecombat.com/t/alchemic-power-issue-need-help/20193/6 "2020-02-05T23:39:45Z")

</div>

Much better…thank you!

There is no difference between your code and mine, so, that leaves equipment. I’m using the wolf cub for this level…have you tried him yet?

---

<div class="post-metadata">

**Author:** ![dedreous](https://sea2.discourse-cdn.com/flex016/user_avatar/discourse.codecombat.com/dedreous/32/13849_2.png) [@dedreous](https://discourse.codecombat.com/u/dedreous)\
**Post date:** [February 5, 2020, 11:46pm UTC](https://discourse.codecombat.com/t/alchemic-power-issue-need-help/20193/7 "2020-02-05T23:46:50Z")

</div>

and, I just tried with the bird and it succeeded too.

---

<div class="post-metadata">

**Author:** ![Mr.Wezi](https://sea2.discourse-cdn.com/flex016/user_avatar/discourse.codecombat.com/mr.wezi/32/11324_2.png) [@Mr.Wezi](https://discourse.codecombat.com/u/Mr.Wezi)\
**Post date:** [February 5, 2020, 11:58pm UTC](https://discourse.codecombat.com/t/alchemic-power-issue-need-help/20193/8 "2020-02-05T23:58:38Z")

</div>

No I havent tried the cub. will try. But i find it strange that you say our codes match and that the bird works fine for you,but not for me.

---

<div class="post-metadata">

**Author:** ![Mr.Wezi](https://sea2.discourse-cdn.com/flex016/user_avatar/discourse.codecombat.com/mr.wezi/32/11324_2.png) [@Mr.Wezi](https://discourse.codecombat.com/u/Mr.Wezi)\
**Post date:** [February 6, 2020, 12:08am UTC](https://discourse.codecombat.com/t/alchemic-power-issue-need-help/20193/9 "2020-02-06T00:08:22Z")

</div>

Nope Still not working properly. The pup runs out farther then the bird flew but runs back without giving me the potion.

---

<div class="post-metadata">

**Author:** ![dedreous](https://sea2.discourse-cdn.com/flex016/user_avatar/discourse.codecombat.com/dedreous/32/13849_2.png) [@dedreous](https://discourse.codecombat.com/u/dedreous)\
**Post date:** [February 6, 2020, 12:26am UTC](https://discourse.codecombat.com/t/alchemic-power-issue-need-help/20193/10 "2020-02-06T00:26:42Z")

</div>

Ok, how about browser? I’m using Chrome, but have not tried in any other. If not, then we’ll need the big guns to check this out…@Chaboi_3000, likely.

---

<div class="post-metadata">

**Author:** ![Mr.Wezi](https://sea2.discourse-cdn.com/flex016/user_avatar/discourse.codecombat.com/mr.wezi/32/11324_2.png) [@Mr.Wezi](https://discourse.codecombat.com/u/Mr.Wezi)\
**Post date:** [February 6, 2020, 12:56am UTC](https://discourse.codecombat.com/t/alchemic-power-issue-need-help/20193/11 "2020-02-06T00:56:42Z")

</div>

Yeah i using Chrome also, but still not working. Ok i’ll let Chaboi have a look. Thanks for your help though.
