You can create an instance variable for your character/AI and call it something like, OldX and OldY.
Every tick (record this value);
Set OldX to Sprite.X
Set OldY to Sprite.Y
but BEFORE that event, in your list of events...
Every tick (compare the value before it changes with event shown above)
Compare value Sprite.X to OldX -> is not equal, do stuff
Compare value Sprite.Y to OldY -> is not equal, do stuff
So ultimately you'd have something like:
Every tick
--Compare value Sprite.X to OldX -> is not equal, do stuff
--Compare value Sprite.Y to OldY -> is not equal, do stuff
-----Set OldX to Sprite.X
-----Set OldY to Sprite.Y
Hopefully that will do the trick!
~Sol