Need help with dismount macro

Hey guys,
I’m trying to make a macro that lets me dismount and charge only when i’m in range.

/cast charge
just dismounts me if i’m out of range. looked online and couldn’t find anything.
any help would be great! :smiley:


that addon has auto dismount and a ton of other quality of life stuff I must have.