Then you shoould be more specific in your question...

Create a key/value in HKCU to store the count and then pseudo-coding:

if PST> $max and ReadValue($key,$value)='3'
LogOff()
endif
_________________________
Give a man a fish and he will be back for more. Slap him with a fish and he will go away forever.