Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Weapon/Armor Stands script D2NT?
#1
I've been using D2NT for a couple weeks now and have been learning a bit about programming and stuff in the process. I've managed to make some custom pickit scripts and edit a couple of the bots and the attack script to my liking. However, something I haven't found is a way to tell the bot to open weapon/armor stands while making runs. So I set off to figure out a way to make a script for it. I first tried to edit the MyShrine configure files to include armor/weapon stands, but I didn't figure it out. So then I tried to edit the Mephisto bot file, and made some progress. I used some of the script from the cow script (from this forum) and managed to make my character TP to and activate the weapon rack and tp back to the middle, but it won't TP to the armor rack like the script suggests (at least I believe it suggests). Could someone look at this script and see where the mistake might be ? Or maybe someone with good scripting skills could make a stand-alone script like MyShrine for all bots, I bet it'd get use!

UPDATE: I figured it out, feel free to copy the updated script below. Some of it is probably redundant, so anyone with knowledge can still correct it. Used some trigonometry to find out how to get the bot to TP to the area of the armor stand, and that seemed to do the trick. You can copy/paste this over your existing meph bot, or I would recommend you make a copy of the original NTMephisto.ntj file, rename it to NTMephisto2.ntj, and then delete the existing code in the new file and replace it with the code below. Then in your character config file, change the bot to NTMephisto2.ntj. Might still have some kinks to fix, but it works fine for my character.

Code:
//Mephisto Bot, armor/weapon stand script. 1.1
//Config
const _NTR_STANDS = true; // Set to true to activate armor&weapon stands
//End Config

_orgx = me.x;
_orgy = me.y;


function NTMain()
{
    Include("libs/common/NTCommon.ntl");
    NTC_IncludeLibs();
    NTC_IncludeConfig("NTBot/char_configs");

    NT_LoadConfig();
    NTSI_LoadNIPFiles("NTBot/item_configs");

    NTA_Initialize();

    if(!NTTM_CheckAct())
    {
        NTC_SendMsgToScript("NTBotGame.ntj", "NTTM_CheckAct()");
        return;
    }

    NTTMGR_TownManager();

    if(!NTTM_TownMove("waypoint"))
    {
        NTC_SendMsgToScript("NTBotGame.ntj", "NTTM_TownMove()");
        return;
    }

    if(!NTM_TakeWaypoint(101))
    {
        NTC_SendMsgToScript("NTBotGame.ntj", "NTM_TakeWaypoint()");
        return;
    }

    NTP_DoPrecast(true);

    if(!NTM_MoveToStair(me.areaid, 102))
    {
        NTC_SendMsgToScript("NTBotGame.ntj", "NTM_MoveToStair()");
        return;
    }

    if(!NTM_TakeStair(102))
    {
        NTC_SendMsgToScript("NTBotGame.ntj", "NTM_TakeStair()");
        return;
    }

    if(!NTTMGR_CheckSafe(NTConfig_CheckSelfSafe, NTConfig_CheckMercSafe))
    {
        NTC_SendMsgToScript("NTBotGame.ntj", "NTTMGR_CheckSafe()");
        return;
    }

    if(!NTM_MoveTo(me.areaid, 17564, 8069))
    {
        NTC_SendMsgToScript("NTBotGame.ntj", "NTM_MoveTo()");
        return;
    }

    NTC_Delay(200);

    if(me.classid != NTC_CHAR_CLASS_PALADIN && me.classid != NTC_CHAR_CLASS_BARBARIAN)
        NTM_MoveTo(me.areaid, 17573, 8071);

    if(!NTA_KillMonster(242))
    {
        NTC_SendMsgToScript("NTBotGame.ntj", "NTA_KillMonster()");
        return;
    }

    if(NTConfig_ClearPosition)
        NTA_ClearPosition();

    NTSI_PickItems();

    if(NTConfig_OpenChest)
    {
        var _chest;

        if(NTM_MoveTo(me.areaid, 17520, 8063))

        _chest = NTC_FindUnit(NTC_UNIT_OBJECT, GetLocaleString(3260), 1);

        if(_chest)
        {
            do
            {
                if(_chest.x == 17513 && _chest.y == 8063)
                {
                    if(NTC_OpenChest(_chest))
                        NTSI_PickItems();

                    break;
                }
            } while(_chest.GetNext());
        }
    }
    function NTR_GetChest()
    {
       var _chest;
    
       _chest = NTC_FindUnit(NTC_UNIT_OBJECT, "chest");
        if(_chest)
        {
          return _chest;
        }
    
       return null;
    }
    function NTR_GetObj(num)
    {
       var _chest;
    
       _chest = NTC_FindUnit(NTC_UNIT_OBJECT, num);
        if(_chest)
        {
          return _chest;
        }
    
       return null;
    }
      if(_NTR_STANDS)
      {
        _target = NTR_GetObj(106);
        if(_target){
        do
            {
            if(_target && GetDistance(_orgx, _orgy, _target.x, _target.y) >= 5)
            {
                if(NTM_MoveTo(me.areaid, _target.x, _target.y))
                {
                    if(NTC_DoClick(NTC_CLICK_LDOWN, NTC_SHIFT_NONE, _target))
                    {
                                     Delay(200);
                                     NTSI_PickItems();
                              }
                           }
                    }
            }while(_target.GetNext());
        }
        _target = NTR_GetObj(107);
        if(_target){
        do
            {
            if(_target && GetDistance(_orgx, _orgy, _target.x, _target.y) >= 5)
            {
                if(NTM_MoveTo(me.areaid, _target.x, _target.y))
                {
                    if(NTC_DoClick(NTC_CLICK_LDOWN, NTC_SHIFT_NONE, _target))
                    {
                                     Delay(200);
                                     NTSI_PickItems();
                              }
                           }
                    }
            }while(_target.GetNext());
        }
    }
    if(!NTM_MoveTo(me.areaid, 17580, 8099))
    {
        NTC_SendMsgToScript("NTBotGame.ntj", "NTM_MoveTo()");
        return;
    }
      if(_NTR_STANDS)
      {
        _target = NTR_GetObj(104);
        if(_target){
        do
            {
            if(_target)
            {
                if(NTM_MoveTo(me.areaid, _target.x, _target.y))
                {
                    if(NTC_DoClick(NTC_CLICK_LDOWN, NTC_SHIFT_NONE, _target))
                    {
                                     Delay(200);
                                     NTSI_PickItems();
                              }
                           }
                    }
            }while(_target.GetNext());
        }
        _target = NTR_GetObj(105);
        if(_target){
        do
            {
            if(_target)
            {
                if(NTM_MoveTo(me.areaid, _target.x, _target.y))
                {
                    if(NTC_DoClick(NTC_CLICK_LDOWN, NTC_SHIFT_NONE, _target))
                    {
                                     Delay(200);
                                     NTSI_PickItems();
                              }
                           }
                    }
            }while(_target.GetNext());
        }
    }

    Delay(1000)
    NTC_SendMsgToScript("NTBotGame.ntj", "SCRIPT_END");
}

Thanks a ton, happy botting.
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  [D2NT Release] Druid Script skidude 20 17,266 08-25-2012, 01:20 AM
Last Post: comper
  Etal Script for Hdin please? Joel Gonzalez 19 456 08-17-2012, 07:15 AM
Last Post: comper
  elite polearm script wishyq 2 138 08-17-2012, 06:50 AM
Last Post: comper
  D2NT BoT Gh0sT17 52 2,056 07-31-2012, 11:10 PM
Last Post: comper
  help with script plz kaosme69 18 292 07-26-2012, 10:02 AM
Last Post: comper
  D2nt need help on some stuff wishyq 3 171 07-22-2012, 12:44 PM
Last Post: comper
  ISO : WW Assassin script ww/ls devonfym 3 161 07-21-2012, 02:56 AM
Last Post: comper
  Little Help Please? (D2NT) pnsmcgraw 12 271 07-16-2012, 02:46 PM
Last Post: Mythosis
  Kolton script wakka help 48Inches 1 136 07-09-2012, 04:44 AM
Last Post: comper
  MasivB's D2NT Simple Unique PickIt masivb 1 118 07-03-2012, 05:03 AM
Last Post: comper

Forum Jump:


Users browsing this thread: 1 Guest(s)