Pasterke 98 Posted June 9, 2013 Share Posted June 9, 2013 Any way to interrupt spells ? something like : if (SpellManager.KnownSpell(MightyBash) && (Me.CurrentTarget.IsCasting && Me.CanInterruptCurrentSpellCast)) { do something; } Link to comment https://wrobot.eu/forums/topic/501-interrupts/ Share on other sites More sharing options...
Droidz 2738 Posted June 10, 2013 Share Posted June 10, 2013 Hello, sample code (fightclass in c#, save this file in *.cs):using System; using System.Threading; using System.Windows.Forms; using robotManager.Helpful; using wManager.Wow.Class; using wManager.Wow.Helpers; using wManager.Wow.ObjectManager; public class Main : ICustomClass { public float Range { get { return 4.5f; } } // Fight Range private bool _isLaunched; private const string FightClassName = "Interrupts"; #region ListSpells private Spell _mightyBash; #endregion ListSpells public void Initialize() { Logging.Write("Loading FightClass: " + FightClassName); // Init spells: _mightyBash = new Spell("Mighty Bash"); Logging.Write("FightClass Loaded: " + FightClassName); // Launch loop in new thread: _isLaunched = true; var threadLoop = new Thread(Loop); threadLoop.Start(); Logging.Write("FightClass Launched: " + FightClassName); } private void Loop() { while (_isLaunched) { try { if (Fight.InFight && ObjectManager.Target.IsValid) { // Spell Mighty Bash: if (ObjectManager.Target.IsCast && _mightyBash.IsSpellUsable && _mightyBash.IsDistanceGood) { var resultLua = Lua.LuaDoString( "ret = \"false\"; spell, rank, displayName, icon, startTime, endTime, isTradeSkill, castID, interrupt = UnitCastingInfo(\"target\"); if interrupt then ret = \"true\" end", "ret"); if (resultLua == "true") { _mightyBash.Launch(); } } } } catch (Exception e) { Logging.Write("Error in FightClass " + FightClassName + ": " + e); } Thread.Sleep(35); // Wait for UC usage } } public void Dispose() { _isLaunched = false; Logging.Write("FightClass Disposed: " + FightClassName); } public void ShowConfiguration() { MessageBox.Show("No setting for this Fight Class: " + FightClassName); } } Link to comment https://wrobot.eu/forums/topic/501-interrupts/#findComment-3250 Share on other sites More sharing options...
Pasterke 98 Posted June 11, 2013 Author Share Posted June 11, 2013 Thx alot :) Link to comment https://wrobot.eu/forums/topic/501-interrupts/#findComment-3254 Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now