Author Topic: Baalleechfight - Change CD keys. Currently restarting.  (Read 517 times)

Offline hendricius

  • Newbie
  • *
  • Join Date: Sep 2010
  • Posts: 5
  • Reputation 0
  • I <3 PureKaoz.com
    • View Profile
Baalleechfight - Change CD keys. Currently restarting.
« on: September 09, 2010, 01:03:21 PM »
My leechers keep restarting after every game as it seems that the entry point leecher does not support switching CD-Keys. I have read a few other thread where someone had the same problem and figured out a solution, but didn't post it.

I'd like the leechers to behave just like the leader and switch cd keys after x games.


Wall of code incoming.

Thanks!

NTBotLeech:
[noae]
Code: [Select]
//##############################################################################################################################
// Do Not distribute these scripts without the credits #########################################################################
//##############################################################################################################################
//Regards - Medix from [url]http://www.bot-area.net[/url] #################################################################################
//##############################################################################################################################
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      = 180;      // 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   = 10000;   // time in milliseconds to wait for character screen to appear
var pleaseWaitTimeout      = 10000;   // 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   = 1000;   // how long to wait when a Game Does Not Exist occurs - minimum - default 10 minutes
var gameDoesNotExistDelayMax   = 1000;   // how long to wait when a Game Does Not Exist occurs - maximum - default 15 minutes
var gameDoesNotExistTimeout   = 30000;   // 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      = "";      // 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   = 5000;      // min how long to wait before joining channel
var waitInChatBeforeActionsMax   = 8000;      // max how long to wait before joining channel
var JoinFromChat = true;
//########################################################################################################################################
//################################AUTOMULE SETTINGS#######################################################################################
//########################################################################################################################################
var MuleAccount = "MULE ACC NAME";
var MulePassword = "MULE ACC PW";
var MuleCharLocation = 0; // charloc 1 = 0 , charloc 2 = 1 , charloc 3 = 2, ..... counts +1 after mule is full
var MuleGame = "MULE GAME NAME";
var MuleGamePassword ="MULE GAME PW";
//#########################################################################################################################################
//################################LEECHBOT SETTINGS########################################################################################
//#########################################################################################################################################
var leaderAccountName = "hendricius";   // Leader // achtet auf grofl und kleinschreibung!!
var gamepassword = 'xxx';      // Wenn du ein Passwort f?r deine Baalruns verwendest, schreibe es hier zwischen die zwei ''
var ChatFLDelay = Random(15000, 30000); //delay between /f l in ms
var JoinGameAgain = true; // Bot joins same game again after leaving it due chicken
//#########################################################################################################################################
//#########################################################################################################################################
//#########################################################################################################################################



// 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;
var zxetay = false;
var samegame = '';
var oldgame = '';
var check = 1;

Include("libs/controlInfo.ntl");
Include("libs/common/NTCommon.ntl");
//Include("joinBotSettings.ntl");
NTC_IncludeLibs();
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(zxetay){
if(Load("NTBot/NTMule.ntj"))
{
_ingame = true;

sendEventToOOG(D2NT_MGR_INGAME, "In Game", 0);
lastGameStatus = 2; // in game successful
}

}

else {


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

sendEventToOOG(D2NT_MGR_INGAME, "In Game", 0);
lastGameStatus = 2; // in game successful
}
}
}
Delay(1000);
}
else
{
if(_ingame)
{
_ingame = false;

sendEventToOOG(D2NT_MGR_READY, "", 0);
}


RegisterEvent(EVENT_SCRIPTMSG, NT_ScriptMsgEvents1);




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(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(JoinFromChat){
game = '';
if (joinChannelInChat)
Delay (1200);
//Say('Locating the leader : '+leaderAccountName);

Say('/f l');
Delay(ChatFLDelay);
if(chat = controlData.get(controlData.controls.lobby.chat.textBox.channelText))
{
var errors = '';
var found_leader = false;
lines = chat.GetText();
for (var friend = 0; friend < lines.length; friend++)
{
if (lines[friend].lastIndexOf(': '+leaderAccountName+',') > -1)
{
game = '';
found_leader = true;
var regOfflineEnglish=/^\d\s?:\s?(\w*)\s?,\s?offline\s*$/gi;
var regGameNameEnglish=/^\s*(the\s)?(game\s)?([\w\s-]*\w)\s\(private\)\.\s*$/gi;
var regGameNameFrench=/^\s*(la\s)?(partie\s)?([\w\s-]*\w)\s\(priv[^\)]*\)\.\s*$/gi;             
var regGameNameGerman=/^\s*(Destruction\s)?(in\s)?(das\s)?(Spiel\s)?\'([\w\s-]*\w)\'\s\(privat[^\)]*\)\.\s*$/gi;

if (lines[friend].match(regOfflineEnglish))

{
errors += (errors == '' ? '' : ' ') + 'leader is offline';
//  if (joinChannelInChat)
// Say('Leader is offline, delay 10 sec.');
//  Delay(5000);
} //err starts here
if (lines[friend + 1].match(regGameNameEnglish) && lines[friend+1].substr(1, 1) != ':')
{
game = lines[friend + 1].replace(regGameNameEnglish, "$3");
}
if (!game && lines[friend + 1].match(regGameNameFrench) && lines[friend+1].substr(1, 1) != ':')
{
game = lines[friend + 1].replace(regGameNameFrench, "$3");
}

if (!game && lines[friend + 1].match(regGameNameGerman) && lines[friend+1].substr(1, 1) != ':')
{
game = lines[friend + 1].replace(regGameNameGerman, "$5");
}
if (!game && lines[friend + 1].match(regGameNameFrench) && lines[friend+1].substr(1, 1) != ':')
{
game = lines[friend + 1].replace(regGameNameFrench, "$3");
}
if(!JoinGameAgain)
{
if (game != '' && game != samegame)
{
if (joinChannelInChat)
Delay(500);
//Say('I found him! In the game ' + game);

controlData.click(controlData.controls.lobby.button.join);
Delay (200);
}
else
{
if(!errors)
{
errors = 'leader is not in game.';
}

}
}

else
{
if (game != '')
{
if (joinChannelInChat)
Delay(500);
//Say('I found him! In the game ' + game);

controlData.click(controlData.controls.lobby.button.join);
Delay (200);
}
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 (200);
             controlData.setText( controlData.controls.lobby.join.editBox.password, gamepassword);
            Delay (200);
             controlData.click(controlData.controls.lobby.join.button.joinGame);
            Delay (800);
        controlData.click(controlData.controls.lobby.button.quit);                       
            Delay (800);
             controlData.click(controlData.controls.lobby.button.join);
            RunGC(); // run garbage collector between each game
             //locationTimeout(1000, location);
             lastGameStatus = 1; // pending join
    check = 1;
         }
      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();

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
      inGameAt = Random(gameDoesNotExistDelayMin, gameDoesNotExistDelayMax);
  controlData.click(controlData.controls.lobby.button.quit);
      lastGameStatus = 0;
  controlData.click(controlData.controls.lobby.button.quit);
      setNextGameMake();
}
}













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

case 3: // Lobby Chat

break;


case 1:   // Lobby

Delay(500);
controlData.click(controlData.controls.lobby.button.join);
Delay(500);
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 (500);
controlData.click(controlData.controls.lobby.button.join);
Delay (500);
}


controlData.setText( controlData.controls.lobby.join.editBox.gameName, MuleGame);
Delay (200);
controlData.setText( controlData.controls.lobby.join.editBox.password, MuleGamePassword);
Delay (200);
controlData.click(controlData.controls.lobby.join.button.joinGame);
RunGC(); // run garbage collector between each game
//locationTimeout(1000, location);
lastGameStatus = 1; // pending join
check = 1;

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, MuleAccount);
Delay(1000)
controlData.setText(controlData.controls.login.editBox.password, MulePassword);
Delay(500);
controlData.click(controlData.controls.login.button.logIn);
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[MuleCharLocation]);
if(_control && _control.GetText() != undefined)
break;

Delay(500);
}

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

controlData.click(controlData.controls.characterSelect.textBox.characters[MuleCharLocation], 0, 0, 1);
controlData.click(controlData.controls.characterSelect.textBox.characterInfo[MuleCharLocation], 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();

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

controlData.click(controlData.controls.lobby.button.quit);


//lastGameStatus = 0;
//setNextGameMake();

//locationTimeout(gameDoesNotExistTimeout, location);
break;
}
}





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

case 3: // Lobby Chat
Delay(5000);
controlData.click(controlData.controls.lobby.button.create);

break;


case 1:   // Lobby

Delay(5000);
controlData.click(controlData.controls.lobby.button.create);

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);
}

controlData.setText( controlData.controls.lobby.create.editBox.gameName, MuleGame);
Delay (200);
controlData.setText( controlData.controls.lobby.create.editBox.password, MuleGamePassword);
Delay (200);
controlData.click(controlData.controls.lobby.create.button.normal);
Delay(500);
controlData.click(controlData.controls.lobby.create.button.createGame);
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 (500);
controlData.click(controlData.controls.lobby.button.join);
Delay (500);
}


controlData.setText( controlData.controls.lobby.join.editBox.gameName, MuleGame);
Delay (200);
controlData.setText( controlData.controls.lobby.join.editBox.password, MuleGamePassword);
Delay (200);
controlData.click(controlData.controls.lobby.join.button.joinGame);
RunGC(); // run garbage collector between each game
//locationTimeout(1000, location);
lastGameStatus = 1; // pending join
check = 1;

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, MuleAccount);
Delay(1000)
controlData.setText(controlData.controls.login.editBox.password, MulePassword);
Delay(500);
controlData.click(controlData.controls.login.button.logIn);
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();

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

controlData.click(controlData.controls.lobby.button.quit);


//lastGameStatus = 0;
//setNextGameMake();

//locationTimeout(gameDoesNotExistTimeout, location);
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;
}


function NT_ScriptMsgEvents1(msg)
{



switch(msg)
{


case "MULE":

ExitGame();
NTC_SendLogToOOG(NTC_LOG_COMMON, "Log on Mule Account");
NTC_Delay(2000);
//ExitGame();
NTC_Delay(20000);
controlData.click(controlData.controls.lobby.button.quit);
NTC_Delay(2000);
controlData.click(controlData.controls.characterSelect.button.exit);
NTC_Delay(2000);

while(1)

{
if(!me.ingame){
locationActionA(controlData.getLocation());
}
else{
Delay(5000);
Load("NTBot/bots/NTJOIN.ntj");
break;
}
}


break;


case "MULE_START":

Delay(5000);
while(1)

{
if(!me.ingame){
locationActionB(controlData.getLocation());
}
else{
Delay(5000);
Load("NTBot/bots/NTMule.ntj");
break;
}
}

zxetay = true;

break;



case "MULE_FULL":

ExitGame();
NTC_Delay(10000);
controlData.click(controlData.controls.lobby.button.quit);
MuleCharLocation++;
while(1)

{
if(!me.ingame){
locationActionA(controlData.getLocation());
}
else{
Delay(5000);
Load("NTBot/bots/NTJOIN.ntj");
break;
}
}


zxetay  = true;

break;


case "DONE":

ExitGame();
NTC_Delay(10000);
NTC_SendLogToOOG(NTC_LOG_COMMON, "Finished Muling!");
NTC_Delay(2000);
controlData.click(controlData.controls.lobby.button.quit);
NTC_Delay(2000);
controlData.click(controlData.controls.characterSelect.button.exit);

zxetay = false;

}

}
[/noae]

Baalleechfight:
[noae]
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

   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 <= 100; i++)
   {
      if(NTC_InMyParty(NTConfig_Leader))
         break;

      Delay(200);
   }   

   while(me.areaid == 109 && NTC_InMyParty(NTConfig_Leader))
   {
      NTM_UsePortal("BluePortal", 131, NTConfig_Leader); // 50
      Delay(1000);
       
   }
   
   NTP_DoPrecast(true);

   while(NTC_InMyParty(NTConfig_Leader))
   {


   NT_ClearThroneInt();

   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 > 25000)
         {
            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);
         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(!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();
   }


   }


   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], 0, 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;
}
[/noae]

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

Baalleechfight - Change CD keys. Currently restarting.
« on: September 09, 2010, 01:03:21 PM »

cooptheking

  • Guest
Re: Baalleechfight - Change CD keys. Currently restarting.
« Reply #1 on: September 09, 2010, 01:12:24 PM »
What Version of D2nt are you using?
are both leader AND leecher using the same exe (just different mpqs?)
what operating system are you working on....

Offline hendricius

  • Newbie
  • *
  • Join Date: Sep 2010
  • Posts: 5
  • Reputation 0
  • I <3 PureKaoz.com
    • View Profile
Re: Baalleechfight - Change CD keys. Currently restarting.
« Reply #2 on: September 09, 2010, 01:28:49 PM »
Both are using the same D2NT version.

Botting on Windows XP.

Other people reported this problem as well, is this a problem with the script or the nature of D2Nt not supporting this for leechers?

Thanks!

cooptheking

  • Guest
Re: Baalleechfight - Change CD keys. Currently restarting.
« Reply #3 on: September 09, 2010, 01:36:41 PM »
Same version of d2nt which is?
3.0
or 3.1
(if you are unsure, simple mouse over D2NT Manager.exe and see if its 3.0.0.0 or 3.0.0.1)

I do believe that in 3.0 this is a problem

but are both bots using the same installation of Diablo2 just different cdkeys OR
both using different different installs with multiple cdkeys mpqs??

Offline hendricius

  • Newbie
  • *
  • Join Date: Sep 2010
  • Posts: 5
  • Reputation 0
  • I <3 PureKaoz.com
    • View Profile
Re: Baalleechfight - Change CD keys. Currently restarting.
« Reply #4 on: September 09, 2010, 02:05:09 PM »
3.1 D2NT version.

Both are using the same install with  multiple cdkey.mpqs.

I had posted this on EoN as well: http://www.edgeofnowhere.cc/viewtopic.php?p=4370656#4370656

The solution presented there seems to work as for changing cd keys, however does disable my leecher from joining games. I'd like to understand the code to learn what the problem is.

Thanks!

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

Re: Baalleechfight - Change CD keys. Currently restarting.
« Reply #4 on: September 09, 2010, 02:05:09 PM »

cooptheking

  • Guest
Re: Baalleechfight - Change CD keys. Currently restarting.
« Reply #5 on: September 09, 2010, 02:14:50 PM »
3.1 D2NT version.

Both are using the same install with  multiple cdkey.mpqs.

I had posted this on EoN as well: http://www.edgeofnowhere.cc/viewtopic.php?p=4370656#4370656

The solution presented there seems to work as for changing cd keys, however does disable my leecher from joining games. I'd like to understand the code to learn what the problem is.

Thanks!

Yes they are right, there is a problem. Many people say this fixed this (but no one has ever posted 'how/what'.
I will be re-writing the NTBotLeech.ntj (to work with automuling  (i use the non /f l version tho)..) I will post it to see if it works for you

Offline hendricius

  • Newbie
  • *
  • Join Date: Sep 2010
  • Posts: 5
  • Reputation 0
  • I <3 PureKaoz.com
    • View Profile
Re: Baalleechfight - Change CD keys. Currently restarting.
« Reply #6 on: September 09, 2010, 05:31:24 PM »
Excellent, thanks :)

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

Re: Baalleechfight - Change CD keys. Currently restarting.
« Reply #6 on: September 09, 2010, 05:31:24 PM »