1. Quester
Code:
/**
* This file was written by [Only registered and activated users can see links. Click Here To Register...]
* Check the programming section for updates and further scripts
* Last Update: 02/27/2011
*/
function NT_LoadConfig()
{
// By default, the first char that enters the game and is level 70 or less will be set as active quester. (which is usually the char that creates the game)
// You can also define the active quester yourself by entering a charname below. (case insensitive)
MWConfig_ActiveQuestersName = "Derb_Gold";
// Specify the number of chars to be rushed - the rush will not start until all chars have joined the game and the party or you initiate it yourself by typing ".start".
MWConfig_NumberOfCharsToRush = 2;
// Whether your chars are supposed to get cubes when being rushed on normal difficulty.
MWConfig_GetHoradricCubesInNorm = true;
// Specify which quests are to be done during the rush. (A4Q1 and A5Q1 are currently the only quests that work relatively well)
//MWConfig_QuestSchedule = [0];
// Specify which acts are included in the rush.
MWConfig_RushActs = [1, 2, 3, 4, 5];
MWConfig_Script.push(["MWRush.ntj", 0]);
me.maxgametime = 0;
}
2.Rush Game
Code:
/**
* This file was modified by [Only registered and activated users can see links. Click Here To Register...]
* Check the programming section for updates and further scripts
* Last Update: 02/19/2011
*/
// Constants
const _CHAT_COMMAND_TRIGGER = '.';
// Global variables
var LeaveGame = false;
function NTMain()
{
SetStatusText("ÿc8Initializing...");
Include("libs/common/NTCommon.ntl");
NTC_IncludeLibs();
Include("NTBot/char_configs/NTConfig.ntl");
Include("MWRush/MWRushConfig_Quester.ntl");
NT_LoadConfig();
if(NTConfig_StartDelay > 0);
NTC_Delay(NTConfig_StartDelay);
NTT_GetCorpses();
RegisterEvent(EVENT_GAMEMSG, MW_ChatHandle);
RegisterEvent(EVENT_KEYDOWN, MW_KeyEvents);
RegisterEvent(EVENT_SCRIPTMSG, MW_ScriptMsgEvents);
if(Load("NTBot/bots/MWRush.ntj"))
Print("ÿc8Running MWRush.ntj");
var _count = 0;
while(!LeaveGame)
{
NTC_Delay(1000);
if(_count > 5)
{
_count = 0;
MWC_ManageParty();
}
_count++;
}
ExitGame();
}
function MW_ChatHandle(msg, type)
{
var _message, _messenger;
if(type == 0)
{
_message = msg.split("ÿc0: ")[1]; // Extract the message
if(_message.substr(0, _CHAT_COMMAND_TRIGGER.length) != _CHAT_COMMAND_TRIGGER)
return;
_message = _message.substr(_CHAT_COMMAND_TRIGGER.length, _message.length); // Remove the trigger
_messenger = msg.split("ÿc0: ")[0].replace("ÿc4", ""); // Extract the name of the char that wrote the message
NTC_SendMsgToScript("MWRush.ntj", _messenger + " " + _message.toUpperCase());
}
}
function MW_KeyEvents(keycode)
{
var _script;
//Print("Keycode: " + keycode);
switch(keycode)
{
case 19: // Pause (PAUSE)
_script = NTC_FindScript("MWRush.ntj");
if(_script)
{
if(_script.running)
{
_script.Stop();
NTC_Delay(250);
ClickMap(NTC_CLICK_LUP, NTC_SHIFT_NONE, null);
MWC_SetStatusText("ÿc1Stopped ÿc4" + _script.name);
NTC_Delay(500);
}
else if(Load("NTBot/bots/MWRush.ntj"))
MWC_SetStatusText("ÿc8Running MWRush.ntj");
}
break;
case 36: // Show coordinates (POS1/HOME)
Print("Current Position: (ÿc2" + me.x + "ÿc0|ÿc1" + me.y + "ÿc0) [ÿc7" + me.areaid + "ÿc0]");
break;
case 46: // Stop Script
NTC_StopScript("MWRush.ntj");
MWC_SetStatusText("ÿc1Stopping Script...");
LeaveGame = true;
break;
case 8: // Show Item Info (UNDO)
MWI_ShowItemInfo();
break;
}
}
function MW_ScriptMsgEvents(msg)
{
var _area, _script;
switch(msg)
{
case "SCRIPT_END":
_script = NTC_FindScript("MWRush.ntj");
if(_script && _script.running)
_script.Stop();
break;
default:
Print("ÿc1MWRush.ntj: " + msg + " failed");
_area = MWC_FindArea();
if(_area)
NTC_SendLogToOOG(NTC_LOG_COMMON, "ÿE00000MWRush.ntj : " + msg + " failed (" + _area.name + ")");
else
NTC_SendLogToOOG(NTC_LOG_COMMON, "ÿE00000MWRush.ntj : " + msg + " failed (unknown area)");
MW_ScriptMsgEvents("SCRIPT_END");
break;
}
}
3. Rush Entry
Code:
/**
* This file was written by [Only registered and activated users can see links. Click Here To Register...]
* Check the programming section for updates and further scripts
* Last Update: 02/25/2011
*/
// 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;
Include("libs/controlInfo.ntl");
Include("libs/common/NTCommon.ntl");
var ControlData = new controlInfo();
var LocationData = new Array("None", GetTickCount());
function NTMain()
{
var _ingame, _gameStartTicks, _locationName;
Delay(1000);
_ingame = false;
while(true)
{
if(me.ingame)
{
if(!_ingame)
{
RunGC();
if(Load("MWRush/MWRushGame.ntj"))
{
_ingame = true;
_gameStartTicks = GetTickCount();
if(me.playtype > 0)
NT_SendEventToOOG(D2NT_MGR_PRINT_LOG, "In Game [IP:" + me.gameserverip.split(".")[3] + "] (" + me.gamename + ((me.gamepassword) ? "//" + me.gamepassword : "") + ")", 0);
else
NT_SendEventToOOG(D2NT_MGR_PRINT_LOG, "In Game (" + me.gamename + ((me.gamepassword) ? "//" + me.gamepassword : "") + ")", 0);
}
}
NT_SendEventToOOG(D2NT_MGR_PRINT_STATUS, "In Game [IP:" + me.gameserverip.split(".")[3] + "] [" + MWC_ConvertTicksToTimeString(GetTickCount() - _gameStartTicks) + "]", 0);
Delay(500);
}
else
{
_locationName = ControlData.getLocation().name;
if(_locationName && LocationData[0] != _locationName)
{
LocationData[0] = _locationName;
LocationData[1] = GetTickCount();
}
if(_ingame)
_ingame = false;
NT_SendEventToOOG(D2NT_MGR_PRINT_STATUS, LocationData[0] + " [" + MWC_ConvertTicksToTimeString(GetTickCount() - LocationData[1]) + "]", 0);
Delay(500);
}
Besten dank fürs draufguckn :)