I’m on the Grim Determination level in Cloudrip, and I’m trying to write a code that has my peasants collecting separate gold coins. There are some great scripts on rather complex methodologies for this, but I’m trying to do something simple (and in Python; if only those threads would’ve been in Python…). Unfortunately, it’s not working. The peasants just stand there.
Sample code:
# In the function commandPeasants():
def commandPeasant(psnt):
if switch == 0:
if gc1:
hero.command(psnt, "move", {"x": gc1.pos.x, "y": gc1.pos.y})
switch = 1
else:
pass
elif switch == 1:
if gc2:
hero.command(psnt, "move", {"x": gc2.pos.x, "y": gc2.pos.y})
switch = 0
else:
pass
else:
pass
# Now, in the loop where those variables get defined:
while True:
coins = hero.findItems()
gCoins = []
switch = 0
for c in coins:
if c.value >= 3:
gCoins.append(c)
if gCoins[0]:
gc1 = gCoins[0]
if gCoins[1]:
gc2 = gCoins[1]
commandFriends()
Any help is greatly appreciated. (While I’m at it, can anyone tell me if there’s a simpler way to feed coordinated through command
? I get errors if I use simple XY
parentheses, or anything like gc1.pos
.)