# How do i fix this error? Kelvintaph Burgler\[SOLVED\]

**URL:** <https://discourse.codecombat.com/t/how-do-i-fix-this-error-kelvintaph-burgler-solved/31246>\
**Category:** Level Help\
**Created:** [November 9, 2021, 11:24pm UTC](https://discourse.codecombat.com/t/how-do-i-fix-this-error-kelvintaph-burgler-solved/31246 "2021-11-09T23:24:00Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![Haris](https://avatars.discourse-cdn.com/v4/letter/h/ccd318/32.png) [@Haris](https://discourse.codecombat.com/u/Haris)\
**Post date:** [November 9, 2021, 11:24pm UTC](https://discourse.codecombat.com/t/how-do-i-fix-this-error-kelvintaph-burgler-solved/31246/1 "2021-11-09T23:24:00Z")

</div>

```python
coors1 = [0, 0]
coors2 = [0, 0]

def lowestHealthFriend():
    lowestHealth = 99999
    lowestFriend = None
    friends = self.findFriends()
    for friend in friends:
        if friend.health < lowestHealth and friend.health < friend.maxHealth:
            lowestHealth = friend.health
            lowestFriend = friend

    return lowestFriend

def moveTo(position, fast = True):
    if(self.isReady("jump") and fast):
        self.jumpTo(position)
    else:
        self.move(position)
summonTypes = ['griffin-rider']
def summonTroops():
    type = summonTypes[len(self.built)%len(summonTypes)]
    if self.gold > self.costOf(type):
        self.summon(type)

def commandGriff(enemy):
    griffs = hero.findByType("griffin-rider")
    for griff in griffs:
        if enemy and griff:
            hero.command(griff, "attack", enemy)
        elif griff:
            +hero.command(griff, "move", {'x': 78, 'y': 40})

def commandTroops():
    for index, friend in enumerate(self.findNearest(hero.findFriend())):
        if chieftain and friend.type != 'paladin':
            continue
        if witch and friend.type != 'paladin':
            continue
        if chieftain and chieftain.pos.x<57 and chieftain.pos.x>43:
             self.command(friend, "move", {'x':25, 'y':48})
        elif not chieftain and friend.pos.x<40:
             self.command(friend, "move", {'x':51, 'y':51})
        elif friend.type == 'paladin':
            CommandPaladin(friend)
        elif friend.type == 'soldier':
            if friend.pos.y>30:
                CommandSoldier(friend)
            else:
                KillRobots(friend)
        else:
            CommandArcher(friend)

def CommandPaladin(paladin):
    if(paladin.canCast("heal") and not chieftain):
        target = lowestHealthFriend()
        if target:
            self.command(paladin, "cast", "heal", target)
    elif(paladin.health<100):
        self.command(paladin, "shield")
    else:
        if witch:
            self.command(paladin, "attack", witch)
        elif(chieftain):
            self.command(paladin, "attack", chieftain)
        else:
            self.command(paladin, "move", {'x':78, 'y':40})

def CommandSoldier(soldier):
    if witch:
        self.command(soldier, "attack", witch)
    else:
        self.command(soldier, "move", {'x':78, 'y':40})

def CommandArcher(soldier):
    if witch:
        self.command(soldier, "attack", witch)
    else:
        self.command(soldier, "move", {'x':78, 'y':40})

def KillRobots(soldier):
    robot = self.findNearest(self.findEnemies())
    if robot:
        self.command(soldier, "attack", robot)

def RunFrom():
    missiles = self.findEnemyMissiles()
    missle = self.findNearest(missiles)
    if len(missiles)>0:
        coors1[0] = missle.pos.x
        coors1[1] = missle.pos.y
        y = findTheY(coors1[0], coors2[0], coors1[1], coors2[1], self.pos.x)
        if y >15:
            moveTo({'x':self.pos.x, 'y':10}, False)
        else:
            moveTo({'x':self.pos.x, 'y':20}, False)
        coors2[0] = coors1[0]
        coors2[1] = coors1[1]

            
def findTheY(x1, x2, y1, y2, x):
    if(y2!=y1):
        y = (x - x1)/(x2 - x1)*(y2 - y1) + y1
    else:
        y = y1
    return y

def findTheMiddle(pos1, pos2):
    return {'x':(pos1.x+pos2.x)/2,'y':(pos1.y+pos2.y)/2}

while True:
    #CHill
    witch = self.findNearest(self.findByType('witch'))
    chieftain = self.findNearest(self.findByType('chieftain'))
    
    
    if witch or chieftain:
        RunFrom()
    summonTroops()
    commandGriff(hero.findByType("robot-walker"))
    commandTroops()

```

UAdd error help

---

<div class="post-metadata">

**Author:** ![Rabbit](https://sea2.discourse-cdn.com/flex016/user_avatar/discourse.codecombat.com/rabbit/32/25831_2.png) [@Rabbit](https://discourse.codecombat.com/u/Rabbit)\
**Post date:** [November 10, 2021, 4:33am UTC](https://discourse.codecombat.com/t/how-do-i-fix-this-error-kelvintaph-burgler-solved/31246/2 "2021-11-10T04:33:57Z")

</div>

What is the error @haris?

---

<div class="post-metadata">

**Author:** ![Haris](https://avatars.discourse-cdn.com/v4/letter/h/ccd318/32.png) [@Haris](https://discourse.codecombat.com/u/Haris)\
**Post date:** [November 11, 2021, 4:33am UTC](https://discourse.codecombat.com/t/how-do-i-fix-this-error-kelvintaph-burgler-solved/31246/3 "2021-11-11T04:33:52Z")

</div>

`Unknown unary operator` error please help @Rabbit

---

<div class="post-metadata">

**Author:** ![CryptiCrystal](https://sea2.discourse-cdn.com/flex016/user_avatar/discourse.codecombat.com/crypticrystal/32/16228_2.png) [@CryptiCrystal](https://discourse.codecombat.com/u/CryptiCrystal)\
**Post date:** [November 12, 2021, 9:13pm UTC](https://discourse.codecombat.com/t/how-do-i-fix-this-error-kelvintaph-burgler-solved/31246/5 "2021-11-12T21:13:44Z")

</div>

> [@Haris](#):
>
> ```python
> def commandGriff(enemy):
> griffs = hero.findByType("griffin-rider")
> for griff in griffs:
> if enemy and griff:
> hero.command(griff, "attack", enemy)
> elif griff:
> +hero.command(griff, "move", {'x': 78, 'y': 40})
> 
> ```

Pretty sure the error is here. There shouldn’t be a plus sign before `hero.command(griff, "move", {'x': 78, 'y': 40})`

---

<div class="post-metadata">

**Author:** ![Haris](https://avatars.discourse-cdn.com/v4/letter/h/ccd318/32.png) [@Haris](https://discourse.codecombat.com/u/Haris)\
**Post date:** [November 13, 2021, 9:43am UTC](https://discourse.codecombat.com/t/how-do-i-fix-this-error-kelvintaph-burgler-solved/31246/6 "2021-11-13T09:43:09Z")

</div>

fix that typo but please help i get one more error. 🙏

```python
ArgumentError: Target a unit

```

nvm i fix that error but i get one more problem

---

<div class="post-metadata">

**Author:** ![Haris](https://avatars.discourse-cdn.com/v4/letter/h/ccd318/32.png) [@Haris](https://discourse.codecombat.com/u/Haris)\
**Post date:** [November 13, 2021, 9:45am UTC](https://discourse.codecombat.com/t/how-do-i-fix-this-error-kelvintaph-burgler-solved/31246/7 "2021-11-13T09:45:40Z")

</div>

```python
# What eldritch artifacts are these? Don't let them blast you!
# The ice gate will open when both ogres are defeated.
summonTypes = ['griffin-rider']

def summon():
    type = summonTypes[len(self.built)%len(summonTypes)]
    if self.gold > self.costOf(type):
        self.summon(type)

def commandGriff():
    griffs = hero.findByType("griffin-rider")
    enemy = hero.findNearest(hero.findByType("robot-walker"))
    for griff in griffs:
        if enemy and griff:
            hero.command(griff, "attack", enemy)
            hero.command(griff, "move", enemy.pos)
        

coors1 = [0, 0]
coors2 = [0, 0]

def RunFrom():
    missiles = self.findEnemyMissiles()
    missle = self.findNearest(missiles)
    if len(missiles)>0:
        coors1[0] = missle.pos.x
        coors1[1] = missle.pos.y
        y = findTheY(coors1[0], coors2[0], coors1[1], coors2[1], self.pos.x)
        if y >15:
            moveTo({'x':self.pos.x, 'y':10}, False)
        else:
            moveTo({'x':self.pos.x, 'y':20}, False)
        coors2[0] = coors1[0]
        coors2[1] = coors1[1]

def findTheY(x1, x2, y1, y2, x):
    if(y2!=y1):
        y = (x - x1)/(x2 - x1)*(y2 - y1) + y1

def moveTo(position, fast = True):
    if(self.isReady("jump") and fast):
        self.jumpTo(position)
    else:
        self.move(position)
        

while True:
    paladins = hero.findByType("paladin")
    friends = hero.findFriends()
    enemies = hero.findEnemies()
    flag = hero.findFlag("green")
    if flag:
        hero.pickUpFlag(flag)
    for friend in friends:
        if friend:
            hero.command(friend, "move", {'x': 40, 'y': 62})
        elif enemy.health < 0:
            hero.command(friend, "move",{'x': 78, 'y': 40})
        RunFrom()
        summon()
        commandGriff()
        witch = hero.findNearest(hero.findByType("witch"))
        chieftain = hero.findNearest(hero.findByType("chieftain"))
        for paladin in paladins:
            if witch:
                hero.command(paladin, "attack", witch)
            if chieftain:
                hero.command(friend, "attack", chieftain)

```

u may try the code to know the problem.

---

<div class="post-metadata">

**Author:** ![Haris](https://avatars.discourse-cdn.com/v4/letter/h/ccd318/32.png) [@Haris](https://discourse.codecombat.com/u/Haris)\
**Post date:** [November 15, 2021, 3:34am UTC](https://discourse.codecombat.com/t/how-do-i-fix-this-error-kelvintaph-burgler-solved/31246/9 "2021-11-15T03:34:26Z")

</div>

can u help fix this pls @riticmaster908 or somone else

---

<div class="post-metadata">

**Author:** ![riticmaster908](https://sea2.discourse-cdn.com/flex016/user_avatar/discourse.codecombat.com/riticmaster908/32/43503_2.png) [@riticmaster908](https://discourse.codecombat.com/u/riticmaster908)\
**Post date:** [November 15, 2021, 4:22am UTC](https://discourse.codecombat.com/t/how-do-i-fix-this-error-kelvintaph-burgler-solved/31246/10 "2021-11-15T04:22:09Z")

</div>

what error is it?  
is it that the robot walker is not dying?

---

<div class="post-metadata">

**Author:** ![Haris](https://avatars.discourse-cdn.com/v4/letter/h/ccd318/32.png) [@Haris](https://discourse.codecombat.com/u/Haris)\
**Post date:** [November 15, 2021, 4:23am UTC](https://discourse.codecombat.com/t/how-do-i-fix-this-error-kelvintaph-burgler-solved/31246/11 "2021-11-15T04:23:15Z")

</div>

i already fix this error but help me defeating chieftain and witch pls my friend kept dying

---

<div class="post-metadata">

**Author:** ![riticmaster908](https://sea2.discourse-cdn.com/flex016/user_avatar/discourse.codecombat.com/riticmaster908/32/43503_2.png) [@riticmaster908](https://discourse.codecombat.com/u/riticmaster908)\
**Post date:** [November 15, 2021, 4:24am UTC](https://discourse.codecombat.com/t/how-do-i-fix-this-error-kelvintaph-burgler-solved/31246/12 "2021-11-15T04:24:04Z")

</div>

try chain lightning and command paladin to shield + heal its self

---

<div class="post-metadata">

**Author:** ![Haris](https://avatars.discourse-cdn.com/v4/letter/h/ccd318/32.png) [@Haris](https://discourse.codecombat.com/u/Haris)\
**Post date:** [November 15, 2021, 4:24am UTC](https://discourse.codecombat.com/t/how-do-i-fix-this-error-kelvintaph-burgler-solved/31246/13 "2021-11-15T04:24:34Z")

</div>

ok wait i try that 20 chars

---

<div class="post-metadata">

**Author:** ![riticmaster908](https://sea2.discourse-cdn.com/flex016/user_avatar/discourse.codecombat.com/riticmaster908/32/43503_2.png) [@riticmaster908](https://discourse.codecombat.com/u/riticmaster908)\
**Post date:** [November 15, 2021, 4:25am UTC](https://discourse.codecombat.com/t/how-do-i-fix-this-error-kelvintaph-burgler-solved/31246/14 "2021-11-15T04:25:51Z")

</div>

and command your soldiers to atatck cheftitan along with archers as chain lightning will kill witch

---

<div class="post-metadata">

**Author:** ![Haris](https://avatars.discourse-cdn.com/v4/letter/h/ccd318/32.png) [@Haris](https://discourse.codecombat.com/u/Haris)\
**Post date:** [November 15, 2021, 4:28am UTC](https://discourse.codecombat.com/t/how-do-i-fix-this-error-kelvintaph-burgler-solved/31246/15 "2021-11-15T04:28:56Z")

</div>

archer keep attacking ice yak  
already did `if enemy.type == "chieftain":`

---

<div class="post-metadata">

**Author:** ![riticmaster908](https://sea2.discourse-cdn.com/flex016/user_avatar/discourse.codecombat.com/riticmaster908/32/43503_2.png) [@riticmaster908](https://discourse.codecombat.com/u/riticmaster908)\
**Post date:** [November 15, 2021, 4:33am UTC](https://discourse.codecombat.com/t/how-do-i-fix-this-error-kelvintaph-burgler-solved/31246/18 "2021-11-15T04:33:39Z")

</div>

dont post junk please

---

<div class="post-metadata">

**Author:** ![riticmaster908](https://sea2.discourse-cdn.com/flex016/user_avatar/discourse.codecombat.com/riticmaster908/32/43503_2.png) [@riticmaster908](https://discourse.codecombat.com/u/riticmaster908)\
**Post date:** [November 15, 2021, 4:34am UTC](https://discourse.codecombat.com/t/how-do-i-fix-this-error-kelvintaph-burgler-solved/31246/19 "2021-11-15T04:34:04Z")

</div>

try doing,

```python
if enemy.type!="ice-yak":
    #attack

```

---

<div class="post-metadata">

**Author:** ![riticmaster908](https://sea2.discourse-cdn.com/flex016/user_avatar/discourse.codecombat.com/riticmaster908/32/43503_2.png) [@riticmaster908](https://discourse.codecombat.com/u/riticmaster908)\
**Post date:** [November 15, 2021, 4:36am UTC](https://discourse.codecombat.com/t/how-do-i-fix-this-error-kelvintaph-burgler-solved/31246/21 "2021-11-15T04:36:19Z")

</div>

I have flagged that post because it is rude and it is spam  
please try to be more nice and avoid spaming.

---

<div class="post-metadata">

**Author:** ![Haris](https://avatars.discourse-cdn.com/v4/letter/h/ccd318/32.png) [@Haris](https://discourse.codecombat.com/u/Haris)\
**Post date:** [November 15, 2021, 4:39am UTC](https://discourse.codecombat.com/t/how-do-i-fix-this-error-kelvintaph-burgler-solved/31246/22 "2021-11-15T04:39:10Z")

</div>

maybe i try to lure the enemy to the ice yak  
bc the big ice yak keep attack the archer

---

<div class="post-metadata">

**Author:** ![riticmaster908](https://sea2.discourse-cdn.com/flex016/user_avatar/discourse.codecombat.com/riticmaster908/32/43503_2.png) [@riticmaster908](https://discourse.codecombat.com/u/riticmaster908)\
**Post date:** [November 15, 2021, 4:39am UTC](https://discourse.codecombat.com/t/how-do-i-fix-this-error-kelvintaph-burgler-solved/31246/23 "2021-11-15T04:39:59Z")

</div>

@ammar_adam I am just trying to warn you so you do not get a suspension/ban in any way please do not think that I hate you.

---

<div class="post-metadata">

**Author:** ![Haris](https://avatars.discourse-cdn.com/v4/letter/h/ccd318/32.png) [@Haris](https://discourse.codecombat.com/u/Haris)\
**Post date:** [November 15, 2021, 4:47am UTC](https://discourse.codecombat.com/t/how-do-i-fix-this-error-kelvintaph-burgler-solved/31246/24 "2021-11-15T04:47:41Z")

</div>

Omg nice it working so wel i send screen shot i succeskilling the chieftain and witch but run out of time…

---

<div class="post-metadata">

**Author:** ![Haris](https://avatars.discourse-cdn.com/v4/letter/h/ccd318/32.png) [@Haris](https://discourse.codecombat.com/u/Haris)\
**Post date:** [November 15, 2021, 4:51am UTC](https://discourse.codecombat.com/t/how-do-i-fix-this-error-kelvintaph-burgler-solved/31246/25 "2021-11-15T04:51:12Z")

</div>

![SUSUUCUSUUSSCESSSS](https://us1.discourse-cdn.com/flex016/uploads/codecombat/original/3X/b/f/bfc82e800706859f22729fbc25e191421ad58c88.png)

[Next page](https://discourse.codecombat.com/t/how-do-i-fix-this-error-kelvintaph-burgler-solved/31246.md?page=2)
