You mean you need to play on every 18th frame? You can compare (sprite.AnimationFrame%18=0) then.
It will be true on frames 0, 18, 36 etc.
Another simple method is to put the list of all frames into a string:
find(";1;18;35;99;205;991;", ";"&sprite.AnimationFrame&";")>=0