Skip to content
View in the app

A better way to browse. Learn more.

WRobot

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

[SOLVED] Cancel Action in Fight Class? Need help.

Featured Replies

SOLVED:

            else if (FrostNova.IsSpellUsable && ObjectManager.Target.GetDistance >= 6 && ObjectManager.Target.GetDistance <= 10 && !ObjectManager.Target.HaveBuff("Frost Nova") && !ObjectManager.Target.HaveBuff("Frostbite") && ObjectManager.Target.HealthPercent >= 20)
            {
				Lua.LuaDoString("SpellStopCasting()");
				Thread.Sleep(50);
				fightState = fightingStateEnum.TargetClose;
				return;
            }


I'm using this for Frost Nova, however it never casts it if Frost Bolt is already casting, I need help to implement code so that when the conditions are met, the current action is canceled:

            else if (FrostNova.IsSpellUsable && ObjectManager.Target.GetDistance >= 6 && ObjectManager.Target.GetDistance <= 10 && !ObjectManager.Target.HaveBuff("Frost Nova") && !ObjectManager.Target.HaveBuff("Frostbite") && ObjectManager.Target.HealthPercent >= 20)
            {
                fightState = fightingStateEnum.TargetClose;
                return;
            }

I've tried a inserting a key stroke but I'm far too noob to efficiently construct C# code.


Any help would be greatly appreciated!

run lua code

 

SpellStopCasting();
SpellStopCasting();
CastSpellByName("Frost Nova");

or cast spell by ID.

CastSpellByID(1234)
CastSpellByID(1234, 'target')

 

or C# Code

wManager.Wow.Helpers.SpellManager.CastSpellByIdLUA(1234);
wManager.Wow.Helpers.SpellManager.CastSpellByIdLUA(1234, "target");

Edited by Andoido

  • Author

Thanks guys for your inputs, I simply want my fight class to stop any action when the mob is within range of Frost Nova, currently it doesnt fire off Frost Nova whenever my character is casting.

But how would I implement it in the current script I'm using? (The script from my first post)

  • Author
On 10/7/2018 at 10:57 AM, Matenia said:

For the code you want, just call 

Lua.LuaDoString("SpellStopCasting()") to cast your spell. Maybe insert a sleep for 50 ms afterwards 


Like this?

            else if (FrostNova.IsSpellUsable && ObjectManager.Target.GetDistance >= 6 && ObjectManager.Target.GetDistance <= 10 && !ObjectManager.Target.HaveBuff("Frost Nova") && !ObjectManager.Target.HaveBuff("Frostbite") && ObjectManager.Target.HealthPercent >= 20)
            {
				Lua.LuaDoString("SpellStopCasting()");
				Thread.Sleep(50);
				fightState = fightingStateEnum.TargetClose;
				return;
            }

It seems to work, but is "Thread.Sleep(50);" really the right way to implement a delay?
Also isn't it better with a Sleep of 1500ms, due to Global Cooldown being 1,5 sec?
Do tell me if you can spot any obvious problems with this.

Thanks guys for your help!

Create an account or sign in to comment

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.