hi. i don’t know what’s wrong with my code please help me out.
here’s my code:
encodedMessage = hero.findNearest(hero.findFriends()).message
passwordArray = []
passwordLength = 5
words = encodedMessage.split(";")
# &&&&&&&&&&&&&&&&&&&&&
index = 0
while index < words.len:
word = words[index]
n = word.trim()
if n.len == 5:
passwordArray.append(n)
index = index + 1
# &&&&&&&&&&&&&&&&&&&&&&&
marksPos = [{"x": 12, "y": 14}, {"x": 38, "y": 38},
{"x": 42, "y": 16}, {"x": 54, "y": 12}];
for i in range(4):
pos = marksPos[i]
hero.moveXY(pos.x, pos.y)
password = passwordArray[i]
if password:
hero.say(password)
else:
hero.say("qwerty")