Script:
# Sprite ids can be found here: https://mindee-bot.com/forum/index.php/topic,1834.0.html
sprite_id = 2600 # 2600 = portal
def onReachedTileLocation(spriteId, location, inline):
script.StatusMessage('Reached: ' + str(location) + ' id: ' + str(spriteId))
script.Say('Hello world!')
script.ForgetLocation() # Call this when ready to move away.
def onChangeLocation(x, y, z):
if not script.HasTarget():
pos = script.FindSprite(sprite_id) # portal sprite
if pos != None: # Found sprite
script.StatusMessage('Found tile at: ' + str(pos))
success = script.GoToTile(pos, sprite_id, False)
if success: # Error checking is optional
script.StatusMessage('Going to: ' + str(pos))
else:
script.StatusMessage('Error going to: ' + str(pos))