Jump to content

Recommended Posts

(untested)

public class Main : wManager.Plugin.IPlugin
{
    public void Initialize()
    {
        robotManager.Events.FiniteStateMachineEvents.OnRunState +=
            delegate (robotManager.FiniteStateMachine.Engine engine, robotManager.FiniteStateMachine.State state, System.ComponentModel.CancelEventArgs cancelable)
            {
                if (state is wManager.Wow.Bot.States.Resurrect)
                {
                    bool popupExists = wManager.Wow.Helpers.Lua.LuaDoString<bool>(
                        "return StaticPopup1 and StaticPopup1 ~= nil");

                    if (popupExists)
                    {
                        bool button2Exists = wManager.Wow.Helpers.Lua.LuaDoString<bool>(
                            "return StaticPopup1Button2 and StaticPopup1Button2 ~= nil");

                        string buttonToClick = button2Exists
                            ? "StaticPopup1Button2:Click()"
                            : "StaticPopup1Button1:Click()";

                        wManager.Wow.Helpers.Lua.LuaDoString(buttonToClick);
                    }
                }
            };
    }

    public void Dispose(){}

    public void Settings(){}
}

 

Link to comment
https://wrobot.eu/forums/topic/15670-ankh/#findComment-70147
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...