Hi guys so I was just playing the level Forest Miners and I not sure if this is a bug or not but when my hero say Clear after that an ogre spawn and started to attack me and my peasant.
Just in case here is my code
# Check if the mines are safe for the workers.
def checkEnemyOrSafe(target):
# If target (the parameter) exists:
if target:
# Then attack target.
hero.attack(target)
# Otherwise:
else:
# Use say() to call the peasants.
hero.say("Clear!!!!!")
pass
while True:
# Move to, and check the top right X mark.
hero.moveXY(64, 54)
enemy = hero.findNearestEnemy()
checkEnemyOrSafe(enemy)
# Move to the bottom left X mark.
hero.moveXY(16, 14)
# Save the result of findNearestEnemy() in a variable.
enemy = hero.findNearestEnemy()
# Call checkEnemyOrSafe(), and pass the
# result of findNearestEnemy as the argument.
checkEnemyOrSafe(enemy)
Maybe just a timing issue? Try experimenting with different types of boots. Different boots have different speeds and can get you there faster (or slower in the case of the Defensive Boots) depending on what you want. If you are a subscriber, try testing with different classes of heroes (warrior, ranger, wizard).
Iāve try several version of code and some copy-paste (like the one of Minh), always same result, the same as Minh.
Check if the mines are safe for the workers.
def checkEnemyOrSafe(target):
if target:
hero.attack(target)
else:
hero.say(āQuick !ā)
pass
while True:
# Move to, and check the top right X mark.
hero.moveXY(64, 54)
enemy1 = hero.findNearestEnemy()
checkEnemyOrSafe(enemy1)
# Move to the bottom left X mark.
hero.moveXY(16, 14)
# Save the result of findNearestEnemy() in a variable.
enemy2 = hero.findNearestEnemy();
# Call checkEnemyOrSafe, and pass the
# result of findNearestEnemy as the argument.
checkEnemyOrSafe(enemy2)
Please format your code according to the FAQ by using ctrl + shift + c so it is easier to read
argh this is a subscription level. Canāt help you on this one ask Chaboi_3000 or one of the subscribed helpers for help instead.
@thebluemeanie Welcome to the forum. If you have future questions make sure you visit previous topics about the āproblem levelā. Almost any level can be solved only by reading the right topic with almost no
programming knowledge - itās like solving a puzzle
The answer is given in Hellenarās post:āTry experimenting with different types of bootsā¦with different classes of heroesā You can succeed with the most basic equipment: