nxpert
Members
-
Joined
-
Last visited
Reputation Activity
-
nxpert reacted to reapler in How to find what hostile player is casting@nxpert if you mean the first method then probably yes. The second with 'LuaEventsId.UNIT_SPELLCAST_SENT' & the example should work(args will be received).
-
nxpert reacted to reapler in How to find what hostile player is castingHello, for this behavior you need to subscribe lua events with arguments(wManager.Wow.Helpers.EventsLuaWithArgs.OnEventsLuaWithArgs).
But i belive the event 'COMBAT_LOG_EVENT_UNFILTERED' is also not working yet for 2.4.3(https://wrobot.eu/forums/topic/5519-register-combat_log-with-args/).
If it works you could add a c# code to your fightclass. It could look like this:
//example private void EventsLuaWithArgsOnOnEventsLuaWithArgs(LuaEventsId id, List<string> args) { if (id == LuaEventsId.COMBAT_LOG_EVENT_UNFILTERED && args[8] == ObjectManager.Me.Name) { if (args[2] == "Polymorph") { Logging.Write("Someone is casting Polymorph on me"); ///... } } }
Otherwise you can use 'UNIT_SPELLCAST_SENT' which should work as intend:
if (wManager.Statistics.RunningTimeInSec() < 2) { robotManager.Helpful.Logging.Write("Register OnEventsLuaWithArgs"); wManager.Wow.Helpers.EventsLuaWithArgs.OnEventsLuaWithArgs += delegate(wManager.Wow.Enums.LuaEventsId id, System.Collections.Generic.List<string> args) { if (id == wManager.Wow.Enums.LuaEventsId.UNIT_SPELLCAST_SENT && args[3] == wManager.Wow.ObjectManager.ObjectManager.Me.Name) { if (args[1] == "Polymorph" || args[1] == "Fear") { robotManager.Helpful.Logging.Write("Someone casts " + args[1] + " on me"); wManager.Wow.Helpers.SpellManager.CastSpellByNameOn("Blessing of Sacrifice", "party1"); //you could add here a task in case if you are on global cooldown to cast it later } } }; System.Threading.Thread.Sleep(2000); }
and here's an example how you can implement the c# code into your fightclass: BoS example.xml
-
nxpert reacted to BetterSister in Run Macro with C#I'll make detailed vid on how to setup microsoft visual studio in couple hours
-
nxpert reacted to Droidz in Run Macro with C#Hello, to run lua macro use this c# code:
wManager.Wow.Helpers.Lua.RunMacroText("/cast SpelName"); And to fix your problem with intellisense add in project references "wManager.dll" and "robotManager.dll".
-
nxpert reacted to BetterSister in Run Macro with C#Once again... I had more important things to do and forgot about this Sorry
-
nxpert reacted to dirtyjobs in New update broke botI enjoyed the support in here today
-
nxpert reacted to dirtyjobs in New update broke botyou the man!
-
nxpert reacted to Droidz in New update broke botHello, sorry, problem resolved.
-
nxpert got a reaction from dirtyjobs in New update broke botThanks a lot, pal. A+ support. 8/8.
-
nxpert got a reaction from dirtyjobs in New update broke botIt's 'updating' to the TBC version.
-
nxpert got a reaction from dirtyjobs in New update broke botUpdated as prompted, now stuck with "Game version incorrect" and infinite update loop.