Idk if there is function like that or you are just suggesting, but you can use hotkey like this:
With this hotkey the tibia client will be closed if you are standing for more than 30 seconds in 1 sqm, but there need to be at least 1 player on your screen and your character have to be under 50% of his full hp.
if standtime > 30*1000 and paround(6) >= 1 and hppc < 50 then
Well, ppl might get it, so you can change that your char have to stay 1 second, or just if you are under 50% hp and player on screen.
if paround(6) >= 1 and hppc < 50 then