# Shine Getter Help (2)

**URL:** <https://discourse.codecombat.com/t/shine-getter-help-2/15974>\
**Category:** Level Help\
**Created:** [September 19, 2018, 7:08pm UTC](https://discourse.codecombat.com/t/shine-getter-help-2/15974 "2018-09-19T19:08:41Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![Sharknado](https://sea2.discourse-cdn.com/flex016/user_avatar/discourse.codecombat.com/sharknado/32/9124_2.png) [@Sharknado](https://discourse.codecombat.com/u/Sharknado)\
**Post date:** [September 19, 2018, 7:08pm UTC](https://discourse.codecombat.com/t/shine-getter-help-2/15974/1 "2018-09-19T19:08:41Z")

</div>

Can someone help me with my code, please?

```python
# To grab the most gold quickly, just go after gold coins.

while True:
    coins = hero.findItems()
    coinIndex = 0
    
    # Wrap this into a loop that iterates over all coins.
    while coinIndex < len(coins):
        
        # Gold coins are worth 3.
        if coins.value == 3:
            # Only pick up gold coins.
            hero.moveXY(coins.pos.x, coins.pos.y)
        coinIndex += 1
    pass
        

```

hero won’t move

---

<div class="post-metadata">

**Author:** ![MunkeyShynes](https://sea2.discourse-cdn.com/flex016/user_avatar/discourse.codecombat.com/munkeyshynes/32/9277_2.png) [@MunkeyShynes](https://discourse.codecombat.com/u/MunkeyShynes)\
**Post date:** [September 19, 2018, 7:25pm UTC](https://discourse.codecombat.com/t/shine-getter-help-2/15974/2 "2018-09-19T19:25:26Z")

</div>

coins is defined as an array, not a single item, so there is no single position to move to. You have to define coin and then move to the coin.pos.

---

<div class="post-metadata">

**Author:** ![Sharknado](https://sea2.discourse-cdn.com/flex016/user_avatar/discourse.codecombat.com/sharknado/32/9124_2.png) [@Sharknado](https://discourse.codecombat.com/u/Sharknado)\
**Post date:** [September 19, 2018, 7:26pm UTC](https://discourse.codecombat.com/t/shine-getter-help-2/15974/3 "2018-09-19T19:26:58Z")

</div>

Can you show me how to do that?

---

<div class="post-metadata">

**Author:** ![MunkeyShynes](https://sea2.discourse-cdn.com/flex016/user_avatar/discourse.codecombat.com/munkeyshynes/32/9277_2.png) [@MunkeyShynes](https://discourse.codecombat.com/u/MunkeyShynes)\
**Post date:** [September 19, 2018, 7:27pm UTC](https://discourse.codecombat.com/t/shine-getter-help-2/15974/4 "2018-09-19T19:27:56Z")

</div>

coin = coins[coinIndex]

Remember this chunk of code. You’re going to be seeing this format a LOT.

---

<div class="post-metadata">

**Author:** ![Sharknado](https://sea2.discourse-cdn.com/flex016/user_avatar/discourse.codecombat.com/sharknado/32/9124_2.png) [@Sharknado](https://discourse.codecombat.com/u/Sharknado)\
**Post date:** [September 19, 2018, 7:29pm UTC](https://discourse.codecombat.com/t/shine-getter-help-2/15974/5 "2018-09-19T19:29:05Z")

</div>

Like this

```python
while True:
    coins = hero.findItems()
    coinIndex = 0
    
    # Wrap this into a loop that iterates over all coins.
    while coinIndex < len(coins):
        coin = coins[coinIndex]
        # Gold coins are worth 3.
        if coins.value == 3:
            # Only pick up gold coins.
            hero.moveXY(coins.pos.x, coins.pos.y)
        coinIndex += 1
    pass

```

---

<div class="post-metadata">

**Author:** ![MunkeyShynes](https://sea2.discourse-cdn.com/flex016/user_avatar/discourse.codecombat.com/munkeyshynes/32/9277_2.png) [@MunkeyShynes](https://discourse.codecombat.com/u/MunkeyShynes)\
**Post date:** [September 19, 2018, 7:29pm UTC](https://discourse.codecombat.com/t/shine-getter-help-2/15974/6 "2018-09-19T19:29:47Z")

</div>

you still didn’t change the places where you refer to coins instead of coin.

---

<div class="post-metadata">

**Author:** ![Sharknado](https://sea2.discourse-cdn.com/flex016/user_avatar/discourse.codecombat.com/sharknado/32/9124_2.png) [@Sharknado](https://discourse.codecombat.com/u/Sharknado)\
**Post date:** [September 19, 2018, 7:30pm UTC](https://discourse.codecombat.com/t/shine-getter-help-2/15974/7 "2018-09-19T19:30:57Z")

</div>

like this

```python
while True:
    coins = hero.findItems()
    coinIndex = 0
    
    # Wrap this into a loop that iterates over all coins.
    while coinIndex < len(coins):
        coin = coins[coinIndex]
        # Gold coins are worth 3.
        if coins.value == 3:
            # Only pick up gold coins.
            hero.moveXY(coin.pos.x, coin.pos.y)
        coinIndex += 1
    pass

```

---

<div class="post-metadata">

**Author:** ![Sharknado](https://sea2.discourse-cdn.com/flex016/user_avatar/discourse.codecombat.com/sharknado/32/9124_2.png) [@Sharknado](https://discourse.codecombat.com/u/Sharknado)\
**Post date:** [September 19, 2018, 7:33pm UTC](https://discourse.codecombat.com/t/shine-getter-help-2/15974/8 "2018-09-19T19:33:26Z")

</div>

I figured it out now

---

<div class="post-metadata">

**Author:** ![Ultec3265](https://avatars.discourse-cdn.com/v4/letter/u/dfb087/32.png) [@Ultec3265](https://discourse.codecombat.com/u/Ultec3265)\
**Post date:** [April 14, 2019, 10:25pm UTC](https://discourse.codecombat.com/t/shine-getter-help-2/15974/9 "2019-04-14T22:25:09Z")

</div>

Mod edit: Please do not post for assistance in multiple locations for the same issue. You will not receive assistance faster with multiple posts.

---

<div class="post-metadata">

**Author:** ![cheunton](https://sea2.discourse-cdn.com/flex016/user_avatar/discourse.codecombat.com/cheunton/32/9939_2.png) [@cheunton](https://discourse.codecombat.com/u/cheunton)\
**Post date:** [May 21, 2019, 2:24pm UTC](https://discourse.codecombat.com/t/shine-getter-help-2/15974/10 "2019-05-21T14:24:18Z")

</div>

can someone help me with this code:

while True:  
coins = hero.findItems()  
coinIndex = 0

```
# Wrap this into a loop that iterates over all coins.
while coinIndex < len(coins):
    coin = coins[coinIndex]
    # Gold coins are worth 3.
    if coins.value == 3:
        # Only pick up gold coins.
        hero.moveXY(coin.pos.x, coin.pos.y)
    coinIndex += 1
pass
```

---

<div class="post-metadata">

**Author:** ![cheunton](https://sea2.discourse-cdn.com/flex016/user_avatar/discourse.codecombat.com/cheunton/32/9939_2.png) [@cheunton](https://discourse.codecombat.com/u/cheunton)\
**Post date:** [May 21, 2019, 2:27pm UTC](https://discourse.codecombat.com/t/shine-getter-help-2/15974/11 "2019-05-21T14:27:27Z")

</div>

my hero will not move

---

<div class="post-metadata">

**Author:** ![MunkeyShynes](https://sea2.discourse-cdn.com/flex016/user_avatar/discourse.codecombat.com/munkeyshynes/32/9277_2.png) [@MunkeyShynes](https://discourse.codecombat.com/u/MunkeyShynes)\
**Post date:** [May 21, 2019, 2:56pm UTC](https://discourse.codecombat.com/t/shine-getter-help-2/15974/12 "2019-05-21T14:56:25Z")

</div>

You define the variable, coin, but don’t use it. Coins is plural. Coins cannot have a value equal to 3 because coins is an array. Look closely at what you’ve written. 😉

---

<div class="post-metadata">

**Author:** ![G4NG](https://avatars.discourse-cdn.com/v4/letter/g/6f9a4e/32.png) [@G4NG](https://discourse.codecombat.com/u/G4NG)\
**Post date:** [May 11, 2020, 9:08am UTC](https://discourse.codecombat.com/t/shine-getter-help-2/15974/13 "2020-05-11T09:08:54Z")

</div>

can you show me how did it work for you cuz i still can’t find the place for coin = coins[coinIndex]

---

<div class="post-metadata">

**Author:** ![AnSeDra](https://sea2.discourse-cdn.com/flex016/user_avatar/discourse.codecombat.com/ansedra/32/13123_2.png) [@AnSeDra](https://discourse.codecombat.com/u/AnSeDra)\
**Post date:** [May 11, 2020, 9:59am UTC](https://discourse.codecombat.com/t/shine-getter-help-2/15974/14 "2020-05-11T09:59:02Z")

</div>

Hi @G4NG and welcome to the forum. Can you show us your code?

---

<div class="post-metadata">

**Author:** ![G4NG](https://avatars.discourse-cdn.com/v4/letter/g/6f9a4e/32.png) [@G4NG](https://discourse.codecombat.com/u/G4NG)\
**Post date:** [May 11, 2020, 5:10pm UTC](https://discourse.codecombat.com/t/shine-getter-help-2/15974/15 "2020-05-11T17:10:31Z")

</div>

i solved it but i need help with another code  
well i have problem with wishing well  
ill write my code here and if you can resend me with corrected errors

---

<div class="post-metadata">

**Author:** ![AnSeDra](https://sea2.discourse-cdn.com/flex016/user_avatar/discourse.codecombat.com/ansedra/32/13123_2.png) [@AnSeDra](https://discourse.codecombat.com/u/AnSeDra)\
**Post date:** [May 11, 2020, 5:54pm UTC](https://discourse.codecombat.com/t/shine-getter-help-2/15974/16 "2020-05-11T17:54:38Z")

</div>

You could create another topic for that

---

<div class="post-metadata">

**Author:** ![G4NG](https://avatars.discourse-cdn.com/v4/letter/g/6f9a4e/32.png) [@G4NG](https://discourse.codecombat.com/u/G4NG)\
**Post date:** [May 11, 2020, 6:15pm UTC](https://discourse.codecombat.com/t/shine-getter-help-2/15974/17 "2020-05-11T18:15:48Z")

</div>

I solved thanks anyways.Im at the last level in desert clash of clones.Do you have the solution for it?

---

<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:** [May 11, 2020, 6:18pm UTC](https://discourse.codecombat.com/t/shine-getter-help-2/15974/18 "2020-05-11T18:18:48Z")

</div>

Sorry, but we don’t give solutions…we provide guidance and hints to help you with your code.

As AnseDra mentioned, please start a new topic to get help with a different level.

---

<div class="post-metadata">

**Author:** ![G4NG](https://avatars.discourse-cdn.com/v4/letter/g/6f9a4e/32.png) [@G4NG](https://discourse.codecombat.com/u/G4NG)\
**Post date:** [May 11, 2020, 6:35pm UTC](https://discourse.codecombat.com/t/shine-getter-help-2/15974/19 "2020-05-11T18:35:38Z")

</div>

Ok i thought you are giving solutions.But anyways your forum helped me a lot BIG THANKS!!!

---

<div class="post-metadata">

**Author:** ![AnSeDra](https://sea2.discourse-cdn.com/flex016/user_avatar/discourse.codecombat.com/ansedra/32/13123_2.png) [@AnSeDra](https://discourse.codecombat.com/u/AnSeDra)\
**Post date:** [May 11, 2020, 6:37pm UTC](https://discourse.codecombat.com/t/shine-getter-help-2/15974/20 "2020-05-11T18:37:51Z")

</div>

You should try to find your own tactic to beat the level and, if you have any troubles, ask us on the forum.

[Next page](https://discourse.codecombat.com/t/shine-getter-help-2/15974.md?page=2)
