How to determine which event is firing off a script

SUGGESTED

I am looking for the code to determine the event that fired off a script.  Are there any methods to check to see if the event is post-read, pre-write, post write, pre delete, or post delete?