If your on a certian Frame # or label

How do a write a function that does the following:

If current frame = “framelabel” then () {

  do this

}

You get the idea, I know that’s nowhere close.