Hi there!
As you might know, blizzard locked the /target totem functionality to prevent macro like this. (you can use /petattack [@mouseover, harm][] but it needs you to mouseover the totems)
But i'm pretty sure there's an ugly way to bypass this.
My idea is to make a loop that will target every enemy and will compare the target name with "totem" or something like that.
So it will be something like :
Code:
/script (or /run i really don't see what's the difference here) for i=1,40 do targetenemy;
if strcmp (@target,"grounding totem") then /petattack target; else i =1; end
Yep, the syntax isn't right but that's for the example.
So everything i need is something to do a Strcmp.
Is there a strcmp function ? Could someone make a simple strcmp using the macro functions ?
Thanks for helping, and if you have any other idea on how to do this, i'm ready to hear you all 
Edit :
Maybe with LUA functions ?
This : strfind(string, pattern[, initpos[, plain]]) - Look for match of pattern in string, optionally from specific location or using plain substring.
Let's say we target something, strfind(targetname,"totem") and then compare the result of strfind (don't know what it returns), if it's a bool (0 = got something 1 nothing) then 0 => petattack 1 => search again.
I really don't know if i can use LUA functions in a macro but worst case, i can make an addon that will do the trick.
Can you tell me a little bit more about strfind and lua functions ?
Edit 2 :
> = string.find("Hello Lua user", "Lua")
7 9
> = string.find("Hello Lua user", "banana")
nil
From WoWWiki. This is awesome, i can compare targetname with "totem", if nil then it's not a totem, if != nil then it's a totem. So this should work. Someone want to help me make an addon (or a macro if i can use strfind in a macro) for this ? I don't know how to make addons
Will edit if i suceed.
Edit 3 :
Bah i can use string.find in a macro but i can't get my macro to target anything within /script :/