Nach einem Volltest des Scripts, welches mit/durch Muddy geschrieben wurde, kann ich mit Freude verkünden: Es ist betriebsbereit! :)
Funktionsweise:
Das Script für Muddys D2NT Version macht folgendes:
Es schaut im Umkreis um die Truhe nach Craftbaren Items, sofern welche rumliegen, wird geschaut was wie zusammenpasst.
Der Bot hebt die passenden Gegenstände für die Craftrezepte auf die ihr in den Globalsettings eingestellt habt und baut sie im Cube zusammen.
Danach prüft er die Eigenschaften der Ringe in der CraftNip, wie gehabt.
Crapcrafts kommen auf den Boden, der Rest in die Truhe.
Umfang des Tests:
Der Umfang meines Test sind 88x Jools/Rubys/Sols/Ringe gewesen. (Quasi 88 Bloodcraftpacks)
Keine Fehler oder sonstige Bugs.
Nichts desto trotz bitte ich euch, dieses Script auch mal zu testen und euer Feedback zu posten :)
Ich bin der Meinung das es einiges leichter macht, denn: Craftpacks bekommen is eine Sache, die Zeit fürs Craften zu haben eine Andere :P
Und wunde Finger wünsche ich keinem EPvper :)
Ein riesen Dank an Muddy, denn ohne Ihn wäre das Script für mich net realisierbar gewesen.
Ich bin kein großer JavaTexter, aber massig Ideen hab ich :)
Installation:
Macht euch am Besten einen Ordner "MWCraft" im Scripts Ordner :)
Dort kommt die MWCraftGame.ntj rein.
Die MWCraftEntry.ntj kommt in den Scriptsordner.
Die MWCraft.ntj File kommt in den NTBot/Bots Ordner :)
MWCraftEntry.ntj
Code:
/**
* This file was written by [Only registered and activated users can see links. Click Here To Register...] & -[Only registered and activated users can see links. Click Here To Register...]
* Check the programming section for updates and further scripts
* Last Update: 07/17/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("MWCraft/MWCraftGame.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);
}
}
}
function NT_SendEventToOOG(locationId, statusString, pendingTime)
{
return SendCopyData("D2NT Manager", null, (locationId<<16)|pendingTime, statusString);
}
MWCraftGame.ntj
Code:
/**
* This file was written by [Only registered and activated users can see links. Click Here To Register...] & -[Only registered and activated users can see links. Click Here To Register...]
* Check the programming section for updates and further scripts
* Last Update: 07/17/2011
*/
var _MW_LeaveGame = false;
function NTMain()
{
SetStatusText("ÿc8Initializing...");
Include("libs/common/NTCommon.ntl");
NTC_IncludeLibs();
NTC_IncludeConfig("NTBot/char_configs");
NT_LoadConfig();
NTSI_LoadNIPFiles("NTBot/item_configs");
RegisterEvent(EVENT_KEYDOWN, MW_KeyEventHandler);
if(NTConfig_StartDelay > 0);
NTC_Delay(NTConfig_StartDelay);
NTT_GetCorpses();
if(Load("NTBot/bots/MWCraft.ntj"))
Print("ÿc8Running MWCraft.ntj");
while(!_MW_LeaveGame)
NTC_Delay(1000);
ExitGame();
}
function MW_KeyEventHandler(keycode)
{
if(keycode == 46) // Exit (DEL)
_MW_LeaveGame = true;
}
MWCraft.ntj
Code:
const _MWCR_PICKUP_RANGE = 15;
function NTMain()
{
Include("libs/common/NTCommon.ntl");
NTC_IncludeLibs();
NTC_IncludeConfig("NTBot/char_configs");
NT_LoadConfig();
NTSI_LoadNIPFiles("NTBot/item_configs");
MWC_Initialize();
if(!NTTM_CheckAct(1, true))
{
NTC_SendMsgToScript("MWBotGame.ntj", NTTM_CheckAct, 18, me.act, true);
return;
}
NTTMGR_TownManager();
while(true)
{
NTCU_InitCubing();
MWCR_PickIngredients();
if(NTCU_CheckCubing())
NTTMGR_VisitStash(true);
NTC_Delay(1000);
}
NTC_SendMsgToScript("MWBotGame.ntj", "SCRIPT_END");
}
function MWCR_PickIngredients()
{
var _item, _craftSets, _index;
var i, j;
_craftSets = new Array();
_item = NTC_FindUnit(NTC_UNIT_ITEM);
if(!_item)
return;
// _craftSets structure: [requiredIngredients[], runegid, gemgid, jewelgid, basegid]
// requiredIngredients[] structure: [ilvl, runeclassid, gemclassid, jewelclassid, baseclassid]
for(i = 0; i < NTConfig_CubingItem.length; i++)
{
if(NTConfig_CubingItem[i][0] >= NTCU_CRAFT_HITPOWER_HELM && NTConfig_CubingItem[i][0] <= NTCU_CRAFT_SAFETY_WEAPON)
{
_craftSets.push([_NTCU_CraftRecipe[NTConfig_CubingItem[i][0] - NTCU_CRAFT_HITPOWER_HELM], null, null, null]);
_craftSets[_craftSets.length - 1][0].push(MWCU_JEWEL, NTConfig_CubingItem[i][1]);
}
}
do
{
if(GetDistance(me, _item) < _MWCR_PICKUP_RANGE && NTSI_CheckItem(_item) == 2)
{
for(i = 0; i < _craftSets.length; i++)
{
_index = _craftSets[i][0].indexOf(_item.classid); // Returns a valid array index if the item is required for the current recipe (1: rune; 2: perfect gem; 3: base item)
if(_index > 0)
{
if(_craftSets[i][_index] == null)
{
_craftSets[i][_index] = _item.gid;
break;
}
}
}
}
} while(_item.GetNext());
for(i = 0; i < _craftSets.length; i++)
{
for(j = 0; j < _craftSets[i].length; j++)
{
if(_craftSets[i][j] == null)
break;
}
if(j >= _craftSets[i].length)
{
for(j = 1; j < _craftSets[i].length; j++)
MWSI_PickupItem(_craftSets[i][j]);
}
}
}
Dann müsst ihr einfach nur im D2NT Manager MWCraftEntry.ntj anstatt NTBot.ntj auswählen und euch manuell in das Game einloggen wo ihr die Craftpacks gedroppt habt.
Voila! :)
Viel Spaß & Erfolg beim Craften(lassen)!