You should declare a sync rate. Also, you should number your sprites starting at 1. This should work for you:
Sync On : sync rate 60
Backdrop On : Color Backdrop 0
Hide Mouse
Set Image Colorkey 255, 255, 255
Create Animated Sprite 1, "Samusanim.bmp", 18, 3, 1
Sprite 1, 250, 250,1
disable escapekey
ink rgb(255,255,0),0
repeat
text 10,10,"sprite frame(1) = " + str$(sprite frame(1))
play sprite 1,1,54,50
Sync
until keystate(1) = 1
enable escapekey
delete sprite 1
show mouse
end
This code displays the number of the current frame of animation. It also disables the ESC key, but checks for it manually, so that you can delete your media before exiting.