# Serpent Savings

this is (edit: not!) my code

``````x = 10
direct = []
direct = Vector(10, 0)
while True:
friend = hero.findNearest(hero.findFriends())
friends = hero.findFriends()
tails = hero.findEnemies()
coins = hero.findItems()
for friend in friends:
if Math.floor(friend.pos.x > 10) and Math.floor(friend.pos.x) < 70:
if Math.floor(friend.pos.y > 10) and Math.floor(friend.pos.y) < 55:
if Math.floor(friend.pos.x) % 7 == 0:
if Math.floor(friend.pos.x) % 2 == 0:
direct = Vector(0, 10)
else:
direct = Vector(0, -10)
else:
direct = Vector(10, 0)
else:
if (friend.pos.y <= 10):
direct = Vector(10, 2)
else:
direct = Vector(10, -2)
direct = Vector(0, 0)
else:
if Math.floor(friend.pos.x < 60):
move = {'x': 75, 'y': 60}
elif(Math.floor(friend.pos.y > 10)):
move = {'x': 75, 'y': 10}
else:
move = {'x': 10, 'y': 10}
hero.command(friend, 'move', move)

``````

Can you send me the link to the level?

Mumbo_6

1 Like

Oh, sorry, im not a subscriber…

1 Like

oh… its ok(20char)

Ah, I see you are not using your own code… This level is super duper difficult, if you can’t do it now, then you may have to come back to it later when you’re more experienced with coding. Or try and write your own code in a new topic and I’ll help you. I’ll close this one.
Also please stick on one topic, I see you made another post somewhere else.
Danny

1 Like

someone pleaseee help me this is my code

``````def onSpawn(event):
global coors
while True:
if friend:
if friend.distanceTo(Vector(coors, coors))<40:
pet.moveXY(coorsn, coorsn)
else:
pet.moveXY(coors, coors)
pet.moveXY(friend.pos.x, friend.pos.y)

coors =  [60, 60]
coorsn = [60, 60]
friends = hero.findFriends()
friend = friends
pet.on("spawn", onSpawn)
path = [
[70, 57],#right top
#[72, 45],
#[14, 45],
#[14, 21],
#[70, 21],
[70, 11],#right bottom
[7, 8],#left bottom
[7, 57]#left Top
]
index = 0
while True:
friends = hero.findFriends()
friend = friends
coors = path[index%len(path)]
coorsn = path[(index+1)%len(path)]
item = friend.findNearestItem()
if item and friend.distanceTo(item.pos)<10:
moveto = item.pos
else:
moveto = Vector(coors, coors)
enemies = friend.findEnemies()
for enemy in enemies:
if friend.distanceTo(enemy) < 5:
vectorToH = Vector.subtract(friend.pos, enemy.pos)
vectorToH = Vector.normalize(vectorToH)
vectorToH = Vector.multiply(vectorToH, 5)
hero.command(friend, "move", moveto)
if friend.distanceTo(Vector(coors, coors))<5:
index+=1
if hero.canCast('haste', friend):
hero.cast('haste', friend)
``````

someone please help me We help everybody here 5 Likes

I’m not saying we can’t help them, I’m saying that I won’t help someone make some code they’ve stolen work. What’s the point of that? I do have limits to my willingness to help, which I think I have proved so far by helping people on the forum for quite a while.

6 Likes

There is some Android bug. I do not share Chaboy opinion and did not give him a like

2 Likes