
(Ist ein selbstextrahierendes Archiv mit Credits, einem Link zum Topic auf Eon und der Anmerkung welche Dateien geändert werden müssen!)
/edit2: Ein paar Scripts haben ein Update erhalten!
Original Post auf EoN:
Hi there,
I managed to adapt the script from bobite (
) that joined games but only for ad2bs. Original credits belongs to him and of course to kimsout and other former developers.
The version i'm based on is NTBOT 3.7.4 && D2NT 1.8.5 (
)
Works in English and French versions of Diablo2
My join-bot enters lobby chat, types "/f l" and joins the friend you specified in the file "\scripts\libs\joinBotSettings.ntl" (that you have to create as indicated bellow).
Once in game, it waits for baal's throne tp, enters it, and fights! Then he moves to act 4 (as soon as the leader bot is in the chaos sanctuary), waits for tp, enters and fights! If the join-bot chickens, it will re-enter the game (if the leader was still in it when the join-bot types "/f l" in the lobby chat), and check at which act the leader is, then starts the according script (baal or diablo).
Of course, the leader-bot and the join-bot have to be mutual friends!
This script has a lot of improvements to do, as:
- delaying the "/f l" when the leader is offline, or in the lobby-chat,
- read each other's messages when in-game (especially for leecher-bots that would want to wait until the tp is safe) => check this page :
- improve diablo script in order to go as fast as possible to the right seal after a chicken
- checking the tp owner (it only checks the tp destination)
- fix a lobby/join bug that sometimes freezes the join-bot in the lobby-chat (after clicking on the join button, the bot freezes for hours... hopefully bnet will disconnect you, and the OOG Manager will restart d2)
- OOG Manager doesn't log game names
- and so on...
There are a lot of files to change, please be aware that there may be bugs, make a copy of your D2NT directory!
I will now make 1 post per file you have to modify, i repeat, in your copied folder of D2NT
I managed to adapt the script from bobite (
) that joined games but only for ad2bs. Original credits belongs to him and of course to kimsout and other former developers. The version i'm based on is NTBOT 3.7.4 && D2NT 1.8.5 (
) Works in English and French versions of Diablo2
My join-bot enters lobby chat, types "/f l" and joins the friend you specified in the file "\scripts\libs\joinBotSettings.ntl" (that you have to create as indicated bellow).
Once in game, it waits for baal's throne tp, enters it, and fights! Then he moves to act 4 (as soon as the leader bot is in the chaos sanctuary), waits for tp, enters and fights! If the join-bot chickens, it will re-enter the game (if the leader was still in it when the join-bot types "/f l" in the lobby chat), and check at which act the leader is, then starts the according script (baal or diablo).
Of course, the leader-bot and the join-bot have to be mutual friends!
This script has a lot of improvements to do, as:
- delaying the "/f l" when the leader is offline, or in the lobby-chat,
- read each other's messages when in-game (especially for leecher-bots that would want to wait until the tp is safe) => check this page :
- improve diablo script in order to go as fast as possible to the right seal after a chicken
- checking the tp owner (it only checks the tp destination)
- fix a lobby/join bug that sometimes freezes the join-bot in the lobby-chat (after clicking on the join button, the bot freezes for hours... hopefully bnet will disconnect you, and the OOG Manager will restart d2)
- OOG Manager doesn't log game names
- and so on...
There are a lot of files to change, please be aware that there may be bugs, make a copy of your D2NT directory!
I will now make 1 post per file you have to modify, i repeat, in your copied folder of D2NT
Der JoinBot ist ein Followbot für D2NT, aber noch im Entwicklungsstadium. Funktioniert für mich aber wunderbar (Der Entwickler folgt mit seinem Char meinem Hammadin :x).
Der Bot geht im Bnet in Chat, gibt dort /f l ein und joined ins Spiel vom Leader! (Chat muss angestellt werden!)
Ich empfehle euch wärmstens einen privaten Chatchannel zu betreten weil der Bot Statusmeldungen ausgibt um die Fehlersuche zu erleichtern!
Zum Installieren kopiert ihr einfach euren D2NT 1.8.5(!) Ordner und ändert folgende Dateien:
scripts/NTBot.ntj:
Code:
var gameMinLength = 420000; // 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 = 260; // time in minutes to retry connecting on a realm down (default is 120 minutes)
var disconnectedRetry = 5; // time in minutes to retry on a disconnection (usually ip ban related)
var cdkeyInUseRetry = 5; // time in minutes to retry on a cdkey in use error message (set to 0 to stop)
var connectingToBnetTimeout = 20000; // time in milliseconds to wait for a login to time out and click cancel and retry
var characterScreenTimeout = 10000; // time in milliseconds to wait for character screen to appear
var pleaseWaitTimeout = 10000; // time in milliseconds to wait for a please wait popup
var createGameThreshold = 5000; // time in milliseconds to wait between making games
var createGameThresholdRandom = 1000; // time in milliseconds to randomly add +/- to the game create time
var createGameTimeout = 15000; // time in milliseconds to register a failed to create game
var waitInLineTimeout = 60000; // time in milliseconds to wait in lines for a create game (60 second default)
var characterSelectDelay = 1000; // time in milliseconds to wait before selecting a character on the char screen
var loginDelay = 1000; // time in milliseconds to wait before submitting login information
var clickDelay = 500; // wait X milliseconds before next action after a click event
var textDelay = 500; // wait X milliseconds before next action after inserting text into a textbox
var clickDelayRandom = 500; // random amount of time to add to a click
var textDelayRandom = 500; // random amount of time to add to a text set
var gameDoesNotExistDelayMin = 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 joinChatAfterGame = true; // join chat after leaving a game
var joinRandomChannel = false; // if this is true, will join a random channel, otherwise it will use the channel below..
var joinChannelInChat = "Euer ChannelName"; // leave blank to not join a private channel
var waitBeforeEnterChatMin = 1000; // min how long to wait before entering chat
var waitBeforeEnterChatMax = 2000; // max how long to wait before entering chat
var waitInChatBeforeActionsMin = 2000; // min how long to wait before joining channel
var waitInChatBeforeActionsMax = 3000; // max how long to wait before joining channel
// DONT EDIT ANYTHING BELOW THIS
// D2NT Manager Command
const D2NT_MGR_LOADING = 1;
const D2NT_MGR_READY = 2;
const D2NT_MGR_LOGIN = 3;
const D2NT_MGR_CREATE_GAME = 4;
const D2NT_MGR_INGAME = 5;
const D2NT_MGR_RESTART = 6;
const D2NT_MGR_CHICKEN = 7;
const D2NT_MGR_PRINT_STATUS = 8;
const D2NT_MGR_PRINT_LOG = 9;
var lastGameMade = GetTickCount();
var lastGameStatus = 0;
var nextGameMake = 0;
var inGameAt = 0;
var chatActionsDone = false;
var lastGameFailed = false;
Include("controlInfo.ntl");
Include("joinBotSettings.ntl");
var controlData = new controlInfo();
var game = '';
function NTMain()
{
Delay(1000);
var _ingame = false;
controlData.clickDelay = clickDelay;
controlData.textDelay = textDelay;
controlData.clickDelayRandom = clickDelayRandom;
controlData.textDelayRandom = textDelayRandom;
while(1)
{
if(me.ingame)
{
if(!inGameAt)
inGameAt = GetTickCount();
if(!_ingame)
{
if(Load("NTBotGame.ntj"))
{
_ingame = true;
sendEventToOOG(D2NT_MGR_INGAME, "In Game", 0);
lastGameStatus = 2; // in game successful
}
}
Delay(1000);
}
else
{
if(_ingame)
{
_ingame = false;
sendEventToOOG(D2NT_MGR_READY, "", 0);
}
locationAction(controlData.getLocation());
Delay(500);
}
}
}
function locationAction(location)
{
switch(location.id)
{
case 3: // Lobby Chat
if(!chatActionsDone)
{
chatActionsDone = true;
Delay(Random(waitInChatBeforeActionsMin, waitInChatBeforeActionsMax));
if(joinRandomChannel || joinChannelInChat != "")
{
Say("/join " + (joinRandomChannel ? getRandomString(Random(3,10)) : joinChannelInChat));
Delay(1000);
}
}
if(JoinFromChat){
game = '';
if (joinChannelInChat)
Say('Locating the leader : '+leaderAccountName);
Delay (1500);
Say('/f l');
Delay(500);
if(chat = controlData.get(controlData.controls.lobby.chat.textBox.channelText))
{
var errors = '';
var found_leader = false;
lines = chat.GetText();
for (var friend = 0; friend < lines.length; friend++)
{
if (lines[friend].lastIndexOf(': '+leaderAccountName+',') > -1)
{
game = '';
found_leader = true;
var regOfflineEnglish=/^\d\s?:\s?(\w*)\s?,\s?offline\s*$/gi;
var regGameNameEnglish=/^\s*(the\s)?(game\s)?([\w\s-]*\w)\s\(private\)\.\s*$/gi;
var regGameNameFrench=/^\s*(la\s)?(partie\s)?([\w\s-]*\w)\s\(priv[^\)]*\)\.\s*$/gi;
if (lines[friend].match(regOfflineEnglish))
{
errors += (errors == '' ? '' : ' ') + 'leader is offline';
if (joinChannelInChat)
Say('Leader is offline, delay 10 sec.');
Delay(10000);
}
if (lines[friend + 1].match(regGameNameEnglish) && lines[friend+1].substr(1, 1) != ':')
{
game = lines[friend + 1].replace(regGameNameEnglish, "$3");
}
if (!game && lines[friend + 1].match(regGameNameFrench) && lines[friend+1].substr(1, 1) != ':')
{
game = lines[friend + 1].replace(regGameNameFrench, "$3");
}
if (game != '')
{
if (joinChannelInChat)
Say('I found him! In the game ' + game);
Delay(1000);
controlData.click(controlData.controls.lobby.button.join);
Delay (500);
}
else
{
if(!errors)
{
errors = 'leader is not in game.';
}
}
}
}
if (!found_leader && joinChannelInChat)
{
if (errors)
Say('Errors : ' + errors);
else
Say('I couldn\'t find the leader in my friend list.');
Delay(1500);
}
}
else
{
if (joinChannelInChat)
Say('I can\'t read the chat!');
Delay(1500);
}
}
break;
case 1: // Lobby
if(location.id == 1 && joinChatAfterGame)
{
Delay(Random(waitBeforeEnterChatMin, waitBeforeEnterChatMax));
controlData.click(controlData.controls.lobby.button.enterChat);
break;
}
if(GetTickCount() > nextGameMake)
{
lastGameFailed = false;
switch(lastGameStatus)
{
case 0:
controlData.click(controlData.controls.lobby.button.create);
nextGameMake = GetTickCount() + createGameTimeout; // set our timeout
sendEventToOOG(D2NT_MGR_PRINT_STATUS, location.name, 0);
break;
case 1: // game failed, rollover to reset timer
inGameAt = GetTickCount(); // reset inGameAt, to wait how long we should have waited..
lastGameFailed = true;
case 2:
outputGameLength();
lastGameStatus = 0;
setNextGameMake();
sendEventToOOG(D2NT_MGR_PRINT_STATUS, location.name, 0);
break;
}
}
else
timeoutDelay(nextGameMake-GetTickCount(), location);
break;
case 2: // Waiting In Line
if(GetTickCount()-lastGameMade > waitInLineTimeout)
controlData.click(controlData.controls.lobby.inLine.button.cancel);
break;
case 4: // Create Game
if(!controlData.get(controlData.controls.lobby.create.editBox.gameName))
{
controlData.click(controlData.controls.lobby.button.join);
Delay (500);
controlData.click(controlData.controls.lobby.button.create);
Delay (500);
}
sendEventToOOG(D2NT_MGR_CREATE_GAME, location.name, 0);
RunGC(); // run garbage collector between each game
locationTimeout(5000, location);
lastGameMade = GetTickCount();
lastGameStatus = 1; // pending creation
break;
case 5: // Join Game
if(!controlData.get(controlData.controls.lobby.join.editBox.gameName))
{
controlData.click(controlData.controls.lobby.button.create);
Delay (1000);
controlData.click(controlData.controls.lobby.button.join);
Delay (1000);
}
if (game != '')
{
controlData.setText( controlData.controls.lobby.join.editBox.gameName, game);
Delay (500);
controlData.setText( controlData.controls.lobby.join.editBox.password, gamepassword);
Delay (500);
controlData.click(controlData.controls.lobby.join.button.joinGame);
RunGC(); // run garbage collector between each game
locationTimeout(5000, location);
lastGameStatus = 1; // pending join
}
break;
case 6: // Ladder
break;
case 7: // Channel List
break;
case 8: // Main Menu
if(controlData.getCurrentRealmIndex() == me.gatewayid)
{
outputGameLength();
controlData.click(controlData.gameTypes[me.playtype]);
}
else
controlData.click(controlData.controls.mainMenu.button.gateway);
break;
case 9: // Login
sendEventToOOG(D2NT_MGR_PRINT_STATUS, location.name, 0);
Delay(loginDelay);
controlData.setText(controlData.controls.login.editBox.accountName, me.account);
sendEventToOOG(D2NT_MGR_LOGIN, location.name, 0);
locationTimeout(5000, location);
break;
case 10: // Login Error (this is a fatal error, so stop)
sendEventToOOG(D2NT_MGR_RESTART, location.name, 10);
Delay(3500);
break;
case 11: // Unable To Connect
timeoutDelay(unableToConnectRetry*60*1000, location)
controlData.click(controlData.controls.login.unableToConnect.button.ok);
break;
case 12: // Character Select
var _time, _control;
sendEventToOOG(D2NT_MGR_PRINT_STATUS, location.name, 0);
for(_time = 0 ; _time < characterScreenTimeout ; _time += 500)
{
_control = controlData.get(controlData.controls.characterSelect.textBox.characterInfo[me.charloc]);
if(_control && _control.GetText() != undefined)
break;
Delay(500);
}
if(_time < characterScreenTimeout)
{
Delay(characterSelectDelay);
controlData.click(controlData.controls.characterSelect.textBox.characters[me.charloc], 0, 0, 1);
controlData.click(controlData.controls.characterSelect.textBox.characterInfo[me.charloc], 0, 0, 1);
// reset last game made, so it doesnt make a game immediately
inGameAt = 0;
setNextGameMake();
}
else
{
controlData.click(controlData.controls.characterSelect.button.exit);
timeoutDelay(realmDownRetry*60*1000, location);
}
break;
case 13: // Realm Down - Character Select screen
controlData.click(controlData.controls.characterSelect.button.exit);
timeoutDelay(realmDownRetry*60*1000, location);
break;
case 14: // Character Select - Disconnected
timeoutDelay(disconnectedRetry*60*1000, location);
controlData.click(controlData.controls.characterSelect.disconnected.button.ok);
break;
case 15: // New Character
break;
case 16: // Character Select - Please Wait popup
if(!locationTimeout(pleaseWaitTimeout, location))
controlData.click(controlData.controls.characterSelect.pleaseWait.button.cancel);
break;
case 17: // Lobby - Lost Connection - just click okay, since we're toast anyway
controlData.click(controlData.controls.lobby.lostConnection.button.ok);
break;
case 18: // D2 Splash
controlData.click(controlData.controls.d2Splash.textBox.copyright);
break;
case 19: // Login - Cdkey In Use
timeoutDelay(cdkeyInUseRetry*60*1000, location);
controlData.click(controlData.controls.login.cdkeyInUse.button.ok);
break;
case 20: // Single Player - Select Difficulty
RunGC(); // run garbage collector between each game
controlData.click(controlData.singlePlayerDifficulties[me.diff]);
break;
case 21: // Main Menu - Connecting
if(!locationTimeout(connectingToBnetTimeout, location))
controlData.click(controlData.controls.mainMenu.connecting.button.cancel);
break;
case 22: // Login - Invalid Cdkey (classic or xpac)
sendEventToOOG(D2NT_MGR_RESTART, location.name, 3600);
Delay(3500);
break;
case 23: // Character Select - Connecting
if(!locationTimeout(characterScreenTimeout, location))
controlData.click(controlData.controls.characterSelect.button.exit);
break;
case 24: // Server Down - not much to do but wait..
break;
case 25: // Lobby - Please Wait
if(!locationTimeout(pleaseWaitTimeout, location))
controlData.click(controlData.controls.lobby.pleaseWait.button.cancel);
break;
case 26: // Lobby - Game Name Exists
sendEventToOOG(D2NT_MGR_PRINT_LOG, "Game already exists", 0);
inGameAt = 0;
lastGameStatus = 0;
setNextGameMake();
locationTimeout(15000, location);
break;
case 27: // Gateway Select
controlData.clickRealmEntry(me.gatewayid);
controlData.click(controlData.controls.gateway.button.ok);
break;
case 28: // Lobby - Game Does Not Exist
inGameAt = Random(gameDoesNotExistDelayMin, gameDoesNotExistDelayMax);
lastGameStatus = 0;
setNextGameMake();
locationTimeout(gameDoesNotExistTimeout, location);
break;
}
}
function sendEventToOOG(locationId, statusString, pendingTime)
{
return SendCopyData("D2NT Manager", null, (locationId<<16)|pendingTime, statusString);
}
function setNextGameMake()
{
lastGameMade = GetTickCount();
nextGameMake = lastGameMade + createGameThreshold + Random(0-createGameThresholdRandom, createGameThresholdRandom) + inGameAt;
inGameAt = 0;
chatActionsDone = false;
}
function outputGameLength()
{
if(inGameAt)
{
duration = GetTickCount() - inGameAt;
inGameAt = (duration < gameMinLength ? gameMinLength - duration : 0);
}
}
function locationTimeout(time, location)
{
endtime = GetTickCount() + time;
while(controlData.getLocation().id == location.id && endtime > GetTickCount())
{
sendEventToOOG(D2NT_MGR_PRINT_STATUS, location.name + " (" + parseInt((endtime-GetTickCount())/1000) + "s)", 0);
Delay(500);
}
return (controlData.getLocation().id != location.id);
}
function timeoutDelay(time, location)
{
endtime = GetTickCount() + time;
while(endtime > GetTickCount())
{
sendEventToOOG(D2NT_MGR_PRINT_STATUS, location.name + " (" + parseInt((endtime-GetTickCount())/1000) + "s)", 0);
Delay(1000);
}
}
function getRandomString(_length)
{
_retString = "";
_charSet = "0123456789abcdefghijklmnopqrstuvwxyz";
while(_length--)
{
_retString += _charSet.charAt(Random(0, _charSet.length-1));
Delay(1);
}
return _retString;
}
Erstellt dann scripts/libs/joinBotSettings.ntl und fügt folgendes ein:
Code:
// Leader Account settings
var JoinFromChat = true;
var leaderAccountName = "YourLeaderAccountName";
var leaderName = "YourLeaderName";
var gamepassword = "YourGamepassword" // up to you
function findLead(leader)
{
_player = GetPlayerUnit();
if(_player)
{
do
{
if(_player.name == leader)
{
return _player;
}
} while(_player.GetNext());
}
return false;
}
function getLeaderAreaId(leader)
{
_player = GetPlayerUnit();
if(_player)
{
do
{
Delay(500);
if(_player.name == leader && _player.areaid != 0)
{
return _player.areaid;
}
} while(_player.GetNext());
}
return false;
}
In script/libs/common/NTMove.ntl ändert ihr dann die Funktion NTM_FindPortalAreaInt in
Code:
function NTM_FindPortalAreaInt(dest)
{
var _portal = NTC_GetUnit(NTC_UNIT_OBJECT, GetLocaleString(3226));
if(_portal)
{
do
{
if(_portal.mode == 2 && _portal.subarea == dest)
{
if(_portal.GetParent())
{
// if(NTC_CheckOwner(_portal) || NTC_InMyParty(_portal.GetParent()))
if (NTC_CheckOwner(_portal) || JoinFromChat)
return _portal;
}
else
return _portal;
}
} while(_portal.GetNext());
}
return -1;
}
in der scripts/libs/common/NTCommon.ntl ersetzt ihr die Funktion NTC_IncludeLibs() mit Folgendem:
Code:
function NTC_IncludeLibs()
{
Include("joinBotSettings.ntl");
Include("common/NTSnagIt.ntl");
Include("common/NTAttack.ntl");
Include("common/NTCubing.ntl");
Include("common/NTMove.ntl");
Include("common/NTPrecast.ntl");
Include("common/NTTown.ntl");
Include("common/NTTownManager.ntl");
Include("common/NTTownMove.ntl");
}
scripts/NTBotGame.ntl :
Code:
var CurScriptIndex = 0;
var LastScript = false;
var CloneDiabloString;
var CloneDiabloNotify = false;
Include("joinBotSettings.ntl");
function NTMain()
{
Delay(1000);
//Print("ÿc4[+] NTBot 3.7.4 [+]");
Include("common/NTCommon.ntl");
NTC_IncludeConfig();
NTC_IncludeLibs();
NT_LoadConfig();
NTSI_LoadNIPFiles();
if(NTConfig_StartDelay > 0);
NTC_Delay(NTConfig_StartDelay);
SetUIState(0x0C, true);
NTT_GetCorpses();
if(NTConfig_Script.length > 0)
{
NTCU_CheckCubing();
NTT_ClearInventory();
NTT_ClearBelt();
Load("tools/NTToolsThread.ntj");
if(NTConfig_CheckCloneDiablo)
{
CloneDiabloString = GetLocaleString(11005);
RegisterEvent(EVENT_GAMEMSG, NT_GameMsgEvents);
}
RegisterEvent(EVENT_KEYDOWN, NT_KeyEvents);
RegisterEvent(EVENT_SCRIPTMSG, NT_ScriptMsgEvents);
Load("bots/" + NTConfig_Script[CurScriptIndex]);
SetStatusText("Running " + NTConfig_Script[CurScriptIndex]);
while(!LastScript || CloneDiabloNotify)
{
if (!findLead(leaderName) && JoinFromChat)
{
ExitGame();
}
// RegisterEvent(EVENT_GAMEMSG, chatHandler);
NTC_Delay(500);
}
}
ExitGame();
}
function chatHandler(msg, type)
{
Say(type+" said :"+msg);
}
function NT_GameMsgEvents(msg, type)
{
if(type == 4 && msg.indexOf(CloneDiabloString) != -1)
{
var _script;
CloneDiabloNotify = true;
NTC_SendLogToOOG(CloneDiabloString);
SetStatusText(CloneDiabloString);
_script = NTC_FindScript(NTConfig_Script[CurScriptIndex]);
if(_script && _script.running)
{
_script.Stop();
NTC_Delay(1000);
}
NTTM_CheckAct();
}
}
function NT_KeyEvents(keycode)
{
var _script;
switch(keycode)
{
case 19:
_script = NTC_FindScript(NTConfig_Script[CurScriptIndex]);
if(_script)
{
if(_script.running)
{
_script.Stop();
SetStatusText("Stopped " + NTConfig_Script[CurScriptIndex]);
}
else
{
Load("bots/" + NTConfig_Script[CurScriptIndex]);
SetStatusText("Running " + NTConfig_Script[CurScriptIndex]);
}
}
break;
}
}
function NT_ScriptMsgEvents(msg)
{
var _area;
switch(msg)
{
case "SCRIPT_END":
if(++CurScriptIndex < NTConfig_Script.length)
{
NTTM_CheckAct();
Load("bots/" + NTConfig_Script[CurScriptIndex]);
SetStatusText("Running " + NTConfig_Script[CurScriptIndex]);
}
else
LastScript = true;
break;
default:
Print("ÿc1" + NTConfig_Script[CurScriptIndex] + " : " + msg + " failed");
_area = GetArea();
if(_area)
NTC_SendLogToOOG(NTConfig_Script[CurScriptIndex] + " : " + msg + " failed (" + _area.name + ")");
else
NTC_SendLogToOOG(NTConfig_Script[CurScriptIndex] + " : " + msg + " failed");
if(++CurScriptIndex < NTConfig_Script.length)
{
NTTM_CheckAct();
Load("bots/" + NTConfig_Script[CurScriptIndex]);
SetStatusText("Running " + NTConfig_Script[CurScriptIndex]);
}
else
LastScript = true;
break;
}
}
scripts/bots/NTBaal.ntj :
Code:
function NTMain()
{
Include("common/NTCommon.ntl");
NTC_IncludeConfig();
NTC_IncludeLibs();
var i;
var _wave;
var _starttick;
NT_LoadConfig();
NTSI_LoadNIPFiles();
NTA_Initialize();
if(!NTTM_CheckAct())
{
NTC_SendMsgToScript("NTBotGame.ntj", "NTTM_CheckAct()");
return;
}
NTTMGR_TownManager();
if(!JoinFromChat)
{
if(!NTTM_TownMove("waypoint"))
{
NTC_SendMsgToScript("NTBotGame.ntj", "NTTM_TownMove()");
return;
}
if(!NTM_TakeWaypoint(129))
{
NTC_SendMsgToScript("NTBotGame.ntj", "NTM_TakeWaypoint()");
return;
}
NTP_DoPrecast();
if(!NTM_MoveToObject(me.areaid, NTC_UNIT_TILE, 82, 83))
{
NTC_SendMsgToScript("NTBotGame.ntj", "NTM_MoveToObject()");
return;
}
if(!NTM_TakeStairs(82, 83))
{
NTC_SendMsgToScript("NTBotGame.ntj", "NTM_TakeStairs()");
return;
}
if(!NTM_MoveToObject(me.areaid, NTC_UNIT_TILE, 82, 83))
{
NTC_SendMsgToScript("NTBotGame.ntj", "NTM_MoveToObject()");
return;
}
if(!NTM_TakeStairs(82, 83))
{
NTC_SendMsgToScript("NTBotGame.ntj", "NTM_TakeStairs()");
return;
}
if(!NTM_MoveTo(me.areaid, 15112, 5068))
{
NTC_SendMsgToScript("NTBotGame.ntj", "NTM_MoveTo()");
return;
}
if(NTConfig_PublicMode)
{
NTM_MoveTo(me.areaid, 15116, 5068);
// Say("TP is not safe, Be careful!");
NTM_MakeTP();
NTA_ClearPosition();
}
}
else
{
//delay until partied with leader
do
{
Delay (100);
} while (!NTC_InMyParty(leaderName));
var leader_area = 0;
do
{
leader_area = getLeaderAreaId(leaderName);
if (leader_area == 108)
{
// Say('Leader is going to Diablo!');
NTC_SendMsgToScript("NTBotGame.ntj", "Leader is not at act 5 : ");
return;
}
} while (leader_area != 131 && leader_area != 132)
if(!NTTM_CheckAct(5))
{
NTC_SendMsgToScript("NTBotGame.ntj", "NTTM_CheckAct()");
return;
}
if(!NTTM_TownMove("portalspot"))
{
NTC_SendMsgToScript("NTBotGame.ntj", "NTTM_TownMove()");
return;
}
NTP_DoPrecast();
Delay(500);
while(me.areaid == 109) {
if (!NTM_UsePortal("BluePortal", 131, leaderName))
NTM_UsePortal("BluePortal", 132, leaderName);
Delay (1000);
}
NTA_ClearPosition();
}
NT_ClearThroneInt();
// Say("Throne is safe, All Come");
while(1)
{
if(me.classid == NTC_CHAR_CLASS_PALADIN || me.classid == NTC_CHAR_CLASS_BARBARIAN)
NTM_MoveTo(me.areaid, 15092, 5028);
else
NTM_MoveTo(me.areaid, 15092, 5040);
if(me.GetState(2))
NTC_PutSkill(109, NTC_HAND_RIGHT);
for(i = 0 ; i < 6 ; i++)
{
_wave = NT_ThroneCheckInt();
if(_wave > 0)
break;
NTC_Delay(500);
}
_starttick = GetTickCount();
while(_wave == 0)
{
if(!NT_ThronePreAttackInt())
NTC_Delay(200);
if(GetTickCount()-_starttick > 15000)
{
NT_ClearThroneInt();
_starttick = GetTickCount();
}
_wave = NT_ThroneCheckInt();
}
NTA_ClearPosition(40, 0x04);
NTA_ClearPosition(40);
NTSI_PickItems();
NTT_CleanPotions();
if(_wave == 1)
{
NTM_MoveTo(me.areaid, 15092, 5028);
//NTP_DoPrecast();
NTC_PutSkill(109, NTC_HAND_RIGHT);
}
else if(_wave == 2 || _wave == 4)
{
NTM_MoveTo(me.areaid, 15092, 5028);
NTC_PutSkill(109, NTC_HAND_RIGHT);
NTC_Delay(1000);
}
else if(_wave == 3)
NT_CheckHydraInt();
else if(_wave == 5)
break;
}
if(NTConfig_KillBaal)
{
var _portal;
// if(NTConfig_PublicMode)
// Say("Killing Baal. Sorc Please Use Static");
if(NTConfig_CheckSafe)
{
if(!NTTMGR_CheckSafe(3))
{
NTC_SendMsgToScript("NTBotGame.ntj", "NTTMGR_CheckSafe()");
return;
}
}
NTM_MoveTo(me.areaid, 15092, 5010);
//NTP_DoPrecast();
while(NTC_FindMonster(543))
NTC_Delay(500);
_portal = NTC_GetUnit(NTC_UNIT_OBJECT, 563);
if(!_portal)
{
NTC_SendMsgToScript("NTBotGame.ntj", "NTC_GetUnit()");
return;
}
if(!NTM_UsePortal("Portal", 132, null, _portal))
{
NTC_SendMsgToScript("NTBotGame.ntj", "NTM_UsePortal()");
return;
}
NTM_MoveTo(me.areaid, 15138, 5916);
var _staticlevel = NTC_CheckSkill(42);
target = NTC_FindMonster(544);
if(target)
{
if(_staticlevel > 0 && NTA_GetResistance(target, NTA_DAMAGE_LIGHTNING) < 100)
{
var _cast = 0;
var _staticrange = Math.floor((5+_staticlevel-1)*2/3);
while(_cast++ < 10 && NTA_IsValidTarget(target, true) && parseInt(target.hp*100/target.hpmax) > 58 && (true || CheckCollision(me, target, 2)))
{
NTA_MoveCloseInt(target, _staticrange);
if(!NTC_DoCast(42, NTC_HAND_RIGHT, target))
{
if(!true)
break;
}
}
}
}
if(!NTA_KillBoss(544))
{
NTC_SendMsgToScript("NTBotGame.ntj", "NTA_KillBoss()");
return;
}
NTSI_PickItems();
}
if(NTConfig_PublicMode)
{
// Say("Diablo Now");
NTC_Delay(1500);
}
NTC_SendMsgToScript("NTBotGame.ntj", "SCRIPT_END");
}
// Internal function
function NT_ClearThroneInt()
{
var _attackpos = [15112, 5068, 15075, 5065, 15114, 5045, 15114, 5012, 15095, 5024, 15078, 5013, 15092, 5040];
for(var i = 0 ; i < _attackpos.length ; i += 2)
{
NTM_MoveTo(me.areaid, _attackpos[i], _attackpos[i+1]);
NTA_ClearPosition(25, 0x04);
NTA_ClearPosition(25);
NTSI_PickItems();
}
NTT_CleanPotions();
}
function NT_ThroneCheckInt()
{
var _monster;
if(!NTC_FindMonster(543))
return 5;
_monster = NTC_GetUnit(NTC_UNIT_MONSTER);
if(_monster)
{
do
{
if(NTA_IsValidTarget(_monster))
{
if(_monster.classid == 23 || _monster.classid == 62)
return 1;
if(_monster.classid == 105 || _monster.classid == 381)
return 2;
if(_monster.classid == 557)
return 3;
if(_monster.classid == 558)
return 4;
if(_monster.classid == 571)
return 5;
}
} while(_monster.GetNext());
}
return 0;
}
function NT_ThronePreAttackInt()
{
if(me.classid == NTC_CHAR_CLASS_SORCERESS)
{
if(NTConfig_AttackSkill[2] == 56 || NTConfig_AttackSkill[2] == 59)
return NTC_DoCast(NTConfig_AttackSkill[2], 2, 15092, 5028);
}
else if(me.classid == NTC_CHAR_CLASS_PALADIN)
{
if(NTConfig_AttackSkill[2] == 112)
{
if(NTConfig_PutAura > 0)
NTC_PutSkill(NTConfig_PutAura, NTC_HAND_RIGHT);
return NTC_DoCast(NTConfig_AttackSkill[2], 2);
}
}
return false;
}
function NT_CheckHydraInt()
{
var _hydra1, _hydra2, _hydra3;
_hydra1 = NTC_GetUnit(NTC_UNIT_MONSTER, 351);
_hydra2 = NTC_GetUnit(NTC_UNIT_MONSTER, 352);
_hydra3 = NTC_GetUnit(NTC_UNIT_MONSTER, 353);
if((_hydra1 && _hydra1.GetStat(172) != 2 && _hydra1.GetState(105))
|| (_hydra2 && _hydra2.GetStat(172) != 2 && _hydra2.GetState(105))
|| (_hydra3 && _hydra3.GetStat(172) != 2 && _hydra3.GetState(105)))
{
NTM_MoveTo(me.areaid, 15112, 5004);
if(me.GetState(2))
NTC_PutSkill(109, NTC_HAND_RIGHT);
NTC_Delay(3000);
}
}
scripts/bots/NTDiablo.ntj :
Code:
function NTMain()
{
Include("common/NTCommon.ntl");
NTC_IncludeConfig();
NTC_IncludeLibs();
NT_LoadConfig();
NTSI_LoadNIPFiles();
NTA_Initialize();
if(!NTTM_CheckAct())
{
NTC_SendMsgToScript("NTBotGame.ntj", "NTTM_CheckAct()");
return;
}
NTTMGR_TownManager();
var _attackpos = [
7790, 5525, // 1
7795, 5485, // 2
7775, 5495, // 3
7768, 5475, // 4
7768, 5445, // 5
7770, 5428, // 6
7790, 5425, // 7
7805, 5425, // 8 problem here
7768, 5405, // 9
7768, 5385, // 10
7790, 5350, // 11
7770, 5325, // 12
7780, 5310, // 13
7765, 5310, // 13
7780, 5310, // 13
];
if(!JoinFromChat)
{
if(!NTTM_TownMove("waypoint"))
{
NTC_SendMsgToScript("NTBotGame.ntj", "NTTM_TownMove()");
return;
}
if(!NTM_TakeWaypoint(107))
{
NTC_SendMsgToScript("NTBotGame.ntj", "NTM_TakeWaypoint()");
return;
}
NTP_DoPrecast();
if(!NTM_MoveTo(108, 7797, 5560))
{
NTC_SendMsgToScript("NTBotGame.ntj", "NTM_MoveTo()");
return;
}
NTC_PingDelay(500);
if(NTConfig_PublicMode)
{
if(!NTM_MoveTo(me.areaid, 7790, 5544))
{
NTC_SendMsgToScript("NTBotGame.ntj", "NTM_MoveTo()");
return;
}
NTA_ClearPosition();
NTA_ClearPosition(20, 0x04);
NTSI_PickItems();
NTM_MoveTo(me.areaid, 7790, 5560);
NTC_PingDelay(100);
if(NTA_ClearPosition())
NTSI_PickItems();
NTM_MoveTo(me.areaid, 7790, 5544);
NTA_ClearPosition();
NTA_ClearPosition();
NTM_MoveTo(me.areaid, 7790, 5540);
NTA_ClearPosition();
NTA_ClearPosition();
NTM_MoveTo(me.areaid, 7790, 5540);
NTA_ClearPosition();
NTA_ClearPosition();
NTM_MoveTo(me.areaid, 7790, 5544);
NTA_ClearPosition();
NTM_MakeTP();
}
}
else
{
//delay until partied with leader
do
{
Delay (100);
} while (!NTC_InMyParty(leaderName));
var leader_area = 0;
do
{
leader_area = getLeaderAreaId(leaderName);
} while (leader_area != 108)
if(!NTTM_CheckAct(4))
{
NTC_SendMsgToScript("NTBotGame.ntj", "NTTM_CheckAct()");
return;
}
if(!NTTM_TownMove("portalspot"))
{
NTC_SendMsgToScript("NTBotGame.ntj", "NTTM_TownMove()");
return;
}
NTP_DoPrecast();
Delay(500);
while(me.areaid == NTC_AREA_ID_ACT_4) {
NTM_UsePortal("BluePortal", 108, leaderName);
Delay (1000);
}
}
if(NTConfig_PublicMode)
{
// Say("TP is safe... Wait for Booo !!!");
NTA_ClearPosition();
NTC_PutSkill(124, NTC_HAND_RIGHT);
NTC_PingDelay(500);
NTA_ClearPosition();
NTP_DoPrecast();
if(NTA_ClearPosition())
NTSI_PickItems();
if (me.y > 5400) {
for(var i = 0 ; i < _attackpos.length ; i += 2)
{
NTM_MoveTo(me.areaid, _attackpos[i], _attackpos[i+1]);
NTA_ClearPosition(10);
NTA_ClearPosition(25, 0x04);
NTSI_PickItems();
if (i>1)
{
NTM_MoveTo(me.areaid, _attackpos[i], _attackpos[i+1]);
NTA_ClearPosition();
NTM_MoveTo(me.areaid, _attackpos[i], _attackpos[i+1]);
}
}
NTA_ClearPosition();
NTT_CleanPotions();
NTM_MoveTo(me.areaid, _attackpos[i], _attackpos[i+1]);
NTA_ClearPosition();
NTM_MoveTo(me.areaid, _attackpos[i], _attackpos[i+1]);
NTM_MakeTP();
NTC_PingDelay(500);
NTA_ClearPosition();
NTM_MoveTo(me.areaid, _attackpos[i], _attackpos[i+1]);
// Say("Booo here in 2 seconds!!!");
NTC_PutSkill(124, NTC_HAND_RIGHT);
NTC_PingDelay(2000);
}
NTA_ClearPosition();
NTP_DoPrecast();
}
if(!NT_OpenSealsInt())
{
if (!JoinFromChat)
{
NTC_SendMsgToScript("NTBotGame.ntj", "NT_OpenSealsInt()");
return;
}
}
if(!NTM_MoveTo(me.areaid, 7792, 5292))
{
NTC_SendMsgToScript("NTBotGame.ntj", "NTM_MoveTo()");
return;
}
NTC_PutSkill(109, NTC_HAND_RIGHT);
while(!NTC_FindMonster(243))
NTC_Delay(200);
var _staticlevel = NTC_CheckSkill(42);
target = NTC_FindMonster(243);
if(target)
{
if(_staticlevel > 0 && NTA_GetResistance(target, NTA_DAMAGE_LIGHTNING) < 100)
{
var _cast = 0;
var _staticrange = Math.floor((5+_staticlevel-1)*2/3);
while(_cast++ < 10 && NTA_IsValidTarget(target, true) && parseInt(target.hp*100/target.hpmax) > 58 && (true || CheckCollision(me, target, 2)))
{
NTA_MoveCloseInt(target, _staticrange);
if(!NTC_DoCast(42, NTC_HAND_RIGHT, target))
{
if(!true)
break;
}
}
}
}
if(!NTA_KillBoss(243))
{
if (!JoinFromChat)
{
NTC_SendMsgToScript("NTBotGame.ntj", "NTA_KillBoss()");
return;
}
}
NTSI_PickItems();
if(NTConfig_PublicMode)
// Say("Next Game");
NTC_PingDelay(1000);
NTC_SendMsgToScript("NTBotGame.ntj", "SCRIPT_END");
}
// Internal function
function NT_OpenSealsInt()
{
var _unit;
var _result;
_unit = GetPresetUnits(me.areaid, NTC_UNIT_OBJECT, 396);
if(!_unit)
return false;
if(_unit[0].roomy*5 + _unit[0].y == 5275)
_result = NT_OpenVizierSealInt(1);
else
_result = NT_OpenVizierSealInt(2);
if(!JoinFromChat && !_result)
return false;
NTA_ClearPosition();
NTT_CleanPotions();
NTA_ClearPosition();
NTC_PutSkill(124, NTC_HAND_RIGHT);
// Say("Booo here in 2 seconds!!!");
NTC_PingDelay(100);
// Say("AND REMEMBER : DONT OPEN SEALS");
NTC_PingDelay(2000);
NTP_DoPrecast();
NTA_ClearPosition();
_unit = GetPresetUnits(me.areaid, NTC_UNIT_OBJECT, 394);
if(!_unit)
return false;
if(_unit[0].roomx*5 + _unit[0].x == 7773)
_result = NT_OpenDeSeisSealInt(1);
else
_result = NT_OpenDeSeisSealInt(2);
if (!JoinFromChat && !_result)
return false;
NTA_ClearPosition();
NTT_CleanPotions();
if(NTConfig_CheckSafe)
{
if(!NTTMGR_CheckSafe(3))
{
NTC_SendMsgToScript("NTBotGame.ntj", "NTTMGR_CheckSafe()");
return;
}
}
NTA_ClearPosition();
NTC_PutSkill(124, NTC_HAND_RIGHT);
// Say("Booo here in 2 seconds!!!");
NTC_PingDelay(100);
// Say("AND REMEMBER : DONT OPEN SEALS");
NTC_PingDelay(2000);
NTP_DoPrecast();
NTA_ClearPosition();
_unit = GetPresetUnits(me.areaid, NTC_UNIT_OBJECT, 392);
if(!JoinFromChat && !_unit)
return false;
if(_unit[0].roomx*5 + _unit[0].x == 7893)
_result = NT_OpenVenomSealInt(1);
else
_result = NT_OpenVenomSealInt(2);
return _result;
}
function NT_OpenVizierSealInt(type)
{
var i, n;
var _attackpos = [
7755, 5300, // Vizier1
7755, 5275, // Vizier2
7755, 5300, // Vizier1
7725, 5285, // Vizier3
7725, 5315, // Visier4
7715, 5295
];
var _monstername = GetLocaleString(2851);
for(i = 0 ; i < _attackpos.length ; i += 2)
{
NTM_MoveTo(me.areaid, _attackpos[i], _attackpos[i+1]);
NTA_ClearPosition(10);
NTA_ClearPosition(25, 0x04);
NTSI_PickItems();
}
for(i = 0 ; i < JoinFromChat ? 1 : 3 ; i++)
{
if(type == 1)
{
NTM_MoveTo(me.areaid, 7700, 5295);
NTA_ClearPosition(10);
NTA_ClearPosition(25, 0x04);
NTSI_PickItems();
NTM_MoveTo(me.areaid, 7675, 5295);
NTA_ClearPosition(10);
NTA_ClearPosition(25, 0x04);
NTSI_PickItems();
NTM_MoveTo(me.areaid, 7660, 5315);
NTA_ClearPosition(10);
NTA_ClearPosition(25, 0x04);
NTSI_PickItems();
if(!JoinFromChat)
NT_OpenSealInt(395, 7654, 5310);
NTSI_PickItems();
if(!JoinFromChat)
NT_OpenSealInt(396, 7659, 5277);
NTA_ClearPosition(10);
NTA_ClearPosition(25, 0x04);
NTSI_PickItems();
NTM_MoveTo(me.areaid, 7680, 5295);
}
else
{
NTM_MoveTo(me.areaid, 7690, 5315);
NTA_ClearPosition(10);
NTA_ClearPosition(25, 0x04);
NTSI_PickItems();
NTM_MoveTo(me.areaid, 7665, 5315);
NTA_ClearPosition(10);
NTA_ClearPosition(25, 0x04);
NTSI_PickItems();
NTM_MoveTo(me.areaid, 7655, 5300);
NTA_ClearPosition(10);
NTA_ClearPosition(25, 0x04);
NTSI_PickItems();
if(!JoinFromChat)
NT_OpenSealInt(395, 7650, 5270);
NTA_ClearPosition(10);
NTA_ClearPosition(25, 0x04);
NTSI_PickItems();
if(!JoinFromChat)
NT_OpenSealInt(396, 7655, 5311);
NTA_ClearPosition(10);
NTA_ClearPosition(25, 0x04);
NTSI_PickItems();
NTM_MoveTo(me.areaid, 7675, 5315);
}
for(n = 0 ; n < JoinFromChat ? 1 : 10 ; n++)
{
NTC_Delay(1000);
NTA_ClearPosition(10);
if(NTA_KillBoss(_monstername))
{
NTA_ClearPosition();
NTSI_PickItems();
return NTM_MoveTo(me.areaid, 7750, 5290);
}
}
}
return false;
}
function NT_OpenDeSeisSealInt(type)
{
var i, n;
var _attackpos = [
7780, 5265,
7795, 5250,
7780, 5240,
7805, 5240,
7800, 5255,
7780, 5240,
];
var _monstername = GetLocaleString(2852);
for(i = 0 ; i < _attackpos.length ; i += 2)
{
NTM_MoveTo(me.areaid, _attackpos[i], _attackpos[i+1]);
NTA_ClearPosition(10);
NTA_ClearPosition(25, 0x04);
NTSI_PickItems();
}
for(i = 0 ; i < JoinFromChat ? 1 : 3 ; i++)
{
if(type == 1)
{
NTM_MoveTo(me.areaid, 7775, 5225);
NTA_ClearPosition(10);
NTA_ClearPosition(25, 0x04);
NTSI_PickItems();
NTM_MoveTo(me.areaid, 7755, 5200);
NTA_ClearPosition(10);
NTA_ClearPosition(25, 0x04);
NTSI_PickItems();
NTM_MoveTo(me.areaid, 7800, 5195);
NTA_ClearPosition(10);
NTA_ClearPosition(25, 0x04);
NTSI_PickItems();
NTM_MoveTo(me.areaid, 7815, 5180);
NTA_ClearPosition(10);
NTA_ClearPosition(25, 0x04);
NTSI_PickItems();
NTM_MoveTo(me.areaid, 7800, 5155);
NTA_ClearPosition(10);
NTA_ClearPosition(25, 0x04);
NTSI_PickItems();
if(!JoinFromChat)
NT_OpenSealInt(394, 7769, 5158);
NTA_ClearPosition(10);
NTA_ClearPosition(25, 0x04);
NTSI_PickItems();
NTM_MoveTo(me.areaid, 7775, 5200);
NTA_ClearPosition(10);
NTA_ClearPosition(25, 0x04);
NTSI_PickItems();
NTM_MoveTo(me.areaid, 7771, 5196);
}
else
{
NTM_MoveTo(me.areaid, 7815, 5200);
NTA_ClearPosition(10);
NTA_ClearPosition(25, 0x04);
NTSI_PickItems();
NTM_MoveTo(me.areaid, 7800, 5195);
NTA_ClearPosition(10);
NTA_ClearPosition(25, 0x04);
NTSI_PickItems();
NTM_MoveTo(me.areaid, 7775, 5190);
NTA_ClearPosition(10);
NTA_ClearPosition(25, 0x04);
NTSI_PickItems();
NTM_MoveTo(me.areaid, 7775, 5165);
NTA_ClearPosition(10);
NTA_ClearPosition(25, 0x04);
NTSI_PickItems();
NTM_MoveTo(me.areaid, 7790, 5155);
NTA_ClearPosition(10);
NTA_ClearPosition(25, 0x04);
NTSI_PickItems();
NTM_MoveTo(me.areaid, 7810, 5155);
NTA_ClearPosition(10);
NTA_ClearPosition(25, 0x04);
NTSI_PickItems();
if(!JoinFromChat)
NT_OpenSealInt(394, 7810, 5156);
NTA_ClearPosition(10);
NTA_ClearPosition(25, 0x04);
NTSI_PickItems();
NTM_MoveTo(me.areaid, 7775, 5170);
}
for(n = 0 ; n < JoinFromChat ? 1 : 10 ; n++)
{
NTC_Delay(1000);
NTA_ClearPosition(10);
if(NTA_KillBoss(_monstername))
{
NTA_ClearPosition(30);
NTSI_PickItems();
return NTM_MoveTo(me.areaid, 7800, 5235);
}
}
}
return false;
}
function NT_OpenVenomSealInt(type)
{
var i, n;
var _attackpos = [
7810, 5275,
7835, 5300,
7855, 5300,
7855, 5280,
];
var _monstername = GetLocaleString(2853);
for(i = 0 ; i < _attackpos.length ; i += 2)
{
NTM_MoveTo(me.areaid, _attackpos[i], _attackpos[i+1]);
NTA_ClearPosition(10);
NTA_ClearPosition(25, 0x04);
NTSI_PickItems();
}
for(i = 0 ; i < JoinFromChat ? 1 : 3 ; i++)
{
if(type == 1)
{
NTM_MoveTo(me.areaid, 7872, 5298);
NTA_ClearPosition(10);
NTA_ClearPosition(25, 0x04);
NTSI_PickItems();
NTM_MoveTo(me.areaid, 7892, 5298);
NTA_ClearPosition(10);
NTA_ClearPosition(25, 0x04);
NTSI_PickItems();
if(!JoinFromChat)
NT_OpenSealInt(393, 7915, 5280);
NTA_ClearPosition(10);
NTA_ClearPosition(25, 0x04);
NTSI_PickItems();
// NTT_CleanPotions();
// if(NTConfig_CheckSafe)
// {
// if(!NTTMGR_CheckSafe(3))
// {
// NTC_SendMsgToScript("NTBotGame.ntj", "NTTMGR_CheckSafe()");
// return;
// }
// }
// NTA_ClearPosition();
// // Say("Booo here in 2 seconds!!!");
// NTC_PingDelay(2000);
// NTP_DoPrecast();
NTA_ClearPosition();
if(!JoinFromChat)
NT_OpenSealInt(392, 7895, 5318);
NTA_ClearPosition(10);
NTA_ClearPosition(25, 0x04);
NTSI_PickItems();
NTM_MoveTo(me.areaid, 7892, 5298);
}
else
{
NTM_MoveTo(me.areaid, 7905, 5290);
NTA_ClearPosition(10);
NTA_ClearPosition(25, 0x04);
NTSI_PickItems();
NTM_MoveTo(me.areaid, 7937, 5305);
NTA_ClearPosition(10);
NTA_ClearPosition(25, 0x04);
NTSI_PickItems();
if(!JoinFromChat)
NT_OpenSealInt(393, 7905, 5277);
NTA_ClearPosition(10);
NTA_ClearPosition(25, 0x04);
NTSI_PickItems();
// NTT_CleanPotions();
// if(NTConfig_CheckSafe)
// {
// if(!NTTMGR_CheckSafe(3))
// {
// NTC_SendMsgToScript("NTBotGame.ntj", "NTTMGR_CheckSafe()");
// return;
// }
// }
// NTA_ClearPosition();
// // Say("Booo here in 2 seconds!!!");
// NTC_PingDelay(2000);
// NTP_DoPrecast();
NTA_ClearPosition();
if(!JoinFromChat)
NT_OpenSealInt(392, 7916, 5310);
NTA_ClearPosition(10);
NTA_ClearPosition(25, 0x04);
NTSI_PickItems();
NTM_MoveTo(me.areaid, 7937, 5305);
}
for(n = 0 ; n < JoinFromChat ? 1 : 10 ; n++)
{
NTC_Delay(1000);
NTA_ClearPosition(10);
if(NTA_KillBoss(_monstername))
{
NTSI_PickItems();
if(NTC_PutSkill(124, NTC_HAND_RIGHT))
NTC_PingDelay(1000);
return true;
}
}
}
return false;
}
function NT_OpenSealInt(classid, x, y)
{
var _seal;
NTM_MoveTo(me.areaid, x, y);
NTA_ClearPosition(10);
NTA_ClearPosition(25, 0x04);
NTSI_PickItems();
_seal = NTC_GetUnit(NTC_UNIT_OBJECT, classid);
if(!_seal)
return false;
if(_seal.mode > 0)
return true;
for(var i = 0 ; i < 4 ; i++)
{
if((i % 2) == 0)
{
if(GetDistance(me, _seal) > 2)
NTM_MoveTo(_seal.areaid, _seal.x+1, _seal.y);
NTC_DoClick(NTC_CLICK_LDOWN, NTC_SHIFT_NONE, _seal);
}
NTC_Delay(500);
if(_seal.mode > 0)
return true;
}
return false;
}
Bekannte Fehler:
"I can't read the chat"
Geht sicher dass ihr in scripts/libs/controlInfo.ntl bei Zeile ~135 Folgendes stehen habt:
Falls die letzte Zeile bei euch fehlt fügt sie ein!
Code:
this.controls.lobby.chat.textBox = new Array(); this.controls.lobby.chat.textBox.channelName = [4,28,138,354,60]; this.controls.lobby.chat.textBox.channelText = [4,28,410,354,298];
Der Follower betritt keine Portale!
Dieses Problem hatte ich, mein Follower ist nur ins TP wenn mein Leader raus ist, also direkt vor Baal. Der Follower hat dann in der Zeit in der der Leader bei Malah war Baal gekillt...
Falls ihr diesen Fehler habt änder eure \scripts\libs\common\NTTown.ntl zu dieser hier:
Code:
var _NTT_BeltColNeeded = new Array(4);
_NTT_BeltColNeeded[0] = 0;
_NTT_BeltColNeeded[1] = 0;
_NTT_BeltColNeeded[2] = 0;
_NTT_BeltColNeeded[3] = 0;
var _NTT_BeltSize = false;
var _NTT_OldItems;
var _NTT_IgnoredItems = new Array(
"aqv", // Arrows quiver
"cqv", // Bolts quiver
"key", // Keys
"tbk", // Tome of Town Portal
"ibk", // Tome of Identify
"tsc", // Scroll of Town Portal
"isc", // Scroll of Identify
"yps", // Antidote potion
"vps", // Stamina potion
"wms", // Thawing potion
"gps", // Rancid Gas Pot
"ops", // Oil Potion
"gpm", // Choking Gas Pot
"opm", // Exploding Pot
"gpl", // Strangling Gas
"opl", // Fulminating Pot
"hp1","hp2","hp3","hp4","hp5", // Healing potions
"mp1","mp2","mp3","mp4","mp5", // Mana potions
"rvs","rvl"); // Rejuvenation potions
// type : 1 = shop, 2 = ressurect, 3 = repair, 4 = potion, 5 = scrolls, 6 = gamble, 7 = ammo, 8 = healing
function NTT_CheckNPC(npc, type)
{
var _npcclassid;
if(typeof(npc) == "number")
_npcclassid = npc;
else
_npcclassid = npc.classid;
if(type == 1)
{
if(_npcclassid == 147 || _npcclassid == 148 || _npcclassid == 154 || _npcclassid == 177 ||
_npcclassid == 178 || _npcclassid == 199 || _npcclassid == 202 || _npcclassid == 252 ||
_npcclassid == 253 || _npcclassid == 254 || _npcclassid == 255 || _npcclassid == 257 ||
_npcclassid == 405 || _npcclassid == 511 || _npcclassid == 512 || _npcclassid == 513)
return true;
else
return false;
}
if(type == 2)
{
if(_npcclassid == 150 || _npcclassid == 198 || _npcclassid == 252 || _npcclassid == 367 || _npcclassid == 515)
return true;
else
return false;
}
if(type == 3)
{
if(_npcclassid == 154 || _npcclassid == 178 || _npcclassid == 253 || _npcclassid == 257 || _npcclassid == 511)
return true;
else
return false;
}
if(type == 4)
{
if(_npcclassid == 148 || _npcclassid == 177 || _npcclassid == 198 || _npcclassid == 202 ||
_npcclassid == 255 || _npcclassid == 405 || _npcclassid == 513)
return true;
else
return false;
}
if(type == 5)
{
if(_npcclassid == 148 || _npcclassid == 177 || _npcclassid == 255 || _npcclassid == 405 || _npcclassid == 513)
return true;
else
return false;
}
if(type == 6)
{
if(_npcclassid == 147 || _npcclassid == 199 || _npcclassid == 254 ||
_npcclassid == 405 || _npcclassid == 512 || _npcclassid == 514)
return true;
else
return false;
}
if(type == 7)
{
if(_npcclassid == 147 || _npcclassid == 154 || _npcclassid == 178 || _npcclassid == 199 || _npcclassid == 252 ||
_npcclassid == 253 || _npcclassid == 257 || _npcclassid == 511 || _npcclassid == 512)
return true;
else
return false;
}
if(type == 8)
{
if(_npcclassid == 148 || _npcclassid == 178 || _npcclassid == 255 || _npcclassid == 513)
return true;
else
return false;
}
return false;
}
// npc : NPC, stash or cube
function NTT_DoInteract(npc)
{
var _uiflag = 0x0A;
if(!npc)
return false;
if(npc.classid == NTC_UNIT_STASH)
_uiflag = 0x1B;
else if(npc.classid == NTC_UNIT_CUBE)
_uiflag = 0x1C;
if(GetUIState(_uiflag))
return true;
for(var i = 0 ; i < 30 ; i++)
{
if((i % 10) == 0)
{
if(npc.classid == NTC_UNIT_CUBE)
me.ClickItem(1, npc);
else
{
if(i > 0)
me.Cancel(0);
NTC_DoClick(NTC_CLICK_LDOWN, NTC_SHIFT_NONE, npc);
}
}
NTC_Delay(200);
if(GetUIState(_uiflag))
{
NTC_PingDelay(500);
return true;
}
}
return false;
}
// type : 0 = shop, 1 = gamble
function NTT_DoTrade(npc, type)
{
if(!npc)
return false;
if(GetUIState(0x0E))
return true;
if(arguments.length < 2)
type = 0;
for(var i = 0 ; i < 20 ; i++)
{
if((i % 10) == 0)
{
if(NTT_CheckNPC(npc.classid, 3))
me.SelectNPCMenu(0x0D06);
else if(type == 1 && NTT_CheckNPC(npc.classid, 6))
me.SelectNPCMenu(0x0D46);
else
me.SelectNPCMenu(0x0D44);
}
NTC_Delay(200);
if(GetUIState(0x0E))
{
NTC_PingDelay(1000);
return true;
}
}
return false;
}
function NTT_GetCorpses()
{
var _corpse;
for(var i = 0 ; i < 4 ; i++)
{
_corpse = NTC_GetUnit(NTC_UNIT_PLAYER);
do
{
if(_corpse.name == me.name && _corpse.hpmax == 0)
{
NTC_SwapWeapons(0);
NTC_DoClick(NTC_CLICK_LDOWN, NTC_SHIFT_NONE, _corpse);
NTC_PingDelay(1000);
break;
}
} while(_corpse.GetNext());
}
}
function NTT_CheckMerc()
{
if(NTConfig_UseMerc)
{
if(NTC_GetMerc())
return false;
else
{
if(NTC_MyGold() < me.GetMercCost())
return false;
return true;
}
}
return false;
}
function NTT_ReviveMerc()
{
var _mygold;
if(!NTT_CheckMerc())
return true;
if(!GetUIState(0x0A))
return false;
_mygold = NTC_MyGold();
if(_mygold < me.GetMercCost())
return false;
for(var i = 0 ; i < 8 ; i++)
{
if((i % 4) == 0)
me.SelectNPCMenu(0x1507);
NTC_Delay(500);
if(_mygold > NTC_MyGold())
return true;
}
return false;
}
function NTT_ResetWeaponMerc()
{
var i, n;
var _merc, _items;
_merc = NTC_GetMerc();
if(!_merc)
return false;
_items = _merc.GetItems();
if(!_items)
return false;
for(i = 0 ; i < _items.length ; i++)
{
if(_items[i].itemloc == 4 && _items[i].runeword)
{
SetUIState(0x26, true);
for(n = 0 ; n < 80 ; n++)
{
if((n % 40) == 0)
me.ClickMercItem(4);
NTC_Delay(100);
if(me.itemoncursor)
{
NTC_PingDelay(200);
break;
}
}
if(n >= 80)
{
me.Cancel(1);
break;
}
for(n = 0 ; n < 120 ; n++)
{
if((n % 40) == 0)
me.ClickMercItem(4);
NTC_Delay(100);
if(!me.itemoncursor)
break;
}
me.Cancel(1);
if(n < 120)
return true;
break;
}
}
return false;
}
function NTT_CheckRepair(repairpercent)
{
var _max_dur;
var _percent;
var _items = me.GetItems();
if(!_items)
return false;
for(var i = 0 ; i < _items.length ; i++)
{
if(_items[i].mode == 1 && !_items[i].GetFlag(0x400000) && !_items[i].GetStat(152))
{
if(_items[i].itemtype == 42 || _items[i].itemtype == 43 || _items[i].itemtype == 44 || _items[i].itemtype == 87)
_percent = Math.floor((_items[i].GetStat(70)*100) / (GetBaseStat("weapons.txt", _items[i].classid, 45)+_items[i].GetStat(254)));
else
{
_max_dur = _items[i].GetStat(73);
if(_max_dur == 0)
continue;
_percent = Math.floor((_items[i].GetStat(72)*100) / (_max_dur*(_items[i].GetStat(75)/100 + 1)));
}
if(_percent <= repairpercent)
return true;
}
}
return false;
}
function NTT_RepairItems(npc)
{
var _mygold;
if(!npc)
return false;
if(!GetUIState(0x0E))
return false;
_mygold = NTC_MyGold();
for(var i = 0 ; i < 8 ; i++)
{
if((i % 4) == 0)
me.Repair();
NTC_Delay(500);
if(_mygold > NTC_MyGold())
return true;
}
return false;
}
function NTT_CheckInventory()
{
var x, y;
var _items;
_itemlist = new Array();
_ignorestring = _NTT_IgnoredItems.join();
if(!NTC_StashGoldFull() && NTC_MyGoldCarry() > NTConfig_MinGoldToStash)
return true;
_invspace = new Array(4);
_invspace[0] = new Array(10);
_invspace[1] = new Array(10);
_invspace[2] = new Array(10);
_invspace[3] = new Array(10);
for(y = 0 ; y < 4 ; y++)
{
for(x = 0 ; x < 10 ; x++)
_invspace[y][x] = 0;
}
_items = me.GetItems();
if(!_items)
return false;
for(var i = 0 ; i < _items.length ; i++)
{
if(_items[i].mode == 0 && _items[i].itemloc == 0)
{
if(NTConfig_Columns[_items[i].y][_items[i].x] > 0)
_itemlist.push(_items[i].code);
for(y = 0 ; y < _items[i].ysize ; y++)
{
for(x = 0 ; x < _items[i].xsize ; x++)
_invspace[y+_items[i].y][x+_items[i].x] = 1;
}
}
}
_freecols = new Array(10);
for(x = 0 ; x < 10 ; x++)
_freecols[x] = 0;
for(x = 0 ; x < 10 ; x++)
{
for(y = 0 ; y < 4 ; y++)
{
if(_invspace[y][x] == 1)
{
_freecols[x] = 1;
break;
}
}
}
_numfreecols = 0;
for(x = 0 ; x < 10 ; x++)
{
if(_freecols[x] == 0)
_numfreecols++;
}
if(NTConfig_FreeSpace > _numfreecols)
{
for(x = 0 ; x < _itemlist.length ; x++)
{
if(_ignorestring.indexOf(_itemlist[x]) != -1)
_itemlist.splice(x, 1);
}
if(_itemlist.length > 0)
return true;
}
return false;
}
function NTT_CheckStash()
{
var x, y;
var _items;
var _StashHeight = (me.gametype == 0) ? 4 : 8;
var _stashspace = new Array(_StashHeight);
for(y = 0 ; y < _StashHeight ; y++)
_stashspace[y] = new Array(6);
for(y = 0 ; y < _StashHeight ; y++)
{
for(x = 0 ; x < 6 ; x++)
_stashspace[y][x] = 0;
}
_items = me.GetItems();
if(!_items)
return false;
for(var i = 0 ; i < _items.length ; i++)
{
if(_items[i].mode == 0 && _items[i].itemloc == 4)
{
for(y = 0 ; y < _items[i].ysize ; y++)
{
for(x = 0 ; x < _items[i].xsize ; x++)
_stashspace[y+_items[i].y][x+_items[i].x] = 1;
}
}
}
for(y = 0 ; y < _StashHeight ; y++)
{
for(x = 0 ; x < 6 ; x++)
{
if(_stashspace[y][x] != 1)
return true;
}
}
return false;
}
function NTT_ManageStash(invitem)
{
var i, x, y;
var _items;
var _stashall;
var StashHeight = (me.gametype == 0) ? 4 : 8;
var _ignorestring = _NTT_IgnoredItems.join();
var _ignoreitem;
if(!GetUIState(0x1B))
return false;
if(arguments.length < 1)
_stashall = true;
else
_stashall = false;
if(!NTC_StashGoldFull() && NTC_MyGoldCarry() > NTConfig_MinGoldToStash)
{
var _mygold = NTC_MyGoldCarry();
Gold(3, _mygold);
for(i = 0 ; i < 2 ; i++)
{
NTC_Delay(500);
if(_mygold > NTC_MyGoldCarry())
break;
}
}
var _stashspace = new Array(StashHeight);
for(y = 0 ; y < StashHeight ; y++)
_stashspace[y] = new Array(6);
for(y = 0 ; y < StashHeight ; y++)
{
for(x = 0 ; x < 6 ; x++)
_stashspace[y][x] = 0;
}
_items = me.GetItems();
if(!_items)
return false;
for(i = 0 ; i < _items.length ; i++)
{
if(_items[i].mode == 0 && _items[i].itemloc == 4)
{
for(y = 0 ; y < _items[i].ysize ; y++)
{
for(x = 0 ; x < _items[i].xsize ; x++)
_stashspace[y+_items[i].y][x+_items[i].x] = 1;
}
}
}
for(i = 0 ; i < _items.length ; i++)
{
if(_items[i].mode == 0 && _items[i].itemloc == 0 && (_stashall || (_items[i].x == invitem.x && _items[i].y == invitem.y)))
{
if(_stashall)
{
_ignoreitem = (NTConfig_Columns[_items[i].y][_items[i].x] == 0);
if(!_ignoreitem)
{
if( _ignorestring.indexOf(_items[i].code) != -1 || NTSI_CheckItem(_items[i]) <= 0 )
_ignoreitem = true;
}
}
else
_ignoreitem = false;
if(!_ignoreitem)
{
_itemdone = false;
for(y = 0 ; y < StashHeight ; y++)
{
if(_itemdone)
break;
for(x = 0 ; x < 6 ; x++)
{
if(_itemdone)
break;
if(_stashspace[y][x] == 0)
{
if((x+_items[i].xsize-1) < 6 && (y+_items[i].ysize-1) < StashHeight)
{
var _havespace = true;
for(m = 0 ; m < _items[i].ysize ; m++)
{
for(n = 0 ; n < _items[i].xsize ; n++)
{
if(_stashspace[y+m][x+n] == 1)
{
_havespace = false;
m = 4;
break;
}
}
}
if(_havespace)
{
if(NTC_ItemToCursor(_items[i]))
{
for(n = 0 ; n < 80 ; n++)
{
if((n % 40) == 0)
me.ClickItem(0, x, y, 4);
NTC_Delay(100);
if(!me.itemoncursor)
break;
}
if(n < 80)
{
for(m = 0 ; m < _items[i].ysize ; m++)
{
for(n = 0 ; n < _items[i].xsize ; n++)
_stashspace[y+m][x+n] = 1;
}
}
NTC_PingDelay(200);
}
_itemdone = true;
}
}
}
}
}
}
if(!_stashall)
return true;
}
}
return true;
}
// type : id = 0, tp = 1
function NTT_GetScroll(type)
{
var _items;
if(arguments.length < 1)
type = 0;
if(type)
_items = me.GetItems("tsc");
else
_items = me.GetItems("isc");
if(_items)
{
for(var i = 0 ; i < _items.length ; i++)
{
if(_items[i].mode == 0 && _items[i].itemloc == 0)
return _items[i];
}
}
return false;
}
// type : id = 0, tp = 1
function NTT_GetTome(type)
{
var _items;
if(arguments.length < 1)
type = 0;
if(type)
_items = me.GetItems("tbk");
else
_items = me.GetItems("ibk");
if(_items)
{
for(var i = 0 ; i < _items.length ; i++)
{
if(_items[i].mode == 0 && _items[i].itemloc == 0)
return _items[i];
}
}
return false;
}
// type : id = 0, tp = 1
function NTT_FillTome(npc, type)
{
var _tome;
if(arguments.length < 1)
return false;
if(arguments.length < 2)
type = 0;
_tome = NTT_GetTome(type);
if(_tome)
{
var _items;
if(_tome.GetStat(70) >= 20)
return true;
if(type)
_items = npc.GetItems("tsc");
else
_items = npc.GetItems("isc");
if(_items)
{
if(_items.length > 0)
return NTT_ShopItem(_items[0], npc, 3);
}
}
return false;
}
// type : id = 0, tp = 1
function NTT_BuyScrolls(npc, type, amount)
{
var _items;
var _counter = 0;
if(arguments.length < 1)
return false;
if(arguments.length < 2)
type = 0;
if(arguments.length < 3)
amount = 1;
if(amount == 0)
return false;
if(type)
_items = npc.GetItems("tsc");
else
_items = npc.GetItems("isc");
if(_items)
{
if(_items.length > 0)
{
for(var i = 0 ; i < amount ; i++)
{
if(NTT_ShopItem(_items[0], npc, 2))
_counter++;
}
}
}
return (_counter > 0);
}
function NTT_GetKey()
{
var _items;
_items = me.GetItems("key");
if(_items)
{
for(var i = 0 ; i < _items.length ; i++)
{
if(_items[i].mode == 0 && _items[i].itemloc == 0)
return _items[i];
}
}
return false;
}
function NTT_FillKey(npc)
{
var _key;
var _items;
if(arguments.length < 1)
return false;
_key = NTT_GetKey();
if(_key)
{
if(_key.GetStat(70) >= 12)
return true;
_items = npc.GetItems("key");
if(_items)
{
if(_items.length > 0)
return NTT_ShopItem(_items[0], npc, 3);
}
}
else
{
_items = npc.GetItems("key");
if(_items)
{
if(_items.length > 0)
{
NTT_ShopItem(_items[0], npc, 2);
return NTT_ShopItem(_items[0], npc, 3);
}
}
}
return false;
}
function NTT_CheckBelt()
{
var _needpotions = false;
for(var i = 0 ; i < 4 ; i++)
{
_NTT_BeltColNeeded[i] = NTT_GetNeededPotionsColInt(NTConfig_BeltColType[i], i);
if(4-_NTT_BeltColNeeded[i] < NTConfig_BeltColMin[i] && NTConfig_BeltColType[i] != "rv")
_needpotions = true;
}
return _needpotions;
}
function NTT_FillBelt(npc)
{
if(!npc)
return false;
if(!GetUIState(0x0E))
return false;
if(!_NTT_BeltSize)
_NTT_BeltSize = NTC_GetBeltSize();
if(_NTT_BeltColNeeded[3] == _NTT_BeltSize || _NTT_BeltColNeeded[2] == _NTT_BeltSize || _NTT_BeltColNeeded[1] == _NTT_BeltSize || _NTT_BeltColNeeded[0] == _NTT_BeltSize)
NTT_BuyPotionsSlowInt(npc);
else
NTT_BuyPotionsFastInt(npc);
return true;
}
function NTT_CheckHeal()
{
var _merc;
if(parseInt(me.hp*100/me.hpmax) < NTConfig_SkipHealLife || parseInt(me.mp*100/me.mpmax) < NTConfig_SkipHealMana)
return true;
_merc = NTC_GetMerc();
if(_merc)
{
if(parseInt(_merc.hp*100/_merc.hpmax) < NTConfig_SkipHealLife)
return true;
}
return false;
}
function NTT_CheckSpace(itemX, itemY)
{
var i, j, x, y;
var _items;
_invspace = new Array(4);
_invspace[0] = new Array(10);
_invspace[1] = new Array(10);
_invspace[2] = new Array(10);
_invspace[3] = new Array(10);
for(y = 0 ; y < 4 ; y++)
{
for(x = 0 ; x < 10 ; x++)
_invspace[y][x] = 0;
}
_items = me.GetItems();
if(!_items)
return false;
for(i = 0 ; i < _items.length ; i++)
{
if(_items[i].mode == 0 && _items[i].itemloc == 0)
{
for(y = 0 ; y < _items[i].ysize ; y++)
{
for(x = 0 ; x < _items[i].xsize ; x++)
_invspace[y+_items[i].y][x+_items[i].x] = 1;
}
}
}
for(i = 0 ; i < 5-itemY ; i++)
{
invloop2:
for(j = 0 ; j < 11-itemX ; j++)
{
for(y = 0 ; y < itemY ; y++)
{
for(x = 0 ; x < itemX ; x++)
{
if(_invspace[i+y][j+x])
continue invloop2;
}
}
return true;
}
}
return false;
}
function NTT_CleanPotions()
{
var _items = me.GetItems();
if(!_items)
return false;
for(var i = 0 ; i < _items.length ; i++)
{
if(_items[i].mode == 0 && _items[i].itemloc == 0 && (_items[i].itemtype == 76 || _items[i].itemtype == 77 || _items[i].itemtype == 78))
{
if(NTConfig_Columns[_items[i].y][_items[i].x] > 0)
{
SetUIState(0x03, true);
me.ClickItem(1, _items[i]);
NTC_PingDelay(500);
}
}
}
me.Cancel(1);
}
function NTT_ClearInventory()
{
var _retval = true;
var _ignorestring = _NTT_IgnoredItems.join();
var _items;
_items = me.GetItems();
if(!_items)
return false;
for(var i = 0 ; i < _items.length ; i++)
{
if(_items[i].mode == 0 && _items[i].itemloc == 0)
{
if(NTConfig_Columns[_items[i].y][_items[i].x] > 0)
{
if(_ignorestring.indexOf(_items[i].code) != -1 || NTSI_CheckItem(_items[i]) != 0)
continue;
SetUIState(0x03, true);
if(NTT_DropItem(_items[i]))
NTC_PingDelay(200);
else
_retval = false;
}
}
}
me.Cancel(1);
return _retval;
}
function NTT_DropItem(item)
{
if(!item)
return false;
if(NTC_ItemToCursor(item))
return NTC_ClearCursor();
return false;
}
function NTT_ClearBelt()
{
var i;
var _result, _needdrop;
var _items;
do
{
_items = me.GetItems();
if(!_items)
{
_result = false;
break;
}
_result = true;
for(i = 0 ; i < _items.length ; i++)
{
if(_items[i].mode == 2 && _items[i].x < 4)
{
_needdrop = false;
switch(_items[i].itemtype)
{
case 76:
if(NTConfig_BeltColType[_items[i].x] != "hp")
_needdrop = true;
break;
case 77:
if(NTConfig_BeltColType[_items[i].x] != "mp")
_needdrop = true;
break;
case 78:
if(NTConfig_BeltColType[_items[i].x] != "rv")
_needdrop = true;
break;
default:
_needdrop = true;
break;
}
if(_needdrop)
{
SetUIState(0x21, true);
if(NTT_DropItem(_items[i]))
NTC_PingDelay(200);
_result = false;
}
}
}
} while(!_result);
me.Cancel(1);
return _result;
}
// mode : 1 = sell, 2 = buy, 3 = shift buy
function NTT_ShopItem(item, npc, mode)
{
var _mygold = NTC_MyGold();
if(mode > 1)
{
if(item.GetItemCost(0, npc.classid) > _mygold)
return false;
}
if(mode > 1)
{
var _havespace = false;
if(item.code == "isc" || item.code == "tsc")
{
var _book = (item.code == "isc") ? NTT_GetTome(0) : NTT_GetTome(1);
if(_book && _book.GetStat(70) < 20)
_havespace = true;
}
if(!_havespace)
{
if(NTT_CheckSpace(item.xsize, item.ysize))
_havespace = true;
}
if(_havespace)
{
for(var i = 0 ; i < 40 ; i++)
{
if((i % 20) == 0)
me.ClickItem(mode > 2 ? 3 : 1, item);
NTC_Delay(100);
if(_mygold > NTC_MyGold())
{
NTC_PingDelay(500);
return true;
}
}
}
}
else
{
if(NTC_ItemToCursor(item))
{
for(var i = 0 ; i < 40 ; i++)
{
if((i % 20) == 0)
me.ClickItem(0, 8, 6, 1);
NTC_Delay(100);
if(!me.itemoncursor)
{
NTC_PingDelay(800);
return true;
}
}
}
}
return false;
}
function NTT_IdItem(scroll, uniditem)
{
var i, _timer;
if(arguments.length < 1 || !scroll)
return false;
if(arguments.length < 2 || !uniditem)
return false;
if(uniditem.GetFlag(0x10))
return true;
for(i = 0 ; i < 40 ; i++)
{
if((i % 20) == 0)
me.ClickItem(1, scroll);
NTC_Delay(100);
if(GetCursorType() == 6)
break;
}
if(i >= 40)
return false;
NTC_PingDelay(200);
for(i = 0 ; i < 40 ; i++)
{
if((i % 20) == 0)
me.ClickItem(0, uniditem);
NTC_Delay(100);
if(uniditem.GetFlag(0x10))
{
NTC_PingDelay(200);
return true;
}
}
return false;
}
function NTT_CheckUnids()
{
var _unidcount = 0;
var _items = me.GetItems();
if(!_items)
return _unidcount;
for(var i = 0 ; i < _items.length ; i++)
{
if(_items[i].mode == 0 && _items[i].itemloc == 0 && !_items[i].GetFlag(0x10))
_unidcount++;
}
return _unidcount;
}
function NTT_GetUnidItems()
{
var _uniditems = new Array();
var _items = me.GetItems();
if(!_items)
return _uniditems;
for(var i = 0 ; i < _items.length ; i++)
{
if(_items[i].mode == 0 && _items[i].itemloc == 0 && !_items[i].GetFlag(0x10))
_uniditems.push(_items[i]);
}
return _uniditems;
}
function NTT_GambleIt(npc)
{
var _gambleitem, _newitem;
if(!npc)
return false;
if(!GetUIState(0x0E))
return false;
_gambleitem = npc.GetItems();
if(!_gambleitem)
return false;
for(var i = 0 ; i < _gambleitem.length ; i++)
{
if(NTC_MyGold() < NTConfig_GambleStopGold)
return false;
if(NTT_IsItemInGambleArrayInt(_gambleitem[i].code))
{
if(NTT_CheckSpace(_gambleitem[i].xsize, _gambleitem[i].ysize))
{
NTT_GetOldItemsInt();
if(NTT_ShopItem(_gambleitem[i], npc, 2))
_newitem = NTT_GetGambledItemInt();
else
return false;
if(_newitem)
{
while(!_newitem.GetFlag(0x10))
NTC_Delay(100);
if(NTSI_CheckItem(_newitem) > 0)
NTC_SendLogToOOG("Kept [" + NTC_ItemQualityToNameList[_newitem.quality] + "] " + _newitem.name);
else
NTT_ShopItem(_newitem, npc, 1);
}
}
}
}
return true;
}
// Internal function
function NTT_IsItemInGambleArrayInt(itemcode)
{
for(var i = 0 ; i < NTConfig_GambleItem.length ; i++)
{
if(itemcode == NTConfig_GambleItem[i])
return true;
}
return false;
}
function NTT_GetPotionAtNPCInt(type, npc)
{
var _items;
if(!type)
return false;
if(type == "hp" || type == "mp")
{
_items = npc.GetItems();
if(_items)
{
var n;
for(var i = 0 ; i < _items.length ; i++)
{
for(n = 5 ; n > 0 ; n--)
{
if(_items[i].code == (type+n))
return _items[i];
}
}
}
}
else
{
if(type == "rv")
return false;
_items = npc.GetItems(type);
if(_items)
{
if(_items.length > 0)
return _items[0];
}
}
return false;
}
function NTT_BuyPotionsFastInt(npc)
{
var i, n;
var _insert, _potion;
var _typearray = new Array();
for(i = 0 ; i < 4 ; i++)
{
if(_NTT_BeltColNeeded[i] > 0)
{
if(_typearray.length == 0)
_typearray.push(NTConfig_BeltColType[i]);
else
{
_insert = true;
for(n = 0 ; n < _typearray.length ; n++)
{
if(_typearray[n] == NTConfig_BeltColType[i])
_insert = false;
}
if(_insert)
_typearray.push(NTConfig_BeltColType[i]);
}
}
}
for(i = 0 ; i < _typearray.length ; i++)
{
if(_typearray[i] == "rv")
continue;
_potion = NTT_GetPotionAtNPCInt(_typearray[i], npc);
if(_potion)
{
if(NTT_ShopItem(_potion, npc, 3))
continue;
else
return false;
}
else
return false;
}
return true;
}
function NTT_BuyPotionsColInt(npc, col)
{
var _numpotions;
var _potion;
if(col < 0 || col > 3)
return false;
if(NTConfig_BeltColType[col] == "rv")
return false;
_numpotions = _NTT_BeltColNeeded[col];
if(_numpotions == 0)
return false;
if(_numpotions > _NTT_BeltSize)
_numpotions = _NTT_BeltSize;
for(var _buyloop = 0 ; _buyloop < _numpotions ; _buyloop++)
{
_potion = NTT_GetPotionAtNPCInt(NTConfig_BeltColType[col], npc);
if(_potion)
NTT_ShopItem(_potion, npc, 2);
else
return false;
}
return true;
}
function NTT_BuyPotionsSlowInt(npc)
{
var _currentcol;
for(_currentcol = 0 ; _currentcol < 4 ; _currentcol++)
{
if(_NTT_BeltColNeeded[_currentcol] == _NTT_BeltSize)
{
NTT_BuyPotionsColInt(npc, _currentcol);
_NTT_BeltColNeeded[_currentcol] = 0;
}
}
for(_currentcol = 0 ; _currentcol < 4 ; _currentcol++)
NTT_BuyPotionsColInt(npc, _currentcol);
return true;
}
function NTT_GetNeededPotionsColInt(type, column)
{
var _restartloop = true;
var _amountneeded = 0;
var _items;
if(!type || column > 3)
return false;
if(!_NTT_BeltSize)
_NTT_BeltSize = NTC_GetBeltSize();
potionloop:
do
{
_amountneeded = _NTT_BeltSize;
_items = me.GetItems();
if(!_items)
continue potionloop;
for(i = 0 ; i < _items.length ; i++)
{
if(_items[i].mode == 2)
{
if(NTT_PotInRightColInt(_items[i].x, column, _NTT_BeltSize))
{
var _potcode = _items[i].code;
if(_potcode.indexOf(type) != -1)
_amountneeded--;
else
{
if(_potcode.indexOf("rv") != -1)
{
if(_items[i].x < 4)
{
me.Cancel(1);
return 0;
}
else
_amountneeded--;
}
else
{
SetUIState(0x21, true);
me.ClickItem(1, _items[i]);
NTC_PingDelay(500);
continue potionloop;
}
}
}
}
}
_restartloop = false;
} while(_restartloop);
me.Cancel(1);
return _amountneeded;
}
function NTT_PotInRightColInt(potx, column, beltsize)
{
for(var i = 0 ; i < beltsize ; i++)
{
if(potx-i*4 == column)
return true;
}
return false;
}
function NTT_GetGambledItemInt()
{
var n;
var _items;
var _founditem;
_items = me.GetItems();
if(!_items)
return false;
for(var i = 0 ; i < _items.length ; i++)
{
if(_items[i].mode == 0 && _items[i].itemloc == 0)
{
_founditem = true;
for(n = 0 ; n < _NTT_OldItems.length ; n++)
{
if(_items[i].gid == _NTT_OldItems[n])
{
_founditem = false;
break;
}
}
if(_founditem)
return _items[i];
}
}
return false;
}
function NTT_GetOldItemsInt()
{
var _items;
_NTT_OldItems = new Array();
_items = me.GetItems();
if(!_items)
return false;
for(var i = 0 ; i < _items.length ; i++)
{
if(_items[i].mode == 0 && _items[i].itemloc == 0)
_NTT_OldItems.push(_items[i].gid);
}
}
Falls ihr Probleme habt postet eure Fehler (möglichst detailiert) hier, da es sich hier meist nicht um D2NT sondern um das JoinBot Script handelt!






