I don’t know whats wrong exactly with my code. Everything seems to work perfectly. But the game say that I didn’t meet the conditions. I can’t summon paladin or artillery yet but it is supposed to be a bonus.
sign = hero.findByType("sign")[0]
message = sign.message
liste = []
data = ""
# Separate each actions to make and put it in a list
for i in range(len(message)):
if (i + 1) % 5 == 0:
data += message[i]
liste.append(data)
data = ""
else:
data += message[i]
for i in range(len(liste)):
x = str(liste[i][1]) + str(liste[i][2])
x = int(x)
y = str(liste[i][3]) + str(liste[i][4])
y = int(y)
if liste[i][0] == "a":
hero.summon("archer")
elif liste[i][0] == "s":
hero.summon("soldier")
elif liste[i][0] == "p":
hero.summon("peasant")
elif liste[i][0] == "g":
hero.summon("griffin-rider")
elif liste[i][0] == "P":
pass # can't summon yet
elif liste[i][0] == "A":
pass # can't summon yet
units = hero.built
currentunit = units[-1]
if currentunit:
hero.command(currentunit, "move", {"x":x , "y": y})