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.

I need help with my fightclass thought lua code

Featured Replies

Hi, folks. I have a problem with my fightclass, maybe someone can help me? 

Anyway, this description of my problem. I'm playing on custom wow server, which using russian language. So I have to do my fightclass use lua code (/runMacroText ""). It's works great, when I using it for myself, but doesn't work, when I need healing class for teammate. For exaple: I'm trying go to dungeon my character with heal, but chart just staying afk. He's trying healing enemy, but not teammate. He just choice teammate at targen on 1-2 second and switches to someone else. Then they're just die. 


So, how can I do to my healing teammate, don't enemy? 

Hello,

No tested, but you can try this plugin :  CastSpellByName to Cast Macro.cs

using robotManager.Helpful;

public class Main : wManager.Plugin.IPlugin
{
    public void Initialize()
    {
        Logging.Write("CastSpellByName to /cast plugin loaded.");
        robotManager.Events.Events.OnCustomEvent += OnEventsOnOnCustomEvent;
    }

    private void OnEventsOnOnCustomEvent(string name, object[] args, System.ComponentModel.CancelEventArgs cancelable)
    {
        if (name.StartsWith("SpellManager.CastSpellByName") &&
            args.Length >= 1 &&
            args[0] is string)
        {
            var spellName = (string)args[0];

            if (!string.IsNullOrWhiteSpace(spellName)){
                
                string luaUnit = null;
                if (args.Length >= 2 &&
                    args[1] is string)
                    luaUnit = (string)args[1];

                cancelable.Cancel = true;

                if (!string.IsNullOrWhiteSpace(luaUnit) && luaUnit != "player")
                {
                    Logging.WriteDebug("Casting " + spellName + " on " + luaUnit + " with macro /cast");
                    wManager.Wow.Helpers.Lua.RunMacroText("/cast [@" + luaUnit + "] " + spellName);
                }
                else
                {
                    Logging.WriteDebug("Casting " + spellName + " with macro /cast");
                    wManager.Wow.Helpers.Lua.RunMacroText("/cast " + spellName);
                }
            }
        }
    }

    public void Dispose()
    {
        robotManager.Events.Events.OnCustomEvent -= OnEventsOnOnCustomEvent;
    }

    public void Settings()
    {
    }
}

I haven't tested, but this plugin should enable fight classes that use the bot method "CastSpellByNameOn" (which is the case for most fight classes) to force the bot to use "/cast ..." instead. Therefore, use this plugin with your fight class configured normally (without using "/cast").

  • Author

I tried fix it, but errors become many. I used Visual Studio, trying fixed errors with syntax, but VS says "everything is okay", but then I put it at folder Wrobot, I got too many errors

I don't know why... Can you give me an idea, why it can happen? @Droidz

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.