Usual day Python [Solved]

Here is my code:

Can you actually put your code in the topic and not make a screenshot.

What armor do you have?


while True:
    enemy = hero.findNearestEnemy()
    if enemy and enemy.type == "munchkin":
        hero.attack(enemy)
    item = hero.findNearestItem()
    if item and item.type == "coin":
        x = item.pos.x
        y = item.pos.y
        hero.moveXY(x, y)


Here is my armor @enPoint77

1 Like

Are you not supposed to do hero.MoveXY (item.pos.x, item.pos.y)? I’d say it would make it much easier.

What is the problem?

The problem is I need to only use 8 lines of code

Never mind. I can’t find your problem. When I use your link, I have to write out the code, and I have no armor.

No it does attack and move

image

Have you tried this idea yet?

Yes I have but I does the same thing and I just need to make it less then 8 lines or 8 lines

This is just one line. Your code has three lines that does the same thing.

You don’t need the X and Y variables.

Did it work for you then?

Yes it did thx so much

1 Like

Thxs to u I only have 29 levels left till desert

1 Like

and she still casually has charge belt lol