[SOLVED] Ogre gauge gouger - totally stuck


#1
while hero.time < 20:
    coin = hero.findNearestItem()
    distance = hero.distanceTo(coin)
    if coin and distance < 65:
        hero.move(coin.pos)
    if hero.gold > 30:
        break
    # Collect coins
    
    


    # Retreat behind the fence
self.move({"x": 16, "y": 35})
hero.buildXY("fence", 17, 35) 

Really struggling on this level. Trying to write some code just to complete it but can’t get past an object/string error on line 18 of my code (fence part)? Help!


#2

You’re very close, all you need to do is change move to moveXY at the end when it tells you to retreat, It’s because when move isn’t looped it tends to only go a a tiny bit and then it stops.

Your coordinates won’t work, or at least they didn’t for me, but just play around with different coordinates and you’ll get it. :grin:


#3
while hero.time < 20:
    coin = hero.findNearestItem()
    distance = hero.distanceTo(coin)
    if coin and distance < 65:
        hero.move(coin.pos)
    if hero.gold > 30:
        break
    # Collect coins
    
    


    # Retreat behind the fence
self.moveXY(26, 35)
hero.buildXY("fence", 21, 37)
self.moveXY(15, 37)

Took your advice but it still fails on the build fence code line for some reason with an object/string error…


#4

Your code is working fine, however as Deadpool198 says, your coordinates do not work. I did not receive any errors so this may be an equipment issue. Please post a screen shot of your equipment.

`


#5

Changed co-ordinates many times now but still won’t work :frowning: Screenshot attached. Have tried with Anya and Nalfar both with hammer.


#6

The error message is correct and telling you what’s wrong. You’re using the wrong hammer. The hammer you’re using does not have the ability to build a fence.


#7

Sorry my fault - such an obvious error. I had forgotten the two different hammers!