[D2NT Release] Welcome Mat v1.0b

Well here it is...
It's not what I was hoping to release but I've done all I can for now. Maybe someone else will have some luck with it.

[Players message log]


[Bots message log]


This is a simple mod for the D2NT31 NTBot42 version found on this site.
It displays a welcome message when a player joins the game if "NTConfig_PublicMode = true;".
I would have liked to have used whispers to avoid spam on the screen,
but had to disable that function because it wasn't very reliable to say the least.
Also users with "/o igw" enabled would not see the message.

Another feature I had intended to release with this was for
"NTConfig_PublicMode = false;".
Where if a player invited the bot, the bot would accept and display a welcome message.
This feature was removed because it conflicted with
"NTConfig_PublicMode = true;", and when it wasn't conflicting it was causing some unwanted results such as excess spam.

I've probably spent a good 20 hours debugging every possible option I could think of, and while some results were positive they seemed to cancel out the more important ones. At any rate this release should be considered Beta.

Preparation:

  • I highly recommend using Notepad++ for all file editing.
  • This release is for D2NT31 NTBot42 as found in the download section of this site here. I cannot guarantee it will work with other builds/versions.



Installation:
ATTENTION: It is highly recommended that you create a backup of your D2NT folder or any files prior to opening them for editing.


Step 1:
Open up the backup of the D2NT folder you just created.
We're going to work with this so we don't touch your original and make a big mess.

Step 2:
Navigate to \scripts\NTBot\tools\ and open up NTToolsThread.ntj using Notepad++.

Step 3:
Scroll down the page and locate the line that starts with "if(NTConfig_PublicMode)".
You can use the search function if you prefer by pressing "Ctrl+F".
if(_count++ > 10)
{
if(NTConfig_PublicMode)
{
_player = GetPlayerUnit();

If it says something else like "if (NTConfig_AcceptInviteOnly), then you are using another build but it still may work.

The script should look like this:
Pastebin Link
Code:
        if(_count++ > 10)
        {
            if(NTConfig_PublicMode)
            {
                _player = GetPlayerUnit();

                if(_player)
                {
                    _mypartyid = _player.partyid;

                    while(_player.GetNext())
                    {
                        if(_player.partyid == 65535 || _player.partyid != _mypartyid)
                        {
                            if(_player.partyflag == 2)
                            {
                                me.ClickParty(_player, 2);
                                break;
                            }

                            if(_player.partyid == 65535)
                            {
                                if(_player.partyflag == 4)
                                    break;

                                me.ClickParty(_player, 2);
                                NTC_Delay(NTC_DELAY_FRAME);

                                if(_player.partyflag == 4 ||  (_player.partyid != 65535 && _player.partyid == _mypartyid))
                                    break;
                            }
                        }
                    }
                }
            }

            _count = 0;
        }

        NTC_Delay(200);
    }


Step 4:
Edit the script to look like the following.
Pastebin Link
Code:
//Modified NTToolsThread.ntj by DNA64 @ http://www.blizzsector.co
//Codename: Welcome Mat
//Version 1.0 [Beta]

 if(_count++ > 10)
      {
         if(NTConfig_PublicMode)
         {
            _player = GetPlayerUnit();

            if(_player)
            {
               _mypartyid = _player.partyid;
               
               while(_player.GetNext())
               {
                  if(_player.partyid == 65535 || _player.partyid != _mypartyid)
                  {
                     if(_player.partyflag == 2)        //partyflag  //0 =  Null //2 = Player invited you  //4 = You invited player 
                     {
                        me.ClickParty(_player, 2); // Auto accepts party invites.
                        //Say ("Hi, come help us and enjoy the drops!"); //DEBUG
                        break;
                     }

                     if(_player.partyid == 65535)
                     {
                        if(_player.partyflag == 4)
                           break;
                           
                        me.ClickParty(_player, 2);
                        NTC_Delay(NTC_DELAY_FRAME);
                        
                        if(_player.partyflag == 4 || (_player.partyid != 65535 && _player.partyid == _mypartyid))

                        Say ("Hi, come help us and enjoy the drops!"); //
                        //Say("/w *" + _player.name + " Hi, Please  accept the party invite I sent you, and enjoy the drops!"); // DEBUG
                           break;
                           
                     }
                  }
               }
            }
         }

         _count = 0;
      }

        NTC_Delay(200);

Step 5:
Save and load D2NT Manager.exe from the backup folder. Run & Enjoy!
Questions, Comments, Suggestions Welcomed!

- Happy Botting
DNA64

This document had to be retyped because submission failed so I kinda got lazy sorry...it looked much better before :P