What's new
  • Visit Rebornbuddy
  • Visit Panda Profiles
  • Visit LLamamMagic
  • Visit Resources
  • Visit Downloads
  • Visit Portal

Lua Functions

bmertler

Member
Joined
Jul 15, 2010
Messages
248
Reaction score
1
What I'm looking to do is run some protected Lua Code, and since HB uses Lua, Im looking for someone to maybe explain how to do this basically its a very long macro that is used through Protected Lua. Im not sure whether this is possible, or if it can even be done. I asked Tony and he said post it so please don't troll me.
 
Lua.DoString("yourluahere"); should do the job. If you were wondering on proper ways to implement this in a plugin, don't ask me xD.
If you merely want to fire and forget, the easiest way without custom plugins would probably be to execute the above C# code as a custom function in Professionbuddy. At least that's the way I usually test protected lua.
If you'd like to see some examples of this, look at my PB script, I'm making excessive use of this method to create better and faster vendor / bank functions.
 
Well Really what i need is a plugin that does the following,

1. Runs a Lua Command like so,,
PHP:
/run if GetSpellCooldown("Kick")==0 and IsSpellInRange("Kick","target") and (UnitCastingInfo("target") or UnitChannelInfo("target")) then CastSpellByName("Kick") end
/run vSnD=0 b={UnitBuff("player", "Slice and Dice")}; if b[7]~=nil then vSnD=b[7]-GetTime() end;
/run if (UnitAffectingCombat("player") or IsStealthed()==1) and UnitExists("focus") and GetSpellCooldown("Tricks of the Trade")==0 and IsSpellInRange("Tricks of the Trade","focus") then RunMacroText("/cast [@focus] Tricks of the Trade") end
/run if IsStealthed()==1 and UnitPower("player")>= 55 then CastSpellByName("Mutilate") end
/run local c=CastSpellByName; local p=UnitPower("player"); if vSnD==0 then if GetComboPoints("player")>0 then if p>=25 then c("Slice and Dice") end else if p>=55 then c("Mutilate") end end end
/run local c=CastSpellByName; local p=UnitPower("player"); if vSnD<4 then if GetComboPoints("player")>0 then if p>=35 then c("Envenom") end else if p>=55 then c("Mutilate") end end end
/run if vSnD>=4 and not UnitBuff("player","Overkill") and GetSpellCooldown("Vanish")==0 and not UnitBuff("player", "Stealth") and UnitHealth("target")>1000000 then CastSpellByName("Vanish") end
/run if vSnD>=4 and GetComboPoints("player")<4 and UnitPower("player")>=55 and (UnitHealth("Target")/UnitHealthMax("Target")>0.35) then CastSpellByName("Mutilate") end
/run if vSnD>=4 and GetComboPoints("player")<4 and UnitPower("player")>=60 and (UnitHealth("Target")/UnitHealthMax("Target")<=0.35) then CastSpellByName("Backstab") end
/run local c=CastSpellByName; local p=UnitPower("player"); local cp=GetComboPoints("player"); if vSnD>=4 and cp>=4 and p>=35 then local dp=0; local i=1; while(i<=40)do local d={UnitDebuff("target",i)}; if d[1]=="Deadly Poison" and d[8]=="player" then dp=d[4] break end i=i+1 end; if dp>=4 then if cp==5 and dp==5 and GetSpellCooldown("Cold Blood")==0 then c("Cold Blood") end c("Envenom") elseif p>=85 then c("Mutilate") end end


/run StaticPopup_Hide("MACRO_ACTION_FORBIDDEN");
2. Checks for End of cast,

3. Recasts it.


// Just wanted to add this code was taken from "http://www.mmowned.com/forums/world-of-warcraft/general/ui-macros-talent-specs/314227-protected-lua-assassination-rogue-macro.html" i did not make it. //
 
Last edited by a moderator:
You don't need a plugin or any other runlua mechanic to do this. This is a combat behavior and it belongs in a Custom Class. All the necessary condition checks and spell casts can and SHOULD be done using Styx.Combat logic
 
The problem is this is a backend macro, not a CC based code, I understand it does the work of a CC but no1 is gonna wanna convert it to a CC. Because it would be a raid PVE CC only.
 
Back
Top