# Help Needed! Alpine Rally (javaScript perfered but python okay)

**URL:** <https://discourse.codecombat.com/t/help-needed-alpine-rally-javascript-perfered-but-python-okay/25276>\
**Category:** Level Help\
**Created:** [November 7, 2020, 8:26pm UTC](https://discourse.codecombat.com/t/help-needed-alpine-rally-javascript-perfered-but-python-okay/25276 "2020-11-07T20:26:12Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![Press\_Start](https://sea2.discourse-cdn.com/flex016/user_avatar/discourse.codecombat.com/press_start/32/15695_2.png) [@Press\_Start](https://discourse.codecombat.com/u/Press_Start)\
**Post date:** [November 7, 2020, 8:26pm UTC](https://discourse.codecombat.com/t/help-needed-alpine-rally-javascript-perfered-but-python-okay/25276/1 "2020-11-07T20:26:12Z")

</div>

I just can’t seem to beat it. Can someone help me?:

```python
invis = -5
while True:
    if (hero.now() - invis > 4):
        if (hero.canCast('haste', self)):
            hero.cast('haste', self)
    if (hero.canCast('invisibility', self)):
        hero.cast('invisibility', self)
        invis = hero.now()
    # if(not(hero.hasEffect('invisibility')) and hero.canCast('earthskin', self)):
    # hero.cast('earthskin', self)
    direction = Vector(hero.pos.x + 30, hero.pos.y)
    enemy = hero.findNearest(hero.findByType('scout'))
    #if(hero.canCast('chain-lightning', enemy)): # hero.cast('chain-lightning', enemy)
    hero.move(direction)
    

```

---

<div class="post-metadata">

**Author:** ![brooksy125](https://sea2.discourse-cdn.com/flex016/user_avatar/discourse.codecombat.com/brooksy125/32/9966_2.png) [@brooksy125](https://discourse.codecombat.com/u/brooksy125)\
**Post date:** [November 7, 2020, 8:37pm UTC](https://discourse.codecombat.com/t/help-needed-alpine-rally-javascript-perfered-but-python-okay/25276/2 "2020-11-07T20:37:49Z")

</div>

The big key for this level in in the Hints. Pender has a special ability that will help you out a lot on this level that they want you to use.

I noticed that your code is in Python and not JavaScript, curious why you prefer JavaScript when your code is currently in Python.

As a last note to help us help you, please include an explanation of how your code is not working like an error message, or how it is not completing the level so we can quickly diagnose the challenges we can help with.

---

<div class="post-metadata">

**Author:** ![xython](https://sea2.discourse-cdn.com/flex016/user_avatar/discourse.codecombat.com/xython/32/7269_2.png) [@xython](https://discourse.codecombat.com/u/xython)\
**Post date:** [November 7, 2020, 8:48pm UTC](https://discourse.codecombat.com/t/help-needed-alpine-rally-javascript-perfered-but-python-okay/25276/3 "2020-11-07T20:48:57Z")

</div>

![image](https://us1.discourse-cdn.com/flex016/uploads/codecombat/original/3X/5/d/5d74e18c48f5f5d2eacf5748f2986c2aeee3f5e4.png)  
 ![image](https://us1.discourse-cdn.com/flex016/uploads/codecombat/original/3X/f/5/f57a68aeb0746ece626a5575e96fc53b7487b4cd.png)  
The big key for every level is to write the code yourself…

---

<div class="post-metadata">

**Author:** ![Press\_Start](https://sea2.discourse-cdn.com/flex016/user_avatar/discourse.codecombat.com/press_start/32/15695_2.png) [@Press\_Start](https://discourse.codecombat.com/u/Press_Start)\
**Post date:** [November 13, 2020, 3:23pm UTC](https://discourse.codecombat.com/t/help-needed-alpine-rally-javascript-perfered-but-python-okay/25276/5 "2020-11-13T15:23:24Z")

</div>

It is fully functional but It still won’t work, also brooksy125, did you acually hack into my acount?

---

<div class="post-metadata">

**Author:** ![Press\_Start](https://sea2.discourse-cdn.com/flex016/user_avatar/discourse.codecombat.com/press_start/32/15695_2.png) [@Press\_Start](https://discourse.codecombat.com/u/Press_Start)\
**Post date:** [November 13, 2020, 3:26pm UTC](https://discourse.codecombat.com/t/help-needed-alpine-rally-javascript-perfered-but-python-okay/25276/6 "2020-11-13T15:26:49Z")

</div>

FYI, have the:

- wolf Pup

- boots of leaping

- vine staff

- elemental codex II

- emperor’s gloves

- Embroidered griffin wool robe

- embroidered griffin wool hat

- glit wristwatch

- leather belt

- boss star III

- Programmaticon v

- the precious

- twilight glasses

- fire opal sense stone

- Ring of Earth

- advanced flags  
Is there any thing I need to change to beat the level?

---

<div class="post-metadata">

**Author:** ![milton.jinich](https://sea2.discourse-cdn.com/flex016/user_avatar/discourse.codecombat.com/milton.jinich/32/21419_2.png) [@milton.jinich](https://discourse.codecombat.com/u/milton.jinich)\
**Post date:** [November 13, 2020, 3:48pm UTC](https://discourse.codecombat.com/t/help-needed-alpine-rally-javascript-perfered-but-python-okay/25276/7 "2020-11-13T15:48:30Z")

</div>

I think you are all good to go

---

<div class="post-metadata">

**Author:** ![Lydia\_Song](https://sea2.discourse-cdn.com/flex016/user_avatar/discourse.codecombat.com/lydia_song/32/31461_2.png) [@Lydia\_Song](https://discourse.codecombat.com/u/Lydia_Song)\
**Post date:** [November 13, 2020, 3:57pm UTC](https://discourse.codecombat.com/t/help-needed-alpine-rally-javascript-perfered-but-python-okay/25276/8 "2020-11-13T15:57:12Z")

</div>

Brooksy didn’t “hack”, you can tell Python by their indents, and Javascript by their brackets

> [@Press\_Start](#):
>
> It is fully functional but It still won’t work

It is functional for other people but might not be functional for you. I really suggest you write your own code, because it is a better bet to write the code yourself so you can see what went wrong and learn in the process. If you just copy and paste from other people, you won’t be able to learn anything.  
Thanks,  
Lydia
