From: Ziggy Puff
I decided to write my own AO for my project

Drat, I wish I would have read this sooner. I had a working prototype earlier today until I ripped it apart after talking to Fran. *cry* *cry* It was fun, but I feel my attention span growing weaker and weaker.

Since the current FO is public source and my script is too mangled at the moment to post, I will pass on my discoveries:
The more I tried to break away from the way Fran and Kex did some things, the more I came back to some of them. Part of it can't be helped. There are just so many ways to process a list, check for certain bad animation states, flip though a set of animations, etc. And other parts were, just nice.
The multiple stand lines in the FO animation notecard can be combined into the same line.
You can combine the parts of the the animation script that randomly plays an animation and that cycles through the various stand animations into same code. This way you could set it up to randomly start playing an animation and then slowly cycle through the others if you are in the stand animation state. Or you could add another list comprised of floats for each animation state. This way you can have different timers for each state with 0 being don't cycle through the other animations.
You can almost get down to really just having to use three global variables: an override animation list and two integers for animation state index and animation set index. (I am not counting a couple of integers used for permission states.) And all your functions use the indexes to determine which animations that it should stop and start. I was thinking of maybe adding a string back for animation state to speed up a particular check. The only downside to this method is that you are doing a little more processing to derive your final animation set from an index. I set my animation device to check every .2 seconds and I couldn't notice.
You may want to drop the swimming functionality. Currently, it looks like you are swimming at flying speed underwater. Meh. I was going to strip it out till I could do something that is closer to the quality of Siggy's swim bracelet. That might take a while (to say the least), but I don't think many would miss it. Compared to all the time you spend in SL, how much time do you spend in the water?
Move all configuration fuctionality to its own script which sends commands to the animation script via link messages. This way you can be more verbose on dialog menus and not hit the memory limit so quickly. (I was hitting this limit with my previous script. I wanted to do a lot more with the menus than what I was doing.) Even the reading of the notecard could be handled by the configuration script. As it reads each line, it sends it to the animation script. However, I am nervous about the possible character length limitation of the link message though. Also I did not get a chance to test it with the command system enabled. For example, what would happen if an animation called "Off" was loaded via linked message?
Add in new animation states. I think when I told Fran about this, she must have thought I was nuts. I added a "Lying", "Model" and "Dance" animation states. The animation script only get to these states from a command from the configuration script via a dialog menu. It also sets the timer length to zero as we want to stay in this animation state until we explicitly exit out of it (by resetting the event timer to its default value). This way you can (appear to) lay on a surface without needing a poseball, flip through various pose animations without needing a pose stand and well... dance. The dance portion would be pretty much a solo dance device as it would kept simple.
You can free up quite a bit of memory. It was nice seeing the message "10k memory free" after loading a full set of animations for a while. Now, after all the checks are loaded back in with the new features...