What's new
  • Visit Rebornbuddy
  • Visit Panda Profiles
  • Visit LLamamMagic
  • Visit Resources
  • Visit Downloads
  • Visit Portal

NotificationOKClick - Auto Click Notification OK button

noobery

New Member
Joined
Jun 14, 2012
Messages
68
Reaction score
1
The plugin will auto click the button of notificaton in D3 such as:
+ Disconnect problem notification
+ Error while create game ... etc

To use this:
1.Create a folder in your DemonBuddy folder called Plugins if you don't have one already.
2.Create a folder in your Plugins folder you have create in step 1
3.Drag and drop the TestInv.cs into your folder in step 2
4.Check NotificationOKClick in the Plugin tab.

Update:
+ Wrong return code in thread check and make the thread run and click only one time. Fix it now.
+ Version 0.2:
- Close thread when bot closed (Shutdown Event)
- Change Interval of checking UI to every 10 seconds (no need to check every 3s)
+ Version 0.3:
- Change flow: Check UI thread only run when bot is running (press start) and stop when bot is stop (press stop)
+ Version 0.4:
- Using .125 api for checking valid UIElement. Thanks DB Developers.
+ Version 0.5:
- Testing support for Network Disconnection OK Button
+ Version 0.6:
- Kill thread when DB exit
+ Version 0.7
- Simple save state for Enable/Disable plugin when run DB.
- Fix not auto click if Enable plugin after press start button
- Test feature : leave game with party (click on party notification dialog)
+ Version 0.8
- Test : Fix bug crash after start bot (maybe the BotThread value is null in some machine)
- Add more log trace for exception
+ Version 0.9
- Using DB Api to eliminate Error/Notification Dialogs.
- Fix crash when enabled ??!!! (Need test :D)
- Delay when Click Resume/Start button to make sure plugin will click it if DB does not create/resume game.


If any error , please attach the Diagnostic log for me.

Know bugs:
- Click OK for party notification may not working yet! Please wait 1-2 days.


FAQ:
1. Why have the word "Test" in release history:
- "Test" means I need you to test for it and report if not working/have problem. Please attach diags log for me if there's some prolem about it.
 

Attachments

Last edited:
Just an FYI, the DemonBuddy API is not thread safe, so using it in that new thread of yours could be dangerous. But hey if it works, it works. Good job.
 
Just wondering, why did you set this to start up another thread?
I see nothing in there than can't be done during a normal pulse()
 
Just wondering, why did you set this to start up another thread?
I see nothing in there than can't be done during a normal pulse()

Sometime some notifications show while you starting the game (Create game failed, Disconnect ...etc). So in that case OnPulse Event is not called.
If DemonBuddy could add other event which run while in MainScreen, then i will use it.
 
Thanks for the quickfix.

But it would be even nicer if the devs could add a pause before it checks if a game is joined to get rid of Error 316700. I wouldnt mind it if it was an error you can actually get while playing "legit"...
 
Code:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows;
using System.Threading;

using Zeta;
using Zeta.Common;
using Zeta.Common.Plugins;
using Zeta.Internals.Actors;

namespace TestInv
{
    public class TestInv : IPlugin 
    {
        WaitHandle flagStop = new AutoResetEvent(false);

        void Log(string message)
        {
            Logging.Write(string.Format("[{0}] {1}", Name, message));
        }


        public void OnDisabled()
        {
            Log("Disabled");
            ((AutoResetEvent)flagStop).Set();
        }
        public void OnEnabled()
        {
            Log("Enabled");
                      
        }
        public void OnInitialize()
        {
            Log("Initalized");            
        }
        public void OnPulse()
        {
            Zeta.Internals.UIElement ui = Zeta.Internals.UIElement.FromHash(0x4CC93A73A58BAFFF);
                    if (ui != null && ui.IsValid)
                    {
                        if (ui.IsVisible)
                        {
                            Log(String.Format("{0} is visible", ui.Name, ui.IsVisible));

                            Zeta.Internals.UIElement Button = Zeta.Internals.UIElement.FromHash(0xB4433DA3F648A992);
                            if (Button != null && Button.IsValid)
                            {
                                //Log(String.Format("UI name = {0}, Visible = {1}", Button.Name, Button.IsVisible));
                                if (Button.IsVisible)
                                {
                                    Log("Notification closed");
                                    Button.Click();
                                }                                
                            }
                        }
                    }            
        }
        public void OnShutdown()
        {
            Log("Shutdown");
        }

        public string Author { get { return "neoz"; } }

        public string Description { get { return "neoz"; } }

        public Window DisplayWindow { get { return null; } }

        public string Name { get { return "NotificationOKClick Thread Safe Plugin"; } }

        public System.Version Version { get { return new Version(0, 1); } }

        public bool Equals(IPlugin other)
        {
            return (other.Name == Name) && (other.Version == Version);
        }
    }
}

Changed things a little to remove the thread and use OnPulse().

Works just fine for Error 316700. Thanks again
 
Code:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows;
using System.Threading;

using Zeta;
using Zeta.Common;
using Zeta.Common.Plugins;
using Zeta.Internals.Actors;

namespace TestInv
{
    public class TestInv : IPlugin 
    {
        WaitHandle flagStop = new AutoResetEvent(false);

        void Log(string message)
        {
            Logging.Write(string.Format("[{0}] {1}", Name, message));
        }


        public void OnDisabled()
        {
            Log("Disabled");
            ((AutoResetEvent)flagStop).Set();
        }
        public void OnEnabled()
        {
            Log("Enabled");
                      
        }
        public void OnInitialize()
        {
            Log("Initalized");            
        }
        public void OnPulse()
        {
            Zeta.Internals.UIElement ui = Zeta.Internals.UIElement.FromHash(0x4CC93A73A58BAFFF);
                    if (ui != null && ui.IsValid)
                    {
                        if (ui.IsVisible)
                        {
                            Log(String.Format("{0} is visible", ui.Name, ui.IsVisible));

                            Zeta.Internals.UIElement Button = Zeta.Internals.UIElement.FromHash(0xB4433DA3F648A992);
                            if (Button != null && Button.IsValid)
                            {
                                //Log(String.Format("UI name = {0}, Visible = {1}", Button.Name, Button.IsVisible));
                                if (Button.IsVisible)
                                {
                                    Log("Notification closed");
                                    Button.Click();
                                }                                
                            }
                        }
                    }            
        }
        public void OnShutdown()
        {
            Log("Shutdown");
        }

        public string Author { get { return "neoz"; } }

        public string Description { get { return "neoz"; } }

        public Window DisplayWindow { get { return null; } }

        public string Name { get { return "NotificationOKClick Thread Safe Plugin"; } }

        public System.Version Version { get { return new Version(0, 1); } }

        public bool Equals(IPlugin other)
        {
            return (other.Name == Name) && (other.Version == Version);
        }
    }
}

Changed things a little to remove the thread and use OnPulse().

Works just fine for Error 316700. Thanks again

Does this work with normal "Your connection has been lost"?
 
Code:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows;
using System.Threading;

using Zeta;
using Zeta.Common;
using Zeta.Common.Plugins;
using Zeta.Internals.Actors;

namespace TestInv
{
    public class TestInv : IPlugin 
    {
        WaitHandle flagStop = new AutoResetEvent(false);

        void Log(string message)
        {
            Logging.Write(string.Format("[{0}] {1}", Name, message));
        }


        public void OnDisabled()
        {
            Log("Disabled");
            ((AutoResetEvent)flagStop).Set();
        }
        public void OnEnabled()
        {
            Log("Enabled");
                      
        }
        public void OnInitialize()
        {
            Log("Initalized");            
        }
        public void OnPulse()
        {
            Zeta.Internals.UIElement ui = Zeta.Internals.UIElement.FromHash(0x4CC93A73A58BAFFF);
                    if (ui != null && ui.IsValid)
                    {
                        if (ui.IsVisible)
                        {
                            Log(String.Format("{0} is visible", ui.Name, ui.IsVisible));

                            Zeta.Internals.UIElement Button = Zeta.Internals.UIElement.FromHash(0xB4433DA3F648A992);
                            if (Button != null && Button.IsValid)
                            {
                                //Log(String.Format("UI name = {0}, Visible = {1}", Button.Name, Button.IsVisible));
                                if (Button.IsVisible)
                                {
                                    Log("Notification closed");
                                    Button.Click();
                                }                                
                            }
                        }
                    }            
        }
        public void OnShutdown()
        {
            Log("Shutdown");
        }

        public string Author { get { return "neoz"; } }

        public string Description { get { return "neoz"; } }

        public Window DisplayWindow { get { return null; } }

        public string Name { get { return "NotificationOKClick Thread Safe Plugin"; } }

        public System.Version Version { get { return new Version(0, 1); } }

        public bool Equals(IPlugin other)
        {
            return (other.Name == Name) && (other.Version == Version);
        }
    }
}

Changed things a little to remove the thread and use OnPulse().

Works just fine for Error 316700. Thanks again

can someone explain to me what thread safe is please? why is it a problem
 
I`ve got problem with this plugin. Its working fine, when error 316700 pops up anywhere, but when it pops on character selection screen - plugin clicks OK, and then nothing happens. Bot just arent clicking on resume game, so I`m just stuck and have to click "resume game" by myself. Any tips for me, on how to fix this error ?
I`m using Artemis Sarkoth profile.

Thank you.
 
Not working with "The game connection has been lost: your client has been disconnected from the server"
 
Not working with "The game connection has been lost: your client has been disconnected from the server"

I can confirm this

Edit: NVM forgot to make a folder for the PlugIn
 
Last edited:
The one I posted does not work for game connection lost I think, only the 316700 error
 
I've noticed this plugin keeps a demonbuddy process running even after closing the bot, which means I have to end task the other process just so I can open DB again.
 
I've noticed this plugin keeps a demonbuddy process running even after closing the bot, which means I have to end task the other process just so I can open DB again.
Thanks for report. Try to disable plugin before exit bot. I'll try find a way to handle this.
 
Back
Top