|
You last visited: Today at 23:59
Advertisement
D2nt Fehler
Discussion on D2nt Fehler within the Diablo 2 forum part of the Other Online Games category.
07/11/2011, 14:45
|
#1
|
elite*gold: 0
Join Date: Mar 2010
Posts: 228
Received Thanks: 20
|
D2nt Fehler
Tach
ich habe folgendes Problem schon seit einigen wochen:
Bei Fehlermeldungen, die D2 zum crashen bringen hängt sich D2 einfach auf bis zum manuellen restart. Die Fehlermeldung ertönt als Ton aber wird nix angezeigt.
Bei dem D2nt Manager wird "Please wait" angezeit aber keine reaktion. Bis jetzt ist es nur mein Leaderbot (Baal -Privates game) passiert.
Ich habe von paar anderen gehört, dass es auch bei anderen D2nt Versionen auftauchte..
Das problem bezieht sich daher auf alle d2nt Versionen, deswegen auch der neue thread. Habe auch schon in eigentlichen thread versucht aber scheint als ob keiner dafür eine lösung hat.
Würde mich über hilfe jeder art freuen
Devil
|
|
|
07/11/2011, 15:33
|
#2
|
elite*gold: 250
Join Date: Mar 2010
Posts: 840
Received Thanks: 184
|
ich glaub gegen den Crash selber kann man nichts unternehmen, aber hier im Forum gibt es ein (AutoIt)Programm, was D2 automatisch schließt, wenn es crasht und sich aufhängt.
|
|
|
07/11/2011, 23:13
|
#3
|
elite*gold: 20
Join Date: Feb 2009
Posts: 3,100
Received Thanks: 922
|
ja wie gesagt das ist normal der error, dass einzige was du mal machen kannst ist in dein diablo 2 ordner die login txt ini zu löschen die in etwa so bezeichnet sind
D2110711
D2110713
D2110714
D2110715 usw
mfg
xdod
|
|
|
07/12/2011, 11:45
|
#4
|
elite*gold: 0
Join Date: Mar 2010
Posts: 228
Received Thanks: 20
|
Danke für die ideen, aber das problem besteht leider immernoch.
|
|
|
07/12/2011, 11:56
|
#5
|
elite*gold: 0
Join Date: Aug 2010
Posts: 435
Received Thanks: 117
|
Mir ist aufgefallen fas ich sowas habe, wenn ich wie bots relativ schnell hintereinander starte.
Z.B. Nach dem mulen.
Anderes ist mir nicht aufgefallen. Vielleicht ein speicher-verteilungs-problem? Oder ähnliches? Rechner stark ausgelastet mit den bots evtl?
|
|
|
07/12/2011, 12:45
|
#6
|
elite*gold: 0
Join Date: Mar 2010
Posts: 228
Received Thanks: 20
|
Quote:
Originally Posted by flow-jow
Mir ist aufgefallen fas ich sowas habe, wenn ich wie bots relativ schnell hintereinander starte.
Z.B. Nach dem mulen.
Anderes ist mir nicht aufgefallen. Vielleicht ein speicher-verteilungs-problem? Oder ähnliches? Rechner stark ausgelastet mit den bots evtl?
|
Am Pc kann es nicht liegen, kaum eine belastung für ihn bei 4x D2.
Es passiert nur bei solchen fehler, sonst läufts stabil.
|
|
|
07/12/2011, 14:14
|
#7
|
elite*gold: 250
Join Date: Mar 2010
Posts: 840
Received Thanks: 184
|
was du auch noch versuchen kannst, is dass Windows automatisch Fenster schließen soll, von denen er keine Rückmeldung erlangt.
Bin mir allerdings ned sicher ob das (noch) geht
|
|
|
07/12/2011, 16:37
|
#8
|
elite*gold: 139
Join Date: Oct 2006
Posts: 12,058
Received Thanks: 24,256
|
Hängt er sich immer bei den gleichen Sachen auf, also z.B. beim verlassen des Spiels?
|
|
|
07/12/2011, 18:05
|
#9
|
elite*gold: 0
Join Date: Mar 2010
Posts: 228
Received Thanks: 20
|
Quote:
Originally Posted by lanara
Hängt er sich immer bei den gleichen Sachen auf, also z.B. beim verlassen des Spiels?
|
Beim verlassen das games, während der Bot läuft ja.
Bei allen anderen bin ich mir nicht sicher, weil ich meistens (wenn ich mal am Pc bin) den ton höre aber dann nicht mehr sehen kann wodurch es ausgelöst worden ist.
|
|
|
07/12/2011, 20:29
|
#10
|
elite*gold: 139
Join Date: Oct 2006
Posts: 12,058
Received Thanks: 24,256
|
Kannste mal den Entry Point posten, den du nutzt? Möglich, dass der Fehler darin versteckt ist, war zumindest bei meiner Version so.
|
|
|
07/12/2011, 21:14
|
#11
|
elite*gold: 0
Join Date: Mar 2010
Posts: 228
Received Thanks: 20
|
Quote:
Originally Posted by lanara
Kannste mal den Entry Point posten, den du nutzt? Möglich, dass der Fehler darin versteckt ist, war zumindest bei meiner Version so.
|
Das ist 1:1 deine Bot version.
PHP Code:
var channelUsers = new Array();
//###################################################################
//###########################Einstellungen###########################
//###################################################################
// Wenn ihr nur einen Key benutzt, dann diesen Wert mindestens auf 180000 setzen, damit ihr keine realmdowns bekommt
var gameMinLength = 180000;
var joinChatAfterLogin = false; // true = Bot geht in den Chat, um .login/Announces zu machen
var joinChannelInChat = "xxxx"; // Wenn der Bot in keinen bestimmten Channel soll, dann nichts eintragen
var channelLogin = false; // true = Bot schreibt .login nachdem er eingeloggt ist
channelUsers.push("Account Name"); // Hier deinen Account Name eintragen
channelUsers.push("Char Name"); // Hier deinen Char Name eintragen
// %game --> "gamename-"
// %counter --> number of the next game
// %time --> time in seconds till game creation
// %password --> game password
var gameAnnouncement = "Next Game: %game%counter in %time seconds."; // Wenn keine NG message im Chat geposted werden soll, dann nichts eintragen
//----------------------------------------------------------------------------------------------------------------------------------------------------------
//###################################################################
//##############################Delays###############################
//###################################################################
// realm delays (minutes)
var unableToConnectRetry = 2;
var realmDownRetry = 60;
var disconnectedRetry = 2;
var cdkeyInUseRetry = 2;
// interface delays (milliseconds)
var connectingToBnetTimeout = 20000;
var characterScreenTimeout = 10000;
var pleaseWaitTimeout = 10000;
var createGameThreshold = 15000;
var createGameThresholdRandom = 2500;
var createGameTimeout = 15000;
var waitInLineTimeout = 60000;
var characterSelectDelay = 1000;
var loginDelay = 1000;
var clickDelay = 1000;
var textDelay = 1000;
var clickDelayRandom = 500;
var textDelayRandom = 500;
var gameDoesNotExistDelayMin = 600000;
var gameDoesNotExistDelayMax = 900000;
var gameDoesNotExistTimeout = 30000;
var gameAnnouncementDelay = 5000;
var gameAnnouncementDelayRandom = 500;
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 joinedChannel = false;
var justJoined = true;
var joinRandomChannel = 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 [IP:" + me.gameserverip.split(".")[3] + "]", 0);
else
sendEventToOOG(D2NT_MGR_INGAME, "In Game", 0);
lastGameStatus = 2; // in game successful
}
}
Delay(1000);
}
else
{
if(_ingame)
{
_ingame = false;
sendEventToOOG(D2NT_MGR_READY, "", 0);
}
locationAction(controlData.getLocation());
Delay(500);
}
}
}
function locationAction(location)
{
switch(location.id)
{
case 3: // Lobby Chat
if(justJoined)
{
justJoined = false;
if(isChannelUser(me.account, me.charname))
{
for(var i = 0; i < 3; i++)
{
SetStatusText("˙c2Chat actions enabled!");
Delay(150);
SetStatusText("");
Delay(150);
}
}
else
{
for(var i = 0; i < 3; i++)
{
SetStatusText("˙c1Chat actions disabled!");
Delay(150);
SetStatusText("");
Delay(150);
}
}
}
if(!chatActionsDone && isChannelUser(me.account, me.charname))
{
chatActionsDone = true;
Delay(Random(waitInChatBeforeActionsMin, waitInChatBeforeActionsMax));
if(!joinedChannel && (joinRandomChannel || joinChannelInChat != ""))
{
var rndChannel = getRandomString(Random(3,10));
SetStatusText("˙c8Joining Channel " + (joinRandomChannel ? rndChannel : joinChannelInChat) );
Delay(1000);
Say("/join " + (joinRandomChannel ? rndChannel : joinChannelInChat));
joinedChannel = true;
Delay(1000);
if(channelLogin)
{
SetStatusText("˙c8Channel Login...");
Say(".login");
Delay(1000);
}
}
}
case 1: // Lobby
if(location.id == 1 && joinChatAfterLogin)
{
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();
lastGameFailed = true;
Delay(5000);
case 2:
outputGameLength();
lastGameStatus = 0;
setNextGameMake();
if(lastGameFailed)
{
SetStatusText("˙c1Failed to join!");
sendEventToOOG(D2NT_MGR_PRINT_LOG, "˙E00000Game " + ((getGameCounter(me.gamename, true)) ? ("(" + getGameCounter(me.gamename, true) + ")") : "") + " creation failed!", 0)
Delay(2500);
}
sendEventToOOG(D2NT_MGR_PRINT_STATUS, location.name, 0);
break;
}
}
else
{
if(joinChannelInChat && gameAnnouncement && me.gamename && isChannelUser(me.account, me.charname))
{
var tempDelay = (gameAnnouncementDelay > 5000) ? gameAnnouncementDelay : 5000 +
(gameAnnouncementDelayRandom > 500) ? Random(0, gameAnnouncementDelayRandom) : 500;
var gameText = gameAnnouncement;
gameText = gameText.replace("%password", me.gamepassword);
gameText = gameText.replace("%game", getGameName(me.gamename));
gameText = gameText.replace("%counter", getGameCounter(me.gamename, false));
gameText = gameText.replace("%time", parseInt((nextGameMake - GetTickCount() - tempDelay)/1000+3.0));
if(parseInt((nextGameMake - GetTickCount() - tempDelay)/1000+3.0) > 5)
{
Delay(tempDelay);
Say(gameText);
}
}
timeoutDelay(nextGameMake-GetTickCount(), location, true);
}
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);
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
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);
SetStatusText("˙c1Game akready exists!");
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, showNextGameStatus)
{
if(arguments.length < 3)
showNextGameStatus = false;
endtime = GetTickCount() + time;
while(endtime > GetTickCount())
{
sendEventToOOG(D2NT_MGR_PRINT_STATUS, location.name + " (" + parseInt((endtime-GetTickCount())/1000) + "s)", 0);
if(showNextGameStatus)
{
if(lastGameFailed && parseInt((endtime-GetTickCount())/1000) > 30)
{
if(parseInt((endtime-GetTickCount())/1000) % 30 == 0)
{
SetStatusText("˙c1Last game failed!");
Delay(5000);
}
if(me.gamename && getGameCounter(me.gamename, false))
SetStatusText("˙c8Next game: " + getGameName(me.gamename) + getGameCounter(me.gamename, false) + " (" + parseInt((endtime-GetTickCount())/1000) + "s)");
else
SetStatusText("˙c8Game creation pending... (" + parseInt((endtime-GetTickCount())/1000) + "s)");
}
else if(parseInt((endtime-GetTickCount())/1000) >= 0)
{
if(me.gamename && getGameCounter(me.gamename, false))
SetStatusText("˙c8Next game: " + getGameName(me.gamename) + getGameCounter(me.gamename, false) + " (" + parseInt((endtime-GetTickCount())/1000) + "s)");
else
SetStatusText("˙c8Game creation pending... (" + parseInt((endtime-GetTickCount())/1000) + "s)");
}
if(me.ingame)
endtime = GetTickCount();
}
Delay(1000);
}
if(showNextGameStatus)
SetStatusText("˙c8Creating game...");
}
function getRandomString(_length)
{
_retString = "";
_charSet = "0123456789abcdefghijklmnopqrstuvwxyz";
while(_length--)
{
_retString += _charSet.charAt(Random(0, _charSet.length-1));
Delay(1);
}
return _retString;
}
function getGameName(lastGameString)
{
if(!lastGameString)
return "";
else
return (lastGameString.substr(0, lastGameString.lastIndexOf('-')+1));
}
function getGameCounter(lastGameString, simple)
{
var myCount, countString;
if(!lastGameString)
return "-1";
else
{
countString = lastGameString.slice(lastGameString.lastIndexOf('-')+1);
switch(countString)
{
case "08":
myCount = 9;
break;
case "09":
myCount = 10;
break;
default:
myCount = parseInt(countString) + 1;
break;
}
if(!simple)
{
if(myCount <= 9)
return ('0' + myCount);
}
return myCount;
}
}
function isChannelUser(accountname, charname)
{
for(var i = 0; i < channelUsers.length; i++)
{
if(accountname.toLowerCase() == channelUsers[i].toLowerCase() || charname.toLowerCase() == channelUsers[i].toLowerCase())
return true;
}
return false;
}
|
|
|
07/12/2011, 21:35
|
#12
|
elite*gold: 0
Join Date: Jul 2009
Posts: 2,147
Received Thanks: 306
|
ich habe den Fehler auch bei dem Etalbot, wobei er schon ein paar Tage nicht mehr kam...
|
|
|
07/12/2011, 21:37
|
#13
|
elite*gold: 139
Join Date: Oct 2006
Posts: 12,058
Received Thanks: 24,256
|
Quote:
Originally Posted by Devil122
Das ist 1:1 deine Bot version.
|
Dachte ich mir schon, versuchs mal hiermit:
Code:
var channelUsers = new Array();
//###################################################################
//###########################Einstellungen###########################
//###################################################################
// Wenn ihr nur einen Key benutzt, dann diesen Wert mindestens auf 180000 setzen, damit ihr keine realmdowns bekommt
var gameMinLength = 190000;
var joinChatAfterLogin = false; // true = Bot geht in den Chat, um .login/Announces zu machen
var joinChannelInChat = "OP MyBaal"; // Wenn der Bot in keinen bestimmten Channel soll, dann nichts eintragen
var channelLogin = true; // true = Bot schreibt .login nachdem er eingeloggt ist
channelUsers.push("Account Name"); // Hier deinen Account Name eintragen
channelUsers.push("Char Name"); // Hier deinen Char Name eintragen
// %game --> "gamename-"
// %counter --> number of the next game
// %time --> time in seconds till game creation
// %password --> game password
var gameAnnouncement = "Next Game: %game%counter in %time seconds."; // Wenn keine NG message im Chat geposted werden soll, dann nichts eintragen
//----------------------------------------------------------------------------------------------------------------------------------------------------------
//###################################################################
//##############################Delays###############################
//###################################################################
// realm delays (minutes)
var unableToConnectRetry = 2;
var realmDownRetry = 60;
var disconnectedRetry = 2;
var cdkeyInUseRetry = 2;
// interface delays (milliseconds)
var connectingToBnetTimeout = 20000;
var characterScreenTimeout = 10000;
var pleaseWaitTimeout = 10000;
var createGameThreshold = 15000;
var createGameThresholdRandom = 1000;
var createGameTimeout = 15000;
var waitInLineTimeout = 60000;
var characterSelectDelay = 1000;
var loginDelay = 1000;
var clickDelay = 1000;
var textDelay = 1000;
var clickDelayRandom = 500;
var textDelayRandom = 500;
var gameDoesNotExistDelayMin = 600000;
var gameDoesNotExistDelayMax = 900000;
var gameDoesNotExistTimeout = 30000;
var gameAnnouncementDelay = 5000;
var gameAnnouncementDelayRandom = 500;
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 joinedChannel = false;
var justJoined = true;
var joinRandomChannel = 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 [IP:" + me.gameserverip.split(".")[3] + "]", 0);
else
sendEventToOOG(D2NT_MGR_INGAME, "In Game", 0);
lastGameStatus = 2; // in game successful
}
}
Delay(1000);
}
else
{
if(_ingame)
{
_ingame = false;
sendEventToOOG(D2NT_MGR_READY, "", 0);
}
locationAction(controlData.getLocation());
Delay(500);
}
}
}
function locationAction(location)
{
switch(location.id)
{
case 3: // Lobby Chat
if(justJoined)
{
justJoined = false;
if(isChannelUser(me.account, me.charname))
{
for(var i = 0; i < 3; i++)
{
SetStatusText("˙c2Chat actions enabled!");
Delay(150);
SetStatusText("");
Delay(150);
}
}
else
{
for(var i = 0; i < 3; i++)
{
SetStatusText("˙c1Chat actions disabled!");
Delay(150);
SetStatusText("");
Delay(150);
}
}
}
if(!chatActionsDone && isChannelUser(me.account, me.charname))
{
chatActionsDone = true;
Delay(Random(waitInChatBeforeActionsMin, waitInChatBeforeActionsMax));
if(!joinedChannel && (joinRandomChannel || joinChannelInChat != ""))
{
var rndChannel = getRandomString(Random(3,10));
SetStatusText("˙c8Joining Channel " + (joinRandomChannel ? rndChannel : joinChannelInChat) );
Delay(1000);
Say("/join " + (joinRandomChannel ? rndChannel : joinChannelInChat));
joinedChannel = true;
Delay(1000);
if(channelLogin)
{
SetStatusText("˙c8Channel Login...");
Say(".login");
Delay(1000);
}
}
}
case 1: // Lobby
if(location.id == 1 && joinChatAfterLogin)
{
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();
lastGameFailed = true;
Delay(5000);
case 2:
outputGameLength();
lastGameStatus = 0;
setNextGameMake();
if(lastGameFailed)
{
SetStatusText("˙c1Failed to join!");
sendEventToOOG(D2NT_MGR_PRINT_LOG, "˙E00000Game " + ((getGameCounter(me.gamename, true)) ? ("(" + getGameCounter(me.gamename, true) + ")") : "") + " creation failed!", 0)
Delay(2500);
}
sendEventToOOG(D2NT_MGR_PRINT_STATUS, location.name, 0);
break;
}
}
else
{
if(joinChannelInChat && gameAnnouncement && me.gamename && isChannelUser(me.account, me.charname))
{
var tempDelay = (gameAnnouncementDelay > 5000) ? gameAnnouncementDelay : 5000 +
(gameAnnouncementDelayRandom > 500) ? Random(0, gameAnnouncementDelayRandom) : 500;
var gameText = gameAnnouncement;
gameText = gameText.replace("%password", me.gamepassword);
gameText = gameText.replace("%game", getGameName(me.gamename));
gameText = gameText.replace("%counter", getGameCounter(me.gamename, false));
gameText = gameText.replace("%time", parseInt((nextGameMake - GetTickCount() - tempDelay)/1000+3.0));
if(parseInt((nextGameMake - GetTickCount() - tempDelay)/1000+3.0) > 5)
{
Delay(tempDelay);
Say(gameText);
}
}
timeoutDelay(nextGameMake-GetTickCount(), location, true);
}
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);
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
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);
if(!locationTimeout(pleaseWaitTimeout, location))
sendEventToOOG(D2NT_MGR_RESTART, location.name, 60);
break;
case 26: // Lobby - Game Name Exists
sendEventToOOG(D2NT_MGR_PRINT_LOG, "˙E00000Game already exists", 0);
SetStatusText("˙c1Game akready exists!");
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, showNextGameStatus)
{
if(arguments.length < 3)
showNextGameStatus = false;
endtime = GetTickCount() + time;
while(endtime > GetTickCount())
{
sendEventToOOG(D2NT_MGR_PRINT_STATUS, location.name + " (" + parseInt((endtime-GetTickCount())/1000) + "s)", 0);
if(showNextGameStatus)
{
if(lastGameFailed && parseInt((endtime-GetTickCount())/1000) > 30)
{
if(parseInt((endtime-GetTickCount())/1000) % 30 == 0)
{
SetStatusText("˙c1Last game failed!");
Delay(5000);
}
if(me.gamename && getGameCounter(me.gamename, false))
SetStatusText("˙c8Next game: " + getGameName(me.gamename) + getGameCounter(me.gamename, false) + " (" + parseInt((endtime-GetTickCount())/1000) + "s)");
else
SetStatusText("˙c8Game creation pending... (" + parseInt((endtime-GetTickCount())/1000) + "s)");
}
else if(parseInt((endtime-GetTickCount())/1000) >= 0)
{
if(me.gamename && getGameCounter(me.gamename, false))
SetStatusText("˙c8Next game: " + getGameName(me.gamename) + getGameCounter(me.gamename, false) + " (" + parseInt((endtime-GetTickCount())/1000) + "s)");
else
SetStatusText("˙c8Game creation pending... (" + parseInt((endtime-GetTickCount())/1000) + "s)");
}
if(me.ingame)
endtime = GetTickCount();
}
Delay(1000);
}
if(showNextGameStatus)
SetStatusText("˙c8Creating game...");
}
function getRandomString(_length)
{
_retString = "";
_charSet = "0123456789abcdefghijklmnopqrstuvwxyz";
while(_length--)
{
_retString += _charSet.charAt(Random(0, _charSet.length-1));
Delay(1);
}
return _retString;
}
function getGameName(lastGameString)
{
if(!lastGameString)
return "";
else
return (lastGameString.substr(0, lastGameString.lastIndexOf('-')+1));
}
function getGameCounter(lastGameString, simple)
{
var myCount, countString;
if(!lastGameString)
return "-1";
else
{
countString = lastGameString.slice(lastGameString.lastIndexOf('-')+1);
switch(countString)
{
case "08":
myCount = 9;
break;
case "09":
myCount = 10;
break;
default:
myCount = parseInt(countString) + 1;
break;
}
if(!simple)
{
if(myCount <= 9)
return ('0' + myCount);
}
return myCount;
}
}
function isChannelUser(accountname, charname)
{
for(var i = 0; i < channelUsers.length; i++)
{
if(accountname.toLowerCase() == channelUsers[i].toLowerCase() || charname.toLowerCase() == channelUsers[i].toLowerCase())
return true;
}
return false;
}
|
|
|
07/13/2011, 12:01
|
#14
|
elite*gold: 0
Join Date: Mar 2010
Posts: 228
Received Thanks: 20
|
Quote:
Originally Posted by lanara
Dachte ich mir schon, versuchs mal hiermit:
Code:
var channelUsers = new Array();
//###################################################################
//###########################Einstellungen###########################
//###################################################################
// Wenn ihr nur einen Key benutzt, dann diesen Wert mindestens auf 180000 setzen, damit ihr keine realmdowns bekommt
var gameMinLength = 190000;
var joinChatAfterLogin = false; // true = Bot geht in den Chat, um .login/Announces zu machen
var joinChannelInChat = "OP MyBaal"; // Wenn der Bot in keinen bestimmten Channel soll, dann nichts eintragen
var channelLogin = true; // true = Bot schreibt .login nachdem er eingeloggt ist
channelUsers.push("Account Name"); // Hier deinen Account Name eintragen
channelUsers.push("Char Name"); // Hier deinen Char Name eintragen
// %game --> "gamename-"
// %counter --> number of the next game
// %time --> time in seconds till game creation
// %password --> game password
var gameAnnouncement = "Next Game: %game%counter in %time seconds."; // Wenn keine NG message im Chat geposted werden soll, dann nichts eintragen
//----------------------------------------------------------------------------------------------------------------------------------------------------------
//###################################################################
//##############################Delays###############################
//###################################################################
// realm delays (minutes)
var unableToConnectRetry = 2;
var realmDownRetry = 60;
var disconnectedRetry = 2;
var cdkeyInUseRetry = 2;
// interface delays (milliseconds)
var connectingToBnetTimeout = 20000;
var characterScreenTimeout = 10000;
var pleaseWaitTimeout = 10000;
var createGameThreshold = 15000;
var createGameThresholdRandom = 1000;
var createGameTimeout = 15000;
var waitInLineTimeout = 60000;
var characterSelectDelay = 1000;
var loginDelay = 1000;
var clickDelay = 1000;
var textDelay = 1000;
var clickDelayRandom = 500;
var textDelayRandom = 500;
var gameDoesNotExistDelayMin = 600000;
var gameDoesNotExistDelayMax = 900000;
var gameDoesNotExistTimeout = 30000;
var gameAnnouncementDelay = 5000;
var gameAnnouncementDelayRandom = 500;
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 joinedChannel = false;
var justJoined = true;
var joinRandomChannel = 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 [IP:" + me.gameserverip.split(".")[3] + "]", 0);
else
sendEventToOOG(D2NT_MGR_INGAME, "In Game", 0);
lastGameStatus = 2; // in game successful
}
}
Delay(1000);
}
else
{
if(_ingame)
{
_ingame = false;
sendEventToOOG(D2NT_MGR_READY, "", 0);
}
locationAction(controlData.getLocation());
Delay(500);
}
}
}
function locationAction(location)
{
switch(location.id)
{
case 3: // Lobby Chat
if(justJoined)
{
justJoined = false;
if(isChannelUser(me.account, me.charname))
{
for(var i = 0; i < 3; i++)
{
SetStatusText("˙c2Chat actions enabled!");
Delay(150);
SetStatusText("");
Delay(150);
}
}
else
{
for(var i = 0; i < 3; i++)
{
SetStatusText("˙c1Chat actions disabled!");
Delay(150);
SetStatusText("");
Delay(150);
}
}
}
if(!chatActionsDone && isChannelUser(me.account, me.charname))
{
chatActionsDone = true;
Delay(Random(waitInChatBeforeActionsMin, waitInChatBeforeActionsMax));
if(!joinedChannel && (joinRandomChannel || joinChannelInChat != ""))
{
var rndChannel = getRandomString(Random(3,10));
SetStatusText("˙c8Joining Channel " + (joinRandomChannel ? rndChannel : joinChannelInChat) );
Delay(1000);
Say("/join " + (joinRandomChannel ? rndChannel : joinChannelInChat));
joinedChannel = true;
Delay(1000);
if(channelLogin)
{
SetStatusText("˙c8Channel Login...");
Say(".login");
Delay(1000);
}
}
}
case 1: // Lobby
if(location.id == 1 && joinChatAfterLogin)
{
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();
lastGameFailed = true;
Delay(5000);
case 2:
outputGameLength();
lastGameStatus = 0;
setNextGameMake();
if(lastGameFailed)
{
SetStatusText("˙c1Failed to join!");
sendEventToOOG(D2NT_MGR_PRINT_LOG, "˙E00000Game " + ((getGameCounter(me.gamename, true)) ? ("(" + getGameCounter(me.gamename, true) + ")") : "") + " creation failed!", 0)
Delay(2500);
}
sendEventToOOG(D2NT_MGR_PRINT_STATUS, location.name, 0);
break;
}
}
else
{
if(joinChannelInChat && gameAnnouncement && me.gamename && isChannelUser(me.account, me.charname))
{
var tempDelay = (gameAnnouncementDelay > 5000) ? gameAnnouncementDelay : 5000 +
(gameAnnouncementDelayRandom > 500) ? Random(0, gameAnnouncementDelayRandom) : 500;
var gameText = gameAnnouncement;
gameText = gameText.replace("%password", me.gamepassword);
gameText = gameText.replace("%game", getGameName(me.gamename));
gameText = gameText.replace("%counter", getGameCounter(me.gamename, false));
gameText = gameText.replace("%time", parseInt((nextGameMake - GetTickCount() - tempDelay)/1000+3.0));
if(parseInt((nextGameMake - GetTickCount() - tempDelay)/1000+3.0) > 5)
{
Delay(tempDelay);
Say(gameText);
}
}
timeoutDelay(nextGameMake-GetTickCount(), location, true);
}
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);
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
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);
if(!locationTimeout(pleaseWaitTimeout, location))
sendEventToOOG(D2NT_MGR_RESTART, location.name, 60);
break;
case 26: // Lobby - Game Name Exists
sendEventToOOG(D2NT_MGR_PRINT_LOG, "˙E00000Game already exists", 0);
SetStatusText("˙c1Game akready exists!");
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, showNextGameStatus)
{
if(arguments.length < 3)
showNextGameStatus = false;
endtime = GetTickCount() + time;
while(endtime > GetTickCount())
{
sendEventToOOG(D2NT_MGR_PRINT_STATUS, location.name + " (" + parseInt((endtime-GetTickCount())/1000) + "s)", 0);
if(showNextGameStatus)
{
if(lastGameFailed && parseInt((endtime-GetTickCount())/1000) > 30)
{
if(parseInt((endtime-GetTickCount())/1000) % 30 == 0)
{
SetStatusText("˙c1Last game failed!");
Delay(5000);
}
if(me.gamename && getGameCounter(me.gamename, false))
SetStatusText("˙c8Next game: " + getGameName(me.gamename) + getGameCounter(me.gamename, false) + " (" + parseInt((endtime-GetTickCount())/1000) + "s)");
else
SetStatusText("˙c8Game creation pending... (" + parseInt((endtime-GetTickCount())/1000) + "s)");
}
else if(parseInt((endtime-GetTickCount())/1000) >= 0)
{
if(me.gamename && getGameCounter(me.gamename, false))
SetStatusText("˙c8Next game: " + getGameName(me.gamename) + getGameCounter(me.gamename, false) + " (" + parseInt((endtime-GetTickCount())/1000) + "s)");
else
SetStatusText("˙c8Game creation pending... (" + parseInt((endtime-GetTickCount())/1000) + "s)");
}
if(me.ingame)
endtime = GetTickCount();
}
Delay(1000);
}
if(showNextGameStatus)
SetStatusText("˙c8Creating game...");
}
function getRandomString(_length)
{
_retString = "";
_charSet = "0123456789abcdefghijklmnopqrstuvwxyz";
while(_length--)
{
_retString += _charSet.charAt(Random(0, _charSet.length-1));
Delay(1);
}
return _retString;
}
function getGameName(lastGameString)
{
if(!lastGameString)
return "";
else
return (lastGameString.substr(0, lastGameString.lastIndexOf('-')+1));
}
function getGameCounter(lastGameString, simple)
{
var myCount, countString;
if(!lastGameString)
return "-1";
else
{
countString = lastGameString.slice(lastGameString.lastIndexOf('-')+1);
switch(countString)
{
case "08":
myCount = 9;
break;
case "09":
myCount = 10;
break;
default:
myCount = parseInt(countString) + 1;
break;
}
if(!simple)
{
if(myCount <= 9)
return ('0' + myCount);
}
return myCount;
}
}
function isChannelUser(accountname, charname)
{
for(var i = 0; i < channelUsers.length; i++)
{
if(accountname.toLowerCase() == channelUsers[i].toLowerCase() || charname.toLowerCase() == channelUsers[i].toLowerCase())
return true;
}
return false;
}
|
Ich werde das mal zwei tage beobachten, ob das problem weiterhin besteht.
Danke für eure hilfe
|
|
|
07/13/2011, 18:24
|
#15
|
elite*gold: 0
Join Date: Jan 2009
Posts: 3,170
Received Thanks: 1,191
|
Bei mir tritt das Gleiche Phänomen beim Muddy Bot auf
Code:
/**
* This file was modified by [email] [/email]
* Check the programming section for updates and further scripts
* Last Update: 02/28/2011
*/
var GameMinLength = 120000; // 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 = 15; // 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 = 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 = 20000; // time in milliseconds to wait between making games
var CreateGameThresholdRandom = 5000; // 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 = 1000; // wait X milliseconds before next action after a click event
var TextDelay = 2500; // 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 = 600000; // how long to wait when a Game Does Not Exist occurs - minimum - default 10 minutes
var GameDoesNotExistDelayMax = 900000; // 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 JoinChatAfterLogin = true; // join chat after login
var JoinRandomChannel = false; // if this is true, will join a random channel, otherwise it will use the channel below..
var JoinChannelInChat = "op uBs-Clan";// leave blank not to join a private channel
var PerformChannelLogin = true; // type ".login" once after joining the channel
var ChannelUsers = new Array(); // dynamic array that holds channel users
var MaximumLocationLoops = 5; // The maximum number of loops for a single location; if the window is does not respond and is caught in an infinite loop it will be restarted when the number of loops exceeds the one you specify here
var JoinGameKeywords = new Array("dia", "baal");
var JoinRandomGamesChars = new Array("");
//---------------------------------------------------------------------------------------------------------------------------------------------------------
// Add any char/account here that is supposed to perform chat actions/game announcements or join a private channel
ChannelUsers.push("Default");
// Or
ChannelUsers.push("DdefaultAccount");
// The following key expressions will be replaced by their actual values: %game --> "gamename-" <> %counter --> number of the next game <> %time --> time in seconds till game creation <> %password --> game password
// Note that the announcement will start after the first run, so there usually won't be any anncouncement right after login - If the gamename is undefined, the bot will try to load the backup file to announce the upcoming game properly
var GameAnnouncement = "Creating %game%counter//%password in about %time seconds"; // Leave blank not to post a channel announcement
var GameAnnouncementDelay = 5000; // Wait X milliseconds before posting the announcement message (don't set this too low!)
var GameAnnouncementDelayRandom = 500; // Random amount of time to add to a to the announcement delay
var UseFileBackupTimeMax = 30; // Time in minutes that may pass since last file update - The backup File is updated at the beginning of every single game and is read everytime the name of your previous game is undefined (e.g. at restarts); Set to 0 to deactivate file backup
//----------------------------------------------------------------------------------------------------------------------------------------------------------
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 LocationLoops = new Array(2);
var ChatActionsDone = false;
var LastGameFailed = false;
var JoinedChannel = false;
var JustJoined = true;
var MadeAnnouncement = false;
Include("libs/controlInfo.ntl");
Include("libs/common/NTCommon.ntl");
var ControlData = new controlInfo();
function NTMain()
{
var _ingame;
Delay(1000);
_ingame = false;
ControlData.ClickDelay = ClickDelay;
ControlData.TextDelay = TextDelay;
ControlData.ClickDelayRandom = ClickDelayRandom;
ControlData.TextDelayRandom = TextDelayRandom;
while(true)
{
if(me.ingame)
{
if(!InGameAt)
InGameAt = GetTickCount();
if(!_ingame)
{
RunGC(); // run garbage collector between each game
if(Load("NTBot/MWBotGame.ntj"))
{
_ingame = true;
MadeAnnouncement = false;
LocationLoops[1] = 0;
MW_WriteBackupFile();
if(me.playtype > 0)
NT_SendEventToOOG(D2NT_MGR_INGAME, "In Game [IP:" + me.gameserverip.split(".")[3] + "]", 0);
else
NT_SendEventToOOG(D2NT_MGR_INGAME, "In Game", 0);
LastGameStatus = 2; // in game successful
}
}
Delay(1000);
}
else
{
if(_ingame)
{
_ingame = false;
NT_SendEventToOOG(D2NT_MGR_READY, "", 0);
}
NT_LocationAction(ControlData.getLocation());
Delay(500);
}
}
}
function NT_LocationAction(location)
{
var _randomChannel, _output, _control;
MW_CheckLocationLoops(location);
switch(location.id)
{
case 3: // Lobby Chat
if(JustJoined)
{
JustJoined = false;
if(MW_IsChannelUser())
_output = "˙c2Chat actions enabled!";
else
_output = "˙c1Chat actions disabled!";
for(var i = 0; i < 3; i++)
{
SetStatusText(_output);
Delay(500);
SetStatusText("");
Delay(500);
}
}
if(!ChatActionsDone && MW_IsChannelUser())
{
ChatActionsDone = true;
Delay(Random(WaitInChatBeforeActionsMin, WaitInChatBeforeActionsMax));
if(!JoinedChannel && (JoinRandomChannel || JoinChannelInChat != ""))
{
_randomChannel = NT_GetRandomString(Random(3,10));
SetStatusText("˙c8Joining Channel ˙c;" + (JoinRandomChannel ? _randomChannel : JoinChannelInChat));
Delay(500);
Say("/join " + (JoinRandomChannel ? _randomChannel : JoinChannelInChat));
JoinedChannel = true;
if(PerformChannelLogin)
{
SetStatusText("˙c8Channel Login...");
Say(".login");
Delay(1000);
}
}
}
case 1: // Lobby
if(location.id == 1 && JoinChatAfterLogin)
{
Delay(Random(WaitBeforeEnterChatMin, WaitBeforeEnterChatMax));
ControlData.click(ControlData.controls.lobby.button.enterChat);
break;
}
if(GetTickCount() > NextGameMake)
{
LastGameFailed = false;
switch(LastGameStatus)
{
case 0:
if(JoinRandomGamesChars.indexOf(me.charname) > -1)
{
_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);
}
else
{
_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
NT_SendEventToOOG(D2NT_MGR_PRINT_STATUS, location.name, 0);
break;
case 1: // game failed, rollover to reset timer
InGameAt = GetTickCount();
LastGameFailed = true;
Delay(5000);
case 2:
NT_OutputGameLength();
LastGameStatus = 0;
NT_SetNextGameMake();
if(LastGameFailed)
{
SetStatusText("˙c1Failed to join!");
NT_SendEventToOOG(D2NT_MGR_PRINT_LOG, "˙BE0000Game creation failed!", 0);
Delay(1000);
}
NT_SendEventToOOG(D2NT_MGR_PRINT_STATUS, location.name, 0);
break;
}
}
else
{
if(JoinChannelInChat && !MadeAnnouncement && MW_IsChannelUser())
{
if(MW_AnnounceGame())
MadeAnnouncement = true;
}
MW_TimeoutDelay(NextGameMake - GetTickCount(), location, JoinRandomGamesChars.indexOf(me.charname) == -1);
}
break;
case 2: // Waiting In Line
if(GetTickCount()-LastGameMade > WaitInLineTimeout)
ControlData.click(ControlData.controls.lobby.inLine.button.cancel);
break;
case 4: // Create Game
if(JoinRandomGamesChars.indexOf(me.charname) == -1)
{
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);
}
NT_SendEventToOOG(D2NT_MGR_CREATE_GAME, location.name, 0);
NT_LocationTimeout(5000, location);
LastGameMade = GetTickCount();
LastGameStatus = 1; // pending creation
}
break;
case 5: // Join Game
if(JoinRandomGamesChars.indexOf(me.charname) > -1)
{
var _games, _game;
_games = ControlData.get(ControlData.controls.lobby.join.textBox.gameList).GetText();
_game = "";
if(_games)
{
for(var i = 0; i < _games.length; i++)
{
for(var j = 0; j < JoinGameKeywords.length; j++)
{
if(_games[i].toLowerCase().indexOf(JoinGameKeywords[j].toLowerCase()) > -1)
{
_game = _games[i];
i = _games.length;
break;
}
}
}
}
if(_game != "")
{
SetStatusText("˙c8Joining Game: " + _game);
Delay(250);
ControlData.setText(ControlData.controls.lobby.join.editBox.gameName, _game);
Delay(1000);
ControlData.click(ControlData.controls.lobby.join.button.joinGame);
NT_LocationTimeout(5000, location);
LastGameMade = GetTickCount();
LastGameStatus = 1; // pending creation
}
else
Delay(2500);
ControlData.click(ControlData.controls.lobby.button.create);
Delay(500);
ControlData.click(ControlData.controls.lobby.button.join);
Delay(500);
}
break;
case 6: // Ladder
break;
case 7: // Channel List
break;
case 8: // Main Menu
if(ControlData.getCurrentRealmIndex() == me.gatewayid)
{
NT_OutputGameLength();
ControlData.click(ControlData.gameTypes[me.playtype]);
}
else
ControlData.click(ControlData.controls.mainMenu.button.gateway);
break;
case 9: // Login
NT_SendEventToOOG(D2NT_MGR_PRINT_STATUS, location.name, 0);
Delay(LoginDelay);
ControlData.setText(ControlData.controls.login.editBox.accountName, me.account);
NT_SendEventToOOG(D2NT_MGR_LOGIN, location.name, 0);
NT_LocationTimeout(5000, location);
break;
case 10: // Login Error (this is a fatal error, so stop)
NT_SendEventToOOG(D2NT_MGR_RESTART, location.name, 10);
Delay(3500);
break;
case 11: // Unable To Connect
MW_TimeoutDelay(UnableToConnectRetry*60*1000, location);
ControlData.click(ControlData.controls.login.unableToConnect.button.ok);
break;
case 12: // Character Select
var _time, _control;
NT_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;
NT_SetNextGameMake();
}
else
{
ControlData.click(ControlData.controls.characterSelect.button.exit);
MW_TimeoutDelay(RealmDownRetry*60*1000, location);
}
break;
case 13: // Realm Down - Character Select screen
ControlData.click(ControlData.controls.characterSelect.button.exit);
MW_TimeoutDelay(RealmDownRetry*60*1000, location);
break;
case 14: // Character Select - Disconnected
MW_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(!NT_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
MW_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(!NT_LocationTimeout(ConnectingToBnetTimeout, location))
ControlData.click(ControlData.controls.mainMenu.connecting.button.cancel);
break;
case 22: // Login - Invalid Cdkey (classic or xpac)
NT_SendEventToOOG(D2NT_MGR_RESTART, location.name, 3600);
Delay(3500);
break;
case 23: // Character Select - Connecting
if(!NT_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(!NT_LocationTimeout(PleaseWaitTimeout, location))
ControlData.click(ControlData.controls.lobby.pleaseWait.button.cancel);
break;
case 26: // Lobby - Game Name Exists
NT_SendEventToOOG(D2NT_MGR_PRINT_LOG, "˙BE0000Game already exists", 0);
SetStatusText("˙c1Game already exists!");
InGameAt = 0;
LastGameStatus = 0;
NT_SetNextGameMake();
NT_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;
NT_SetNextGameMake();
NT_LocationTimeout(GameDoesNotExistTimeout, location);
break;
}
}
function NT_SendEventToOOG(locationId, statusString, pendingTime)
{
return SendCopyData("D2NT Manager", null, (locationId<<16)|pendingTime, statusString);
}
function NT_SetNextGameMake()
{
LastGameMade = GetTickCount();
NextGameMake = LastGameMade + CreateGameThreshold + Random(0 - CreateGameThresholdRandom, CreateGameThresholdRandom) + InGameAt;
InGameAt = 0;
ChatActionsDone = false;
}
function NT_OutputGameLength()
{
var _duration;
if(InGameAt)
{
_duration = GetTickCount() - InGameAt;
if(_duration < GameMinLength)
InGameAt = GameMinLength - _duration;
else
InGameAt = 0;
}
}
function NT_LocationTimeout(time, location)
{
var _endtime = GetTickCount() + time;
while(ControlData.getLocation().id == location.id && _endtime > GetTickCount())
{
if(LocationLoops[1] > 1)
NT_SendEventToOOG(D2NT_MGR_PRINT_STATUS, location.name + " [" + MWC_ConvertTicksToTimeString(_endtime - GetTickCount()) + "] [" + LocationLoops[1] + "]", 0);
else
NT_SendEventToOOG(D2NT_MGR_PRINT_STATUS, location.name + " [" + MWC_ConvertTicksToTimeString(_endtime - GetTickCount()) + "]", 0);
Delay(1000);
}
return (ControlData.getLocation().id != location.id);
}
function MW_TimeoutDelay(time, location, showNextGameStatus)
{
var _gamename, _outputString, _timeString;
if(arguments.length < 3)
showNextGameStatus = false;
_endtime = GetTickCount() + time;
_gamename = me.gamename;
_timeString = "";
if(!_gamename)
{
_gamename = MW_ReadBackupFile(0);
if(_gamename)
SetStatusText("˙c8Using File Backup...");
}
while(_endtime > GetTickCount())
{
_timeString = " [" + MWC_ConvertTicksToTimeString(_endtime - GetTickCount()) + "]";
NT_SendEventToOOG(D2NT_MGR_PRINT_STATUS, location.name + _timeString , 0);
if(showNextGameStatus)
{
if(LastGameFailed && parseInt(_endtime-GetTickCount()) > CreateGameThreshold && parseInt((_endtime-GetTickCount())/1000) % 30 >= 0 && parseInt((_endtime-GetTickCount())/1000) % 30 <= 5)
{
_outputString = "˙c1Last game failed!";
_timeString = "";
}
else if(parseInt((_endtime-GetTickCount())/1000) >= 0)
{
if(_gamename && MW_GetGameCounter(_gamename, false))
_outputString = "˙c8Next game: " + MW_GetGameName(_gamename) + MW_GetGameCounter(_gamename, false);
else
_outputString = "˙c8Game creation pending... ";
}
MWC_SetStatusText(_outputString, _timeString);
if(me.ingame)
_endtime = GetTickCount();
}
Delay(1000);
}
if(showNextGameStatus)
SetStatusText("˙c8Creating game...");
return;
}
function NT_GetRandomString(length)
{
_retString = "";
_charSet = "0123456789abcdefghijklmnopqrstuvwxyz";
while(length--)
{
_retString += _charSet.charAt(Random(0, _charSet.length - 1));
Delay(1);
}
return _retString;
}
function MW_GetGameName(lastGameString)
{
if(!lastGameString)
return "";
else
return lastGameString.substr(0, lastGameString.lastIndexOf('-') + 1);
}
function MW_GetGameCounter(lastGameString, simple)
{
var _count, _countString;
if(!lastGameString)
return "-1";
else
{
_countString = lastGameString.slice(lastGameString.lastIndexOf('-') + 1);
if(_countString[0] == '0')
_countString = _countString.substr(1);
_count = parseInt(_countString) + 1;
if(_count == 100)
_count = 0;
if(!simple)
{
if(_count <= 9)
return '0' + _count;
}
return _count;
}
}
function MW_IsChannelUser()
{
for(var i = 0; i < ChannelUsers.length; i++)
{
if(me.account.toLowerCase() == ChannelUsers[i].toLowerCase() || me.charname.toLowerCase() == ChannelUsers[i].toLowerCase())
return true;
}
return false;
}
function MW_ReadBackupFile(type)
{
var _fhandle, _buffer, _time, _now, _retValue;
_fhandle = FileOpen("/Logs/Temporary Data/" + me.charname + ".channel", 2);
_retValue = "";
_now = new Date();
if(_fhandle && _now)
{
_buffer = _fhandle.ReadLine();
if(_buffer)
{
_time = parseInt(_buffer);
if(_now.getTime() - _time < UseFileBackupTimeMax*6E4)
{
_retValue = _fhandle.ReadLine();
if(type > 0)
_retValue = _fhandle.ReadLine();
}
}
_fhandle.Close();
}
else if(_fhandle)
_fhandle.Close();
return _retValue;
}
function MW_WriteBackupFile()
{
var _fhandle, _now;
if(UseFileBackupTimeMax == 0)
return false;
_fhandle = FileOpen("/Logs/Temporary Data/" + me.charname + ".channel", 1);
_now = new Date();
if(_fhandle && _now)
{
_fhandle.WriteLine(_now.getTime());
_fhandle.WriteLine(me.gamename);
_fhandle.WriteLine(me.gamepassword);
_fhandle.Close();
return true;
}
else if(_fhandle)
_fhandle.Close();
return false;
}
function MW_CheckLocationLoops(location)
{
if(!location)
return false;
if(!LocationLoops[0] || location.id != LocationLoops[0].id)
{
LocationLoops[0] = location;
LocationLoops[1] = 0;
}
else if(LocationLoops[0].id != 5)
{
LocationLoops[1]++;
if(LocationLoops[1] >= MaximumLocationLoops)
{
if(LocationLoops[1] < 1000)
NT_SendEventToOOG(D2NT_MGR_PRINT_LOG, "˙BE0000Location Loop Restart!;˙c1Location Loops: " + LocationLoops[1] + "\n˙BE0000Location: " + LocationLoops[0].name + "\n˙BE0000Location ID: " + LocationLoops[0].id, 0);
LocationLoops[1] = 1000; // Make sure the location loop notification is only shown once
NT_SendEventToOOG(D2NT_MGR_RESTART, location.name, 0);
}
}
return true;
}
function MW_AnnounceGame()
{
var _gamePass, _gameName, _gameText, _delay;
_gameName = me.gamename;
if(!_gameName)
_gameName = MW_ReadBackupFile(0);
_gamePass = me.gamepassword;
if(!_gamePass)
_gamePass = MW_ReadBackupFile(1);
if(_gameName && !me.ingame)
{
_delay = (GameAnnouncementDelay > 5000) ? GameAnnouncementDelay : 5000;
_delay += (GameAnnouncementDelayRandom > 500) ? Random(0, GameAnnouncementDelayRandom) : 500;
_gameText = GameAnnouncement.replace("%password", ((_gamePass) ? _gamePass : "N/A"));
_gameText = _gameText.replace("%game", MW_GetGameName(_gameName));
_gameText = _gameText.replace("%counter", MW_GetGameCounter(_gameName, false));
_gameText = _gameText.replace("%time", parseInt((NextGameMake - GetTickCount() - _delay + ClickDelay + TextDelay) / 1000 + 5));
if(_gameText.indexOf("NaN") > -1)
return false;
if(parseInt((NextGameMake - GetTickCount() - _delay + ClickDelay + TextDelay) / 1000) > 3)
{
Delay(_delay);
return Say(_gameText);
}
}
return false;
}
Der Fehler tritt immer beim verlasen des Games auf (oben steht Exiting Game..). Gehäuft bei Chicken-Exit.
|
|
|
 |
|
Similar Threads
|
Muddy´s D2nt Bot Fehler.
03/02/2011 - Diablo 2 Programming - 1 Replies
Hallo, ich habe folgendes Problem.
Ich habe mir mal Muddy´s D2nt Bot Ver. runtergeladen.
Nun läuft alles supi, außer das er Kein Diablo + Baal macht.
Wenn er mit den Runnen anfängt macht er alles das was er soll.
Andy, Duriel, Meph, (Dann eiegentlich Diablo aber den lässt er aus).
Dann gehts weiter mit Eldrich + Shenk, danach sollte Baalrun kommen, aber er leavt nach Shenk.
Ich habe keine *//* vor den Baal und Diablo Scrip sind alle genau so eingestellt wie bei den restliche Bossen...
|
D2NT TheBluebird v1.1 Fehler
05/09/2010 - Diablo 2 - 2 Replies
Wenn ich eingestellt habe das er bei über-dia im game warten soll, bekommt er jedoch ein disconnect. Wo kann der fehler liegen ?
|
d2nt pickit fehler?
04/14/2010 - Diablo 2 - 1 Replies
Servus
habe vorhin mein bot laufen lassen und im launcher stand "eth. Harnisch" gepickt.
Als ich aber später manuel auf dem Char war, war nichts vom, eth. duriels zu sehen :(
wie kann sowas passieren? Er hat das Item wohl später wegeworfen/verkauft?!
Mein inv war nicht voll, allerdings waren in der truhe nur 2x2 slots frei. Kann es daran liegen?
|
D2NT 3.0 Fehler
03/28/2010 - Diablo 2 - 13 Replies
moin,
D2NT 3.0 läuft bei mir ohne Probleme.
Aber wenn ein Boss tot ist, krieg ich jedesmal diesen Fehler :
D2NT\scripts\libs\common\NTItemParser.ntl (60) : SyntaxError: missing ; before statement
Line 60 hab ich mal fettgedruckt dargestellt
Hier die Datei:
|
D2NT Bot fehler
05/14/2009 - Diablo 2 - 1 Replies
Hi
Ich nuzr schon eine weile den D2NT Bot und bis jez bin ich ganz zufrieden.
doch vor ein paar tagen habe ich ihn wieder angeschmissen und im Game gibt er mir folgende meldung aus
http://666kb.com/i/b8wm6rjb1i4lw1t40.bmp
Kann mir wer helfen woran das liegen könnte bzw was da nicht richtig ist??
Den er macht nach ausgabe der meldung nichts mehr und alles as ich davor gemacht habe war das ich meiner soso n Phönix Monarch in den Zweiten Waffenslot gelegt habe und meinem Merc eine infy...
|
All times are GMT +1. The time now is 23:59.
|
|