Hi all, i need two simple actions, can anybody help me?

1: logout if moved

2: logout if someone kill my training monster

Thanks all !!!