@Minh I'm not up to Cloudrip at all (still in the desert), but looking over your code, I'm a bit stuck on this part:
hero.buildTypes = ["decoy", "arrow-tower"]
buildType = buildTypes[len(hero.built) % len(buildTypes)]
if hero.gold >= buildType:
(some problems with the formatting there...)
I'm assuming that you took @user1's edit, and that's what took out the error message.
This should mean that you have a list with two strings, decoy and arrow-tower. You then make a new variable,
buildType, which should be the modulo (
%) of the length of some function called
hero.built and the length of buildTypes. What is
hero.built? I'm assuming it's a built-in function that shows what the hero has built already, but I don't know it. Perhaps this is part of the problem?
Also, the line
buildType = buildTypes[len(hero.built) % len(buildTypes)] is, essentially supposed to be yielding the value of the object you want to build (I think), since that's what you're comparing to
hero.gold in the next line (the last one I quoted). I'm not figuring out how it should be doing that, though, perhaps because I'm a total newbie, though perhaps part of the problem is there; if you're code isn't returning the right number there, I would assume the hero won't be building at the right times.
Hope something in here helps.