heya :D erstmals danke für das mit den zufällig chars erstellen. hab da ein bisschen herumgetan, weil ich den einbau nicht ganz gecheckt hab, aber funktioniert jetzt wunderbar. (kannst dir ja angucken in der MuleFunctions, lol)
folgendes: bei RealmDowns funktioniert das mit dem sleep delay nicht, wenn man sich grade in der mulephase befindet. (d.h. RD ist während mulen aufgetreten)
im diablo fenster selber sieht man eben die RD message ganz normal, im D2NT manager steht dann immer als message "Character Select (2s)", und alle 2sekunden eben wieder von neuem.
im D2 fenster versucht der bot dann alle paar sekunden auf "create new character" zu gehen, d.h. irgendwie kapiert der das nicht ganz, dass der grad nen RD hat. normalerweise sollte er ja dann raus gehen ins startmenü.
Code:
function NT_ScriptMsgEvents1(msg)
{
if (DGDebug)
NTC_SendLogToOOG(NTC_LOG_COMMON, "[Debug] ScriptMsg: " + msg);
switch(msg)
{
case "MULE":
MuleState = "mule";
isWaiting = true;
WriteMuleStats();
ExitGame();
NTC_SendLogToOOG(NTC_LOG_COMMON, "Log on Mule Account");
StatusDelay(20000, "Log on Mule Account ");
ControlData.click(ControlData.controls.lobby.button.quit);
Delay(2000);
ControlData.click(ControlData.controls.characterSelect.button.exit);
Delay(2000);
if (DGDebug)
NTC_SendLogToOOG(NTC_LOG_COMMON, "Debug: Prepare to log in");
var filehandle = FileOpen("NTBot/mule_configs/" + me.account + "mulenip", 1);
if(filehandle)
{
if (DGDebug)
NTC_SendLogToOOG(NTC_LOG_COMMON, "Debug: Writing Mule Nipfile : " + DGCurrentAcc);
if (DGDebug)
NTC_SendLogToOOG(NTC_LOG_COMMON, "Debug: Content : " + DGNipFiles[DGCurrentAcc]);
filehandle.WriteLine(DGNipFiles[DGCurrentAcc]);
filehandle.Close();
}
isWaiting = false;
WriteMuleStats();
break;
case "MULE_START":
MuleState = "mulefull";
isWaiting = true;
WriteMuleStats();
JoinBug = 0;
isMuling = true;
preventRecover = true;
StatusDelay(TimeBeforeMuleGame * 60 * 1000, "Wait before MuleGame ");
MuleState = "mulestart";
isWaiting = false;
WriteMuleStats();
break;
case "MULE_FULL":
MuleState = "mulefull";
isWaiting = true;
WriteMuleStats();
ExitGame();
NTC_SendLogToOOG(NTC_LOG_COMMON, "Log on next Mule char because current Mulechar is full!");
StatusDelay(10000, "Next Char ");
ControlData.click(ControlData.controls.lobby.button.quit);
isMuling = true;
muleFull = true;
isWaiting = false;
WriteMuleStats();
break;
case "DONE":
MuleState = "done";
isWaiting = true;
WriteMuleStats();
ExitGame();
DGCurrentAcc++;
if (DGCurrentAcc >= DGNipFiles.length)
{
StatusDelay(TimeAfterMule * 60 * 1000, "Finished Muling ");
NTC_SendLogToOOG(NTC_LOG_COMMON, "Finished Muling!");
NTC_Delay(2000);
ControlData.click(ControlData.controls.lobby.button.quit);
NTC_Delay(2000);
ControlData.click(ControlData.controls.characterSelect.button.exit);
StatusDelay(10000, "LogIn ");
JoinBug = 0;
DGCurrentAcc = 0;
MuleState = "notmuling";
WriteMuleStats();
isWaiting = false;
isMuling = false;
}else{
NTC_SendLogToOOG(NTC_LOG_COMMON, "Log on next Mule Account");
StatusDelay(22000, "Next Account ");
ControlData.click(ControlData.controls.lobby.button.quit);
NTC_Delay(2000);
ControlData.click(ControlData.controls.characterSelect.button.exit);
NTC_Delay(2000);
var filehandle = FileOpen("NTBot/mule_configs/" + me.account + "mulenip", 1);
if(filehandle)
{
filehandle.WriteLine(DGNipFiles[DGCurrentAcc]);
filehandle.Close();
}
}
isWaiting = false;
WriteMuleStats();
break;
case "DEBUGPERMED":
if (DGDebug)
NTC_SendLogToOOG(NTC_LOG_COMMON, "[Debug] Game Permed");
break;
case "RECOVER":
MuleState = "recover";
isWaiting = true;
WriteMuleStats();
ExitGame();
NTC_SendLogToOOG(NTC_LOG_COMMON, "Trying to Recover Items");
StatusDelay(22000, "[AutoMule] Recovering ");
ControlData.click(ControlData.controls.lobby.button.join);
Delay(2000);
if (DGDebug)
NTC_SendLogToOOG(NTC_LOG_COMMON, "Debug: Trying to join Game");
isWaiting = false;
WriteMuleStats();
break;
case "ABORT":
StatusDelay(10000, "[AutoMule] Restart");
NTC_SendLogToOOG(NTC_LOG_COMMON, "[AutoMule] Recovery Completed! Restarting!");
NTC_Delay(2000);
JoinBug = 0;
DGCurrentAcc = 0;
MuleState = "notmuling";
WriteMuleStats();
isMuling = false;
NT_SendEventToOOG(D2NT_MGR_RESTART, location.name, 10);
break;
}
}
function AutoMuleLocationAction(location)
{
switch(location.id)
{
case 3: // Lobby Chat
Delay(500);
ControlData.click(ControlData.controls.lobby.button.join);
break;
case 1: // Lobby
Delay(500);
ControlData.click(ControlData.controls.lobby.button.join);
Delay(500);
break;
case 2: // Waiting In Line
if(GetTickCount()-LastGameMade > waitInLineTimeout)
ControlData.click(ControlData.controls.lobby.inLine.button.cancel);
break;
case 4: // Create Game
if (DGDebug)
NTC_SendLogToOOG(NTC_LOG_COMMON, "Debug: Something is wrong! Trying to recover...");
Delay(500);
ControlData.click(ControlData.controls.lobby.button.join);
break;
case 5: // Join Game
if(!ControlData.get(ControlData.controls.lobby.join.editBox.gameName))
{
ControlData.click(ControlData.controls.lobby.button.create);
Delay (500);
ControlData.click(ControlData.controls.lobby.button.join);
Delay (500);
}
ControlData.setText( ControlData.controls.lobby.join.editBox.gameName, MuleGame);
Delay (200);
ControlData.setText( ControlData.controls.lobby.join.editBox.password, MuleGamePassword);
Delay (5000);
ControlData.click(ControlData.controls.lobby.join.button.joinGame);
LastGameStatus = 1; // pending join
break;
case 6: // Ladder
Delay(500);
ControlData.click(ControlData.controls.lobby.button.join);
break;
case 7: // Channel List
Delay(500);
ControlData.click(ControlData.controls.lobby.button.join);
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
if (DGDebug)
NTC_SendLogToOOG(NTC_LOG_COMMON, "Debug: Start login");
NT_SendEventToOOG(D2NT_MGR_PRINT_STATUS, location.name, 0);
Delay(LoginDelay);
if (DGDebug)
NTC_SendLogToOOG(NTC_LOG_COMMON, "Debug: Enter Account");
ControlData.setText(ControlData.controls.login.editBox.accountName, DGMuleAccs[DGCurrentAcc]);
Delay(1000)
if (DGDebug)
NTC_SendLogToOOG(NTC_LOG_COMMON, "Debug: Enter PW");
ControlData.setText(ControlData.controls.login.editBox.password, DGMulePws[DGCurrentAcc]);
Delay(500);
if (DGDebug)
NTC_SendLogToOOG(NTC_LOG_COMMON, "Debug: Click Login!");
ControlData.click(ControlData.controls.login.button.logIn);
if (DGDebug)
NTC_SendLogToOOG(NTC_LOG_COMMON, "Debug: Logged In");
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);
DGCurrentAcc = 0;
MuleState = "notmuling";
isMuling = false;
break;
case 11: // Unable To Connect
NT_TimeoutDelay(unableToConnectRetry*60*1000, location)
ControlData.click(ControlData.controls.login.unableToConnect.button.ok);
DGCurrentAcc = 0;
MuleState = "notmuling";
isMuling = false;
break;
case 12: // Character Select
var _time, _control;
if (muleFull)
{
MuleCharLocation[DGCurrentAcc]++;
muleFull = false;
if (MuleCharLocation[DGCurrentAcc] > 7)
DGCurrentAcc++;
if (DGCurrentAcc > DGMuleAccs.length)
{
ControlData.click(ControlData.controls.characterSelect.button.exit);
DGCurrentAcc = 0;
MuleState = "notmuling";
isMuling = false;
WriteMuleStats();
}
}
NT_SendEventToOOG(D2NT_MGR_PRINT_STATUS, location.name, 0);
for(_time = 0 ; _time < CharacterScreenTimeout ; _time += 500)
{
if (DGDebug)
NTC_SendLogToOOG(NTC_LOG_COMMON, "Debug: Choose Character 1");
_control = ControlData.get(ControlData.controls.characterSelect.textBox.characterInfo[MuleCharLocation[DGCurrentAcc]]);
if(_control && _control.GetText() != undefined)
break;
Delay(500);
}
if(_time < CharacterScreenTimeout)
{
Delay(CharacterSelectDelay);
if (DGDebug)
NTC_SendLogToOOG(NTC_LOG_COMMON, "Debug: Choose Character 2 - " + DGCurrentAcc);
ControlData.click(ControlData.controls.characterSelect.textBox.characters[MuleCharLocation[DGCurrentAcc]], 0, 0, 1);
if (DGDebug)
NTC_SendLogToOOG(NTC_LOG_COMMON, "Debug: Choose Character 3 - MuleCharLocation[DGCurrentAcc]");
ControlData.click(ControlData.controls.characterSelect.textBox.characterInfo[MuleCharLocation[DGCurrentAcc]], 0, 0, 1);
// reset last game made, so it doesnt make a game immediately
InGameAt = 0;
NT_SetNextGameMake();
}
else
{
if (DGDebug)
NTC_SendLogToOOG(NTC_LOG_COMMON, "Debug: Exit Charselection");
var _rdfile;
_rdfile = FileOpen("rd.dat", 2);
_rdfile.Close();
ControlData.click(ControlData.controls.characterSelect.button.exit);
NT_TimeoutDelay(RealmDownRetry*60*1000, location);
}
break;
case 13: // Realm Down - Character Select screen
var _rdfile;
_rdfile = FileOpen("rd.dat", 2);
_rdfile.Close();
ControlData.click(ControlData.controls.characterSelect.button.exit);
NT_TimeoutDelay(RealmDownRetry*60*1000, location);
DGCurrentAcc = 0;
MuleState = "notmuling";
isMuling = false;
break;
case 14: // Character Select - Disconnected
NT_TimeoutDelay(disconnectedRetry*60*1000, location);
ControlData.click(ControlData.controls.characterSelect.disconnected.button.ok);
DGCurrentAcc = 0;
MuleState = "notmuling";
isMuling = false;
break;
case 15: // New Character
Delay(500);
break;
case 16: // Character Select - Please Wait popup
myTest++;
if(myTest > 10)
{
NT_SendEventToOOG(D2NT_MGR_PRINT_LOG, "ÿE00000Restart due to infinite loop!", 0);
NT_SendEventToOOG(D2NT_MGR_RESTART, location.name, 10);
}
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
Delay(500);
ControlData.click(ControlData.controls.lobby.lostConnection.button.ok);
DGCurrentAcc = 0;
MuleState = "notmuling";
isMuling = false;
break;
case 18: // D2 Splash
Delay(500);
ControlData.click(ControlData.controls.d2Splash.textBox.copyright);
break;
case 19: // Login - Cdkey In Use
NT_TimeoutDelay(cdkeyInUseRetry*60*1000, location);
ControlData.click(ControlData.controls.login.cdkeyInUse.button.ok);
break;
case 20: // Single Player - Select Difficulty
// You can't Mule in Single Player ;)
Delay(500);
DGCurrentAcc = 0;
MuleState = "notmuling";
isMuling = false;
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..
Delay(5000);
DGCurrentAcc = 0;
MuleState = "notmuling";
isMuling = false;
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
// We should not get this Message, but well - JOIN!
Delay(500);
NT_SendEventToOOG(D2NT_MGR_PRINT_LOG, "Game already exists", 0);
ControlData.click(ControlData.controls.lobby.button.join);
break;
case 27: // Gateway Select
Delay(500);
ControlData.clickRealmEntry(me.gatewayid);
ControlData.click(ControlData.controls.gateway.button.ok);
break;
case 28: // Lobby - Game Does Not Exist
if (JoinBug == 1)
{
JoinBug++;
Delay(25000);
ControlData.click(ControlData.controls.lobby.button.create);
}else if (JoinBug < JoinRetries){
JoinBug++;
Delay(JoinRetryDelay * 1000);
ControlData.click(ControlData.controls.lobby.button.create);
}else{
// Well we are kinda fucked, abort!
NTC_SendLogToOOG(NTC_LOG_COMMON, "Could not join Mulegame!");
NTC_Delay(2000);
ControlData.click(ControlData.controls.lobby.button.quit);
NTC_Delay(2000);
ControlData.click(ControlData.controls.characterSelect.button.exit);
JoinBug = 0;
DGCurrentAcc = 0;
MuleState = "notmuling";
isMuling = false;
}
break;
default:
break;
}
}
function FullAutoLocationAction(location)
{
switch(location.id)
{
case 3: // Lobby Chat
Delay (500);
ControlData.click(ControlData.controls.lobby.button.join);
break;
case 1: // Lobby
Delay (500);
ControlData.click(ControlData.controls.lobby.button.join);
break;
case 2: // Waiting In Line
if(GetTickCount()-LastGameMade > WaitInLineTimeout)
ControlData.click(ControlData.controls.lobby.inLine.button.cancel);
break;
case 4: // Create Game
Delay (500);
ControlData.click(ControlData.controls.lobby.button.join);
break;
case 5: // Join Game
if(!ControlData.get(ControlData.controls.lobby.join.editBox.gameName))
{
ControlData.click(ControlData.controls.lobby.button.create);
Delay (500);
ControlData.click(ControlData.controls.lobby.button.join);
Delay (500);
}
ControlData.setText( ControlData.controls.lobby.join.editBox.gameName, MuleGame);
Delay (200);
ControlData.setText( ControlData.controls.lobby.join.editBox.password, MuleGamePassword);
Delay (10000);
ControlData.click(ControlData.controls.lobby.join.button.joinGame);
LastGameStatus = 1; // pending join
break;
case 6: // Ladder
Delay (500);
ControlData.click(ControlData.controls.lobby.button.join);
break;
case 7: // Channel List
Delay (500);
ControlData.click(ControlData.controls.lobby.button.join);
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
if (DGDebug)
NTC_SendLogToOOG(NTC_LOG_COMMON, "Debug: Get Account Name");
var _AccName = getCurrentMuleAcc();
if (DGDebug)
NTC_SendLogToOOG(NTC_LOG_COMMON, "Debug: Acc Name is '" + _AccName + "'");
if (_AccName == "")
createNewAccount = true;
if (!createNewAccount)
{
Delay(1234);
if (DGDebug)
NTC_SendLogToOOG(NTC_LOG_COMMON, "Debug: Account Name");
ControlData.setText(ControlData.controls.login.editBox.accountName, _AccName);
Delay(872);
if (DGDebug)
NTC_SendLogToOOG(NTC_LOG_COMMON, "Debug: Password");
ControlData.setText(ControlData.controls.login.editBox.password, getCurrentMulePW());
Delay(468);
if (DGDebug)
NTC_SendLogToOOG(NTC_LOG_COMMON, "Debug: Log In");
ControlData.click(ControlData.controls.login.button.logIn);
NT_LocationTimeout(5000, location);
break;
}else{
Delay(1234);
if (DGDebug)
NTC_SendLogToOOG(NTC_LOG_COMMON, "Debug: Create New Account");
ControlData.click(ControlData.controls.login.button.createNewAccount);
NT_LocationTimeout(5000, location);
break;
}
case 10: // Login Error (this is a fatal error, so stop)
NTC_SendLogToOOG(NTC_LOG_COMMON, "MuleScript: Login Error");
NT_SendEventToOOG(D2NT_MGR_RESTART, location.name, 10);
Delay(3500);
DGCurrentAcc = 0;
MuleState = "notmuling";
isMuling = false;
break;
case 11: // Unable To Connect
NTC_SendLogToOOG(NTC_LOG_COMMON, "MuleScript: Unable to Connect");
NT_TimeoutDelay(unableToConnectRetry*60*1000, location)
ControlData.click(ControlData.controls.login.unableToConnect.button.ok);
DGCurrentAcc = 0;
MuleState = "notmuling";
isMuling = false;
break;
case 12: // Character Select
Delay(500);
for(var i = 0 ; i < 8 ; i++)
{
_control = ControlData.get(ControlData.controls.characterSelect.textBox.characterInfo[i]);
if(!_control || _control.GetText() == undefined)
break;
Delay(500);
}
if(i < 8)
{
if (muleFull || (i == 0))
{
ControlData.click(ControlData.controls.characterSelect.button.createNew);
CharCreateNumber = i;
muleFull = false;
}else{
var _time, _control;
NT_SendEventToOOG(D2NT_MGR_PRINT_STATUS, location.name, 0);
for(_time = 0 ; _time < CharacterScreenTimeout ; _time += 500)
{
if (DGDebug)
NTC_SendLogToOOG(NTC_LOG_COMMON, "Debug: Choose Character 1");
_control = ControlData.get(ControlData.controls.characterSelect.textBox.characterInfo[i-1]);
if(_control && _control.GetText() != undefined)
break;
Delay(500);
}
if(_time < CharacterScreenTimeout)
{
Delay(CharacterSelectDelay);
if (DGDebug)
NTC_SendLogToOOG(NTC_LOG_COMMON, "Debug: Choose Character 2 - " + DGCurrentAcc);
ControlData.click(ControlData.controls.characterSelect.textBox.characters[i-1], 0, 0, 1);
if (DGDebug)
NTC_SendLogToOOG(NTC_LOG_COMMON, "Debug: Choose Character 3 -" + i);
ControlData.click(ControlData.controls.characterSelect.textBox.characterInfo[i-1], 0, 0, 1);
// reset last game made, so it doesnt make a game immediately
InGameAt = 0;
NT_SetNextGameMake();
}
else
{
if (DGDebug)
NTC_SendLogToOOG(NTC_LOG_COMMON, "Debug: Exit Charselection");
var _rdfile;
_rdfile = FileOpen("rd.dat", 2);
_rdfile.Close();
ControlData.click(ControlData.controls.characterSelect.button.exit);
NT_TimeoutDelay(RealmDownRetry*60*1000, location);
}
break;
}
}
else
{
// No more Chars to create - Create Next Account
Delay(500);
if (muleFull)
{
ControlData.click(ControlData.controls.characterSelect.button.exit);
createNewAccount = true;
muleFull = false;
}else{
var _time, _control;
NT_SendEventToOOG(D2NT_MGR_PRINT_STATUS, location.name, 0);
for(_time = 0 ; _time < CharacterScreenTimeout ; _time += 500)
{
if (DGDebug)
NTC_SendLogToOOG(NTC_LOG_COMMON, "Debug: Choose Character 1");
_control = ControlData.get(ControlData.controls.characterSelect.textBox.characterInfo[i-1]);
if(_control && _control.GetText() != undefined)
break;
Delay(500);
}
if(_time < CharacterScreenTimeout)
{
Delay(CharacterSelectDelay);
if (DGDebug)
NTC_SendLogToOOG(NTC_LOG_COMMON, "Debug: Choose Character 2 - " + DGCurrentAcc);
ControlData.click(ControlData.controls.characterSelect.textBox.characters[i-1], 0, 0, 1);
if (DGDebug)
NTC_SendLogToOOG(NTC_LOG_COMMON, "Debug: Choose Character 3 -" + i);
ControlData.click(ControlData.controls.characterSelect.textBox.characterInfo[i-1], 0, 0, 1);
// reset last game made, so it doesnt make a game immediately
InGameAt = 0;
NT_SetNextGameMake();
}
else
{
if (DGDebug)
NTC_SendLogToOOG(NTC_LOG_COMMON, "Debug: Exit Charselection");
ControlData.click(ControlData.controls.characterSelect.button.exit);
NT_TimeoutDelay(RealmDownRetry*60*1000, location);
}
break;
}
break;
}
NT_LocationTimeout(2000, location);
break;
case 13: // Realm Down - Character Select screen
var _rdfile;
_rdfile = FileOpen("rd.dat", 2);
_rdfile.Close();
NTC_SendLogToOOG(NTC_LOG_COMMON, "MuleScript: Realm Down");
ControlData.click(ControlData.controls.characterSelect.button.exit);
NT_TimeoutDelay(RealmDownRetry*60*1000, location);
DGCurrentAcc = 0;
MuleState = "notmuling";
isMuling = false;
break;
case 14: // Character Select - Disconnected
NTC_SendLogToOOG(NTC_LOG_COMMON, "MuleScript: Disconnected");
NT_TimeoutDelay(DisconnectedRetry*60*1000, location);
ControlData.click(ControlData.controls.characterSelect.disconnected.button.ok);
DGCurrentAcc = 0;
MuleState = "notmuling";
isMuling = false;
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
NTC_SendLogToOOG(NTC_LOG_COMMON, "MuleScript: Connection Lost");
ControlData.click(ControlData.controls.lobby.lostConnection.button.ok);
Delay(15000);
DGCurrentAcc = 0;
MuleState = "notmuling";
isMuling = false;
break;
case 18: // D2 Splash
ControlData.click(ControlData.controls.d2Splash.textBox.copyright);
break;
case 19: // Login - Cdkey In Use
NT_TimeoutDelay(CdKeyInUseRetry*60*1000, location);
ControlData.click(ControlData.controls.login.cdkeyInUse.button.ok);
DGCurrentAcc = 0;
MuleState = "notmuling";
isMuling = false;
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);
DGCurrentAcc = 0;
MuleState = "notmuling";
isMuling = false;
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..
Delay(15000);
DGCurrentAcc = 0;
MuleState = "notmuling";
isMuling = false;
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
// We should not get this Message, but well - JOIN!
Delay(500);
ControlData.click(ControlData.controls.lobby.button.join);
break;
case 27: // Gateway Select
Delay(500);
ControlData.clickRealmEntry(me.gatewayid);
ControlData.click(ControlData.controls.gateway.button.ok);
break;
case 28: // Lobby - Game Does Not Exist
if (JoinBug == 1)
{
JoinBug++;
Delay(25000);
ControlData.click(ControlData.controls.lobby.button.create);
}else if (JoinBug < JoinRetries){
JoinBug++;
Delay(JoinRetryDelay * 1000);
ControlData.click(ControlData.controls.lobby.button.create);
}else{
// Well we are kinda fucked, abort!
NTC_SendLogToOOG(NTC_LOG_COMMON, "Could not join Mulegame!");
NTC_Delay(2000);
ControlData.click(ControlData.controls.lobby.button.quit);
NTC_Delay(2000);
ControlData.click(ControlData.controls.characterSelect.button.exit);
JoinBug = 0;
DGCurrentAcc = 0;
MuleState = "notmuling";
isMuling = false;
//LastGameStatus = 0;
//NT_SetNextGameMake();
//NT_LocationTimeout(gameDoesNotExistTimeout, location);
}
break;
case 29: // Create New Char
Delay(613);
ControlData.click(ControlData.controls.characterCreate.chars[0]);
Delay(2399);
ControlData.setText(ControlData.controls.characterCreate.editBox.charName, getNextCharName());
// SET LADDER AND STUFF !?
if (!isLadder)
{
Delay(198);
ControlData.click(ControlData.controls.characterCreate.button.ladderChar);
}
if (isHC)
{
Delay(555);
ControlData.click(ControlData.controls.characterCreate.button.hardcore);
Delay(1111);
ControlData.click(ControlData.controls.characterCreate.button.continuehardcore);
}
if (isClassic)
{
Delay(341);
ControlData.click(ControlData.controls.characterCreate.button.expansionChar);
}
// Create the Char Now
Delay(2109);
ControlData.click(ControlData.controls.characterCreate.button.ok);
break;
case 30: // Create New Char
Delay(222);
break;
case 31: // Terms & Stuff
Delay(521);
ControlData.click(ControlData.controls.termsofuse.button.agree);
NT_LocationTimeout(1000, location);
break;
case 32: // Select New Account Name and Password
Delay(2334);
_NewAccName = getNewAccountName();
ControlData.setText(ControlData.controls.newaccount.editBox.accountName, _NewAccName);
Delay(1772);
_NewAccPW = getNewAccountPassword();
ControlData.setText(ControlData.controls.newaccount.editBox.password, _NewAccPW);
Delay(1129);
ControlData.setText(ControlData.controls.newaccount.editBox.confirmpassword, _NewAccPW);
Delay(794);
ControlData.click(ControlData.controls.newaccount.button.ok);
var filehandle = FileOpen("NTBot/mule_configs/MuleAccs/MuleAccs_" + me.account + "_" + MuleAccSuffix[DGCurrentAcc] +".txt", 2);
if(filehandle)
{
filehandle.WriteLine(_NewAccName + "//" + _NewAccPW);
filehandle.Close();
}
createNewAccount = false;
NT_LocationTimeout(2000, location);
break;
case 33: // Set Recovery E-Mail
if (RegMail.length)
{
Delay(642);
NTC_SendLogToOOG(NTC_LOG_COMMON, "Debug: Set Mail");
ControlData.setText(ControlData.controls.email.editBox.email, RegMail);
Delay(1421);
NTC_SendLogToOOG(NTC_LOG_COMMON, "Debug: Confirm Mail");
ControlData.setText(ControlData.controls.email.editBox.confirmemail, RegMail);
Delay(913);
NTC_SendLogToOOG(NTC_LOG_COMMON, "Debug: Submit");
ControlData.click(ControlData.controls.email.button.register);
NT_LocationTimeout(2000, location);
}else{
Delay(2311);
NTC_SendLogToOOG(NTC_LOG_COMMON, "Debug: Dont Reg");
ControlData.click(ControlData.controls.email.button.dontregister);
NT_LocationTimeout(2000, location);
}
break;
case 34: // No Regged Email Popup
Delay(1391);
ControlData.click(ControlData.controls.email.confirm.button.continue);
NT_LocationTimeout(2000, location);
break;
default:
Delay(426);
break;
}
}
function BotMuleAction(location)
{
switch(location.id)
{
case 3: // Lobby Chat
SetStatusText("ÿc1[AutoMule] Wait 5s");
Delay(5000);
if (DGDebug)
NTC_SendLogToOOG(NTC_LOG_COMMON, "Debug: Click Create!");
ControlData.click(ControlData.controls.lobby.button.create);
break;
case 1: // Lobby
SetStatusText("ÿc1[AutoMule] Wait 5s");
Delay(5000);
ControlData.click(ControlData.controls.lobby.button.create);
break;
case 2: // Waiting In Line
if(GetTickCount()-LastGameMade > waitInLineTimeout)
ControlData.click(ControlData.controls.lobby.inLine.button.cancel);
break;
case 4: // Create Game
if(!ControlData.get(ControlData.controls.lobby.create.editBox.gameName))
{
ControlData.click(ControlData.controls.lobby.button.join);
Delay (500);
ControlData.click(ControlData.controls.lobby.button.create);
Delay (500);
}
ControlData.setText( ControlData.controls.lobby.create.editBox.gameName, MuleGame);
Delay (600);
ControlData.setText( ControlData.controls.lobby.create.editBox.password, MuleGamePassword);
Delay (700);
ControlData.click(ControlData.controls.lobby.create.button.normal);
SetStatusText("ÿc1[AutoMule] Create Game in 5s");
Delay(5000);
ControlData.click(ControlData.controls.lobby.create.button.createGame);
Delay(500);
if (DGDebug)
NTC_SendLogToOOG(NTC_LOG_COMMON, "Debug: Creating Game!");
//sendEventToOOG(D2NT_MGR_CREATE_GAME, location.name, 0);
//RunGC(); // run garbage collector between each game
NT_LocationTimeout(5000, location);
LastGameMade = GetTickCount();
LastGameStatus = 1; // pending creation
break;
case 5: // Join Game
if(!ControlData.get(ControlData.controls.lobby.join.editBox.gameName))
{
ControlData.click(ControlData.controls.lobby.button.create);
Delay (500);
ControlData.click(ControlData.controls.lobby.button.join);
Delay (500);
}
ControlData.setText( ControlData.controls.lobby.join.editBox.gameName, MuleGame);
Delay (200);
ControlData.setText( ControlData.controls.lobby.join.editBox.password, MuleGamePassword);
SetStatusText("ÿc1[AutoMule] Join in 5s");
Delay (5000);
ControlData.click(ControlData.controls.lobby.join.button.joinGame);
//RunGC(); // run garbage collector between each game
//NT_LocationTimeout(1000, location);
LastGameStatus = 1; // pending join
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
NT_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
{
var _rdfile;
_rdfile = FileOpen("rd.dat", 2);
_rdfile.Close();
ControlData.click(ControlData.controls.characterSelect.button.exit);
NT_TimeoutDelay(RealmDownRetry*60*1000, location);
}
break;
case 13: // Realm Down - Character Select screen
var _rdfile;
_rdfile = FileOpen("rd.dat", 2);
_rdfile.Close();
ControlData.click(ControlData.controls.characterSelect.button.exit);
NT_TimeoutDelay(RealmDownRetry*60*1000, location);
break;
case 14: // Character Select - Disconnected
NT_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
NT_TimeoutDelay(cdkeyInUseRetry*60*1000, location);
ControlData.click(ControlData.controls.login.cdkeyInUse.button.ok);
break;
case 20: // Single Player - Select Difficulty
RunGC(); // run garbage collector between each game
ControlData.click(ControlData.singlePlayerDifficulties[me.diff]);
break;
case 21: // Main Menu - Connecting
if(!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, "Game already exists", 0);
// Well then try to join it instead ;)
ControlData.click(ControlData.controls.lobby.button.join);
// 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
if (JoinBug == 0)
{
JoinBug++;
SetStatusText("ÿc1[AutoMule] Maybe Join Bug, waiting 30s");
Delay(25000);
ControlData.click(ControlData.controls.lobby.button.create);
}else if (JoinBug < JoinRetries){
SetStatusText("ÿc1[AutoMule] Attempt #" + JoinBug + "/" + JoinRetries + " waiting " + JoinRetryDelay + "s");
JoinBug++;
Delay(JoinRetryDelay * 1000);
ControlData.click(ControlData.controls.lobby.button.create);
}else{
// Well we are kinda fucked, abort!
SetStatusText("ÿc1[AutoMule] Aborting now...");
NTC_SendLogToOOG(NTC_LOG_COMMON, "Could not join Mulegame!");
NTC_Delay(2000);
ControlData.click(ControlData.controls.lobby.button.quit);
NTC_Delay(2000);
ControlData.click(ControlData.controls.characterSelect.button.exit);
JoinBug = 0;
DGCurrentAcc = 0;
MuleState = "notmuling";
isMuling = false;
//LastGameStatus = 0;
//NT_SetNextGameMake();
//NT_LocationTimeout(gameDoesNotExistTimeout, location);
}
break;
default:
break;
}
}
function getNextCharName()
{
var _charname = "";
var _charSetA = "abcdefghijklmnopqrstuvwxyz";
var _charSetB = "abcdefghijklmnopqrstuvwxyz";
var _charSetC = "abcdefghijklmnopqrstuvwxyz";
var _charSetD = "abcdefghijklmnopqrstuvwxyz";
var _charSetE = "abcdefghijklmnopqrstuvwxyz";
var _charSetF = "abcdefghijklmnopqrstuvwxyz";
var _charSetG = "abcdefghijklmnopqrstuvwxyz";
var _charSetH = "abcdefghijklmnopqrstuvwxyz";
var _charSetI = "abcdefghijklmnopqrstuvwxyz";
var _charSetJ = "abcdefghijklmnopqrstuvwxyz";
var _charSetK = "abcdefghijklmnopqrstuvwxyz";
var _charSetL = "abcdefghijklmnopqrstuvwxyz";
var _charSetM = "abcdefghijklmnopqrstuvwxyz";
var _charSetN = "abcdefghijklmnopqrstuvwxyz";
var _charSetO = "abcdefghijklmnopqrstuvwxyz";
_charname += _charSetA.charAt(Random(0, _charSetA.length-1));
_charname += _charSetB.charAt(Random(0, _charSetB.length-2));
_charname += _charSetC.charAt(Random(0, _charSetC.length-3));
_charname += _charSetD.charAt(Random(0, _charSetD.length-4));
_charname += _charSetE.charAt(Random(0, _charSetE.length-5));
_charname += _charSetF.charAt(Random(0, _charSetF.length-6));
_charname += _charSetG.charAt(Random(0, _charSetG.length-7));
_charname += _charSetH.charAt(Random(0, _charSetH.length-8));
_charname += _charSetI.charAt(Random(0, _charSetI.length-9));
_charname += _charSetJ.charAt(Random(0, _charSetJ.length-10));
_charname += _charSetK.charAt(Random(0, _charSetK.length-11));
_charname += _charSetL.charAt(Random(0, _charSetL.length-12));
_charname += _charSetM.charAt(Random(0, _charSetM.length-13));
_charname += _charSetN.charAt(Random(0, _charSetN.length-14));
_charname += _charSetO.charAt(Random(0, _charSetO.length-15));
Delay(25);
return _charname;
}
function WriteMuleStats()
{
var filehandle = FileOpen("NTBot/mule_configs/" + me.account + "mulestats", 1);
if(filehandle)
{
if (DGDebug)
NTC_SendLogToOOG(NTC_LOG_COMMON, "Debug: Writing Mule Stat File");
filehandle.WriteLine("MuleState=" + MuleState);
//filehandle.WriteLine("Waiting=" + isWaiting);
filehandle.WriteLine("CurrentAcc=" + DGCurrentAcc);
filehandle.Close();
}
}
function ReadMuleStats()
{
var filehandle = FileOpen("NTBot/mule_configs/" + me.account + "mulestats", 2);
if(filehandle)
{
while (!filehandle.eof)
{
var _stat = filehandle.ReadLine();
_stat = _stat.split("=");
if (_stat[0] == "MuleState")
{
MuleState = _stat[1];
if (DGDebug)
NTC_SendLogToOOG(NTC_LOG_COMMON, "[Debug] MuleState: " + MuleState);
}
else if (_stat[0] == "CurrentAcc")
{
DGCurrentAcc = _stat[1];
if (DGDebug)
NTC_SendLogToOOG(NTC_LOG_COMMON, "[Debug] DGCurrentAcc: " + DGCurrentAcc);
}
else if (_stat[0] == "Waiting")
{
DGCurrentAcc = _stat[1];
if (DGDebug)
NTC_SendLogToOOG(NTC_LOG_COMMON, "[Debug] Waiting: " + isWaiting);
}
}
}
if (MuleState != "notmuling")
{
isMuling = true;
}
}
function getCurrentMuleAcc()
{
var _name = "";
var filehandle = FileOpen("NTBot/mule_configs/MuleAccs/MuleAccs_" + me.account + "_" + MuleAccSuffix[DGCurrentAcc] +".txt", 2);
if(filehandle)
{
while (!filehandle.eof)
{
var _temp = filehandle.ReadLine();
if (_temp != "")
_name = _temp;
}
filehandle.Close();
}
if (_name != "")
{
_name = _name.split("//")
_name = _name[0];
}
return _name;
}
function getCurrentMulePW()
{
var _name = "";
var filehandle = FileOpen("NTBot/mule_configs/MuleAccs/MuleAccs_" + me.account + "_" + MuleAccSuffix[DGCurrentAcc] +".txt", 2);
if(filehandle)
{
while (!filehandle.eof)
{
var _temp = filehandle.ReadLine();
if (_temp != "")
_name = _temp;
}
filehandle.Close();
}
_name = _name.split("//")
return _name[1];
}
function getNewAccountName()
{
var _result;
_result = AccPrefix + "-";
if (UseNumbers)
{
_result += MuleAccSuffix[DGCurrentAcc];
_result += getNextAccNumber();
}
else
{
_result += getNextAccLetter();
_result += MuleAccSuffix[DGCurrentAcc];
}
return _result;
}
function getNextAccNumber()
{
var _count = 0;
var filehandle = FileOpen("NTBot/mule_configs/MuleAccs/MuleAccs_" + me.account + "_" + MuleAccSuffix[DGCurrentAcc] +".txt", 2);
if(filehandle)
{
while (!filehandle.eof)
{
_count++;
filehandle.ReadLine();
}
filehandle.Close();
}
return _count;
}
function getNextAccLetter()
{
var _count = -1;
var _index;
var _letter = "";
var _Letters = ["a","b","c","d","e","f","g","h","i","j","k","l","m","n","o","p","q","r","s","t","u","v","w","x","y","z"];
var filehandle = FileOpen("NTBot/mule_configs/MuleAccs/MuleAccs_" + me.account + "_" + MuleAccSuffix[DGCurrentAcc] +".txt", 2);
if(filehandle)
{
while (!filehandle.eof)
{
_count++;
filehandle.ReadLine();
}
filehandle.Close();
}
while (_count + 1 > _Letters.length)
{
_index = _count % _Letters.length;
_letter += _Letters[_index];
_count -= _Letters.length;
}
_index = _count % _Letters.length;
_letter += _Letters[_index];
return _letter;
}
function getNewAccountPassword()
{
var _pw;
if (NewAccPW[DGCurrentAcc].length)
{
_pw = NewAccPW[DGCurrentAcc];
}else{
_pw = getRandomString(8);
}
return _pw;
}
Include("libs/common/NTItemAlias.ntl");
var _NTIP_DontMuleCheckList = new Array();
function NTIPDontMuleOpenFile(filepath)
{
var _nipfile;
var _line;
var _filename, _lineCount, _buffer;
_lineCount = 0;
_nipfile = FileOpen(filepath, 0);
_filename = filepath.split("/")[filepath.split("/").length - 1];
if(!_nipfile)
return false;
while(!_nipfile.eof)
{
_lineCount++;
_buffer = _nipfile.ReadLine();
_line = NTIPParseLineInt(_buffer);
if(_line)
{
_line.push("ÿc8" + _filename + "ÿc0, Line ÿc8" + _lineCount);
_line.push(_buffer);
_NTIP_DontMuleCheckList.push(_line);
}
}
_nipfile.Close();
return true;
}
function NTSI_LoadDontMule(filepath)
{
for(var i = 0 ; i < NTConfig_DontMule.length ; i++)
NTIPDontMuleOpenFile(filepath + "/" + NTConfig_DontMule[i]);
}
function NTIPDontMuleCheckItem(item, offset, printinfo)
{
var i;
var _identified;
var _result = 0;
var _amount, _amountString, _replacedCheckListItem, _specs;
_identified = item.itemflag & 0x10;
if(arguments.length < 2)
printinfo = false;
for(i = 0 ; i < _NTIP_DontMuleCheckList.length ; i++)
{
if(_NTIP_DontMuleCheckList[i][0].length > 0)
{
if(eval(_NTIP_DontMuleCheckList[i][0]))
{
if(_NTIP_DontMuleCheckList[i][1].length > 0)
{
if(eval(_NTIP_DontMuleCheckList[i][1]))
{
if(printinfo)
{
Print("Match found in " + _NTIP_DontMuleCheckList[i][2]);
Print("Corresponding ÿc8Nip Lineÿc0: " +_NTIP_DontMuleCheckList[i][3]);
Print("Corresponding ÿc;JavaScript Lineÿc0: " + _NTIP_DontMuleCheckList[i][0] + "&&" + _NTIP_DontMuleCheckList[i][1]);
}
return 1;
}
else if(!_identified && _result == 0)
_result = -1;
}
else
{
if(printinfo)
{
Print("Match found in " + _NTIP_DontMuleCheckList[i][2]);
Print("Corresponding ÿc8Nip Line: ÿc0" +_NTIP_DontMuleCheckList[i][3]);
Print("Corresponding ÿc;JavaScript Line: ÿc0" + _NTIP_DontMuleCheckList[i][0]);
}
return 1;
}
}
}
else if(_NTIP_DontMuleCheckList[i][1].length > 0)
{
if(eval(_NTIP_DontMuleCheckList[i][1]))
return 1;
else if(!_identified && _result == 0)
_result = -1;
}
}
return _result;
}