ImperialOfficer Sarven Brawl hack

Hi everyone,
I recently saw Imperial Officer had reached number 1 on the all time difficulty list of Sarven Brawl. I was confused because he was using Alejandro, which seems impossible, but I wouldn’t have reported it without any evidence. So I looked on the “difficulty latest” page (this was a few days ago so his solution was still on it) and watched it and found that he was using the crude builders hammer.
This was his code:

# Stay alive for two minutes.
# If you win, it gets harder (and more rewarding).
# If you lose, you must wait a day before you can resubmit.
# Remember, each submission gets a new random seed
hero.buildXY("fence", hero.pos.x, hero.pos.y + 2)
hero.buildXY("fence", hero.pos.x + 2, hero.pos.y)
hero.buildXY("fence", hero.pos.x-2, hero.pos.y)
hero.buildXY("fence", hero.pos.x, hero.pos.y - 2)
hero.buildXY("fence", hero.pos.x-2, hero.pos.y - 2)
hero.buildXY("fence", hero.pos.x+2, hero.pos.y - 2)
hero.buildXY("fence", hero.pos.x-2, hero.pos.y + 2)
hero.buildXY("fence", hero.pos.x+2, hero.pos.y + 2)
while True:
    enemy = hero.findNearestEnemy()
    if enemy and hero.distanceTo(enemy) <= 2:
        hero.bash(enemy)
    hero.shield()
    

hammers are restricted on this level, so he must have hacked it.
I don’t want to be annoying and a grass, but if everyone did that then the whole leaderboard would be filled with people using hammers.
@Maka, could you fix this when you have time. Thanks
:lion: :lion: :lion:

@Bryukh has helped with this type of thing before.

Thanks for telling me.
:lion:

I’ve reported it. We’re in the middle of Hour of Code, so it’s unlikely to be fixed this week.
Maka

Ok, thanks. There’s no rush.
:lion: :lion: :lion:

I’ve been searching the repo source code for some ideas. Then, I got an idea to fix this type of glitch/bug, by adding a new function to force the user to go to the inventory when using the direct link(and removing the option to press the X button in that case). Then the user can’t quit out and use the hammer or any other “should-be” restricted items. Of course I expect this will take the coders some time, but I think this can be a solution to this.

3 Likes