ID:2065477
 
(See the best response by Lummox JR.)
Problem description:
Is there a way to determine the number of frames in an animation?
This is useful for several reasons.
Best response
The number of frames is determined by how fast the client ticks, and how long the animation takes.

duration / world.tick_lag

This formula will be subject to change in the future when the client is capable of ticking at a higher rate than the server.
In response to Lummox JR
Makes sense. The issue is that unless I explicitly open a .dmi file and count the number of frames in that .dmi file's animation [x] I would not have an idea of setting timing for certain events.

I was asking more specifically if there is a way (at run-time) to determine the # of frames in a particular state of a .dmi file.
Oh, you're talking about icon animations, not animate() specifically. I see what you mean now.

At present, there isn't a runtime way to get the number of frames from an icon state. I have some code in mind for getting better icon info that I was considering for 510, but with the glut of new features I decided it was better to leave that for a future update.
Ah ok thanks. I'll just have to use the method you presented above.