# Follow me on youtube channel Phy Tu
# Help with programming on Python, school math, physics
# https://www.youtube.com/channel/UCP5ycahCEZ24qmRRgNnko5Q
# Don’t let ogres step into the grove.
def onSpawn():
while True:
scout = pet.findNearestByType("scout")
if scout and pet.isReady("charm"):
pet.charm(scout)
# Assign the event handler to the pet's "spawn" event.
pet.on("spawn",onSpawn)
# Fight!
while True:
enemy=hero.findNearestEnemy()
if enemy:
hero.attack(enemy)