Auto aspect hunter?

now I have seen a post in WotLK hunter, where he has a Lua script to see if mana is .25 if so then it will cast aspect of viper and if above it will use hawk/dragonhawk… is this even possible this is the first time that I have seen such a thing in a gse macro, I know it doesn’t work but I assumed it was bad translation as the macro is Chinese see edit.

Edit:
to clarify this is the snippet

function()
for i=1,40 do local n=UnitBuff(“player”,i)
if n==“Aspect of the Dragonhawk” or n==“Aspect of the Hawk” then
return true
elseif n==“Aspect of the Viper” and UnitPower(“player”)/ UnitPowerMax(“player”)<0.3 then
return true
end
end
return false
end