# Solved

**URL:** https://discourse.codecombat.com/c/solved/8.md?page=1

[Latest](https://discourse.codecombat.com/latest.md) · [Categories](https://discourse.codecombat.com/categories.md) · [Tags](https://discourse.codecombat.com/tags.md)

**Page:** 2

---

## [Non-UserCodeError: TypeError: undefined is not a function](https://discourse.codecombat.com/t/non-usercodeerror-typeerror-undefined-is-not-a-function/788)

<div class="topic-metadata">

**Author:** [@Bellardia](https://discourse.codecombat.com/u/Bellardia)\
**Replies:** 5\
**Last updated:** [April 1, 2020, 8:56am UTC](https://discourse.codecombat.com/t/non-usercodeerror-typeerror-undefined-is-not-a-function/788 "2020-04-01T08:56:39Z")

</div>

I've submitted code which triggers a console error of "Non-UserCodeError: TypeError: undefined is not a function" This causes the game to never load, and I can't seem to enter a game to attempt to fix. Full trace |…

---

## [\[SOLVED\] Desert Level - Sarven Shepherd](https://discourse.codecombat.com/t/solved-desert-level-sarven-shepherd/14099)

<div class="topic-metadata">

**Author:** [@Inukaze](https://discourse.codecombat.com/u/Inukaze)\
**Replies:** 5\
**Last updated:** [December 5, 2019, 6:18pm UTC](https://discourse.codecombat.com/t/solved-desert-level-sarven-shepherd/14099 "2019-12-05T18:18:54Z")

</div>

Hi there, from yesterday i am trying to beat “Sarven Shepherd (Desert)” and when i put the follow code : # https://codecombat.com/play/level/sarven-shepherd? # Usa el bucle "while" para elegir al ogro while True: En…

---

## [Friend and Foe Level Help \[solved\]](https://discourse.codecombat.com/t/friend-and-foe-level-help-solved/19079)

<div class="topic-metadata">

**Author:** [@fogledude102](https://discourse.codecombat.com/u/fogledude102)\
**Replies:** 2\
**Last updated:** [August 31, 2019, 7:50am UTC](https://discourse.codecombat.com/t/friend-and-foe-level-help-solved/19079 "2019-08-31T07:50:19Z")

</div>

In the level Friend and Foe in the Backwoods Forest, I am having trouble figuring out the correct way to complete the level. Here is my code: # Peasants and peons are gathering in the forest. # Command the peasants to b…

---

## [\[Solved\] Gas Attack returning "0"](https://discourse.codecombat.com/t/solved-gas-attack-returning-0/15776)

<div class="topic-metadata">

**Author:** [@Carbonalligator](https://discourse.codecombat.com/u/Carbonalligator)\
**Replies:** 6\
**Last updated:** [July 11, 2019, 6:42pm UTC](https://discourse.codecombat.com/t/solved-gas-attack-returning-0/15776 "2019-07-11T18:42:52Z")

</div>

I checked my code and I can’t find any errors, but it always tells the cannon to use 0 grams. Here’s my code. # Calculate the total health of all the ogres. def sumHealth(enemies): # Create a variable and set it t…

---

## [Decoy Drill Help](https://discourse.codecombat.com/t/decoy-drill-help/7428)

<div class="topic-metadata">

**Author:** [@FuzzyCheese](https://discourse.codecombat.com/u/FuzzyCheese)\
**Replies:** 2\
**Last updated:** [May 4, 2016, 1:39am UTC](https://discourse.codecombat.com/t/decoy-drill-help/7428 "2016-05-04T01:39:31Z")

</div>

I belive this code should work but my character never builds the decoys: var decoysBuilt = 0; while(true) { var coin = this.findNearest(this.findItems()); if(coin) { this.moveXY(coin.pos.x, coin.pos.y); …

---

## [Bookkeeper code help](https://discourse.codecombat.com/t/bookkeeper-code-help/6954)

<div class="topic-metadata">

**Author:** [@alex\_1](https://discourse.codecombat.com/u/alex_1)\
**Replies:** 14\
**Last updated:** [April 29, 2019, 3:06am UTC](https://discourse.codecombat.com/t/bookkeeper-code-help/6954 "2019-04-29T03:06:49Z")

</div>

ok i trying to complete this level and i've tried about a million times and i still cant figure it out here's what i got while true: enemies = self.findEnemies() nearest\_enemy = self.findNearest(enemies) i…

---

## [Unable to load level Ingredient Identification](https://discourse.codecombat.com/t/unable-to-load-level-ingredient-identification/15954)

<div class="topic-metadata">

**Author:** [@Erik\_Smit](https://discourse.codecombat.com/u/Erik_Smit)\
**Replies:** 49\
**Last updated:** [February 24, 2019, 11:02pm UTC](https://discourse.codecombat.com/t/unable-to-load-level-ingredient-identification/15954 "2019-02-24T23:02:50Z")

</div>

When I try to open the Ingredient Identification level I get the follow error: I’ve tried all 3 buttons, no difference. I’ve tried on Chrome and Edge, both the same result. If I sign out, I can do the level, but a…

---

## [\[Solved\] Stuck on The Two Flowers Python](https://discourse.codecombat.com/t/solved-stuck-on-the-two-flowers-python/17277)

<div class="topic-metadata">

**Author:** [@cp0649](https://discourse.codecombat.com/u/cp0649)\
**Replies:** 5\
**Last updated:** [January 27, 2019, 9:43pm UTC](https://discourse.codecombat.com/t/solved-stuck-on-the-two-flowers-python/17277 "2019-01-27T21:43:13Z")

</div>

I’m not sure what’s going wrong with this code exactly, there’s a problem with line 12. It says “command’s argument minion should have type unit, but got object: Hector.” # If the peasant is damaged, the flowers will sh…

---

## [Two flowers Help needed URGENTLY! \[SOLVED\]](https://discourse.codecombat.com/t/two-flowers-help-needed-urgently-solved/17062)

<div class="topic-metadata">

**Author:** [@CodeKnight77](https://discourse.codecombat.com/u/CodeKnight77)\
**Replies:** 7\
**Last updated:** [January 10, 2019, 9:01pm UTC](https://discourse.codecombat.com/t/two-flowers-help-needed-urgently-solved/17062 "2019-01-10T21:01:56Z")

</div>

I can’t play this level because I need to equip some glasses, but all the glasses are restricted! Very stupid. I would appreciate it a lot if someone could tell me how to get past this glitch and if I can’t I can’t play …

---

## [Why doesn't enemy.type work?](https://discourse.codecombat.com/t/why-doesnt-enemy-type-work/17016)

<div class="topic-metadata">

**Author:** [@CodeKnight77](https://discourse.codecombat.com/u/CodeKnight77)\
**Replies:** 7\
**Last updated:** [January 7, 2019, 4:45am UTC](https://discourse.codecombat.com/t/why-doesnt-enemy-type-work/17016 "2019-01-07T04:45:37Z")

</div>

On Sarven Brawl I used the following code: enemy = hero.findNearestEnemy() if enemy and enemy != "sand-yak": hero.attack(enemy) Everything was fine except when no other enemies were around Tharin started at…

---

## [\[SOLVED\] Endangered Burl (Bug?)](https://discourse.codecombat.com/t/solved-endangered-burl-bug/16231)

<div class="topic-metadata">

**Author:** [@Unknown](https://discourse.codecombat.com/u/Unknown)\
**Replies:** 6\
**Last updated:** [October 22, 2018, 2:42pm UTC](https://discourse.codecombat.com/t/solved-endangered-burl-bug/16231 "2018-10-22T14:42:14Z")

</div>

I have reviewed the other topics similar to this and have found nothing similar to the the problem I have, I will post my code but I do not think that is the problem, though I could be wrong… while(true) { var enemy…

---

## [\[Solved\] Lost In The Stack](https://discourse.codecombat.com/t/solved-lost-in-the-stack/16953)

<div class="topic-metadata">

**Author:** [@Cydo](https://discourse.codecombat.com/u/Cydo)\
**Replies:** 18\
**Last updated:** [January 2, 2019, 10:52am UTC](https://discourse.codecombat.com/t/solved-lost-in-the-stack/16953 "2019-01-02T10:52:06Z")

</div>

So when ever I try to do Lost in the Stack in the Kithgard Dungeon I get this error. \[Album\] Imgur …

---

## [\[SOLVED\] Request Assistance with Reindeer Tender](https://discourse.codecombat.com/t/solved-request-assistance-with-reindeer-tender/13056)

<div class="topic-metadata">

**Author:** [@MunkeyShynes](https://discourse.codecombat.com/u/MunkeyShynes)\
**Replies:** 14\
**Last updated:** [November 20, 2018, 8:44pm UTC](https://discourse.codecombat.com/t/solved-request-assistance-with-reindeer-tender/13056 "2018-11-20T20:44:19Z")

</div>

I’ve run out of ideas to try to fix this. When code is run, the three reindeer go to the first three pens, regardless of whether or not one is already occupied. # This is the array of pen positions penPositions = \[ {"x…

---

## [\[ SOLVED \] Help on functions accepting multiple parameter!](https://discourse.codecombat.com/t/solved-help-on-functions-accepting-multiple-parameter/16433)

<div class="topic-metadata">

**Author:** [@Melina\_Cortes](https://discourse.codecombat.com/u/Melina_Cortes)\
**Replies:** 6\
**Last updated:** [November 14, 2018, 12:19am UTC](https://discourse.codecombat.com/t/solved-help-on-functions-accepting-multiple-parameter/16433 "2018-11-14T00:19:03Z")

</div>

I don’t understand how to make a function that accepts a parameter. Here is my code: Define a function with multiple parameters, and use it. Move to a point. If an enemy is there, attack it. def checkAndAttack(): enemy…

---

## [Problem with "Oasis" Level Javascript](https://discourse.codecombat.com/t/problem-with-oasis-level-javascript/16363)

<div class="topic-metadata">

**Author:** [@camicool09](https://discourse.codecombat.com/u/camicool09)\
**Replies:** 3\
**Last updated:** [November 5, 2018, 7:24am UTC](https://discourse.codecombat.com/t/problem-with-oasis-level-javascript/16363 "2018-11-05T07:24:58Z")

</div>

Hello, I’ve been stuck on this level for awhile now. My hero moves right to avoid the Yaks but runs into one when moving left. while(true) { var x = hero.pos.x; var y = hero.pos.y; var enemy = hero.findNear…

---

## [\[SOLVED\] Finding Player Names?](https://discourse.codecombat.com/t/solved-finding-player-names/16304)

<div class="topic-metadata">

**Author:** [@SmileyMiley](https://discourse.codecombat.com/u/SmileyMiley)\
**Replies:** 15\
**Last updated:** [October 30, 2018, 2:29am UTC](https://discourse.codecombat.com/t/solved-finding-player-names/16304 "2018-10-30T02:29:30Z")

</div>

I was playing the multiplayer level Dueling Grounds, and ran into an issue while defining two functions for my pet. Here are the two functions: def onDefeat(): player = #The Player's username hero.say("You won,…

---

## [\[SOLVED\] Sand Snakes (ran out of time)](https://discourse.codecombat.com/t/solved-sand-snakes-ran-out-of-time/16255)

<div class="topic-metadata">

**Author:** [@CreeperFoot](https://discourse.codecombat.com/u/CreeperFoot)\
**Replies:** 4\
**Last updated:** [October 25, 2018, 6:45am UTC](https://discourse.codecombat.com/t/solved-sand-snakes-ran-out-of-time/16255 "2018-10-25T06:45:00Z")

</div>

while True: coins = hero.findItems() coinIndex = 0 nearest = None nearestDistance = 9999 # Loop through all the coins to find the nearest one. while coinIndex \< len(coins): coin = coi…

---

## [\[SOLVED\] Mountain Mercenaries Help](https://discourse.codecombat.com/t/solved-mountain-mercenaries-help/16168)

<div class="topic-metadata">

**Author:** [@Snowman](https://discourse.codecombat.com/u/Snowman)\
**Replies:** 3\
**Last updated:** [October 14, 2018, 6:04pm UTC](https://discourse.codecombat.com/t/solved-mountain-mercenaries-help/16168 "2018-10-14T18:04:47Z")

</div>

I am mostly sure I have a correct code based upon what I have found looking at the discourse. Having said this, something seems to happen when there aren’t any enemies: the soldiers stop doing things and don’t attack new…

---

## [\[Solved\] Munchkin Swarm Python](https://discourse.codecombat.com/t/solved-munchkin-swarm-python/1614)

<div class="topic-metadata">

**Author:** [@TDGuy](https://discourse.codecombat.com/u/TDGuy)\
**Replies:** 7\
**Last updated:** [October 13, 2018, 4:30pm UTC](https://discourse.codecombat.com/t/solved-munchkin-swarm-python/1614 "2018-10-13T16:30:53Z")

</div>

I’m having an issue with Munchkin Swarm. Presently I’m using Python to code it and here is my code: enemy = self.findNearestEnemy() loop: if self.distanceTo(enemy) \< 10: if self.isReady("cleave"): …

---

## [\[SOLVED\] Please Help me pass the Lurker Level](https://discourse.codecombat.com/t/solved-please-help-me-pass-the-lurker-level/16012)

<div class="topic-metadata">

**Author:** [@Sharknado](https://discourse.codecombat.com/u/Sharknado)\
**Replies:** 5\
**Last updated:** [October 3, 2018, 6:07pm UTC](https://discourse.codecombat.com/t/solved-please-help-me-pass-the-lurker-level/16012 "2018-10-03T18:07:58Z")

</div>

Don’t know what I did wrong. # findEnemies returns a list of all your enemies. # Only attack shamans. Don't attack yaks! enemies = hero.findEnemies() enemyIndex = 0 # Wrap this section in a while loop to iterate all e…

---

## [\[SOLVED\] The Second Kithmaze Reward Question](https://discourse.codecombat.com/t/solved-the-second-kithmaze-reward-question/16053)

<div class="topic-metadata">

**Author:** [@Unknown](https://discourse.codecombat.com/u/Unknown)\
**Replies:** 9\
**Last updated:** [September 27, 2018, 9:31pm UTC](https://discourse.codecombat.com/t/solved-the-second-kithmaze-reward-question/16053 "2018-09-27T21:31:42Z")

</div>

I have completed this level and it says that I unlocked ¨Ninja¨ but I never got him. If someone has aready posted about this can someone direct me to it, if not can someone help?

---

## [\[SOLVED\] Stuck on Mountain Mercenaries](https://discourse.codecombat.com/t/solved-stuck-on-mountain-mercenaries/16041)

<div class="topic-metadata">

**Author:** [@Sharknado](https://discourse.codecombat.com/u/Sharknado)\
**Replies:** 7\
**Last updated:** [September 26, 2018, 3:18pm UTC](https://discourse.codecombat.com/t/solved-stuck-on-mountain-mercenaries/16041 "2018-09-26T15:18:27Z")

</div>

Can anyone help me with my code, it doesn’t work. while True: # Move to the nearest coin. # Use move instead of moveXY so you can command constantly. hero.say("I need coins!") if hero.gold \< hero.costOf(…

---

## [Clash of Clones Please](https://discourse.codecombat.com/t/clash-of-clones-please/16035)

<div class="topic-metadata">

**Author:** [@Sharknado](https://discourse.codecombat.com/u/Sharknado)\
**Replies:** 4\
**Last updated:** [September 26, 2018, 1:30am UTC](https://discourse.codecombat.com/t/clash-of-clones-please/16035 "2018-09-26T01:30:28Z")

</div>

Can anyone help I can’t pass this level I tried using low-level equipment but I keep on dying? Here is my code. while True: enemy = hero.findNearestEnemy() if hero.isReady("bash"): hero.bash(enemy)

---

## [\[SOLVED\] Ogre gauge gouger - totally stuck](https://discourse.codecombat.com/t/solved-ogre-gauge-gouger-totally-stuck/15966)

<div class="topic-metadata">

**Author:** [@mratranslate](https://discourse.codecombat.com/u/mratranslate)\
**Replies:** 6\
**Last updated:** [September 20, 2018, 2:56pm UTC](https://discourse.codecombat.com/t/solved-ogre-gauge-gouger-totally-stuck/15966 "2018-09-20T14:56:23Z")

</div>

while hero.time \< 20: coin = hero.findNearestItem() distance = hero.distanceTo(coin) if coin and distance \< 65: hero.move(coin.pos) if hero.gold \> 30: break # Collect coins …

---

## [My code for "Clash of Clones" in Python is being wonky and I don't know why](https://discourse.codecombat.com/t/my-code-for-clash-of-clones-in-python-is-being-wonky-and-i-dont-know-why/15678)

<div class="topic-metadata">

**Author:** [@BookFanatic](https://discourse.codecombat.com/u/BookFanatic)\
**Replies:** 39\
**Last updated:** [August 19, 2018, 2:50pm UTC](https://discourse.codecombat.com/t/my-code-for-clash-of-clones-in-python-is-being-wonky-and-i-dont-know-why/15678 "2018-08-19T14:50:58Z")

</div>

hero.moveXY(66, 90) hero.moveXY(82, 71) def defeatAllEnemies(): enemy = hero.findNearestEnemy() if enemy: if enemy and enemy.type == "anya": if hero.isReady("invisibility"): h…

---

## [Blue haze around some avatars](https://discourse.codecombat.com/t/blue-haze-around-some-avatars/14771)

<div class="topic-metadata">

**Author:** [@123hi123](https://discourse.codecombat.com/u/123hi123)\
**Replies:** 17\
**Last updated:** [May 26, 2018, 3:02pm UTC](https://discourse.codecombat.com/t/blue-haze-around-some-avatars/14771 "2018-05-26T15:02:24Z")

</div>

So whenever I am scrolling down the Latest section, sometimes I see a blue haze around some people’s avatars. What is this for?

---

## [\[SOLVED\] Passing Through](https://discourse.codecombat.com/t/solved-passing-through/15619)

<div class="topic-metadata">

**Author:** [@SwordandShield](https://discourse.codecombat.com/u/SwordandShield)\
**Replies:** 20\
**Last updated:** [August 16, 2018, 6:00pm UTC](https://discourse.codecombat.com/t/solved-passing-through/15619 "2018-08-16T18:00:37Z")

</div>

Hi guys! Too bad I’m still stuck on Passing Through. When it said #Else: I looked at the Programmaticon 2 else. But it says if hero is ready cleave. Can you guys help me please? Thank you all :heart:

---

## [Alchemic Power/pet doesn't fetch](https://discourse.codecombat.com/t/alchemic-power-pet-doesnt-fetch/15624)

<div class="topic-metadata">

**Author:** [@LordHandLee](https://discourse.codecombat.com/u/LordHandLee)\
**Replies:** 7\
**Last updated:** [August 16, 2018, 5:57pm UTC](https://discourse.codecombat.com/t/alchemic-power-pet-doesnt-fetch/15624 "2018-08-16T17:57:52Z")

</div>

The pet fetches and delivers the first potion but only fetches the second and does not deliver. I have tested this out on several browsers and got the same result on all. I play a warrior and have the best gear in the ga…

---

## [A Giant Problem](https://discourse.codecombat.com/t/a-giant-problem/15591)

<div class="topic-metadata">

**Author:** [@xantar](https://discourse.codecombat.com/u/xantar)\
**Replies:** 2\
**Last updated:** [August 15, 2018, 6:44pm UTC](https://discourse.codecombat.com/t/a-giant-problem/15591 "2018-08-15T18:44:32Z")

</div>

A problem: I made a code that summons burls, undeads and paladins and then sacrifice all of them then raise them from dead and a loop like that. The problem is my health reached so much that the site has crashed (Error: …

---

## [Cant load Return to the Thornbush Farm in backwoods forest](https://discourse.codecombat.com/t/cant-load-return-to-the-thornbush-farm-in-backwoods-forest/15061)

<div class="topic-metadata">

**Author:** [@chico114](https://discourse.codecombat.com/u/chico114)\
**Replies:** 26\
**Last updated:** [August 13, 2018, 6:57pm UTC](https://discourse.codecombat.com/t/cant-load-return-to-the-thornbush-farm-in-backwoods-forest/15061 "2018-08-13T18:57:06Z")

</div>

Im trying to play Retrn to the thornbush farm level in backwoods forest but everytime i click play to enter the level this appears I really want to progress but this is not allowing me to do so :frowning: Im using lua …

[Previous page](https://discourse.codecombat.com/c/solved/8.md)

[Next page](https://discourse.codecombat.com/c/solved/8.md?page=2)
