D2NT Auto Mule

09/18/2010 20:46 stairbuilder#76
I was under the impression, haven't messed with the item separation just yet, that you could set only one file per mule account. Is that wrong? Actually would be easier to do it like that in the starter file if that is the case.

You are very right about getting the bugs worked out before messing with other options. I just always try and think about other ways of doing things. Taking other peoples work and modding it around a bit is the way I learn.

as I get some time to test things more I will let you know what I see
09/18/2010 21:11 ldevil#77
Quote:
Originally Posted by stairbuilder View Post
I was under the impression, haven't messed with the item separation just yet, that you could set only one file per mule account. Is that wrong? Actually would be easier to do it like that in the starter file if that is the case.
I still don't see you point. But here is mine:

You separate your NiP files like this:
muleaccA.nip (All in here that should go on Acc A)
muleaccB.nip (All in here that should go on Acc B)
...
normal.nip / rare.nip / ... (and all the other files you normally have just without the "special" Items you put in the "muleacc?.nip")

Now you can set "deafult" (or in the version available here, just empty string "") as NiPFile for a mule account and it will Pick the default config.

I do it like this atm:
keys / runes / all the rest

Works great for me :)

But well if you like it better your way, have it your way. As said, if you need any help just ask. Your idea would only take another switch statement I think :D

Quote:
You are very right about getting the bugs worked out before messing with other options. I just always try and think about other ways of doing things. Taking other peoples work and modding it around a bit is the way I learn.

as I get some time to test things more I will let you know what I see
I'm allways happy to get feedback on my work / modifications added to it. That way I can improve the script further and make it the way I need it (or if enought request it, maybe as well the way others need it)
09/19/2010 14:19 kroken123#78
So this script is actually working now?
09/19/2010 15:08 ldevil#79
Quote:
Originally Posted by kroken123 View Post
So this script is actually working now?
It does work. However if something goes wrong (Failed to Join, Crash, ...) then you may lose all the loot & the bot may stop working unless manually restarted.

As said in my post. Use it on your own risk!
09/21/2010 21:05 dino368#80
Hey, dank dir hat mit sehr geholfen jedoch als ich dann mal alles fertig hatte, find er damit an ...

Quote:
<D2NT Error> E:\Program Files\Diablo II\MD\D2NT\scripts\libs\common\NTSnagIt.ntl (159) :referenceError: NTI_WriteLog is not defined.
als ich dann

Quote:
NTConfig_UseXMLItemlog =true;
einfach mal auf false machte, mir ziemlich egal ob log geht oder nit

kam direkt

Quote:
<D2NT Error> NTI_ReadLoc is undefined
langsam verzweifel ich.. hab den rohen d2nt Bot geladen und mit deinem Automule script erweitert. keine zusätzlichen Änderungen gemacht

EDIT: hat sich erledigt, habe mir einen KOMPLETTEN rohbau von d2nt besorgt und da die automule schritte eingeleitet und die fehler sind weg, in der rar für das automule script ist die town.nip drin von dir und die hat nen verändertes itemlog mit drin das du nit mitgeliefert hast und so kommt der fehler.

EDIT: Habs nun soweit das er items in permgame wirft und in den mule acc einloggt aber dann nicht den mule char auswählt uns ins mule game loggt, warum?
09/21/2010 21:17 ldevil#81
Lief der Bot denn ohne mein Script? Weil ich wüsste echt nicht, was mein Script mit dem Fehler zu tun hat. Da ich aber selber eben Muddies Version brauch, kann ich dir jetzt auch nicht einfach den rohen Bot mit meinem Script geben. Das hab ich einfach nicht.
09/21/2010 22:53 dino368#82
Jo also wie gesagt habe nur den d2nt Bot im absolut rohen Zustand ohne irgendwelche veränderungen geladen und dort dein auto mule script eingefügt.

bin nun ein stück weiter.

funzt also alles bis auf das er nach dem perm game in den mule acc einloggt (items erfolgreich rausgeworfen) aber keinen char auswählt, also in der charauswahl stecken bleibt (oder wie lange soll man da warten hab so ca. 1 min gewartet)
09/21/2010 23:37 ldevil#83
Irgend ne Fehlermeldung im Log? Die Loc's richtig eingestellt? Und ne sollte nur so 10-20 sec gehen
09/21/2010 23:56 dino368#84
keine fehlermeldungen nix :(

steht einfach im Auswahlbildschirm für die Mulechars des Muleaccounts.

NTJOIN und NTMule sind in ihrem NTBot/bots ordner wo sie hingehören.



EDIT: ich lass ihn mal die Nacht nun laufen mit automule, vielleicht passiert ja was.

EDIT: Nein alles beim alten Problem, bleibt solange in der CHarauswahl bis ich ihn manuell erlöse
09/23/2010 01:35 ldevil#85
Quote:
Originally Posted by dino368 View Post
keine fehlermeldungen nix :(

steht einfach im Auswahlbildschirm für die Mulechars des Muleaccounts.

NTJOIN und NTMule sind in ihrem NTBot/bots ordner wo sie hingehören.



EDIT: ich lass ihn mal die Nacht nun laufen mit automule, vielleicht passiert ja was.

EDIT: Nein alles beim alten Problem, bleibt solange in der CHarauswahl bis ich ihn manuell erlöse
Hm, komisch bei mir gibt's zwar auch hi und da Fehler (immer wenn ich grad net da bin :p) aber danach steht einfach mein Bot Char in nem neuen Game und macht da gar nix.

Kannst du mal (also ohne die Account Namen und Pws und so) deine NTBot.ntj hier rein kopieren? edit: Natürlich im Code-Tag bitte
09/23/2010 09:29 dino368#86
Code:
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      = 15000;      // time in milliseconds to wait between making games
var createGameThresholdRandom   = 2000;      // 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      = false;   // 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   = 2000;      // min how long to wait before joining channel
var waitInChatBeforeActionsMax   = 3000;      // max how long to wait before joining channel
var JoinFromChat = true;
//########################################################################################################################################
//################################AUTOMULE SETTINGS#######################################################################################
//########################################################################################################################################
switch(me.account)
{
////////////////////////////////////////////////////////
//                                                    //
// COPY THIS PART BELOW FOR EACH ACCOUNT YOU BOT WITH //
//                                                    //
// Make sure you add the same amount of Accounts, PWs,//
// Nipfiles AND columns to MuleCharLocation!          //
// And make sure to chose a different mule game name  //
// for each of your accounts                          //
//                                                    //
// best regards                                       //
// Ldevil                                             //
//                                                    //

case "":
	var DGMuleAccs = ["",""];
	var DGMulePws = ["",""];
	var DGNipFiles = ["mule/rest.nip","mule/runeskeysgems.nip"];
	var MuleCharLocation = [0,0]; // charloc 1 = 0 , charloc 2 = 1 , charloc 3 = 2, ..... counts +1 after mule is full
	var MuleGame = "";
	var MuleGamePassword ="";
	break;

//                                                    //
// COPY THIS PART ABOVE FOR EACH ACCOUNT YOU BOT WITH //
//                                                    //
////////////////////////////////////////////////////////
}







// 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 DGCurrentAcc = 0;

Include("libs/controlInfo.ntl");
Include("libs/common/NTCommon.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(GetTickCount() > nextGameMake)
		{
			var _control;

			lastGameFailed = false;

			switch(lastGameStatus)
			{
			case 0:
				_control = controlData.get(controlData.controls.lobby.button.create);
				if(_control && _control.pressed)
				{
					controlData.click(controlData.controls.lobby.button.join);
					Delay(500);
				}

				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;
		
		
		
		break;
		
	case 1:   // Lobby
		
		if(location.id == 1 && joinChatAfterGame)
		{
			Delay(Random(waitBeforeEnterChatMin, waitBeforeEnterChatMax));
			controlData.click(controlData.controls.lobby.button.enterChat);
			break;
		}

		if(GetTickCount() > nextGameMake)
		{
			var _control;

			lastGameFailed = false;

			switch(lastGameStatus)
			{
			case 0:
				_control = controlData.get(controlData.controls.lobby.button.create);
				if(_control && _control.pressed)
				{
					controlData.click(controlData.controls.lobby.button.join);
					Delay(500);
				}

				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

		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

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


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

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













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, DGMuleAccs[DGCurrentAcc]);
		Delay(1000)
		controlData.setText(controlData.controls.login.editBox.password, DGMulePws[DGCurrentAcc]);
		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[DGCurrentAcc]]);
			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, 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

		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);
		NTC_Delay(20000);
		controlData.click(controlData.controls.lobby.button.quit);
		NTC_Delay(2000);
		controlData.click(controlData.controls.characterSelect.button.exit);
		NTC_Delay(2000);

		var filehandle = FileOpen("NTBot/char_configs/mule/" + me.account + "mulenip", 1);
		if(filehandle)
		{
			filehandle.WriteLine(DGNipFiles[DGCurrentAcc]); 

			filehandle.Close();
		}

		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_SendLogToOOG(NTC_LOG_COMMON, "Log on next Mule char because current Mulechar is full!");
		NTC_Delay(10000);
		controlData.click(controlData.controls.lobby.button.quit);
		MuleCharLocation[DGCurrentAcc]++;
		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);
		DGCurrentAcc++;
		if (DGCurrentAcc == DGMuleAccs.length)
		{
			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);
			
			DGCurrentAcc = 0;
		
			zxetay = false;
		}else{	
			NTC_SendLogToOOG(NTC_LOG_COMMON, "Log on next Mule Account");
			NTC_Delay(2000);
			NTC_Delay(20000);
			controlData.click(controlData.controls.lobby.button.quit);
			NTC_Delay(2000);
			controlData.click(controlData.controls.characterSelect.button.exit);
			NTC_Delay(2000);

			var filehandle = FileOpen("NTBot/char_configs/mule/" + me.account + "mulenip", 1);
			if(filehandle)
			{
				filehandle.WriteLine(DGNipFiles[DGCurrentAcc]); 

				filehandle.Close();
			}	

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

}
Das die NTBot :)
09/23/2010 22:31 ldevil#87
Code:
controlData.click(controlData.controls.characterSelect.textBox.characters[MuleCharLocation], 0, 0, 1);
            controlData.click(controlData.controls.characterSelect.textBox.characterInfo[MuleCharLocation], 0, 0, 1);
Hat nen Typo, in der Version die du hast -.-

Das sollte so aussehen:

Code:
controlData.click(controlData.controls.characterSelect.textBox.characters[MuleCharLocation[COLOR="Red"][DGCurrentAcc][/COLOR]], 0, 0, 1);
            controlData.click(controlData.controls.characterSelect.textBox.characterInfo[MuleCharLocation[COLOR="Red"][DGCurrentAcc][/COLOR]], 0, 0, 1);
Ich schau ma ob ich den Fehler echt net behoben hab, weil bei mir stimmts ;)

edit: OMG das hat's echt net hier hin geschafft -.-

Sorry an alle :o

Ist nun updated... Problem ist, dass ich eben das ganze eigentlich für Muddy's Version geschrieben habe und daher immer alles auch noch für den normalen D2NT updaten muss... scheint so als ob ich den Fehler hier vergessen hatte :(
09/24/2010 18:22 rotu#88
habe mnal ne frage und zwar wo schreibe ich mule acc und so ein bzw wie mache ich das nu??
09/24/2010 22:55 ldevil#89
IM NTBot.ntj

Code:
case "[COLOR="Red"]Bot Account[/COLOR]":
    var DGMuleAccs = ["[COLOR="Red"]Mule Account 1[/COLOR]","[COLOR="Red"]Mule Account 2[/COLOR]"];
    var DGMulePws = ["[COLOR="Red"]PW 1[/COLOR]","[COLOR="Red"]PW 2[/COLOR]"];
    var DGNipFiles = ["[COLOR="Red"]nip file 1[/COLOR]","[COLOR="Red"]nip file 2[/COLOR]"];
    var MuleCharLocation = [[COLOR="Red"]0[/COLOR],[COLOR="Red"]0[/COLOR]]; // charloc 1 = 0 , charloc 2 = 1 , charloc 3 = 2, ..... counts +1 after mule is full
    var MuleGame = "[COLOR="Red"]Mule Game Name[/COLOR]";
    var MuleGamePassword ="[COLOR="Red"]Mule Game Passwort[/COLOR]";
    break;
09/24/2010 23:52 dino368#90
Quote:
Originally Posted by ldevil View Post
Code:
controlData.click(controlData.controls.characterSelect.textBox.characters[MuleCharLocation], 0, 0, 1);
            controlData.click(controlData.controls.characterSelect.textBox.characterInfo[MuleCharLocation], 0, 0, 1);
Hat nen Typo, in der Version die du hast -.-

Das sollte so aussehen:

Code:
controlData.click(controlData.controls.characterSelect.textBox.characters[MuleCharLocation[COLOR="Red"][DGCurrentAcc][/COLOR]], 0, 0, 1);
            controlData.click(controlData.controls.characterSelect.textBox.characterInfo[MuleCharLocation[COLOR="Red"][DGCurrentAcc][/COLOR]], 0, 0, 1);
Ich schau ma ob ich den Fehler echt net behoben hab, weil bei mir stimmts ;)

edit: OMG das hat's echt net hier hin geschafft -.-

Sorry an alle :o

Ist nun updated... Problem ist, dass ich eben das ganze eigentlich für Muddy's Version geschrieben habe und daher immer alles auch noch für den normalen D2NT updaten muss... scheint so als ob ich den Fehler hier vergessen hatte :(
Oki, danke, macht nix kann ja mal vorkommen!

Habs nun getestet und er hebt sie auch auf, also die items, nur bleibt der mule im game einfach stehen und loggt nit auf bot zurück, woran liegt das nun?

EDIT: Muss leider sagen das er auch Items nit aufhebt aber sogar auf den zweiten mule acc nun loggt, aber dort dann wie beschrieben stehen bleibt ohne auf Bot zurück zu wechseln