The script class is a very important part of the game. It is used in every room to perform animation and handle events.
Sets the client property to theClient. If the other parameters are specified, it sets the caller property to theCaller, and the register property to
theRegister. Finally, it calls the changeState method with the start property as it's parameter.
If the script property is not NULL, it calls the doit method of it. Next, if cycles property is not zero, it decrements it. If after decrementing, it
is equal to zero, it calls the cue() method.
If the cycles property was zero to begin with, and the seconds property is not equal to zero, it compares the actual seconds to the lastSeconds property. If they are not
equal, it sets lastSeconds to the current seconds (from GetTime(gtTIME_OF_DAY)) and decrements the seconds property. If the seconds property is equal to zero, it calss the
Disposes of the script object and all of it's elements.
Sets the state property to the newState.
Calls the changeState() method with (state + 1) as it's parameter. Then, if specified, sends the sendParams to the object.
If the script property is not null, it calls the script's handleEvent() method with pEvent has it's parameter. It then returns whether of not the pEvent
object has been claimed.
If the script property is not NULL, it disposes of the object pointed to by it. It then calls scriptObj's init() method, and if specified, send the
rest of the parameters to scriptObj.