Register for your free account! | Forgot your password?

Go Back   elitepvpers > Other Online Games > Diablo 2 > Diablo 2 Programming
You last visited: Today at 04:06

  • Please register to post and access all features, it's quick, easy and FREE!

Advertisement



[Release] Überarbeitete NTBotLeech

Discussion on [Release] Überarbeitete NTBotLeech within the Diablo 2 Programming forum part of the Diablo 2 category.

Closed Thread
 
Old   #1

 
lanara's Avatar
 
elite*gold: 139
Join Date: Oct 2006
Posts: 12,058
Received Thanks: 24,256
[Release] Überarbeitete NTBotLeech

Bevor das ganze in meinem Thread etwas untergeht, veröffentliche ich es auch mal hier, da es ja für jeden D2NT Bot zu gebrauchen ist. Es handelt sich dabei um einen Entry Point für Chars die ein Spiel joinen sollen. Der Unterschied zu anderen NTBotLeech Scripten ist, dass dieses hier nichtmehr "/f l" spammed, um das Spiel des Leaders zu finden.

Der Bot schreibt jetzt genau einmal "/f l", wenn er den Channel betritt. Hat der Leader schon ein Spiel offen, dann joined er. Wenn nicht, wartet er im Channel, bis der Leader ein Spiel erstellt und joined dann anhand der Friendmessage die gesendet wird. Das ist vorallem bei Public Runs deutlich effektiver, wo man sehr schnell joinen muss, bevor das Spiel voll ist. Aber um es kurz zu machen, hier das Script:

Code:
var DelayedJoinChars               = new Array();
//###################################################################
//###########################Einstellungen###########################
//###################################################################
	
var LeaderAccountName          = "LeaderAccountName";
var LeaderName                 = "LeaderName";
var GamePassword               = "1";
var JoinGameAgain              = false; // wenn der Bot nach chicken oder disconnect ins selbe Spiel nochmal gehen soll, auf true stellen

var UseCDKeyChangeTrick        = false; // Wenn der LeechBot mehrere CD Keys nutzen soll, dann auf true stellen.

var JoinRandomChannel          = false;
var JoinChannelInChat          = "OP MyBaal";
var FirstJoinMessage           = ""; // Soll der Leechbot etwas sagen, wenn er in den Chat kommt, dann hier eintragen
var ChatMessageAfterGame       = ""; // Soll der Leechbot etwas sagen, wenn er aus dem Spiel kommt, dann hier eintragen

// Wenn mehrere Leecher das selbe Spiel joinen sollen müssen sie das leicht Zeitversetzt tun,
// da es sonst zu Joinbugs kommt. Die Chars ODER Accounts hier bitte eintragen:
DelayedJoinChars.push("LeecherOne", "LeecherTwo", "LeecherThree");

//###################################################################
//##############################Delays###############################
//###################################################################

var GameMinLength              = 180000;

// realm delays (minutes)
var UnableToConnectRetry       = 2;
var RealmDownRetry             = 60;
var DisconnectedRetry          = 2;
var CdKeyInUseRetry            = 2;

// interface delays (milliseconds)
var MultipleLeecherJoinDelay   = 1000;
var JoinDelay                  = 100;
var ConnectingToBnetTimeout    = 20000;
var CharacterScreenTimeout     = 10000;
var PleaseWaitTimeout          = 10000;
var CreateGameThreshold        = 10000;
var CreateGameThresholdRandom  = 1000;
var CreateGameTimeout          = 15000;
var WaitInLineTimeout          = 15000;
var CharacterSelectDelay       = 1000;
var LoginDelay                 = 1000;
var ClickDelay                 = 500;
var TextDelay                  = 500;
var ClickDelayRandom           = 500;
var TextDelayRandom            = 500;
var GameDoesNotExistDelayMin   = 600000;
var GameDoesNotExistDelayMax   = 900000;
var GameDoesNotExistTimeout    = 30000;
var WaitBeforeEnterChatMin     = 1000;
var WaitBeforeEnterChatMax     = 2000;
var WaitInChatBeforeActionsMin = 2000;
var WaitInChatBeforeActionsMax = 3000;

//###################################################################
//###################################################################
//###############DO NOT CHANGE 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 SayChatMsgAfterGame = true;

Include("libs/controlInfo.ntl");

var ControlData = new controlInfo();

var SameGame = "";
var OldGame = "";
var Game = "";
var Debug = false;
var JoinChatAfterGame    = true;


function NTMain()
{
	Delay(1000);

	var _ingame = false;

	ControlData.ClickDelay = ClickDelay;
	ControlData.TextDelay = TextDelay;
	ControlData.ClickDelayRandom = ClickDelayRandom;
	ControlData.TextDelayRandom = TextDelayRandom;

	while(1)
	{
		if(me.ingame)
		{
			OldGame = me.gamename;

			if(!InGameAt)
				InGameAt = GetTickCount();

			if(!_ingame)
			{
				RunGC(); // run garbage collector between each game

				if(Load("NTBot/MWBotGame.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;
				SayChatMsgAfterGame = true;

				sendEventToOOG(D2NT_MGR_READY, "", 0);
			}

			locationAction(ControlData.getLocation());

			Delay(500);
		}
	}
}

function locationAction(location)
{
	var _randomChannel;
	
	switch(location.id)
	{
	case 3: // Lobby Chat
		sendEventToOOG(D2NT_MGR_PRINT_STATUS, location.name, 0);

		if(!ChatActionsDone)
		{  
			ChatActionsDone = true;

			Delay(Random(WaitInChatBeforeActionsMin, WaitInChatBeforeActionsMax));

			if(JoinRandomChannel || JoinChannelInChat != "")
			{
				SetStatusText("ÿc8Joining channel...");
				Say("/join " + (JoinRandomChannel ? getRandomString(Random(3,10)) : JoinChannelInChat));
				Delay(2000);
			}

			if(FirstJoinMessage)
			{
				Say(FirstJoinMessage);
				Delay(1000);
			}
		}

		if (SayChatMsgAfterGame == true)
		{
			if(ChatMessageAfterGame && OldGame != "")
				Say(ChatMessageAfterGame);
				
			SetStatusText("ÿc8Checking friendlist...");
			Say("/f l");
			SayChatMsgAfterGame = false;
			Delay(1500);
		}

		Game = "";

		if(chat = ControlData.get(ControlData.controls.lobby.chat.textBox.channelText))
		{
			var found_leader = false;
			lines = chat.GetText();
			for (var line_id = lines.length - 1; line_id > -1; line_id--)
			{
				if (found_leader) // useless... :/
					break;

				if (lines[line_id].substring(0,1) == " ")
					continue;

				// retrieving the whole message
				var msg = lines[line_id].replace(/^\s+|\s+$/, "");
				var msglines = 1;
				while (lines[line_id+msglines] != undefined && lines[line_id+msglines].substring(0,2) == "  ")
				{
					msg += " " + lines[line_id+msglines].replace(/^\s+|\s+$/, "");
					msglines++;
				}
				
				// checking if the msg is a friendly whisper
				if (msg.toLowerCase().lastIndexOf(LeaderName.toLowerCase() + " (*" + LeaderAccountName.toLowerCase() + ")") > -1)
				{
					var regGameNameWhispered=/^.*(game|partie|spiel|partita|partida).*(nomm[^\s]*|called|chiamata)\s*([\w\s-]*\w)\s*\.\s*$/gi;
					if (msg.match(regGameNameWhispered))
						Game = msg.replace(regGameNameWhispered, "$3");

					if (Game != "")
					{
						found_leader = true;
						break;
					}
				}

				// checking if the msg is from the friend list
				if (msg.toLowerCase().lastIndexOf(": " + LeaderAccountName.toLowerCase() + ",") > -1)
				{
					found_leader = true;
					var regOffline=/^.*(offline|desconectado).*$/gi;
					var regInChat=/^.*(channel|canale?)\s*([\w\s-]*\w)\.?\s*$/gi;
					var regGameName=/^.*(game|partie|spiel|partita|partida)\s*([\w\s-]*\w)\s*\(priv[^\)]*\)\.\s*$/gi;

					if (msg.match(regOffline))
						SetStatusText("ÿc8Leader is currently offline.");
					else if (msg.match(regInChat))
						SetStatusText("ÿc8Waiting for leader to create a game.");
					else if (msg.match(regGameName))
						Game = msg.replace(regGameName, "$2");

					break;
				}
			}

			if (found_leader == false)
			{
				DebugInOOG("I couldn\'t find the leader in my friend list!");
				SetStatusText("ÿc8Leader not found.");
			}
			
			if (Game != "")
			{
				DebugInOOG('Leader is in the game "' + Game + '"');
				//ControlData.click(ControlData.controls.lobby.button.join);
				//Delay(100);
				
				if(!JoinGameAgain)
				{
					if (Game != SameGame)
					{
						SetStatusText("ÿc8Joining Game: " + Game);
						
						if (UseCDKeyChangeTrick)
						{
							sendEventToOOG(D2NT_MGR_CREATE_GAME, location.name, 0);
							Delay(1000);
						}

						ControlData.click(ControlData.controls.lobby.button.join);
						Delay (200);
					}
					else
						SetStatusText("ÿc8Waiting for next game...");
				}
				else
				{
					SetStatusText("ÿc8Joining Game: " + Game);
					
					if (UseCDKeyChangeTrick)
					{
						sendEventToOOG(D2NT_MGR_CREATE_GAME, location.name, 0);
						Delay(1000);
					}

					ControlData.click(ControlData.controls.lobby.button.join);
					Delay (200);
				}

			}
		}
		else
		{
			DebugInOOG("I can\'t read the chat!");
		}

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

		sendEventToOOG(D2NT_MGR_CREATE_GAME, location.name, 0);

		locationTimeout(5000, location);

		LastGameMade = GetTickCount();
		LastGameStatus = 1; // pending creation
		break;

  case 5: // Join Game
    if (Game)
    {
		ControlData.setText( ControlData.controls.lobby.join.editBox.gameName, Game);
		Delay(100);
		ControlData.setText( ControlData.controls.lobby.join.editBox.password, GamePassword);
		for(var i = 0; i < DelayedJoinChars.length; i++)
		{
			if(me.charname.toLowerCase() == DelayedJoinChars[i].toLowerCase() || me.account.toLowerCase() == DelayedJoinChars[i].toLowerCase())
			{
				Delay(MultipleLeecherJoinDelay * i);
				break;
			}
		}
		Delay(JoinDelay);
		ControlData.click(ControlData.controls.lobby.join.button.joinGame);
		RunGC(); // run garbage collector between each game
		locationTimeout(5000, location);
		LastGameStatus = 1; // pending join
	}
	else
	{
		DebugInOOG("No game to join : cancelling");
		me.Cancel(1);
		Delay(1000);
	}
	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
		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, "yE00000Game 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);
		LastGameStatus = 0;
		setNextGameMake();

		locationTimeout(GameDoesNotExistTimeout, location);
		break;
	default:
		DebugInOOG("Unhandled location : "+location.id);
		break;
	}
	//DebugInOOG("Location : "+location.id);
}

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 DebugInOOG(logString)
{
	if (Debug)
		return SendCopyData("D2NT Manager", null, 9<<16, "-- Debug : " + logString);
	else
		return false;
}
Um es mit Muddy's D2NT nutzen zu können muss in Zeile 112 das NTBotgame in MWBotgame umbenannt werden.
Code:
if(Load("NTBot/[COLOR="Red"]NT[/COLOR]BotGame.ntj"))
Über Feedback wäre ich dankbar, da ich es bisher nur kurz getestet habe.



Edit:
  • JoinDelay hinzugefügt, falls der Char zu schnell joined einfach erhöhen.
  • DelayedJoinChars hinzugefügt, damit mehrere Chars ohne Joinbug in das gleiche Spiel joinen können. Bei MultipleLeecherJoinDelay kann das Delay geändert werden.
lanara is offline  
Thanks
4 Users
Old 07/17/2011, 19:40   #2
 
elite*gold: 0
Join Date: Aug 2009
Posts: 435
Received Thanks: 159
Nach ein paar Schwierigkeiten Automule zu integrieren funktioniert es jetzt soweit! Super Sache.

Ach ja, nutze Muddy's und es funktioniert super^^
DeathFromHeaven is offline  
Thanks
1 User
Old 07/20/2011, 17:59   #3

 
modwx's Avatar
 
elite*gold: 20
Join Date: Feb 2009
Posts: 362
Received Thanks: 26
wenn ich die ersetze crash diablo nach jedem laden direkt (loading-->fehlermeldung-->restart)

benutze den bot aus deinem thread public botting for.....
modwx is offline  
Old 07/20/2011, 18:15   #4
Administrator
 
Muddy Waters's Avatar
 
elite*gold: 41364
Join Date: Jan 2010
Posts: 22,727
Received Thanks: 12,653
In dem Fall hast du sehr wahrscheinlich einen Syntaxfehler in den Entry Point gebaut, denn das würde genau dazu zu dem Verhalten führen, welches du da beschreibst.
Überprüf das nochmal genau und stell sicher, dass dort keine Fehler drin sind.

LG
Muddy
Muddy Waters is offline  
Old 07/20/2011, 18:31   #5

 
modwx's Avatar
 
elite*gold: 20
Join Date: Feb 2009
Posts: 362
Received Thanks: 26
hier mal die fehlermeldung:

<D2NT Error> C:\..........\scripts\libs\controlinfo.ntl (735) : ReferenceError : controlData is not defined




Code:
var DelayedJoinChars               = new Array();
//###################################################################
//###########################Einstellungen###########################
//###################################################################
	
var LeaderAccountName          = "Crackhead";
var LeaderName                 = "Jyx";
var GamePassword               = "devil";
var JoinGameAgain              = false; // wenn der Bot nach chicken oder disconnect ins selbe Spiel nochmal gehen soll, auf true stellen

var UseCDKeyChangeTrick        = false; // Wenn der LeechBot mehrere CD Keys nutzen soll, dann auf true stellen.

var JoinRandomChannel          = false;
var JoinChannelInChat          = "OP MyBaal";
var FirstJoinMessage           = ""; // Soll der Leechbot etwas sagen, wenn er in den Chat kommt, dann hier eintragen
var ChatMessageAfterGame       = ""; // Soll der Leechbot etwas sagen, wenn er aus dem Spiel kommt, dann hier eintragen

// Wenn mehrere Leecher das selbe Spiel joinen sollen müssen sie das leicht Zeitversetzt tun,
// da es sonst zu Joinbugs kommt. Die Chars ODER Accounts hier bitte eintragen:
DelayedJoinChars.push("LeecherOne", "LeecherTwo", "LeecherThree");

//###################################################################
//##############################Delays###############################
//###################################################################

var GameMinLength              = 180000;

// realm delays (minutes)
var UnableToConnectRetry       = 2;
var RealmDownRetry             = 60;
var DisconnectedRetry          = 2;
var CdKeyInUseRetry            = 2;

// interface delays (milliseconds)
var MultipleLeecherJoinDelay   = 1000;
var JoinDelay                  = 100;
var ConnectingToBnetTimeout    = 20000;
var CharacterScreenTimeout     = 10000;
var PleaseWaitTimeout          = 10000;
var CreateGameThreshold        = 10000;
var CreateGameThresholdRandom  = 1000;
var CreateGameTimeout          = 15000;
var WaitInLineTimeout          = 15000;
var CharacterSelectDelay       = 1000;
var LoginDelay                 = 1000;
var ClickDelay                 = 500;
var TextDelay                  = 500;
var ClickDelayRandom           = 500;
var TextDelayRandom            = 500;
var GameDoesNotExistDelayMin   = 600000;
var GameDoesNotExistDelayMax   = 900000;
var GameDoesNotExistTimeout    = 30000;
var WaitBeforeEnterChatMin     = 1000;
var WaitBeforeEnterChatMax     = 2000;
var WaitInChatBeforeActionsMin = 2000;
var WaitInChatBeforeActionsMax = 3000;

//###################################################################
//###################################################################
//###############DO NOT CHANGE 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 SayChatMsgAfterGame = true;

Include("libs/controlInfo.ntl");

var ControlData = new controlInfo();

var SameGame = "";
var OldGame = "";
var Game = "";
var Debug = false;
var JoinChatAfterGame    = true;


function NTMain()
{
	Delay(1000);

	var _ingame = false;

	ControlData.ClickDelay = ClickDelay;
	ControlData.TextDelay = TextDelay;
	ControlData.ClickDelayRandom = ClickDelayRandom;
	ControlData.TextDelayRandom = TextDelayRandom;

	while(1)
	{
		if(me.ingame)
		{
			OldGame = me.gamename;

			if(!InGameAt)
				InGameAt = GetTickCount();

			if(!_ingame)
			{
				RunGC(); // run garbage collector between each game

				if(Load("NTBot/MWBotGame.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;
				SayChatMsgAfterGame = true;

				sendEventToOOG(D2NT_MGR_READY, "", 0);
			}

			locationAction(ControlData.getLocation());

			Delay(500);
		}
	}
}

function locationAction(location)
{
	var _randomChannel;
	
	switch(location.id)
	{
	case 3: // Lobby Chat
		sendEventToOOG(D2NT_MGR_PRINT_STATUS, location.name, 0);

		if(!ChatActionsDone)
		{  
			ChatActionsDone = true;

			Delay(Random(WaitInChatBeforeActionsMin, WaitInChatBeforeActionsMax));

			if(JoinRandomChannel || JoinChannelInChat != "")
			{
				SetStatusText("ÿc8Joining channel...");
				Say("/join " + (JoinRandomChannel ? getRandomString(Random(3,10)) : JoinChannelInChat));
				Delay(2000);
			}

			if(FirstJoinMessage)
			{
				Say(FirstJoinMessage);
				Delay(1000);
			}
		}

		if (SayChatMsgAfterGame == true)
		{
			if(ChatMessageAfterGame && OldGame != "")
				Say(ChatMessageAfterGame);
				
			SetStatusText("ÿc8Checking friendlist...");
			Say("/f l");
			SayChatMsgAfterGame = false;
			Delay(1500);
		}

		Game = "";

		if(chat = ControlData.get(ControlData.controls.lobby.chat.textBox.channelText))
		{
			var found_leader = false;
			lines = chat.GetText();
			for (var line_id = lines.length - 1; line_id > -1; line_id--)
			{
				if (found_leader) // useless... :/
					break;

				if (lines[line_id].substring(0,1) == " ")
					continue;

				// retrieving the whole message
				var msg = lines[line_id].replace(/^\s+|\s+$/, "");
				var msglines = 1;
				while (lines[line_id+msglines] != undefined && lines[line_id+msglines].substring(0,2) == "  ")
				{
					msg += " " + lines[line_id+msglines].replace(/^\s+|\s+$/, "");
					msglines++;
				}
				
				// checking if the msg is a friendly whisper
				if (msg.toLowerCase().lastIndexOf(LeaderName.toLowerCase() + " (*" + LeaderAccountName.toLowerCase() + ")") > -1)
				{
					var regGameNameWhispered=/^.*(game|partie|spiel|partita|partida).*(nomm[^\s]*|called|chiamata)\s*([\w\s-]*\w)\s*\.\s*$/gi;
					if (msg.match(regGameNameWhispered))
						Game = msg.replace(regGameNameWhispered, "$3");

					if (Game != "")
					{
						found_leader = true;
						break;
					}
				}

				// checking if the msg is from the friend list
				if (msg.toLowerCase().lastIndexOf(": " + LeaderAccountName.toLowerCase() + ",") > -1)
				{
					found_leader = true;
					var regOffline=/^.*(offline|desconectado).*$/gi;
					var regInChat=/^.*(channel|canale?)\s*([\w\s-]*\w)\.?\s*$/gi;
					var regGameName=/^.*(game|partie|spiel|partita|partida)\s*([\w\s-]*\w)\s*\(priv[^\)]*\)\.\s*$/gi;

					if (msg.match(regOffline))
						SetStatusText("ÿc8Leader is currently offline.");
					else if (msg.match(regInChat))
						SetStatusText("ÿc8Waiting for leader to create a game.");
					else if (msg.match(regGameName))
						Game = msg.replace(regGameName, "$2");

					break;
				}
			}

			if (found_leader == false)
			{
				DebugInOOG("I couldn\'t find the leader in my friend list!");
				SetStatusText("ÿc8Leader not found.");
			}
			
			if (Game != "")
			{
				DebugInOOG('Leader is in the game "' + Game + '"');
				//ControlData.click(ControlData.controls.lobby.button.join);
				//Delay(100);
				
				if(!JoinGameAgain)
				{
					if (Game != SameGame)
					{
						SetStatusText("ÿc8Joining Game: " + Game);
						
						if (UseCDKeyChangeTrick)
						{
							sendEventToOOG(D2NT_MGR_CREATE_GAME, location.name, 0);
							Delay(1000);
						}

						ControlData.click(ControlData.controls.lobby.button.join);
						Delay (200);
					}
					else
						SetStatusText("ÿc8Waiting for next game...");
				}
				else
				{
					SetStatusText("ÿc8Joining Game: " + Game);
					
					if (UseCDKeyChangeTrick)
					{
						sendEventToOOG(D2NT_MGR_CREATE_GAME, location.name, 0);
						Delay(1000);
					}

					ControlData.click(ControlData.controls.lobby.button.join);
					Delay (200);
				}

			}
		}
		else
		{
			DebugInOOG("I can\'t read the chat!");
		}

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

		sendEventToOOG(D2NT_MGR_CREATE_GAME, location.name, 0);

		locationTimeout(5000, location);

		LastGameMade = GetTickCount();
		LastGameStatus = 1; // pending creation
		break;

  case 5: // Join Game
    if (Game)
    {
		ControlData.setText( ControlData.controls.lobby.join.editBox.gameName, Game);
		Delay(100);
		ControlData.setText( ControlData.controls.lobby.join.editBox.password, GamePassword);
		for(var i = 0; i < DelayedJoinChars.length; i++)
		{
			if(me.charname.toLowerCase() == DelayedJoinChars[i].toLowerCase() || me.account.toLowerCase() == DelayedJoinChars[i].toLowerCase())
			{
				Delay(MultipleLeecherJoinDelay * i);
				break;
			}
		}
		Delay(JoinDelay);
		ControlData.click(ControlData.controls.lobby.join.button.joinGame);
		RunGC(); // run garbage collector between each game
		locationTimeout(5000, location);
		LastGameStatus = 1; // pending join
	}
	else
	{
		DebugInOOG("No game to join : cancelling");
		me.Cancel(1);
		Delay(1000);
	}
	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
		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, "yE00000Game 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);
		LastGameStatus = 0;
		setNextGameMake();

		locationTimeout(GameDoesNotExistTimeout, location);
		break;
	default:
		DebugInOOG("Unhandled location : "+location.id);
		break;
	}
	//DebugInOOG("Location : "+location.id);
}

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 DebugInOOG(logString)
{
	if (Debug)
		return SendCopyData("D2NT Manager", null, 9<<16, "-- Debug : " + logString);
	else
		return false;
}
modwx is offline  
Old 07/20/2011, 19:17   #6
 
elite*gold: 0
Join Date: Mar 2010
Posts: 539
Received Thanks: 418
Aufpassen mit der Schreibweise von ControlData!

Bei Muddy's ist es immer ControlData geschrieben, ersetz einfach alle anderen Schreibweisen (ersetzen -> alle ersetzen), die Variablen sind nämlich case-sensitive!
TheCrazy11 is offline  
Old 07/20/2011, 19:25   #7

 
modwx's Avatar
 
elite*gold: 20
Join Date: Feb 2009
Posts: 362
Received Thanks: 26
hat leider bei mir nicht geklappt...selber fehler
modwx is offline  
Old 07/20/2011, 19:48   #8
 
elite*gold: 0
Join Date: Mar 2010
Posts: 539
Received Thanks: 418
Gerade gesehen, du hast den Fehler ja in der controlinfo.ntl!

Poste die mal!
TheCrazy11 is offline  
Old 07/20/2011, 20:44   #9

 
modwx's Avatar
 
elite*gold: 20
Join Date: Feb 2009
Posts: 362
Received Thanks: 26
Code:
/*
	controlInfo() Class written by njaguar
	v3.1
*/

function controlInfo() {
	this.controls							= new Array();
	this.controls.lobby						= new Array();
	this.controls.lobby.name					= "Lobby";
	this.controls.lobby.id						= 1;

	this.controls.lobby.textBox					= new Array();
	this.controls.lobby.textBox.chat				= [4,28,410,354,298];
	this.controls.lobby.textBox.status				= [4,447,398,290,269];
	this.controls.lobby.textBox.characterInfo			= [4,143,588,230,87];

	this.controls.lobby.button					= new Array();
	this.controls.lobby.button.create				= [6,533,469,120,20];
	this.controls.lobby.button.join					= [6,652,469,120,20];
	this.controls.lobby.button.channel				= [6,535,490,80,20];
	this.controls.lobby.button.ladder				= [6,614,490,80,20];
	this.controls.lobby.button.quit					= [6,693,490,80,20];
	this.controls.lobby.button.enterChat				= [6,27,480,120,20];
	this.controls.lobby.button.help					= [6,146,480,120,20];

	this.controls.lobby.location = [
		this.controls.lobby.button.enterChat,
		this.controls.lobby.button.help,
	];


	this.controls.lobby.inLine					= new Array();
	this.controls.lobby.inLine.name					= "Waiting In Line";
	this.controls.lobby.inLine.id					= 2;

	this.controls.lobby.inLine.textBox				= new Array();
	this.controls.lobby.inLine.textBox.inLine			= [4,427,234,300,100];

	this.controls.lobby.inLine.button				= new Array();
	this.controls.lobby.inLine.button.cancel			= [6,433,433,96,32];
	
	this.controls.lobby.inLine.location = [
		this.controls.lobby.inLine.textBox.inLine,
		this.controls.lobby.inLine.button.cancel,
	];

	this.controls.lobby.serverDown					= new Array();
	this.controls.lobby.serverDown.name				= "Server Down";
	this.controls.lobby.serverDown.id				= 24;

	this.controls.lobby.serverDown.textBox				= new Array();
	this.controls.lobby.serverDown.textBox.serverDown		= [4,438,300,326,150];
	this.controls.lobby.serverDown.textBox.serverDown.key		= [5139];

	this.controls.lobby.serverDown.location = [
		this.controls.lobby.serverDown.textBox.serverDown,
	]

	// this is also the Please Wait dialog in the lobby, as well as Character Already Exists for creating chars
	this.controls.lobby.pleaseWait					= new Array();
	this.controls.lobby.pleaseWait.name				= "Please Wait...";//"Lost Connection";
	this.controls.lobby.pleaseWait.id				= 25;
	
	this.controls.lobby.pleaseWait.textBox				= new Array();
	this.controls.lobby.pleaseWait.textBox.pleaseWait		= [4,268,320,264,120];
	
	this.controls.lobby.pleaseWait.button				= new Array();
	this.controls.lobby.pleaseWait.button.cancel			= [6,351,337,96,32];

	this.controls.lobby.pleaseWait.location = [
		this.controls.lobby.pleaseWait.textBox.pleaseWait,
		this.controls.lobby.pleaseWait.button.cancel,
	];


	// this is also the Please Wait dialog in the lobby
	this.controls.lobby.lostConnection				= new Array();
	this.controls.lobby.lostConnection.name				= "Lost Connection";
	this.controls.lobby.lostConnection.id				= 17;
	
	this.controls.lobby.lostConnection.textBox			= new Array();
	this.controls.lobby.lostConnection.textBox.lostConnection	= [4,268,320,264,120];
	this.controls.lobby.lostConnection.textBox.lostConnection.key	= [5351];
	
	this.controls.lobby.lostConnection.button			= new Array();
	this.controls.lobby.lostConnection.button.ok			= [6,351,337,96,32];

	this.controls.lobby.lostConnection.location = [
		this.controls.lobby.lostConnection.textBox.lostConnection,
		this.controls.lobby.lostConnection.button.ok,
	];


	// Game Name Already Exists
	this.controls.lobby.gameExists					= new Array();
	this.controls.lobby.gameExists.name				= "Game Already Exists";
	this.controls.lobby.gameExists.id				= 26;
	
	this.controls.lobby.gameExists.textBox				= new Array();
	this.controls.lobby.gameExists.textBox.gameExists		= [4,438,300,326,150];
	this.controls.lobby.gameExists.textBox.gameExists.key		= [5138];
	
	this.controls.lobby.gameExists.location = [
		this.controls.lobby.gameExists.textBox.gameExists,
	];	


	// Game Does Not Exist (also A Game Already Exists With That Name and Server Down w/ different key)
	this.controls.lobby.gameDoesNotExist				= new Array();
	this.controls.lobby.gameDoesNotExist.name			= "Game Does Not Exist";
	this.controls.lobby.gameDoesNotExist.id				= 28;
	
	this.controls.lobby.gameDoesNotExist.textBox			= new Array();
	this.controls.lobby.gameDoesNotExist.textBox.text		= [4,438,300,326,150];
	this.controls.lobby.gameDoesNotExist.textBox.text.key		= [5159];

	this.controls.lobby.gameDoesNotExist.location = [
		this.controls.lobby.gameDoesNotExist.textBox.text,
	];


	this.controls.lobby.chat					= new Array();
	this.controls.lobby.chat.name					= "Lobby Chat";
	this.controls.lobby.chat.id					= 3;

	this.controls.lobby.chat.button 				= new Array();
	this.controls.lobby.chat.button.send				= [6,27,470,80,20];
	this.controls.lobby.chat.button.whisper				= [6,107,470,80,20];
	this.controls.lobby.chat.button.help				= [6,187,470,80,20];
	this.controls.lobby.chat.button.squelch				= [6,27,490,72,20];
	this.controls.lobby.chat.button.unsquelch			= [6,99,490,96,20];
	this.controls.lobby.chat.button.emote				= [6,195,490,72,20];

	this.controls.lobby.chat.textBox				= new Array();
	this.controls.lobby.chat.textBox.channelName			= [4,28,138,354,60];
	this.controls.lobby.chat.textBox.channelText 			= [4,28,410,354,298];

	this.controls.lobby.chat.location = [
		this.controls.lobby.chat.button.send,
		this.controls.lobby.chat.button.whisper,
		this.controls.lobby.chat.button.help,
	];

		
	this.controls.lobby.create					= new Array();
	this.controls.lobby.create.name					= "Create Game";
	this.controls.lobby.create.id					= 4;

	this.controls.lobby.create.textBox				= new Array();
	this.controls.lobby.create.textBox.createGame			= [4,496,111,200,22];
	this.controls.lobby.create.textBox.gameName			= [4,427,134,150,12];
	this.controls.lobby.create.textBox.password			= [4,427,188,300,12];
	this.controls.lobby.create.textBox.gameDescription		= [4,427,243,300,12];
	this.controls.lobby.create.textBox.maxNumberOfPlayers		= [4,632,306,300,12];
	this.controls.lobby.create.textBox.characterDifference		= [4,632,342,300,12];
	this.controls.lobby.create.textBox.levels			= [4,705,342,150,12];
	this.controls.lobby.create.textBox.normal			= [4,723,380,150,12];
	this.controls.lobby.create.textBox.nightmare			= [4,579,380,150,12];
	this.controls.lobby.create.textBox.hell				= [4,459,380,150,12];
	
	this.controls.lobby.create.editBox				= new Array();
	this.controls.lobby.create.editBox.gameName			= [1,432,162,158,20];
	this.controls.lobby.create.editBox.password			= [1,432,217,158,20];
	this.controls.lobby.create.editBox.gameDescription		= [1,432,268,333,20];
	this.controls.lobby.create.editBox.maxNumberOfPlayers		= [1,657,308,27,20];
	this.controls.lobby.create.editBox.characterDifference		= [1,657,342,27,20];

	this.controls.lobby.create.button				= new Array();
	this.controls.lobby.create.button.createGame			= [6,594,433,172,32];
	this.controls.lobby.create.button.cancel			= [6,433,433,96,32];
	this.controls.lobby.create.button.maxNumberOfPlayersUp		= [0];
	this.controls.lobby.create.button.maxNumberOfPlayersDown	= [0];
	this.controls.lobby.create.button.useCharacterDifference	= [0];
	this.controls.lobby.create.button.characterDifferenceUp		= [0];
	this.controls.lobby.create.button.characterDifferenceDown	= [0];
	this.controls.lobby.create.button.normal			= [6,430,381,16,16];
	this.controls.lobby.create.button.nightmare			= [6,555,381,16,16];
	this.controls.lobby.create.button.hell				= [6,698,381,16,16];
	
	this.controls.lobby.create.location = [
		this.controls.lobby.create.editBox.gameName,
		this.controls.lobby.create.editBox.password,
		this.controls.lobby.create.editBox.gameDescription,
	];


	// insert all game join controls here
	this.controls.lobby.join					= new Array();
	this.controls.lobby.join.name					= "Join Game";
	this.controls.lobby.join.id					= 5;
	
	this.controls.lobby.join.editBox				= new Array();
	this.controls.lobby.join.editBox.gameName			= [1,432,148,155,20];
	this.controls.lobby.join.editBox.password			= [1,606,148,155,20];
	
	this.controls.lobby.join.textBox				= new Array();
	this.controls.lobby.join.textBox.joinGame			= [4,496,106,200,22];
	this.controls.lobby.join.textBox.gameName			= [4,428,121,150,12];
	this.controls.lobby.join.textBox.password			= [4,602,121,150,12];
	this.controls.lobby.join.textBox.gameNamePlayers		= [4,431,212,200,12];
	this.controls.lobby.join.textBox.gameList			= [4,432,393,160,173];	// list is stored in extended text
	this.controls.lobby.join.textBox.gameDetails			= [4,609,393,143,194];	// details is stored in extended text

	this.controls.lobby.join.button					= new Array();
	this.controls.lobby.join.button.joinGame			= [6,594,433,172,32];
	this.controls.lobby.join.button.cancel				= [6,433,433,96,32];
	
	this.controls.lobby.join.location = [
		this.controls.lobby.join.editBox.gameName,
		this.controls.lobby.join.textBox.joinGame,
		this.controls.lobby.join.textBox.gameList,		
	];

	
	// insert all game ladder controls here
	this.controls.lobby.ladder					= new Array();
	this.controls.lobby.ladder.name					= "Ladder";
	this.controls.lobby.ladder.id					= 6;

	this.controls.lobby.ladder.textBox				= new Array();
	this.controls.lobby.ladder.button				= new Array();
	this.controls.lobby.ladder.list					= new Array();


	// insert all game channel controls here
	this.controls.lobby.channel					= new Array();
	this.controls.lobby.channel.name				= "Channel List";
	this.controls.lobby.channel.id					= 7;

	this.controls.lobby.channel.textBox				= new Array();
	this.controls.lobby.channel.editBox				= new Array();
	this.controls.lobby.channel.button				= new Array();
	this.controls.lobby.channel.list				= new Array();


	// insert all main menu controls here
	this.controls.mainMenu						= new Array();
	this.controls.mainMenu.name					= "Main Menu";
	this.controls.mainMenu.id					= 8;

	this.controls.mainMenu.textBox					= new Array();
	this.controls.mainMenu.textBox.d2Version			= [4,0,599,200,40];

	this.controls.mainMenu.button					= new Array();
	this.controls.mainMenu.button.gateway				= [6,264,391,272,25];
	this.controls.mainMenu.button.battleNet				= [6,264,366,272,35];
	this.controls.mainMenu.button.otherMultiplayer			= [6,264,433,272,35];
	this.controls.mainMenu.button.singlePlayer			= [6,264,324,272,35];
	this.controls.mainMenu.button.credits				= [6,264,528,135,25];
	this.controls.mainMenu.button.cinematics			= [6,402,528,135,25];
	this.controls.mainMenu.button.exitDiabloII			= [6,264,568,272,35];

	this.controls.mainMenu.location = [
		this.controls.mainMenu.button.battleNet,
		this.controls.mainMenu.button.otherMultiplayer,
		this.controls.mainMenu.button.singlePlayer,
	];
	

	// connecting to battle.net
	this.controls.mainMenu.connecting				= new Array();
	this.controls.mainMenu.connecting.id				= 21;
	this.controls.mainMenu.connecting.name				= "Connecting to Battle.net";
	
	this.controls.mainMenu.connecting.textBox			= new Array();
	this.controls.mainMenu.connecting.textBox.connectingTo		= [4,222,280,340,60];
	this.controls.mainMenu.connecting.textBox.body			= [4,222,360,340,70];	// contains connecting to battle.net/fastest server, accessing your account, or checking versions
	this.controls.mainMenu.connecting.textBox.progress		= [4,222,370,340,20];	// dots
	
	this.controls.mainMenu.connecting.button			= new Array();
	this.controls.mainMenu.connecting.button.cancel			= [6,330,416,128,35];

	this.controls.mainMenu.connecting.location = [
		this.controls.mainMenu.connecting.textBox.connectingTo,
		this.controls.mainMenu.connecting.textBox.body,
		this.controls.mainMenu.connecting.textBox.progress,
		this.controls.mainMenu.connecting.button.cancel,
	];


	// startup screen
	this.controls.d2Splash						= new Array();
	this.controls.d2Splash.name					= "D2 Splash"
	this.controls.d2Splash.id					= 18;
	
	this.controls.d2Splash.textBox					= new Array();
	this.controls.d2Splash.textBox.copyright			= [4,100,580,600,80];
	
	this.controls.d2Splash.location = [
		this.controls.d2Splash.textBox.copyright,
	];



	// insert all bnet login controls here (including account settings)
	// add: ACCOUNT SETTINGS, CHANGE PASSWORD, GET NEW PASSWORD, CHANGE EMAIL, CREATE NEW ACCOUNT agreement & form
	this.controls.login						= new Array();
	this.controls.login.name					= "Login";
	this.controls.login.id						= 9;
	
	this.controls.login.textBox					= new Array();
	this.controls.login.textBox.accountName				= [4,321,340,300,32];
	this.controls.login.textBox.password				= [4,321,394,300,32];
	this.controls.login.textBox.heading				= [4,200,350,400,100];

	this.controls.login.editBox					= new Array();
	this.controls.login.editBox.accountName				= [1,322,342,162,19];
	this.controls.login.editBox.password				= [1,322,396,162,19];

	this.controls.login.button					= new Array();
	this.controls.login.button.createNewAccount			= [6,264,572,272,35];
	this.controls.login.button.accountSettings			= [6,264,528,272,35];
	this.controls.login.button.logIn				= [6,264,484,272,35];
	this.controls.login.button.exit					= [6,33,572,128,35];

	this.controls.login.location = [
		this.controls.login.textBox.accountName,
		this.controls.login.editBox.password,
		this.controls.login.editBox.accountName,
		this.controls.login.button.logIn,
	];


	// login error, permanent failure, bad account or password
	this.controls.login.loginError					= new Array();
	this.controls.login.loginError.name				= "Login Error";
	this.controls.login.loginError.id				= 10;

	this.controls.login.loginError.textBox				= new Array();
	this.controls.login.loginError.textBox.loginError		= [4,195,237,410,40];	// used for invalid login/password popups
	this.controls.login.loginError.textBox.invalidPassword		= [4,199,377,402,140];
	this.controls.login.loginError.textBox.invalidAccount		= [4,199,377,402,140];

	this.controls.login.loginError.button				= new Array();
	this.controls.login.loginError.button.ok			= [6,335,412,128,35];	// used for invalid login/password popups

	this.controls.login.loginError.location = [
		this.controls.login.loginError.textBox.loginError,
		this.controls.login.loginError.button.ok,
	];


	// unable to connect, related to ip-bans or no internet connection
	this.controls.login.unableToConnect				= new Array();
	this.controls.login.unableToConnect.name			= "Unable To Connect";
	this.controls.login.unableToConnect.id				= 11;
	
	this.controls.login.unableToConnect.textBox			= new Array();
	this.controls.login.unableToConnect.textBox.title		= [4,158,220,485,40];
	this.controls.login.unableToConnect.textBox.head		= [4,162,320,477,100];
	this.controls.login.unableToConnect.textBox.body		= [4,162,420,477,100];

	this.controls.login.unableToConnect.button			= new Array();
	this.controls.login.unableToConnect.button.ok			= [6,335,450,128,35];
	
	this.controls.login.unableToConnect.location = [
		this.controls.login.unableToConnect.textBox.title,
		this.controls.login.unableToConnect.textBox.head,
		this.controls.login.unableToConnect.button.ok,
	];


	this.controls.login.cdkeyInUse					= new Array();
	this.controls.login.cdkeyInUse.name				= "Cdkey In Use";
	this.controls.login.cdkeyInUse.id				= 19;

	this.controls.login.cdkeyInUse.textBox				= new Array();
	this.controls.login.cdkeyInUse.textBox.unableToConnect		= [4,158,220,485,40];
	this.controls.login.cdkeyInUse.textBox.cdkeyInUse		= [4,162,270,477,50];
	this.controls.login.cdkeyInUse.textBox.byWho			= [4,158,310,485,40];
	this.controls.login.cdkeyInUse.textBox.onlyOneRegistered	= [4,162,420,477,100];
	
	this.controls.login.cdkeyInUse.button				= new Array();
	this.controls.login.cdkeyInUse.button.ok			= [6,335,450,128,35];
	
	this.controls.login.cdkeyInUse.location = [
		this.controls.login.cdkeyInUse.textBox.unableToConnect,
		this.controls.login.cdkeyInUse.textBox.cdkeyInUse,
		this.controls.login.cdkeyInUse.textBox.byWho,
	];


	// login - invalid cdkey
	this.controls.login.invalidCdkey				= new Array();
	this.controls.login.invalidCdkey.id				= 22;
	this.controls.login.invalidCdkey.name				= "Invalid Cdkey";
	
	this.controls.login.invalidCdkey.textBox			= new Array();
	this.controls.login.invalidCdkey.textBox.unableToConnect	= [4,158,220,485,40];
	this.controls.login.invalidCdkey.textBox.invalidCdkey		= [4,162,320,477,100];
	this.controls.login.invalidCdkey.textBox.invalidCdkey.key	= [5202, 10912];
	this.controls.login.invalidCdkey.textBox.uninstall		= [4,162,420,477,100];

	this.controls.login.invalidCdkey.button				= new Array();
	this.controls.login.invalidCdkey.button.ok			= [6,335,450,128,35];

	this.controls.login.invalidCdkey.location = [
		this.controls.login.invalidCdkey.textBox.unableToConnect,
		this.controls.login.invalidCdkey.textBox.invalidCdkey,
		this.controls.login.invalidCdkey.textBox.uninstall,
		this.controls.login.invalidCdkey.button.ok
	];


	// insert all character select screen controls here (including single player)
	this.controls.characterSelect					= new Array();
	this.controls.characterSelect.name				= "Character Select";
	this.controls.characterSelect.id				= 12;
	
	this.controls.characterSelect.textBox				= new Array();
	this.controls.characterSelect.textBox.selectedCharName		= [4,85,78,466,42];
	this.controls.characterSelect.textBox.currentRealm		= [4,629,44,145,21];
	this.controls.characterSelect.textBox.selectedCurrentRealm	= [4,626,100,151,44];
	this.controls.characterSelect.textBox.characters		= new Array(8);
	this.controls.characterSelect.textBox.characters[0]		= [4,237,178,72,93];
	this.controls.characterSelect.textBox.characters[1]		= [4,509,178,72,93];
	this.controls.characterSelect.textBox.characters[2]		= [4,237,271,72,93];
	this.controls.characterSelect.textBox.characters[3]		= [4,509,271,72,93];
	this.controls.characterSelect.textBox.characters[4]		= [4,237,364,72,93];
	this.controls.characterSelect.textBox.characters[5]		= [4,509,364,72,93];
	this.controls.characterSelect.textBox.characters[6]		= [4,237,457,72,93];
	this.controls.characterSelect.textBox.characters[7]		= [4,509,457,72,93];
	this.controls.characterSelect.textBox.characterInfo		= new Array(8);
	this.controls.characterSelect.textBox.characterInfo[0]		= [4,37,178,200,92];
	this.controls.characterSelect.textBox.characterInfo[1]		= [4,309,178,200,92];
	this.controls.characterSelect.textBox.characterInfo[2]		= [4,37,271,200,92];
	this.controls.characterSelect.textBox.characterInfo[3]		= [4,309,271,200,92];
	this.controls.characterSelect.textBox.characterInfo[4]		= [4,37,364,200,92];
	this.controls.characterSelect.textBox.characterInfo[5]		= [4,309,364,200,92];
	this.controls.characterSelect.textBox.characterInfo[6]		= [4,37,457,200,92];
	this.controls.characterSelect.textBox.characterInfo[7]		= [4,309,457,200,92];
	this.controls.characterSelect.textBox.deleteConfirmation	= [];

	this.controls.characterSelect.button				= new Array();
	this.controls.characterSelect.button.ok				= [6,627,572,128,35];
	this.controls.characterSelect.button.exit			= [6,33,572,128,35];
	this.controls.characterSelect.button.createNew			= [6,33,528,168,60];
	this.controls.characterSelect.button.convertTo			= [6,233,528,168,60];
	this.controls.characterSelect.button.deleteChar			= [6,433,528,168,60];
	this.controls.characterSelect.button.changeRealm		= [6,609,113,182,30];
	this.controls.characterSelect.button.deleteYes			= [];
	this.controls.characterSelect.button.deleteNo			= [];
	
	this.controls.characterSelect.location = [
		this.controls.characterSelect.textBox.selectedCharName,
		this.controls.characterSelect.textBox.characters[0],
		this.controls.characterSelect.textBox.characterInfo[7],		
	];


	this.controls.characterCreate					= new Array();
	this.controls.characterCreate.name				= "Character Create";
	this.controls.characterCreate.id				= 29;

	this.controls.characterCreate.editBox				= new Array();
	this.controls.characterCreate.editBox.charName			= [1,318,510,157,16];

	this.controls.characterCreate.textBox				= new Array();
	this.controls.characterCreate.textBox.selectHeroClass		= [4,0,80,800,50];
	this.controls.characterCreate.textBox.charName			= [4,321,512,200,32];
	this.controls.characterCreate.textBox.bottomText		= [4,210,610,430,120];
	this.controls.characterCreate.textBox.expansionChar		= [4,339,561,200,32];
	this.controls.characterCreate.textBox.hardcore			= [4,339,581,100,32];
	this.controls.characterCreate.textBox.ladderChar		= [4,339,601,200,32];
	this.controls.characterCreate.textBox.className			= [4,0,180,800,100];
	this.controls.characterCreate.textBox.classDesc			= [4,250,210,300,100];

	this.controls.characterCreate.button				= new Array();
	this.controls.characterCreate.button.exit			= [6,33,572,128,35];
	this.controls.characterCreate.button.expansionChar		= [6,319,540,15,16];
	this.controls.characterCreate.button.hardcore			= [6,319,560,15,16];
	this.controls.characterCreate.button.ladderChar			= [6,319,580,15,16];
	this.controls.characterCreate.button.ok				= [6,627,572,128,35];

	this.controls.characterCreate.chars				= new Array(9);
	this.controls.characterCreate.chars[0]				= [2,400,330,88,184];
	this.controls.characterCreate.chars[1]				= [2,626,353,88,184];
	this.controls.characterCreate.chars[2]				= [2,521,339,88,184];
	this.controls.characterCreate.chars[3]				= [2,301,333,88,184];
	this.controls.characterCreate.chars[4]				= [2,232,364,88,184];
	this.controls.characterCreate.chars[5]				= [2,100,337,88,184];
	this.controls.characterCreate.chars[6]				= [2,720,370,88,184];
	this.controls.characterCreate.chars[7]				= [2,345,470,110,127];
	this.controls.characterCreate.chars[8]				= [2,268,350,264,176];

	this.controls.characterCreate.location = [
		this.controls.characterCreate.textBox.selectHeroClass,
		this.controls.characterCreate.textBox.bottomText,
	];

/*
	this.controls.characterCreate.alreadyExists			= new Array();
	this.controls.characterCreate.alreadyExists.name		= "Character Create - Dupe Name";
	this.controls.characterCreate.alreadyExists.id			= 30;
	
	this.controls.characterCreate.alreadyExists.textBox		= new Array();
	this.controls.characterCreate.alreadyExists.textBox.errorMsg	= [4,268,320,264,120];

	this.controls.characterCreate.alreadyExists.button		= new Array();
	this.controls.characterCreate.alreadyExists.button.ok		= [6,351,337,96,32];

	this.controls.characterCreate.alreadyExists.location = [
		this.controls.characterCreate.alreadyExists.textBox.errorMsg,
		this.controls.characterCreate.alreadyExists.button.ok,
	];
*/


	// realm down on char select screen
	this.controls.characterSelect.realmDown				= new Array();
	this.controls.characterSelect.realmDown.name			= "Realm Down";
	this.controls.characterSelect.realmDown.id			= 13;

	this.controls.characterSelect.realmDown.textBox			= new Array();
	this.controls.characterSelect.realmDown.textBox.realmDown	= [4,37,178,547,35];
	this.controls.characterSelect.realmDown.textBox.realmDown.key	= [11162];

	this.controls.characterSelect.realmDown.location = [
		this.controls.characterSelect.realmDown.textBox.realmDown,
	];
	this.controls.characterSelect.realmDown.checkNullText		= true;


	// Connecting on char select screen
	this.controls.characterSelect.connecting			= new Array();
	this.controls.characterSelect.connecting.name			= "Connecting...";
	this.controls.characterSelect.connecting.id			= 23;

	this.controls.characterSelect.connecting.textBox		= new Array();
	this.controls.characterSelect.connecting.textBox.connecting	= [4,37,178,547,35];
	this.controls.characterSelect.connecting.textBox.connecting.key	= [11065];

	this.controls.characterSelect.connecting.location = [
		this.controls.characterSelect.connecting.textBox.connecting,
	];
	this.controls.characterSelect.connecting.checkNullText		= true;


	// Popup: You were,disconnected from,battle.net.  Please,reconnect.
	this.controls.characterSelect.disconnected			= new Array();
	this.controls.characterSelect.disconnected.name			= "Disconnected";
	this.controls.characterSelect.disconnected.id			= 14;
	
	this.controls.characterSelect.disconnected.textBox		= new Array();
	this.controls.characterSelect.disconnected.textBox.disconnected	= [4,268,300,264,100];
	
	this.controls.characterSelect.disconnected.button		= new Array();
	this.controls.characterSelect.disconnected.button.ok		= [6,351,337,96,32];
	
	this.controls.characterSelect.disconnected.location = [
		this.controls.characterSelect.disconnected.textBox.disconnected,
		this.controls.characterSelect.disconnected.button.ok,
	];
	
	
	// Single Player - Difficulty Select
	this.controls.characterSelect.difficulty			= new Array();
	this.controls.characterSelect.difficulty.name			= "Select Difficulty";
	this.controls.characterSelect.difficulty.id			= 20;

	this.controls.characterSelect.difficulty.textBox		= new Array();
	this.controls.characterSelect.difficulty.textBox.select		= [4,264,260,272,35];

	this.controls.characterSelect.difficulty.button			= new Array();
	this.controls.characterSelect.difficulty.button.normal		= [6,264,297,272,35];
	this.controls.characterSelect.difficulty.button.nightmare	= [6,264,340,272,35];
	this.controls.characterSelect.difficulty.button.hell		= [6,264,383,272,35];
	
	this.controls.characterSelect.difficulty.location = [
		this.controls.characterSelect.difficulty.textBox.select,
		this.controls.characterSelect.difficulty.button.normal,
		this.controls.characterSelect.difficulty.button.nightmare,
		this.controls.characterSelect.difficulty.button.hell,
	];


	// new character controls
	this.controls.newCharacter					= new Array();	
	this.controls.newCharacter.name					= "New Character";	
	this.controls.newCharacter.id					= 15;	

	this.controls.newCharacter.textBox				= new Array();
	this.controls.newCharacter.editBox				= new Array();
	this.controls.newCharacter.button				= new Array();


	// Please Wait control popup
	this.controls.characterSelect.pleaseWait			= new Array();
	this.controls.characterSelect.pleaseWait.name			= "Please Wait";
	this.controls.characterSelect.pleaseWait.id			= 16;

	this.controls.characterSelect.pleaseWait.textBox		= new Array();
	this.controls.characterSelect.pleaseWait.textBox.pleaseWait	= [4,268,300,264,100];

	this.controls.characterSelect.pleaseWait.button			= new Array();
	this.controls.characterSelect.pleaseWait.button.cancel		= [6,351,337,96,32];

	this.controls.characterSelect.pleaseWait.location = [
		this.controls.characterSelect.pleaseWait.textBox.pleaseWait,
		this.controls.characterSelect.pleaseWait.button.cancel,
	];
	
	
	// select gateway (realm)
	this.controls.gateway						= new Array();
	this.controls.gateway.name					= "Select Gateway";
	this.controls.gateway.id					= 27;
	this.controls.gateway.baseX					= 285;
	this.controls.gateway.baseY					= 352;
	this.controls.gateway.nextY					= 24;

	this.controls.gateway.textBox					= new Array();
	this.controls.gateway.textBox.selectGateway			= [4,237,270,340,35];
	this.controls.gateway.textBox.ifCurrentGateway			= [4,257,345,320,84];
	this.controls.gateway.textBox.realmList				= [4,257,500,292,160];

	this.controls.gateway.button					= new Array();
	this.controls.gateway.button.ok					= [6,281,538,96,32];
	this.controls.gateway.button.cancel				= [6,436,538,96,32];

	this.controls.gateway.location = [
		this.controls.gateway.textBox.realmList,
		this.controls.gateway.button.ok,
		this.controls.gateway.button.cancel,
	];


	// getLocation will iterate over these, in this order, do error checkers first
	this.locations = [
		this.controls.characterSelect.pleaseWait,
		this.controls.lobby.gameDoesNotExist,
		this.controls.lobby.gameExists,
		this.controls.lobby.lostConnection,
		this.controls.lobby.pleaseWait,
		this.controls.lobby.inLine,
		this.controls.lobby.serverDown,
		this.controls.characterSelect.realmDown,
		this.controls.characterSelect.connecting,
		this.controls.characterSelect.disconnected,
		this.controls.login.loginError,
		this.controls.login.invalidCdkey,
		this.controls.login.unableToConnect,
		this.controls.login.cdkeyInUse,
		this.controls.lobby.create,
		this.controls.lobby.join,
//		ladder
//		channel
		this.controls.lobby.chat,
		this.controls.lobby,
		this.controls.characterSelect.difficulty,
		this.controls.characterSelect,
		this.controls.login,
		this.controls.mainMenu.connecting,
		this.controls.gateway,
		this.controls.mainMenu,
		this.controls.d2Splash,
		this.controls.characterCreate,
	];

	this.gameTypes = [
		this.controls.mainMenu.button.singlePlayer,
		this.controls.mainMenu.button.battleNet,
		this.controls.mainMenu.button.otherMultiplayer,
	];
	
	this.gameDifficulties = [
		this.controls.lobby.create.button.normal,
		this.controls.lobby.create.button.nightmare,
		this.controls.lobby.create.button.hell,
	];
	
	this.singlePlayerDifficulties = [
		this.controls.characterSelect.difficulty.button.normal,
		this.controls.characterSelect.difficulty.button.nightmare,
		this.controls.characterSelect.difficulty.button.hell,
	];
	
	this.clickDelay = 250;
	this.textDelay = 100;
	this.clickDelayRandom = 0;
	this.textDelayRandom = 0;
	
	this.realmNames = [];
	this.realmNames["U.S. WEST"] = 0;
	this.realmNames["U.S. EAST"] = 1;
	this.realmNames["ASIA"] = 2;
	this.realmNames["EUROPE"] = 3;


	// returns control object if exists, else null
	this.get = function( controlArray ) {
		retControl = 0;
		if( controlArray && controlArray.length==5 ) {
			retControl = GetControl( controlArray[0], controlArray[1], controlArray[2], controlArray[3], controlArray[4] );
		}
		return retControl;
	}

	// clicks object, if it exists, return true if exists, false if not
	this.click = function( controlArray, _x, _y, _skipdelay ) {
		if( control = this.get( controlArray ) ) {
			if( _x || _y ) {
				control.Click( _x, _y );
			} else {
				control.Click( );
			}

			if(!_skipdelay) Delay( this.clickDelay + Random( 0, this.clickDelayRandom ) );
			return true;
		}
		return false;
	}

	// sets text on object, returns false if not exists
	this.setText = function( controlArray, str ) {
		if( controlArray[0]==1 ) {
		if( control = this.get( controlArray ) ) {
			control.SetText( str );
			
			Delay( this.textDelay + Random( 0, this.textDelayRandom ) );
			return true;
		}
		}
		return false;
	}
	
	// clicks a realm entry, this is 0 based! 0 = top entry (uswest)
	this.clickRealmEntry = function( realmEntryIndex ) {
		this.click( this.controls.gateway.textBox.realmList, 0, (realmEntryIndex*this.controls.gateway.nextY)+(this.controls.gateway.nextY/2) );
	}

	// returns the 0 based index of the currently selected realm
	this.getCurrentRealmIndex = function( ) {
		retVal = -1;
		control = this.get( controlData.controls.mainMenu.button.gateway );
		if(control) {
			realmString = control.text.substring(control.text.indexOf(":")+2, control.text.length);
			if(realmString in this.realmNames) retVal = this.realmNames[realmString];
		}
		return retVal;
	}

	this.getLocation = function( ) {
		for(_i=0; _i<this.locations.length; _i++) {
			found = 0;
			for(_j=0; _j<this.locations[_i].location.length; _j++) {
				if( (control = this.get( this.locations[_i].location[_j] )) && (!this.locations[_i].checkNullText || control.text!=null) ) {
					if(this.locations[_i].location[_j].key) {
						for(_k=0; _k<this.locations[_i].location[_j].key.length; _k++) {
							if((_s = control.GetText()) && GetLocaleString(this.locations[_i].location[_j].key[_k]) == String(_s.join(" ")) ) {
								found++;
								break;
							}
						}
					} else {
						found++;
					}
				}
			}
			if(found == this.locations[_i].location.length) return this.locations[_i];
		}

		return 0;	// no valid location found
	
	}
	
	// returns the current location, see locations array for listing
	this.getLocationQuick = function( ) {	
		for(_i=0; _i<this.locations.length; _i++) {
			found = true;
			for(_j=0; _j<this.locations[_i].location.length; _j++) {
				if( !(control = this.get( this.locations[_i].location[_j] )) ||
					( this.locations[_i].checkNullText && control.text==null ) ) {
					found = false;
					break;
				}
			}
			if(found) return this.locations[_i];
		}
	
		return 0;	// no valid location found
	}
}
wie gesagt mit der alten ntbotleech klappt es ohne probleme
modwx is offline  
Old 07/20/2011, 20:52   #10
 
elite*gold: 0
Join Date: Mar 2010
Posts: 539
Received Thanks: 418
Dann ersetz mal in Zeile 735 der controlinfo.ntl controlData durch ControlData.
TheCrazy11 is offline  
Old 07/20/2011, 21:28   #11

 
lanara's Avatar
 
elite*gold: 139
Join Date: Oct 2006
Posts: 12,058
Received Thanks: 24,256
Das Problem hatte einer in meinem Thread auch schon, ich habe keine Ahnung wieso da bei euch controlData in der Datei steht. Normal müsste die Zeile so aussehen:

Code:
control = this.get( [B]this[/B].controls.mainMenu.button.gateway );
lanara is offline  
Thanks
1 User
Old 07/21/2011, 08:52   #12

 
modwx's Avatar
 
elite*gold: 20
Join Date: Feb 2009
Posts: 362
Received Thanks: 26
also der fehler ist weg startet ohne probleme,joined auch ohne probleme ...nur wenn er im game ist steht oben im fenster die ganze zeit "joining game" und macht nix, im manager wird angezeigt das er schon ingame ist und zeit läuft.....
modwx is offline  
Old 07/28/2011, 14:53   #13
 
stoned2k9's Avatar
 
elite*gold: 0
Join Date: Jun 2009
Posts: 600
Received Thanks: 105
hatte selbige Probs wie mod...alles geregelt jetzt. leecher findet nun den leader nichtmehr. trotz dass alles richtig eingetragen ist und sie sich in der fl befinden. läuft auch mit ner alten botleech datei sauber. nur hier gehts nicht.

jemand ne idee?
stoned2k9 is offline  
Old 08/01/2011, 01:11   #14
 
elite*gold: 0
Join Date: Aug 2009
Posts: 435
Received Thanks: 159
bei mir stürzt das game immer ab, wenn der leader nicht nach 20 sekunden oder so gefunden wurde...

Hab mir so gerade nen ban eingezogen... hoffentlich nicht allzulang, aber über 12 stunden geht er schon -.-

Edit: muss mich verbessern, war nur ein verlängerter Timeban, wegen des häufigen wieder einloggens... hab erstmal die ganzen delays erhöht^^
DeathFromHeaven is offline  
Old 03/04/2012, 13:21   #15
 
Barbar.'s Avatar
 
elite*gold: 0
Join Date: Jan 2012
Posts: 10
Received Thanks: 0
Quote:
Originally Posted by lanara View Post
Das Problem hatte einer in meinem Thread auch schon, ich habe keine Ahnung wieso da bei euch controlData in der Datei steht. Normal müsste die Zeile so aussehen:

Code:
control = this.get( [B]this[/B].controls.mainMenu.button.gateway );
hmm habe auch diese problem aber finde die stelle nicht wo ich die ersetzen mussalso bitte helfen

pk problem gelöst ControlData muss in controlData geändert werden

Barbar. is offline  
Closed Thread


Similar Threads Similar Threads
[Release]Überarbeitete shops und items
12/29/2010 - Metin2 PServer Guides & Strategies - 15 Replies
Da viele Uppverfahren bei den SF von profizcoker94 haben wollten stell ich mal meine überarbeiteten shops und item_proto rein. Uppverfahren: Neuer Shop: (Paar vond en Waffen die man anders nicht bekommen würde) http://www2.pic-upload.de/20.04.10/v9dlx43rp8b5.j pg NOCH EIN NEUER SHOP AB LVL 90 WAFFEN! In uppitem shop2 hinzugefügt:
NTBotLeech.ntj erweitern
10/25/2010 - Diablo 2 Programming - 9 Replies
Hallo zusammen... Ich arbeite zur Zeit an einem Leechscript ohne /f l Spam (habe jede Menge Ipban dadurch bekommen, und ich finde die Methode auch nicht sauber.) Mit Hilfe von EON ist folgendes Script entstanden: 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 = 30; ...
Überarbeitete SF [DEUTSCH] #2
03/20/2010 - Metin2 PServer Guides & Strategies - 355 Replies
DIESER SERVICE EXISTIERT NICHT MEHR.
überarbeitete db
02/28/2010 - Metin2 Private Server - 14 Replies
hallo leute es gibt jetzt so viele db die überarbeitet ist dh. vieles duetsch etc und welche findet ihr am besten?



All times are GMT +1. The time now is 04:07.


Powered by vBulletin®
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
SEO by vBSEO ©2011, Crawlability, Inc.
This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

Support | Contact Us | FAQ | Advertising | Privacy Policy | Terms of Service | Abuse
Copyright ©2025 elitepvpers All Rights Reserved.