Register for your free account! | Forgot your password?

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

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

Advertisement



[Script für "Random Game join"]

Discussion on [Script für "Random Game join"] within the Diablo 2 forum part of the Other Online Games category.

Closed Thread
 
Old   #1
 
Orxius's Avatar
 
elite*gold: 10
Join Date: Dec 2008
Posts: 328
Received Thanks: 42
[Script für "Random Game join"]

Vorweg möchte ich darauf hinweißen, das ich den Code/Script weder geschrieben habe ,noch hier wirklich Supporten kann!
Ich hab in verschieden Theards hier gelesen das er gesucht wird!
Von daher möchte ich ihn hier posten!

Eig. reposte ich nur diesen Beitrag, auf Seite 11 von Njom´s Chestscript ist schon einmal der Link gepostet worden!

So hier die Originalquelle :

Also hier nochmal das Script :
Code:
var gameMinLength		= 180000;	// time in milliseconds, minimum game length, 180 seconds default (1 game/3 minutes)

var unableToConnectRetry	= 15;		// time in minutes to retry connecting on connection fail (real value is +/- 1 min)
var realmDownRetry		= 30;		// time in minutes to retry connecting on a realm down (default is 300 minutes)
var disconnectedRetry		= 5;		// time in minutes to retry on a disconnection (usually ip ban related)
var cdkeyInUseRetry		= 2;		// 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		= 10000;		// time in milliseconds to wait between making games
var createGameThresholdRandom	= 2500;		// 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	= 30000;	// how long to wait when a Game Does Not Exist occurs - minimum - default 10 minutes
var gameDoesNotExistDelayMax	= 45000;	// 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		= true;		// 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

// DONT EDIT ANYTHING BELOW THIS

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

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

Include("libs/controlInfo.ntl");

var controlData = new controlInfo();

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)
			{
				RunGC(); // run garbage collector between each game

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

					if(me.playtype > 0)
						sendEventToOOG(D2NT_MGR_INGAME, "In Game[" + me.gamename + "]", 0);
					else
						sendEventToOOG(D2NT_MGR_INGAME, "In Game", 0);

					lastGameStatus = 2; // in game successful
				}
			}

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

				sendEventToOOG(D2NT_MGR_READY, "", 0);
			}

			locationAction(controlData.getLocation());

			Delay(500);
		}
	}
}

function locationAction(location)
{
	switch(location.id)
	{
	case 3: // Lobby Chat
		if(!chatActionsDone)
		{
			chatActionsDone = true;
			Delay(Random(waitInChatBeforeActionsMin, waitInChatBeforeActionsMax));

			if(joinRandomChannel || joinChannelInChat != "")
			{
				Say("/join " + (joinRandomChannel ? getRandomString(Random(3,10)) : joinChannelInChat));
				Delay(1000);
			}
		}
	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.join);
				if(_control && _control.pressed)
				{
					controlData.click(controlData.controls.lobby.button.create);
					Delay(500);
				}

				controlData.click(controlData.controls.lobby.button.join);
				Delay(2000);
				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
		sendEventToOOG(D2NT_MGR_CREATE_GAME, location.name, 0);

		locationTimeout(5000, location);

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

	case 5: // Join Game
		var bla = controlData.get(controlData.controls.lobby.join.textBox.gameList);
		var lines;
		var game;
		var validgame;
		var gamelist;
		var j = 0;
				
		while(1)
		{
			lines = bla.GetText();
			
			if(!lines)
			{
				sendEventToOOG(D2NT_MGR_PRINT_LOG, "�FF7E00" + "Debug - 'lines' was null");
				controlData.click(controlData.controls.lobby.button.create);
				Delay(500);
				controlData.click(controlData.controls.lobby.button.join);
				Delay(2000);
			}
			else
			{
				for (i = 0; i < lines.length; i++) 
				{
					if(lines[i].indexOf("chaos") != -1 || lines[i].indexOf("baal") != -1)
					{
						validgame = true;
						game = lines[i];
						gamelist = FileOpen("logs/GameList.txt", 2);
						if(!gamelist)
							continue;
						
						while(!gamelist.eof)
						{
							if(game == gamelist.ReadLine())
							{
								validgame = false;
								sendEventToOOG(D2NT_MGR_PRINT_LOG, "�FF7E00" + "Debug - game found on list: " + game);
							}
							j = (j + 1);
						}
							
						if(validgame)
						{
							gamelist.WriteLine(game);
							gamelist.Close();
							break;
						}
						else
						{
							gamelist.Close();
						}
					}
				}
			}
			
			if(j >= 50)
			{
				gamelist = FileOpen("logs/GameList.txt", 1);
				gamelist.WriteLine(game);
				gamelist.Close();
			}
			
			if(game && lines && validgame)
				break;
		}
		
		Delay(250);
		controlData.setText(controlData.controls.lobby.join.editBox.gameName, game);
		//Delay(250);
		//sendEventToOOG(D2NT_MGR_PRINT_LOG, "�4D86B0Joining: " + game);
		Delay(250);
		controlData.click(controlData.controls.lobby.join.button.joinGame);
		
		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, "�E00000Game 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;
	}
}

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;
}
Instructions - READ THIS OR SUFFER MY WRATH--first make sure d2nt manager isn't running
-save the provided text as joiner.ntj
-use joiner.ntj as entry point in d2nt manager
///important\\\
-make a folder named logs in \D2NT\scripts folder
-make a file named GameList.txt in logs folder

change log:
-fixed a crash bug (crashes may still occur, but very rarely)
-logs last 50 games to a text file so you don't join the same game twice
-removed "joined: xxx" line from common log
-changed In Game message to print joined games
-reduced join delay from 4 seconds to 2 seconds (if you lag, it will click create and join again to refresh game list)

Original bei koton!
________________________________

Ich hoffe ich konnte nun hier einige Begierden stillen!!
Aus eigenen Erfahrungen her bin ich recht zufrieden mit diesem Scrpt, habe es abgewandelt und verwende es für Chestbotting!!

Ich hoffe ich konnte helfen , schöne Nacht noch Orxius

Edit : verdammt erst jetzt gesehen das es bereits in den Sticky´s ist !!!!!! Sorry Kal_el, close den Theard oder mach ,weiß Gott was damit
Orxius is offline  
Old 05/29/2011, 07:40   #2
 
kal_el's Avatar
 
elite*gold: 0
Join Date: Jan 2009
Posts: 7,310
Received Thanks: 2,205
Quote:
Edit : verdammt erst jetzt gesehen das es bereits in den Sticky´s ist !!!!!! Sorry Kal_el, close den Theard oder mach ,weiß Gott was damit
closed
kal_el is offline  
Closed Thread


Similar Threads Similar Threads
Komme nicht ins Game es steht immer " Failed to join the battle " bitte hilfe.
04/04/2011 - Combat Arms - 7 Replies
Überschrift sagt alles .. danke im vorraus..
Kann mir bitte jemmand eine Hmachi HP erstellen """""SOS HELP""""
09/15/2010 - Metin2 Private Server - 11 Replies
SO wie der Titel schon sagt ich suche einen der mir per Teamviwer eine hp machen kann habe schon alles ausprobiert aber es klappt nie!!!! PLS HELP...
"Failed to join game error" Hilfe !!!
07/12/2010 - Diablo 2 - 7 Replies
Habe seit kurzen andauernd den Fehler Failed to join game.... Kann man da irgendwas fixen oder liegt das momentan an den servern ??



All times are GMT +2. The time now is 04:59.


Powered by vBulletin®
Copyright ©2000 - 2024, 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 ©2024 elitepvpers All Rights Reserved.