hi i’ve been trying this code for a while, but i don’t know what’s wrong. here’s the code:
def findFriendByName(name):
friends = hero.findFriends()
for i in range(len(friends)):
if friends[i].id == name:
return friends[i]
return None
sergeant = hero.findNearest(hero.findFriends())
wereList = sergeant.wereList
wereNames = wereList.split(",")
for h in wereNames:
wereyeti = wereNames.trim
findFriendByName(wereyeti)
hero.command(h, "move", {"":48, "":47})
thanks for your help
@AnSeDra, could you help me on this level please?
Ok. I will try to help you debug your code.
Here put
hero.command(h, "move", {"x":48, "y":47})
Here put
h=findFriendByName(wereyeti)
Here put
wereName
Instead of wereNames put wereName.
Does it work now?
it says that inside the move argument there should be a unit in the unit argument, but it’s null. why?
Can you reshow me your code?
there aren’t any errors but the hero doesn’t do anything. here’s the code:
def findFriendByName(name):
friends = hero.findFriends()
for i in range(len(friends)):
if friends[i].id == name:
return friends[i]
return None
sergeant = hero.findNearest(hero.findFriends())
wereList = sergeant.wereList
wereNames = wereList.split(",")
for wereName in wereNames:
wereyeti = wereName.trim
h = findFriendByName(wereyeti)
if h:
hero.command(h, "move", {"x":48, "y":47})
Can you send me a link to the level?
Thanks.(20 chars) I will look at my code to refresh my mind with the level.
yes it does. thanks @AnSeDra! 
No problem! Glad I could help you! And congratulations for completing the level! 