Play Home Contribute Github Join Us! Discourse Staff Members Github Contribution Guides Team

Useful Competitors Lua problem


I have tried to fix this code many times but it ends up not working. Please look over this code and help me adjust it as needed. Thanks! :grinning:

            while True do
            local enemy = hero:findNearestEnemy()
            local item = hero:findNearestItem()
               if not (enemy.type is "peon") then end
               if not (item.type is "poison") then end

Please give more information about what is happening when you run your code, if it is informing you about any errors, and etc. A screenshot would help…


sorry that i haven’t replied in a while. I have not been on discourse in a while. Ill get a screen shot now.

1 Like

@Ring I believe you need to use hero:moveXY(item.pos.x, item.pos.y), because you do not have the required boots to use the method “move”


I do. my boots have “Move” as an option. also i think im done with code combat for a bit…