Author Topic: Baal leech script help  (Read 840 times)

Offline Deaths_A_13itch

  • Newbie
  • *
  • Join Date: Aug 2010
  • Posts: 7
  • Reputation 0
  • here to mf the shit out of D2
    • View Profile
Baal leech script help
« on: September 05, 2010, 08:51:01 AM »
for some reason it just doesnt work even though i followed every step in the guide

i tried the script that spammed the /f l and it actually found the game, but when i use the other script it just sits in the channel and waits for the green message to appear which causes it to enter the wrong game name or puts it in 2 fast so that the game is still being created and then it wont attempt that game name again

then after i manually enter the game name it moves around a little checks pots etc but doesnt enter the tp/ attack

this is my NTBotLeech file that is in the scripts folder

Code: [Select]
var gameMinLength      = 90000;   // time in milliseconds, minimum game length, 180 seconds default (1 game/3 minutes)

var unableToConnectRetry   = 5;      // time in minutes to retry connecting on connection fail (real value is +/- 1 min)
var realmDownRetry      = 260;      // time in minutes to retry connecting on a realm down (default is 120 minutes)
var disconnectedRetry      = 5;      // time in minutes to retry on a disconnection (usually ip ban related)
var cdkeyInUseRetry      = 5;      // time in minutes to retry on a cdkey in use error message (set to 0 to stop)
var connectingToBnetTimeout   = 20000;   // time in milliseconds to wait for a login to time out and click cancel and retry
var characterScreenTimeout   = 5000;   // time in milliseconds to wait for character screen to appear
var pleaseWaitTimeout      = 2000;   // time in milliseconds to wait for a please wait popup
var createGameThreshold      = 5000;      // time in milliseconds to wait between making games
var createGameThresholdRandom   = 1000;      // time in milliseconds to randomly add +/- to the game create time
var createGameTimeout      = 15000;   // time in milliseconds to register a failed to create game
var waitInLineTimeout      = 60000;   // time in milliseconds to wait in lines for a create game (60 second default)
var characterSelectDelay   = 1000;      // time in milliseconds to wait before selecting a character on the char screen
var loginDelay         = 1000;      // time in milliseconds to wait before submitting login information
var clickDelay         = 500;      // wait X milliseconds before next action after a click event
var textDelay         = 500;      // wait X milliseconds before next action after inserting text into a textbox
var clickDelayRandom      = 500;      // random amount of time to add to a click
var textDelayRandom      = 500;      // random amount of time to add to a text set
var gameDoesNotExistDelayMin   = 500;   // how long to wait when a Game Does Not Exist occurs - minimum - default 10 minutes
var gameDoesNotExistDelayMax   = 500;   // how long to wait when a Game Does Not Exist occurs - maximum - default 15 minutes
var gameDoesNotExistTimeout   = 1000;   // how long to wait for the dialog to disappear (default 30 seconds, don't change this)
var joinChatAfterGame      = true;   // join chat after leaving a game
var joinRandomChannel      = false;      // if this is true, will join a random channel, otherwise it will use the channel below..
var joinChannelInChat      = "mijy";      // leave blank to not join a private channel
var waitBeforeEnterChatMin   = 1000;      // min how long to wait before entering chat
var waitBeforeEnterChatMax   = 2000;      // max how long to wait before entering chat
var waitInChatBeforeActionsMin   = 2000;      // min how long to wait before joining channel
var waitInChatBeforeActionsMax   = 3000;      // max how long to wait before joining channel
var JoinFromChat = true;
var leaderAccountName = "mijy2011"; // leader account name here
var gamepassword = '';
var samegame = '';
var oldgame = '';
var check = 1;

// DONT EDIT ANYTHING BELOW THIS

// D2NT Manager Command
const D2NT_MGR_LOADING = 1;
const D2NT_MGR_READY = 2;
const D2NT_MGR_LOGIN = 3;
const D2NT_MGR_CREATE_GAME = 4;
const D2NT_MGR_INGAME = 5;
const D2NT_MGR_RESTART = 6;
const D2NT_MGR_CHICKEN = 7;
const D2NT_MGR_PRINT_STATUS = 8;
const D2NT_MGR_PRINT_LOG = 9;

var lastGameMade = GetTickCount();
var lastGameStatus = 0;
var nextGameMake = 0;
var inGameAt = 0;
var chatActionsDone = false;
var lastGameFailed = false;

Include("libs/controlInfo.ntl");
//Include("joinBotSettings.ntl");

var controlData = new controlInfo();

var game = '';

function NTMain()
{
   Delay(1000);

   var _ingame = false;

   controlData.clickDelay = clickDelay;
   controlData.textDelay = textDelay;
   controlData.clickDelayRandom = clickDelayRandom;
   controlData.textDelayRandom = textDelayRandom;

   while(1)
   {
      if(me.ingame)
      {
         if(!inGameAt)
            inGameAt = GetTickCount();

         if(!_ingame)
         {
            if(Load("NTBot/NTBotGame.ntj"))
            {
               _ingame = true;

if(me.playtype > 0)
sendEventToOOG(D2NT_MGR_INGAME, "In Game[IP:" + me.gameserverip.split(".")[3] + "]", 0);
else
sendEventToOOG(D2NT_MGR_INGAME, "In Game", 0);

               lastGameStatus = 2; // in game successful
            }
         }

         Delay(1000);
      }
      else
      {
         if(_ingame)
         {
            _ingame = false;

            sendEventToOOG(D2NT_MGR_READY, "", 0);
         }

         locationAction(controlData.getLocation());

         Delay(500);
      }
   }
}

function locationAction(location)
{
   switch(location.id)
   {
 
   case 3: // Lobby Chat
      if(!chatActionsDone)
      {
         chatActionsDone = true;
         Delay(Random(waitInChatBeforeActionsMin, waitInChatBeforeActionsMax));
 
         if(joinRandomChannel || joinChannelInChat != "")
         {
            Say("/join " + (joinRandomChannel ? getRandomString(Random(3,10)) : joinChannelInChat));
            Delay(1000);
         }
      }
 

      if(JoinFromChat){
    if(check == 1)
{
    sendEventToOOG(D2NT_MGR_CREATE_GAME, location.name, 0);
    outputGameLength();
            lastGameStatus = 0;
            setNextGameMake();
            sendEventToOOG(D2NT_MGR_PRINT_STATUS, location.name, 0);
    check = check + 1;
}

         game = '';
         Delay(1000);
         if(chat = controlData.get(controlData.controls.lobby.chat.textBox.channelText))
         {
            var errors = '';
            var found_leader = false;
            lines = chat.GetText();
         if (lines.length > 1)
            for (var friend = 0; friend < lines.length; friend++)
            {
          if (undefined!==lines[friend + 1])
            if (lines[friend + 1].lastIndexOf('game called') > -1 && lines[friend].lastIndexOf(leaderAccountName) > -1)
               {
                  game = '';
                  found_leader = true;
                  var regOfflineEnglish=/^\d\s?:\s?(\w*)\s?,\s?offline\s*$/gi;
              var regGameNameEnglish=/^\s*(called\s)?([\w\s-]*\w)?(\.)*$/gi;
             
                  if (lines[friend].match(regOfflineEnglish))
                  {
                     errors += (errors == '' ? '' : ' ') + 'leader is offline';
                     Delay(5000);
                  }
                  if (lines[friend + 1].match(regGameNameEnglish))
                  {
                game = lines[friend + 1].substring(lines[friend + 1].lastIndexOf('called')+7,lines[friend + 1].lastIndexOf('.'));
                  }
                  if (game != '' && game != samegame && game != oldgame)
                  {
                     controlData.click(controlData.controls.lobby.button.join);
Delay(200);
                 controlData.setText( controlData.controls.lobby.join.editBox.gameName, game);
            Delay (200);
controlData.setText( controlData.controls.lobby.join.editBox.password, gamepassword);
Delay (200);
         controlData.click(controlData.controls.lobby.join.button.joinGame);
check = 1;
                  }
                  else
                  {
                     if(!errors)
                     {
                        errors = 'leader is not in game.';
                     }
                  }
               }
            }
            if (!found_leader && joinChannelInChat)
            {
               if (errors)
                  Say('Errors : ' + errors);
               //else
               //   Say('I couldn\'t find the leader in my friend list.');
               Delay(1500);
            }
         }
         else
         {
            if (joinChannelInChat)
               Say('I can\'t read the chat!');
            Delay(1500);
         }
         
      }
   errors = '';
   if(game != '')
      samegame = game;

      break;



 
     
   case 1:   // Lobby
      if(location.id == 1 && joinChatAfterGame)
      {
         Delay(Random(waitBeforeEnterChatMin, waitBeforeEnterChatMax));
         controlData.click(controlData.controls.lobby.button.enterChat);
         break;
      }

      if(GetTickCount() >= nextGameMake)
      {
         lastGameFailed = false;

         switch(lastGameStatus)
         {
         case 0:
            controlData.click(controlData.controls.lobby.button.create);
            nextGameMake = GetTickCount() + createGameTimeout; // set our timeout
            sendEventToOOG(D2NT_MGR_PRINT_STATUS, location.name, 0);
            break;
         case 1: // game failed, rollover to reset timer
            inGameAt = GetTickCount(); // reset inGameAt, to wait how long we should have waited..
            lastGameFailed = true;
         case 2:
            outputGameLength();
            lastGameStatus = 0;
            setNextGameMake();
            sendEventToOOG(D2NT_MGR_PRINT_STATUS, location.name, 0);
            break;
         }
      }
      else
         timeoutDelay(nextGameMake-GetTickCount(), location);
      break;

   case 2: // Waiting In Line
      if(GetTickCount()-lastGameMade > waitInLineTimeout)
         controlData.click(controlData.controls.lobby.inLine.button.cancel);
      break;

   case 4: // Create Game
        if(!controlData.get(controlData.controls.lobby.create.editBox.gameName))
        {
            controlData.click(controlData.controls.lobby.button.join);
            Delay (500);
            controlData.click(controlData.controls.lobby.button.create);
            Delay (500);
        }
      sendEventToOOG(D2NT_MGR_CREATE_GAME, location.name, 0);

      RunGC(); // run garbage collector between each game

      locationTimeout(5000, location);

      lastGameMade = GetTickCount();
      lastGameStatus = 1; // pending creation
      break;

   case 5: // Join Game
        if(!controlData.get(controlData.controls.lobby.join.editBox.gameName))
        {
            controlData.click(controlData.controls.lobby.button.create);
            Delay (1000);
            controlData.click(controlData.controls.lobby.button.join);
            Delay (1000);
        }
        if (game != '')
        {
            controlData.setText( controlData.controls.lobby.join.editBox.gameName, game);
            Delay (100);
            //controlData.setText( controlData.controls.lobby.join.editBox.password, gamepassword);
            //Delay (100);
    controlData.click(controlData.controls.lobby.join.button.joinGame);
        }
check = 1;
    lastGameStatus = 1; // pending creation
      break;

   case 6: // Ladder
      break;

   case 7: // Channel List
      break;

   case 8: // Main Menu
      if(controlData.getCurrentRealmIndex() == me.gatewayid)
      {
         outputGameLength();
         controlData.click(controlData.gameTypes[me.playtype]);
      }
      else
         controlData.click(controlData.controls.mainMenu.button.gateway);
      break;

   case 9: // Login
      sendEventToOOG(D2NT_MGR_PRINT_STATUS, location.name, 0);
      Delay(loginDelay);

      controlData.setText(controlData.controls.login.editBox.accountName, me.account);

      sendEventToOOG(D2NT_MGR_LOGIN, location.name, 0);

      locationTimeout(5000, location);
      break;

   case 10: // Login Error (this is a fatal error, so stop)
      sendEventToOOG(D2NT_MGR_RESTART, location.name, 10);
      Delay(3500);
      break;

   case 11: // Unable To Connect
      timeoutDelay(unableToConnectRetry*60*1000, location)
      controlData.click(controlData.controls.login.unableToConnect.button.ok);
      break;

   case 12: // Character Select
      var _time, _control;

      sendEventToOOG(D2NT_MGR_PRINT_STATUS, location.name, 0);

      for(_time = 0 ; _time < characterScreenTimeout ; _time += 500)
      {
         _control = controlData.get(controlData.controls.characterSelect.textBox.characterInfo[me.charloc]);
         if(_control && _control.GetText() != undefined)
            break;

         Delay(500);
      }

      if(_time < characterScreenTimeout)
      {
         Delay(characterSelectDelay);

         controlData.click(controlData.controls.characterSelect.textBox.characters[me.charloc], 0, 0, 1);
         controlData.click(controlData.controls.characterSelect.textBox.characterInfo[me.charloc], 0, 0, 1);

         // reset last game made, so it doesnt make a game immediately
         inGameAt = 0;
         setNextGameMake();
      }
      else
      {
         controlData.click(controlData.controls.characterSelect.button.exit);
         timeoutDelay(realmDownRetry*60*1000, location);
      }
      break;

   case 13: // Realm Down - Character Select screen
      controlData.click(controlData.controls.characterSelect.button.exit);
      timeoutDelay(realmDownRetry*60*1000, location);
      break;

   case 14: // Character Select - Disconnected
      timeoutDelay(disconnectedRetry*60*1000, location);
      controlData.click(controlData.controls.characterSelect.disconnected.button.ok);
      break;

   case 15: // New Character
      break;   

   case 16: // Character Select - Please Wait popup
      if(!locationTimeout(pleaseWaitTimeout, location))
         controlData.click(controlData.controls.characterSelect.pleaseWait.button.cancel);
      break;

   case 17: // Lobby - Lost Connection - just click okay, since we're toast anyway
      controlData.click(controlData.controls.lobby.lostConnection.button.ok);
      break;

   case 18: // D2 Splash
      controlData.click(controlData.controls.d2Splash.textBox.copyright);
      break;

   case 19: // Login - Cdkey In Use
      timeoutDelay(cdkeyInUseRetry*60*1000, location);
      controlData.click(controlData.controls.login.cdkeyInUse.button.ok);
      break;

   case 20: // Single Player - Select Difficulty
      RunGC(); // run garbage collector between each game

      controlData.click(controlData.singlePlayerDifficulties[me.diff]);
      break;

   case 21: // Main Menu - Connecting
      if(!locationTimeout(connectingToBnetTimeout, location))
         controlData.click(controlData.controls.mainMenu.connecting.button.cancel);
      break;

   case 22: // Login - Invalid Cdkey (classic or xpac)
      sendEventToOOG(D2NT_MGR_RESTART, location.name, 3600);
      Delay(3500);
      break;   

   case 23: // Character Select - Connecting
      if(!locationTimeout(characterScreenTimeout, location))
         controlData.click(controlData.controls.characterSelect.button.exit);
      break;

   case 24: // Server Down - not much to do but wait..
      break;

   case 25: // Lobby - Please Wait
      if(!locationTimeout(pleaseWaitTimeout, location))
         controlData.click(controlData.controls.lobby.pleaseWait.button.cancel);
      break;

   case 26: // Lobby - Game Name Exists
      //sendEventToOOG(D2NT_MGR_PRINT_LOG, "Game already exists", 0);

      //inGameAt = 0;
      //lastGameStatus = 0;
      //setNextGameMake();
this.controls.lobby.button.quit
      locationTimeout(15000, location);
      break;

   case 27: // Gateway Select
      controlData.clickRealmEntry(me.gatewayid);
      controlData.click(controlData.controls.gateway.button.ok);
      break;

   case 28: // Lobby - Game Does Not Exist

Delay(160000); // 40 seconds longer then leader's min game time, edit yourself
controlData.click(controlData.controls.lobby.button.quit)
Delay(1000);
controlData.click(controlData.controls.characterSelect.textBox.characters[me.charloc], 0, 0, 1);
controlData.click(controlData.controls.characterSelect.textBox.characterInfo[me.charloc], 0, 0, 1)
oldgame = game;

      break;
   }
}

function sendEventToOOG(locationId, statusString, pendingTime)
{
   return SendCopyData("D2NT Manager", null, (locationId<<16)|pendingTime, statusString);
}

function setNextGameMake()
{
   lastGameMade = GetTickCount();
   nextGameMake = lastGameMade + createGameThreshold + Random(0-createGameThresholdRandom, createGameThresholdRandom) + inGameAt;
   inGameAt = 0;
   chatActionsDone = false;
}

function outputGameLength()
{
   if(inGameAt)
   {
      duration = GetTickCount() - inGameAt;

      inGameAt = (duration < gameMinLength ? gameMinLength - duration : 0);
   }
}

function locationTimeout(time, location)
{
   endtime = GetTickCount() + time;

   while(controlData.getLocation().id == location.id && endtime > GetTickCount())
   {
      sendEventToOOG(D2NT_MGR_PRINT_STATUS, location.name + " (" + parseInt((endtime-GetTickCount())/1000) + "s)", 0);
      Delay(500);
   }

   return (controlData.getLocation().id != location.id);
}

function timeoutDelay(time, location)
{
   endtime = GetTickCount() + time;

   while(endtime > GetTickCount())
   {
      sendEventToOOG(D2NT_MGR_PRINT_STATUS, location.name + " (" + parseInt((endtime-GetTickCount())/1000) + "s)", 0);
      Delay(1000);
   }
}

function getRandomString(_length)
{
   _retString = "";
   _charSet = "0123456789abcdefghijklmnopqrstuvwxyz";

   while(_length--)
   {
      _retString += _charSet.charAt(Random(0, _charSet.length-1));
      Delay(1);
   }

   return _retString;
}

this is my NTBaalLeechFight
Code: [Select]
function NTMain()
{

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

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

NTA_Initialize(); // 10

var _leader = "iMake_Fg"; // Name of leader's character in game (exactly)

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

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

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

NTTMGR_TownManager();

NTTM_TownMove("portalspot");

for(i = 0; i <= 200; i++)
{
if(NTC_InMyParty(_leader))
break;

Delay(200);
}

while(me.areaid == 109 && NTC_InMyParty(_leader))
{
NTM_UsePortal("BluePortal", 131, _leader); // 50
Delay(5000);

}

NTP_DoPrecast(true);

while(NTC_InMyParty(_leader))
{
Delay(1000);
}


NTC_SendMsgToScript("NTBotGame.ntj", "SCRIPT_END");

}

hope u can help or send me some working files
thanks in advance
« Last Edit: September 05, 2010, 08:52:49 AM by Deaths_A_13itch »

PureKaoz.com - D2NT, Diablo 3 & Starcaft 2 Hacks

Baal leech script help
« on: September 05, 2010, 08:51:01 AM »

cooptheking

  • Guest
Re: Baal leech script help
« Reply #1 on: September 05, 2010, 11:39:20 AM »
1)looks like you didn't follow all the instructions when installing the scripts
Code: [Select]
var _leader = "iMake_Fg"; // Name of leader's character in game (exactly)you need to change iMake_Fg , into whatever your leaders characer in game name is (exactly) (it is case sensitive)

2) As far as having both scripts (that isnt needed you only need one) but if you want to be able to use both i suppose?
Trying to join too fast....
Code: [Select]
                     controlData.click(controlData.controls.lobby.button.join);
         Delay(200);
                    controlData.setText( controlData.controls.lobby.join.editBox.gameName, game);
                  Delay (200);
         controlData.setText( controlData.controls.lobby.join.editBox.password, gamepassword);
         Delay (200);
               controlData.click(controlData.controls.lobby.join.button.joinGame);
         check = 1;
change it too
Code: [Select]
                     controlData.click(controlData.controls.lobby.button.join);
         Delay(2000);
                    controlData.setText( controlData.controls.lobby.join.editBox.gameName, game);
                  Delay (2000);
         controlData.setText( controlData.controls.lobby.join.editBox.password, gamepassword);
         Delay (2000);
               controlData.click(controlData.controls.lobby.join.button.joinGame);
         check = 1;

3) Putting in wrong game name, i'd need to see the leader join game message  (the green message your leecher gets when leader makes game)..post a s/s

Offline Deaths_A_13itch

  • Newbie
  • *
  • Join Date: Aug 2010
  • Posts: 7
  • Reputation 0
  • here to mf the shit out of D2
    • View Profile
Re: Baal leech script help
« Reply #2 on: September 06, 2010, 08:35:35 AM »
1) fixed xD thanks

2) awesome the bot now waits a few secs to let the other one load

3)

hope that explains wat im talking about, it includes what its trying to enter as the game name

cooptheking

  • Guest
Re: Baal leech script help
« Reply #3 on: September 06, 2010, 03:11:09 PM »
Code: [Select]
              var regGameNameEnglish=/^\s*(called\s)?([\w\s-]*\w)?(\.)*$/gi;
try changing it to
Code: [Select]
              var regGameNameEnglish=/^\s*([\w\s-]*\w)?(\.)*$/gi;
if that still doesn't work let me know and i'll get u a compeltely new file ;)

Offline Deaths_A_13itch

  • Newbie
  • *
  • Join Date: Aug 2010
  • Posts: 7
  • Reputation 0
  • here to mf the shit out of D2
    • View Profile
Re: Baal leech script help
« Reply #4 on: September 07, 2010, 05:42:54 AM »
it still puts in the same as in the screen shot, no idea why...

PureKaoz.com - D2NT, Diablo 3 & Starcaft 2 Hacks

Re: Baal leech script help
« Reply #4 on: September 07, 2010, 05:42:54 AM »

cooptheking

  • Guest
Re: Baal leech script help
« Reply #5 on: September 07, 2010, 10:24:07 AM »
Edit the appropiate "account name" and see if this works for you (if not i have a few more we can try)
Code: [Select]
var gameMinLength      = 60000;   // time in milliseconds, minimum game length, 180 seconds default (1 game/3 minutes)

var unableToConnectRetry    = 5;      // time in minutes to retry connecting on connection fail (real value is +/- 1 min)
var realmDownRetry      = 260;      // time in minutes to retry connecting on a realm down (default is 120 minutes)
var disconnectedRetry      = 5;      // time in minutes to retry on a disconnection (usually ip ban related)
var cdkeyInUseRetry      = 5;      // time in minutes to retry on a cdkey in use error message (set to 0 to stop)
var connectingToBnetTimeout   = 20000;   // time in milliseconds to wait for a login to time out and click cancel and retry
var characterScreenTimeout    = 5000;   // time in milliseconds to wait for character screen to appear
var pleaseWaitTimeout      = 2000;   // time in milliseconds to wait for a please wait popup
var createGameThreshold      = 5000;      // time in milliseconds to wait between making games
var createGameThresholdRandom   = 1000;      // time in milliseconds to randomly add +/- to the game create time
var createGameTimeout      = 15000;   // time in milliseconds to register a failed to create game
var waitInLineTimeout      = 60000;   // time in milliseconds to wait in lines for a create game (60 second default)
var characterSelectDelay    = 1000;      // time in milliseconds to wait before selecting a character on the char screen
var loginDelay          = 1000;      // time in milliseconds to wait before submitting login information
var clickDelay          = 500;      // wait X milliseconds before next action after a click event
var textDelay          = 500;      // wait X milliseconds before next action after inserting text into a textbox
var clickDelayRandom      = 500;      // random amount of time to add to a click
var textDelayRandom      = 500;      // random amount of time to add to a text set
var gameDoesNotExistDelayMin    = 500;   // how long to wait when a Game Does Not Exist occurs - minimum - default 10 minutes
var gameDoesNotExistDelayMax    = 500;   // how long to wait when a Game Does Not Exist occurs - maximum - default 15 minutes
var gameDoesNotExistTimeout    = 1000;   // how long to wait for the dialog to disappear (default 30 seconds, don't change this)
var joinChatAfterGame      = true;   // join chat after leaving a game
var joinRandomChannel      = false;      // if this is true, will join a random channel, otherwise it will use the channel below..
var joinChannelInChat      = "op gpk";      // leave blank to not join a private channel
var waitBeforeEnterChatMin    = 1000;      // min how long to wait before entering chat
var waitBeforeEnterChatMax    = 2000;      // max how long to wait before entering chat
var waitInChatBeforeActionsMin  = 2000;      // min how long to wait before joining channel
var waitInChatBeforeActionsMax   = 3000;      // max how long to wait before joining channel
var JoinFromChat = true;
var leaderAccountName = "XXXXXXX";      // leader account name here
var gamepassword = '';
var samegame = '';
var oldgame = '';
var check = 1;

// DONT EDIT ANYTHING BELOW THIS

// D2NT Manager Command
const D2NT_MGR_LOADING = 1;
const D2NT_MGR_READY = 2;
const D2NT_MGR_LOGIN = 3;
const D2NT_MGR_CREATE_GAME = 4;
const D2NT_MGR_INGAME = 5;
const D2NT_MGR_RESTART = 6;
const D2NT_MGR_CHICKEN = 7;
const D2NT_MGR_PRINT_STATUS = 8;
const D2NT_MGR_PRINT_LOG = 9;

var lastGameMade = GetTickCount();
var lastGameStatus = 0;
var nextGameMake = 0;
var inGameAt = 0;
var chatActionsDone = false;
var lastGameFailed = false;

Include("libs/controlInfo.ntl");
//Include("joinBotSettings.ntl");

var controlData = new controlInfo();

var game = '';

function NTMain()
{
   Delay(1000);

   var _ingame = false;

   controlData.clickDelay = clickDelay;
   controlData.textDelay = textDelay;
   controlData.clickDelayRandom = clickDelayRandom;
   controlData.textDelayRandom = textDelayRandom;

   while(1)
   {
      if(me.ingame)
      {
         if(!inGameAt)
            inGameAt = GetTickCount();

         if(!_ingame)
         {
            if(Load("NTBot/NTBotGame.ntj"))
            {
               _ingame = true;

      if(me.playtype > 0)
         sendEventToOOG(D2NT_MGR_INGAME, "In Game[IP:" + me.gameserverip.split(".")[3] + "]", 0);
      else
         sendEventToOOG(D2NT_MGR_INGAME, "In Game", 0);

               lastGameStatus = 2; // in game successful
            }
         }

         Delay(1000);
      }
      else
      {
         if(_ingame)
         {
            _ingame = false;

            sendEventToOOG(D2NT_MGR_READY, "", 0);
         }

         locationAction(controlData.getLocation());

         Delay(500);
      }
   }
}

function locationAction(location)
{
   switch(location.id)
   {
 

   case 3: // Lobby Chat
      if(!chatActionsDone)
      {
         chatActionsDone = true;
         Delay(Random(waitInChatBeforeActionsMin, waitInChatBeforeActionsMax));
 
         if(joinRandomChannel || joinChannelInChat != "")
         {
           Say("/join " + (joinRandomChannel ? getRandomString(Random(3,10)) : joinChannelInChat));
            Delay(1000);
        }
      }
 
      if(JoinFromChat){

         game = '';
         Delay(1000);
         if(chat = controlData.get(controlData.controls.lobby.chat.textBox.channelText))
         {
            var errors = '';
            var found_leader = false;
         var linewithname = '';
            lines = chat.GetText();
         if (lines.length > 1)
            for (var friend = 0; friend < lines.length; friend++)
            {
         if (undefined!==lines[friend + 1])
            linewithname = lines[friend + 1];
         if (undefined!==lines[friend + 1])
            linewithname = lines[friend + 2];
           
         if (undefined!==linewithname && linewithname.length > 0)
            if ((lines[friend + 1].lastIndexOf('game called') > -1 || linewithname.lastIndexOf('called') > -1)&& lines[friend].lastIndexOf(leaderAccountName) > -1)
               {
                  game = '';
                  found_leader = true;
                  var regOfflineEnglish=/^\d\s?:\s?(\w*)\s?,\s?offline\s*$/gi;
             
                  if (lines[friend].match(regOfflineEnglish))
                  {
                     errors += (errors == '' ? '' : ' ') + 'leader is offline';
                     Delay(5000);
                  }
               linewithname = linewithname.replace(/^\s+/,"");
               if (linewithname.lastIndexOf('called') > -1)
                  game = linewithname.substring(linewithname.lastIndexOf('called')+7,linewithname.lastIndexOf('.'));
               else
               {
                  game = linewithname.substring(0,linewithname.lastIndexOf('.'));
               }
               linewithname = '';
             
                  if (game != '' && game != samegame && game != oldgame)
                  {
               controlData.click(controlData.controls.lobby.button.join);
                  Delay(2000);
                   controlData.setText( controlData.controls.lobby.join.editBox.gameName, game);
                  Delay (2000);
               controlData.setText( controlData.controls.lobby.join.editBox.password, gamepassword);
                  Delay (2000);
               controlData.click(controlData.controls.lobby.join.button.joinGame);
                  check = 1;
                  }
                  else
                  {
                     if(!errors)
                     {
                        errors = 'leader is not in game.';
                     }
                  }
               }
            }
            if (!found_leader && joinChannelInChat)
            {
               if (errors)
                  Say('Errors : ' + errors);
               else
               //   Say('I couldn\'t find the leader in my friend list.');
               Delay(1500);
            }
         }
         else
         {
            //if (joinChannelInChat)
            //   Say('I can\'t read the chat!');
            Delay(1500);
         }
         
      }
   errors = '';
   if(game != '')
      samegame = game;
      break;
 
     
   case 1:   // Lobby
         if(check == 1)
      {
         sendEventToOOG(D2NT_MGR_CREATE_GAME, location.name, 0);
         outputGameLength();
            lastGameStatus = 0;
            setNextGameMake();
            sendEventToOOG(D2NT_MGR_PRINT_STATUS, location.name, 0);
         check = check + 1;
      }

      if(GetTickCount() >= nextGameMake)
      {
         lastGameFailed = false;

         switch(lastGameStatus)
         {
         case 0:
            controlData.click(controlData.controls.lobby.button.create);
            nextGameMake = GetTickCount() + createGameTimeout; // set our timeout
            sendEventToOOG(D2NT_MGR_PRINT_STATUS, location.name, 0);
            break;
         case 1: // game failed, rollover to reset timer
            inGameAt = GetTickCount(); // reset inGameAt, to wait how long we should have waited..
            lastGameFailed = true;
         case 2:
            outputGameLength();
            lastGameStatus = 0;
            setNextGameMake();
            sendEventToOOG(D2NT_MGR_PRINT_STATUS, location.name, 0);
            break;
         }
      }
      else
         timeoutDelay(nextGameMake-GetTickCount(), location);
      break;

   case 2: // Waiting In Line
      if(GetTickCount()-lastGameMade > waitInLineTimeout)
         controlData.click(controlData.controls.lobby.inLine.button.cancel);
      break;

   case 4: // Create Game
        if(!controlData.get(controlData.controls.lobby.create.editBox.gameName))
        {
            controlData.click(controlData.controls.lobby.button.join);
            Delay (500);
            controlData.click(controlData.controls.lobby.button.create);
            Delay (500);
        }
      sendEventToOOG(D2NT_MGR_CREATE_GAME, location.name, 0);

      RunGC(); // run garbage collector between each game

      locationTimeout(5000, location);

      lastGameMade = GetTickCount();
      lastGameStatus = 1; // pending creation
      break;

   case 5: // Join Game
        if(!controlData.get(controlData.controls.lobby.join.editBox.gameName))
        {
            controlData.click(controlData.controls.lobby.button.create);
            Delay (1000);
            controlData.click(controlData.controls.lobby.button.join);
            Delay (1000);
        }
        if (game != '')
        {
            controlData.setText( controlData.controls.lobby.join.editBox.gameName, game);
            Delay (100);
            //controlData.setText( controlData.controls.lobby.join.editBox.password, gamepassword);
            //Delay (100);
       controlData.click(controlData.controls.lobby.join.button.joinGame);
        }
   check = 1;
       lastGameStatus = 1; // pending creation
      break;

   case 6: // Ladder
      break;

   case 7: // Channel List
      break;

   case 8: // Main Menu
      if(controlData.getCurrentRealmIndex() == me.gatewayid)
      {
         outputGameLength();
         controlData.click(controlData.gameTypes[me.playtype]);
      }
      else
         controlData.click(controlData.controls.mainMenu.button.gateway);
      break;

   case 9: // Login
      sendEventToOOG(D2NT_MGR_PRINT_STATUS, location.name, 0);
      Delay(loginDelay);

      controlData.setText(controlData.controls.login.editBox.accountName, me.account);

      sendEventToOOG(D2NT_MGR_LOGIN, location.name, 0);

      locationTimeout(5000, location);
      break;

   case 10: // Login Error (this is a fatal error, so stop)
      sendEventToOOG(D2NT_MGR_RESTART, location.name, 10);
      Delay(3500);
      break;

   case 11: // Unable To Connect
      timeoutDelay(unableToConnectRetry*60*1000, location)
      controlData.click(controlData.controls.login.unableToConnect.button.ok);
      break;

   case 12: // Character Select
      var _time, _control;

      sendEventToOOG(D2NT_MGR_PRINT_STATUS, location.name, 0);

      for(_time = 0 ; _time < characterScreenTimeout ; _time += 500)
      {
         _control = controlData.get(controlData.controls.characterSelect.textBox.characterInfo[me.charloc]);
         if(_control && _control.GetText() != undefined)
            break;

         Delay(500);
      }

      if(_time < characterScreenTimeout)
      {
         Delay(characterSelectDelay);

         controlData.click(controlData.controls.characterSelect.textBox.characters[me.charloc], 0, 0, 1);
         controlData.click(controlData.controls.characterSelect.textBox.characterInfo[me.charloc], 0, 0, 1);

         // reset last game made, so it doesnt make a game immediately
         inGameAt = 0;
         setNextGameMake();
      }
      else
      {
         controlData.click(controlData.controls.characterSelect.button.exit);
         timeoutDelay(realmDownRetry*60*1000, location);
      }
      break;

   case 13: // Realm Down - Character Select screen
      controlData.click(controlData.controls.characterSelect.button.exit);
      timeoutDelay(realmDownRetry*60*1000, location);
      break;

   case 14: // Character Select - Disconnected
      timeoutDelay(disconnectedRetry*60*1000, location);
      controlData.click(controlData.controls.characterSelect.disconnected.button.ok);
      break;

   case 15: // New Character
      break;   

   case 16: // Character Select - Please Wait popup
      if(!locationTimeout(pleaseWaitTimeout, location))
         controlData.click(controlData.controls.characterSelect.pleaseWait.button.cancel);
      break;

   case 17: // Lobby - Lost Connection - just click okay, since we're toast anyway
      controlData.click(controlData.controls.lobby.lostConnection.button.ok);
      break;

   case 18: // D2 Splash
      controlData.click(controlData.controls.d2Splash.textBox.copyright);
      break;

   case 19: // Login - Cdkey In Use
      timeoutDelay(cdkeyInUseRetry*60*1000, location);
      controlData.click(controlData.controls.login.cdkeyInUse.button.ok);
      break;

   case 20: // Single Player - Select Difficulty
      RunGC(); // run garbage collector between each game

      controlData.click(controlData.singlePlayerDifficulties[me.diff]);
      break;

   case 21: // Main Menu - Connecting
      if(!locationTimeout(connectingToBnetTimeout, location))
         controlData.click(controlData.controls.mainMenu.connecting.button.cancel);
      break;

   case 22: // Login - Invalid Cdkey (classic or xpac)
      sendEventToOOG(D2NT_MGR_RESTART, location.name, 3600);
      Delay(3500);
      break;   

   case 23: // Character Select - Connecting
      if(!locationTimeout(characterScreenTimeout, location))
         controlData.click(controlData.controls.characterSelect.button.exit);
      break;

   case 24: // Server Down - not much to do but wait..
      break;

   case 25: // Lobby - Please Wait
      if(!locationTimeout(pleaseWaitTimeout, location))
         controlData.click(controlData.controls.lobby.pleaseWait.button.cancel);
      break;

   case 26: // Lobby - Game Name Exists
      //sendEventToOOG(D2NT_MGR_PRINT_LOG, "Game already exists", 0);

      //inGameAt = 0;
      //lastGameStatus = 0;
      //setNextGameMake();
   this.controls.lobby.button.quit   
      locationTimeout(15000, location);
      break;

   case 27: // Gateway Select
      controlData.clickRealmEntry(me.gatewayid);
      controlData.click(controlData.controls.gateway.button.ok);
      break;

   case 28: // Lobby - Game Does Not Exist

   Delay(160000);   // 40 seconds longer then leader's min game time, edit yourself
   controlData.click(controlData.controls.lobby.button.quit)
   Delay(1000);
   controlData.click(controlData.controls.characterSelect.textBox.characters[me.charloc], 0, 0, 1);
   controlData.click(controlData.controls.characterSelect.textBox.characterInfo[me.charloc], 0, 0, 1)
   oldgame = game;

      break;
   }
}

function sendEventToOOG(locationId, statusString, pendingTime)
{
   return SendCopyData("D2NT Manager", null, (locationId<<16)|pendingTime, statusString);
}

function setNextGameMake()
{
   lastGameMade = GetTickCount();
   nextGameMake = lastGameMade + createGameThreshold + Random(0-createGameThresholdRandom, createGameThresholdRandom) + inGameAt;
   inGameAt = 0;
   chatActionsDone = false;
}

function outputGameLength()
{
   if(inGameAt)
   {
      duration = GetTickCount() - inGameAt;

      inGameAt = (duration < gameMinLength ? gameMinLength - duration : 0);
   }
}

function locationTimeout(time, location)
{
   endtime = GetTickCount() + time;

   while(controlData.getLocation().id == location.id && endtime > GetTickCount())
   {
      sendEventToOOG(D2NT_MGR_PRINT_STATUS, location.name + " (" + parseInt((endtime-GetTickCount())/1000) + "s)", 0);
      Delay(500);
   }

   return (controlData.getLocation().id != location.id);
}

function timeoutDelay(time, location)
{
   endtime = GetTickCount() + time;

   while(endtime > GetTickCount())
   {
      sendEventToOOG(D2NT_MGR_PRINT_STATUS, location.name + " (" + parseInt((endtime-GetTickCount())/1000) + "s)", 0);
      Delay(1000);
   }
}

function getRandomString(_length)
{
   _retString = "";
   _charSet = "0123456789abcdefghijklmnopqrstuvwxyz";

   while(_length--)
   {
      _retString += _charSet.charAt(Random(0, _charSet.length-1));
      Delay(1);
   }

   return _retString;
}


Offline fireshocker

  • Newbie
  • *
  • Join Date: Jun 2010
  • Posts: 11
  • Reputation 0
    • View Profile
Re: Baal leech script help
« Reply #6 on: September 07, 2010, 03:28:02 PM »
http://purekaoz.com/index.php/topic,113.0.html

this topic was in the archives that my son had an issue with game name being wrong.  it was an eeasy fix.   hope this helps

Offline Deaths_A_13itch

  • Newbie
  • *
  • Join Date: Aug 2010
  • Posts: 7
  • Reputation 0
  • here to mf the shit out of D2
    • View Profile
Re: Baal leech script help
« Reply #7 on: September 09, 2010, 10:58:00 AM »
ok so i can get it to join, but now i added in the eldritch run to get full rejuvs and the sorc wont take the baal tp
without the eldritch run she takes the tp but doesnt fight or go and kill baal
can i make it do that? cuz i really need someone to kill the seconds wave for my hdin(he uses all his pots)
« Last Edit: September 09, 2010, 11:01:51 AM by Deaths_A_13itch »

PureKaoz.com - D2NT, Diablo 3 & Starcaft 2 Hacks

Re: Baal leech script help
« Reply #7 on: September 09, 2010, 10:58:00 AM »

cooptheking

  • Guest
Re: Baal leech script help
« Reply #8 on: September 09, 2010, 11:39:02 AM »
ok so i can get it to join, but now i added in the eldritch run to get full rejuvs and the sorc wont take the baal tp
without the eldritch run she takes the tp but doesnt fight or go and kill baal
can i make it do that? cuz i really need someone to kill the seconds wave for my hdin(he uses all his pots)

Okay~ So just to recap.
Your sorc will not take the baal tp IF you run eldritch before hand?
But if you do not run eldritch she takes tp?

Offline Deaths_A_13itch

  • Newbie
  • *
  • Join Date: Aug 2010
  • Posts: 7
  • Reputation 0
  • here to mf the shit out of D2
    • View Profile
Re: Baal leech script help
« Reply #9 on: September 09, 2010, 07:17:02 PM »
yeh, sorry if that was confusing

PureKaoz.com - D2NT, Diablo 3 & Starcaft 2 Hacks

Re: Baal leech script help
« Reply #9 on: September 09, 2010, 07:17:02 PM »

cooptheking

  • Guest
Re: Baal leech script help
« Reply #10 on: September 09, 2010, 07:31:28 PM »
Please post your baal script again

Offline Deaths_A_13itch

  • Newbie
  • *
  • Join Date: Aug 2010
  • Posts: 7
  • Reputation 0
  • here to mf the shit out of D2
    • View Profile
Re: Baal leech script help
« Reply #11 on: September 10, 2010, 03:59:47 AM »
Code: [Select]
var gameMinLength      = 60000;   // time in milliseconds, minimum game length, 180 seconds default (1 game/3 minutes)

var unableToConnectRetry    = 5;      // time in minutes to retry connecting on connection fail (real value is +/- 1 min)
var realmDownRetry      = 260;      // time in minutes to retry connecting on a realm down (default is 120 minutes)
var disconnectedRetry      = 5;      // time in minutes to retry on a disconnection (usually ip ban related)
var cdkeyInUseRetry      = 5;      // time in minutes to retry on a cdkey in use error message (set to 0 to stop)
var connectingToBnetTimeout   = 20000;   // time in milliseconds to wait for a login to time out and click cancel and retry
var characterScreenTimeout    = 5000;   // time in milliseconds to wait for character screen to appear
var pleaseWaitTimeout      = 2000;   // time in milliseconds to wait for a please wait popup
var createGameThreshold      = 5000;      // time in milliseconds to wait between making games
var createGameThresholdRandom   = 1000;      // time in milliseconds to randomly add +/- to the game create time
var createGameTimeout      = 15000;   // time in milliseconds to register a failed to create game
var waitInLineTimeout      = 60000;   // time in milliseconds to wait in lines for a create game (60 second default)
var characterSelectDelay    = 1000;      // time in milliseconds to wait before selecting a character on the char screen
var loginDelay          = 1000;      // time in milliseconds to wait before submitting login information
var clickDelay          = 500;      // wait X milliseconds before next action after a click event
var textDelay          = 500;      // wait X milliseconds before next action after inserting text into a textbox
var clickDelayRandom      = 500;      // random amount of time to add to a click
var textDelayRandom      = 500;      // random amount of time to add to a text set
var gameDoesNotExistDelayMin    = 500;   // how long to wait when a Game Does Not Exist occurs - minimum - default 10 minutes
var gameDoesNotExistDelayMax    = 500;   // how long to wait when a Game Does Not Exist occurs - maximum - default 15 minutes
var gameDoesNotExistTimeout    = 1000;   // how long to wait for the dialog to disappear (default 30 seconds, don't change this)
var joinChatAfterGame      = true;   // join chat after leaving a game
var joinRandomChannel      = false;      // if this is true, will join a random channel, otherwise it will use the channel below..
var joinChannelInChat      = "mijy";      // leave blank to not join a private channel
var waitBeforeEnterChatMin    = 1000;      // min how long to wait before entering chat
var waitBeforeEnterChatMax    = 2000;      // max how long to wait before entering chat
var waitInChatBeforeActionsMin  = 2000;      // min how long to wait before joining channel
var waitInChatBeforeActionsMax   = 3000;      // max how long to wait before joining channel
var JoinFromChat = true;
var leaderAccountName = "mijy2011";      // leader account name here
var gamepassword = '';
var samegame = '';
var oldgame = '';
var check = 1;

// DONT EDIT ANYTHING BELOW THIS

// D2NT Manager Command
const D2NT_MGR_LOADING = 1;
const D2NT_MGR_READY = 2;
const D2NT_MGR_LOGIN = 3;
const D2NT_MGR_CREATE_GAME = 4;
const D2NT_MGR_INGAME = 5;
const D2NT_MGR_RESTART = 6;
const D2NT_MGR_CHICKEN = 7;
const D2NT_MGR_PRINT_STATUS = 8;
const D2NT_MGR_PRINT_LOG = 9;

var lastGameMade = GetTickCount();
var lastGameStatus = 0;
var nextGameMake = 0;
var inGameAt = 0;
var chatActionsDone = false;
var lastGameFailed = false;

Include("libs/controlInfo.ntl");
//Include("joinBotSettings.ntl");

var controlData = new controlInfo();

var game = '';

function NTMain()
{
   Delay(1000);

   var _ingame = false;

   controlData.clickDelay = clickDelay;
   controlData.textDelay = textDelay;
   controlData.clickDelayRandom = clickDelayRandom;
   controlData.textDelayRandom = textDelayRandom;

   while(1)
   {
      if(me.ingame)
      {
         if(!inGameAt)
            inGameAt = GetTickCount();

         if(!_ingame)
         {
            if(Load("NTBot/NTBotGame.ntj"))
            {
               _ingame = true;

      if(me.playtype > 0)
         sendEventToOOG(D2NT_MGR_INGAME, "In Game[IP:" + me.gameserverip.split(".")[3] + "]", 0);
      else
         sendEventToOOG(D2NT_MGR_INGAME, "In Game", 0);

               lastGameStatus = 2; // in game successful
            }
         }

         Delay(1000);
      }
      else
      {
         if(_ingame)
         {
            _ingame = false;

            sendEventToOOG(D2NT_MGR_READY, "", 0);
         }

         locationAction(controlData.getLocation());

         Delay(500);
      }
   }
}

function locationAction(location)
{
   switch(location.id)
   {
 

   case 3: // Lobby Chat
      if(!chatActionsDone)
      {
         chatActionsDone = true;
         Delay(Random(waitInChatBeforeActionsMin, waitInChatBeforeActionsMax));
 
         if(joinRandomChannel || joinChannelInChat != "")
         {
           Say("/join " + (joinRandomChannel ? getRandomString(Random(3,10)) : joinChannelInChat));
            Delay(1000);
        }
      }
 
      if(JoinFromChat){

         game = '';
         Delay(1000);
         if(chat = controlData.get(controlData.controls.lobby.chat.textBox.channelText))
         {
            var errors = '';
            var found_leader = false;
         var linewithname = '';
            lines = chat.GetText();
         if (lines.length > 1)
            for (var friend = 0; friend < lines.length; friend++)
            {
         if (undefined!==lines[friend + 1])
            linewithname = lines[friend + 1];
         if (undefined!==lines[friend + 1])
            linewithname = lines[friend + 2];
           
         if (undefined!==linewithname && linewithname.length > 0)
            if ((lines[friend + 1].lastIndexOf('game called') > -1 || linewithname.lastIndexOf('called') > -1)&& lines[friend].lastIndexOf(leaderAccountName) > -1)
               {
                  game = '';
                  found_leader = true;
                  var regOfflineEnglish=/^\d\s?:\s?(\w*)\s?,\s?offline\s*$/gi;
             
                  if (lines[friend].match(regOfflineEnglish))
                  {
                     errors += (errors == '' ? '' : ' ') + 'leader is offline';
                     Delay(5000);
                  }
               linewithname = linewithname.replace(/^\s+/,"");
               if (linewithname.lastIndexOf('called') > -1)
                  game = linewithname.substring(linewithname.lastIndexOf('called')+7,linewithname.lastIndexOf('.'));
               else
               {
                  game = linewithname.substring(0,linewithname.lastIndexOf('.'));
               }
               linewithname = '';
             
                  if (game != '' && game != samegame && game != oldgame)
                  {
               controlData.click(controlData.controls.lobby.button.join);
                  Delay(2000);
                   controlData.setText( controlData.controls.lobby.join.editBox.gameName, game);
                  Delay (2000);
               controlData.setText( controlData.controls.lobby.join.editBox.password, gamepassword);
                  Delay (2000);
               controlData.click(controlData.controls.lobby.join.button.joinGame);
                  check = 1;
                  }
                  else
                  {
                     if(!errors)
                     {
                        errors = 'leader is not in game.';
                     }
                  }
               }
            }
            if (!found_leader && joinChannelInChat)
            {
               if (errors)
                  Say('Errors : ' + errors);
               else
               //   Say('I couldn\'t find the leader in my friend list.');
               Delay(1500);
            }
         }
         else
         {
            //if (joinChannelInChat)
            //   Say('I can\'t read the chat!');
            Delay(1500);
         }
         
      }
   errors = '';
   if(game != '')
      samegame = game;
      break;
 
     
   case 1:   // Lobby
         if(check == 1)
      {
         sendEventToOOG(D2NT_MGR_CREATE_GAME, location.name, 0);
         outputGameLength();
            lastGameStatus = 0;
            setNextGameMake();
            sendEventToOOG(D2NT_MGR_PRINT_STATUS, location.name, 0);
         check = check + 1;
      }

      if(GetTickCount() >= nextGameMake)
      {
         lastGameFailed = false;

         switch(lastGameStatus)
         {
         case 0:
            controlData.click(controlData.controls.lobby.button.create);
            nextGameMake = GetTickCount() + createGameTimeout; // set our timeout
            sendEventToOOG(D2NT_MGR_PRINT_STATUS, location.name, 0);
            break;
         case 1: // game failed, rollover to reset timer
            inGameAt = GetTickCount(); // reset inGameAt, to wait how long we should have waited..
            lastGameFailed = true;
         case 2:
            outputGameLength();
            lastGameStatus = 0;
            setNextGameMake();
            sendEventToOOG(D2NT_MGR_PRINT_STATUS, location.name, 0);
            break;
         }
      }
      else
         timeoutDelay(nextGameMake-GetTickCount(), location);
      break;

   case 2: // Waiting In Line
      if(GetTickCount()-lastGameMade > waitInLineTimeout)
         controlData.click(controlData.controls.lobby.inLine.button.cancel);
      break;

   case 4: // Create Game
        if(!controlData.get(controlData.controls.lobby.create.editBox.gameName))
        {
            controlData.click(controlData.controls.lobby.button.join);
            Delay (500);
            controlData.click(controlData.controls.lobby.button.create);
            Delay (500);
        }
      sendEventToOOG(D2NT_MGR_CREATE_GAME, location.name, 0);

      RunGC(); // run garbage collector between each game

      locationTimeout(5000, location);

      lastGameMade = GetTickCount();
      lastGameStatus = 1; // pending creation
      break;

   case 5: // Join Game
        if(!controlData.get(controlData.controls.lobby.join.editBox.gameName))
        {
            controlData.click(controlData.controls.lobby.button.create);
            Delay (1000);
            controlData.click(controlData.controls.lobby.button.join);
            Delay (1000);
        }
        if (game != '')
        {
            controlData.setText( controlData.controls.lobby.join.editBox.gameName, game);
            Delay (100);
            //controlData.setText( controlData.controls.lobby.join.editBox.password, gamepassword);
            //Delay (100);
       controlData.click(controlData.controls.lobby.join.button.joinGame);
        }
   check = 1;
       lastGameStatus = 1; // pending creation
      break;

   case 6: // Ladder
      break;

   case 7: // Channel List
      break;

   case 8: // Main Menu
      if(controlData.getCurrentRealmIndex() == me.gatewayid)
      {
         outputGameLength();
         controlData.click(controlData.gameTypes[me.playtype]);
      }
      else
         controlData.click(controlData.controls.mainMenu.button.gateway);
      break;

   case 9: // Login
      sendEventToOOG(D2NT_MGR_PRINT_STATUS, location.name, 0);
      Delay(loginDelay);

      controlData.setText(controlData.controls.login.editBox.accountName, me.account);

      sendEventToOOG(D2NT_MGR_LOGIN, location.name, 0);

      locationTimeout(5000, location);
      break;

   case 10: // Login Error (this is a fatal error, so stop)
      sendEventToOOG(D2NT_MGR_RESTART, location.name, 10);
      Delay(3500);
      break;

   case 11: // Unable To Connect
      timeoutDelay(unableToConnectRetry*60*1000, location)
      controlData.click(controlData.controls.login.unableToConnect.button.ok);
      break;

   case 12: // Character Select
      var _time, _control;

      sendEventToOOG(D2NT_MGR_PRINT_STATUS, location.name, 0);

      for(_time = 0 ; _time < characterScreenTimeout ; _time += 500)
      {
         _control = controlData.get(controlData.controls.characterSelect.textBox.characterInfo[me.charloc]);
         if(_control && _control.GetText() != undefined)
            break;

         Delay(500);
      }

      if(_time < characterScreenTimeout)
      {
         Delay(characterSelectDelay);

         controlData.click(controlData.controls.characterSelect.textBox.characters[me.charloc], 0, 0, 1);
         controlData.click(controlData.controls.characterSelect.textBox.characterInfo[me.charloc], 0, 0, 1);

         // reset last game made, so it doesnt make a game immediately
         inGameAt = 0;
         setNextGameMake();
      }
      else
      {
         controlData.click(controlData.controls.characterSelect.button.exit);
         timeoutDelay(realmDownRetry*60*1000, location);
      }
      break;

   case 13: // Realm Down - Character Select screen
      controlData.click(controlData.controls.characterSelect.button.exit);
      timeoutDelay(realmDownRetry*60*1000, location);
      break;

   case 14: // Character Select - Disconnected
      timeoutDelay(disconnectedRetry*60*1000, location);
      controlData.click(controlData.controls.characterSelect.disconnected.button.ok);
      break;

   case 15: // New Character
      break;   

   case 16: // Character Select - Please Wait popup
      if(!locationTimeout(pleaseWaitTimeout, location))
         controlData.click(controlData.controls.characterSelect.pleaseWait.button.cancel);
      break;

   case 17: // Lobby - Lost Connection - just click okay, since we're toast anyway
      controlData.click(controlData.controls.lobby.lostConnection.button.ok);
      break;

   case 18: // D2 Splash
      controlData.click(controlData.controls.d2Splash.textBox.copyright);
      break;

   case 19: // Login - Cdkey In Use
      timeoutDelay(cdkeyInUseRetry*60*1000, location);
      controlData.click(controlData.controls.login.cdkeyInUse.button.ok);
      break;

   case 20: // Single Player - Select Difficulty
      RunGC(); // run garbage collector between each game

      controlData.click(controlData.singlePlayerDifficulties[me.diff]);
      break;

   case 21: // Main Menu - Connecting
      if(!locationTimeout(connectingToBnetTimeout, location))
         controlData.click(controlData.controls.mainMenu.connecting.button.cancel);
      break;

   case 22: // Login - Invalid Cdkey (classic or xpac)
      sendEventToOOG(D2NT_MGR_RESTART, location.name, 3600);
      Delay(3500);
      break;   

   case 23: // Character Select - Connecting
      if(!locationTimeout(characterScreenTimeout, location))
         controlData.click(controlData.controls.characterSelect.button.exit);
      break;

   case 24: // Server Down - not much to do but wait..
      break;

   case 25: // Lobby - Please Wait
      if(!locationTimeout(pleaseWaitTimeout, location))
         controlData.click(controlData.controls.lobby.pleaseWait.button.cancel);
      break;

   case 26: // Lobby - Game Name Exists
      //sendEventToOOG(D2NT_MGR_PRINT_LOG, "Game already exists", 0);

      //inGameAt = 0;
      //lastGameStatus = 0;
      //setNextGameMake();
   this.controls.lobby.button.quit   
      locationTimeout(15000, location);
      break;

   case 27: // Gateway Select
      controlData.clickRealmEntry(me.gatewayid);
      controlData.click(controlData.controls.gateway.button.ok);
      break;

   case 28: // Lobby - Game Does Not Exist

   Delay(160000);   // 40 seconds longer then leader's min game time, edit yourself
   controlData.click(controlData.controls.lobby.button.quit)
   Delay(1000);
   controlData.click(controlData.controls.characterSelect.textBox.characters[me.charloc], 0, 0, 1);
   controlData.click(controlData.controls.characterSelect.textBox.characterInfo[me.charloc], 0, 0, 1)
   oldgame = game;

      break;
   }
}

function sendEventToOOG(locationId, statusString, pendingTime)
{
   return SendCopyData("D2NT Manager", null, (locationId<<16)|pendingTime, statusString);
}

function setNextGameMake()
{
   lastGameMade = GetTickCount();
   nextGameMake = lastGameMade + createGameThreshold + Random(0-createGameThresholdRandom, createGameThresholdRandom) + inGameAt;
   inGameAt = 0;
   chatActionsDone = false;
}

function outputGameLength()
{
   if(inGameAt)
   {
      duration = GetTickCount() - inGameAt;

      inGameAt = (duration < gameMinLength ? gameMinLength - duration : 0);
   }
}

function locationTimeout(time, location)
{
   endtime = GetTickCount() + time;

   while(controlData.getLocation().id == location.id && endtime > GetTickCount())
   {
      sendEventToOOG(D2NT_MGR_PRINT_STATUS, location.name + " (" + parseInt((endtime-GetTickCount())/1000) + "s)", 0);
      Delay(500);
   }

   return (controlData.getLocation().id != location.id);
}

function timeoutDelay(time, location)
{
   endtime = GetTickCount() + time;

   while(endtime > GetTickCount())
   {
      sendEventToOOG(D2NT_MGR_PRINT_STATUS, location.name + " (" + parseInt((endtime-GetTickCount())/1000) + "s)", 0);
      Delay(1000);
   }
}

function getRandomString(_length)
{
   _retString = "";
   _charSet = "0123456789abcdefghijklmnopqrstuvwxyz";

   while(_length--)
   {
      _retString += _charSet.charAt(Random(0, _charSet.length-1));
      Delay(1);
   }

   return _retString;
}

thats the NTBotLeech


Code: [Select]
function NTMain()
{
Include("libs/common/NTCommon.ntl");
NTC_IncludeLibs();
NTC_IncludeConfig("NTBot/char_configs");

var i;
var _wave;
var _starttick;

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(129))
{
NTC_SendMsgToScript("NTBotGame.ntj", "NTM_TakeWaypoint()");
return;
}

NTP_DoPrecast(true);

for(i = 0 ; i < 2 ; i++)
{
if(!NTM_MoveToStair(me.areaid, 130+i))
{
NTC_SendMsgToScript("NTBotGame.ntj", "NTM_MoveToStair()");
return;
}

if(!NTM_TakeStair(130+i))
{
NTC_SendMsgToScript("NTBotGame.ntj", "NTM_TakeStair()");
return;
}
}

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

NTA_ClearPosition(20, true, 2);

if(NTConfig_PublicMode)
{
NTM_MoveTo(me.areaid, 15112, 5004, 1, true);
NTA_ClearPosition(20, true, 2);
NTM_MoveTo(me.areaid, 15116, 5004);

NTM_MakeTP();
Say("TP up, Be careful!");
}

NT_ClearThroneInt();

if(NTConfig_PublicMode)
{
NTM_MoveTo(me.areaid, 15112, 5004, 1, true);

NTM_MakeTP();
Say("Tp safe, Help clear wave 2 :)");
}

while(1)
{
if(me.classid == NTC_CHAR_CLASS_PALADIN || me.classid == NTC_CHAR_CLASS_BARBARIAN)
NTM_MoveTo(me.areaid, 15092, 5028);
else
NTM_MoveTo(me.areaid, 15092, 5040);

if(me.GetState(2))
NTC_PutSkill(109, NTC_HAND_RIGHT);

for(i = 0 ; i < 6 ; i++)
{
_wave = NT_ThroneCheckInt();
if(_wave > 0)
break;

NTC_Delay(500);
}

_starttick = GetTickCount();

while(_wave == 0)
{
if(!NT_ThronePreAttackInt())
NTC_Delay(200);

if(GetTickCount()-_starttick > 15000)
{
NT_ClearThroneInt();

_starttick = GetTickCount();
}

_wave = NT_ThroneCheckInt();
}

switch(_wave)
{
case 1:
NTA_ClearPosition(40, true, 1);
NTP_DoPrecast(true);
break;
case 3:
NTA_ClearPosition(40, true, 2);
NT_CheckHydraInt();
break;
case 4:
NTA_ClearPosition(40, true, 2);
break;
case 5:
NTA_ClearPosition(40, true);
break;
default:
NTA_ClearPosition(40, true, 1);
break;
}

if(_wave == 5)
break;
}

if(NTConfig_KillBaal)
{
var _portal;

if(NTConfig_PublicMode)
Say("Kill that mofo!");

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

NTM_MoveTo(me.areaid, 15092, 5010);

NTP_DoPrecast(true);

while(NTC_FindUnit(NTC_UNIT_MONSTER, 543))
NTC_Delay(500);

_portal = NTC_FindUnit(NTC_UNIT_OBJECT, 563, 1);

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

if(!NTM_UsePortal("Portal", 132, null, _portal))
{
NTC_SendMsgToScript("NTBotGame.ntj", "NTM_UsePortal()");
return;
}

NTM_MoveTo(me.areaid, 15138, 5916);

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

NTSI_PickItems();
}

if(NTConfig_PublicMode)
Say("2 Ez, Next game in ~15 seconds!!");

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

// Internal function
function NT_ClearThroneInt()
{
var _attackpos = [15112, 5068, 15075, 5065, 15114, 5045, 15114, 5012, 15095, 5024, 15078, 5013, 15092, 5040];

for(var i = 0 ; i < _attackpos.length ; i += 2)
{
NTM_MoveTo(me.areaid, _attackpos[i], _attackpos[i+1]);

NTA_ClearPosition(25, true, 2);
}
}

function NT_ThroneCheckInt()
{
var _monster;

if(!NTC_FindUnit(NTC_UNIT_MONSTER, 543))
return 5;

_monster = NTC_FindUnit(NTC_UNIT_MONSTER);

if(_monster)
{
do
{
if(NTA_IsValidMonster(_monster))
{
if(_monster.classid == 23 || _monster.classid == 62)
return 1;

if(_monster.classid == 105 || _monster.classid == 381)
return 2;

if(_monster.classid == 557)
return 3;

if(_monster.classid == 558)
return 4;

if(_monster.classid == 571)
return 5;
}
} while(_monster.GetNext());
}

return 0;
}

function NT_ThronePreAttackInt()
{
if(me.classid == NTC_CHAR_CLASS_SORCERESS)
{
if(NTConfig_AttackSkill[3] == 56 || NTConfig_AttackSkill[3] == 59)
return NTC_CastSkill(NTConfig_AttackSkill[3], 2, 15092, 5028);
}
else if(me.classid == NTC_CHAR_CLASS_PALADIN)
{
if(NTConfig_AttackSkill[3] == 112)
{
if(NTConfig_AttackSkill[4] > 0)
NTC_PutSkill(NTConfig_AttackSkill[4], NTC_HAND_RIGHT);

return NTC_CastSkill(NTConfig_AttackSkill[3], 2);
}
}

return false;
}

function NT_CheckHydraInt()
{
var _hydra1, _hydra2, _hydra3;

_hydra1 = NTC_FindUnit(NTC_UNIT_MONSTER, 351);
_hydra2 = NTC_FindUnit(NTC_UNIT_MONSTER, 352);
_hydra3 = NTC_FindUnit(NTC_UNIT_MONSTER, 353);

if((_hydra1 && _hydra1.GetStat(172) != 2 && _hydra1.GetState(105))
|| (_hydra2 && _hydra2.GetStat(172) != 2 && _hydra2.GetState(105))
|| (_hydra3 && _hydra3.GetStat(172) != 2 && _hydra3.GetState(105)))
{
NTM_MoveTo(me.areaid, 15112, 5004);

if(me.GetState(2))
NTC_PutSkill(109, NTC_HAND_RIGHT);

NTC_PingDelay(3000);
}
}

thats my NTBaal script

PureKaoz.com - D2NT, Diablo 3 & Starcaft 2 Hacks

Re: Baal leech script help
« Reply #11 on: September 10, 2010, 03:59:47 AM »