Don't Rush Be Quiet help


#1

I don’t understand. To me the code makes perfect sense.

def mod30(n):
 if n >= 30:
    return n - 30
 else:
    return n

def mod40(n):
# Use an if-statement to return the correct value.
  item = hero.findNearestItem()
hero.moveXY(item.pos.x, item.pos.y)
hero.shield()
hero.shield()

return n
while True:
 item = hero.findNearestItem()
items = hero.findItems()

time = hero.now()
x = mod30(time) + 25
y = mod40(time) + 10
hero.moveXY(item.pos.x, item.pos.y)



#2

Are you sure all your indentations are correct? :wink:


#3

Yes, what about this.

def mod30(n):
if n >= 30:
    return n - 30
else:
    return n

def mod40(n):
# Use an if-statement to return the correct value.
item = hero.findNearestItem()
hero.moveXY(item.pos.x, item.pos.y)
hero.shield()
hero.shield()

return n
while True:
item = hero.findNearestItem()
items = hero.findItems()

time = hero.now()
x = mod30(time) + 25
y = mod40(time) + 10
hero.moveXY(item.pos.x, item.pos.y)



#4

Did you put anything in the mod40(n) function? It looks empty to me. :slight_smile: