I usually split this up in several tasks (you can use the macros again in another macro - like a collection of premade Macros).
Save all the macros and put a (ranged) attack to your Slot0.
Just start the "afk" macro and have fun
You'll run into problems with a full inventory. The solution is to use a G15 Keyboard or a tool such as "Ghostmouse". Put the Inventory Window to a fixed place on your screen (make it so that the window won't scroll). Now just simulate a rightclick at position of your last inventory slot. Then simulate the destroy click and so on....
Hop you'll enjoy it.
Macro: loot
/target corpse;
/loot all;
Macro Attack:
/target self;
/ui action cycleTargetOutward;
/pause 0.5;
/ui action toolbarSlot00;
/pause 1;
/ui action toolbarSlot00;
Macro: afk (this starts the others)
/m attack;
/pause 1;
/m loot;
/pause 1;
/m afk;