Movement macro?

I have played around with a few different macros, but none of them seem to do what I want.

Does anyone have a druid macro that automatically (upon pushing it)

will shift you to swim form when swimming
shift you to cat form if indoors
shift you to travel form if you are outdoors and in combat
will all your mount (land, only, now I guess) if you are outdoors and out of combat?

I used to have one in Mop that was very nice.

I know this post is over two years old but it seems like the best place to put this macro. I can’t remember where I found this macro so kudos to whoever wrote it. This will do all forms of travelling. If inside will be cat form, outside, depending if you can fly or not or in the water will choose the appropriate travel form. In this example, if you’re a Moonkin then when pressed again will change to Moonkin form. If you want to default back to bear just replace Moonkin with Bear.

The only caveat is to go into travel form, you must be moving.

#showtooltip
/run if GetUnitSpeed("player")>0 then ChangeActionBarPage(2) end
/use [mounted][form:2][form:3]Moonkin Form;[indoors,noswimming]Cat Form;[swimming][outdoors,combat][actionbar:2]Travel Form;Running Wild
/changeactionbar 1