Basically what is happening is I used some of the code from the other articles but when I try to run the code, they never seem to work. Here is my current code in case anyone is wondering:
# Put flags where you want to build traps.
# When you're not building traps, pick up coins!
while True:
flag = hero.findFlag()
if flag:
# How do we get flagX and flagY from the flag's pos?
# (Look below at how to get x and y from items.)
fx = flag.pos.x
fy = flag.pos.y
hero.buildXY("fire-trap", fx, fy)
hero.pickUpFlag(flag)
else:
item = hero.findNearestItem()
if item:
itemPos = item.pos
itemX = itemPos.x
itemY = itemPos.y
hero.moveXY(itemX, itemY)
Anyway, his is confusing me a lot, and also this is my first time on CodeCombat in a few months so I am pretty rusty anyway.