You'll need to download the SuperMacro addon to create complex macros. The default client macros have a character limit of 256 and you can only have 18(?)-ish macros. SuperMacro allows you to create unlimited macros with no character limit as well as custom functions through SM_Extend.lua.