Register for your free account! | Forgot your password?

Go Back   elitepvpers > Other Online Games > Diablo 2 > Diablo 2 Programming
You last visited: Today at 08:31

  • Please register to post and access all features, it's quick, easy and FREE!

Advertisement



[Release]Kurast Scripte für Muddy D2NT

Discussion on [Release]Kurast Scripte für Muddy D2NT within the Diablo 2 Programming forum part of the Diablo 2 category.

Reply
 
Old   #1
 
elite*gold: 0
Join Date: Apr 2009
Posts: 49
Received Thanks: 9
[Release]Kurast Scripte für Muddy D2NT

Hi

Hier mein Release für UnterKurast, OberKurast und KurastBasar wo keine Monster gekillt werden sondern nur Kisten, Leichen, Waffenständer etc gelootet wird.
Die 3 bis 6 Supertruhen in Uk werden in diesem Script ebenfalls geöffnet.

Zunächst das in die MWLoot.ntl
Code:
function MWL_LootAreaChests()
{
	var _pUnit, _chests, _chest;
	
	_chests = new Array();
	_pUnit = GetPresetUnits(me.areaid, NTC_UNIT_OBJECT); // Get an array that holds all object units in our current area

	if(!_pUnit)
		return;
	
	var _debugArray = new Array();
	for(var i = 0; i < _pUnit.length; i++)
	{
		if(!MWL_IsLootableChest(_pUnit[i].id) && _MWL_SuperChestClassids.indexOf(_pUnit[i].id) == -1) // Skip non lootable object units
			continue;
		
		if(typeof _debugArray[_pUnit[i].id] != "number")
			_debugArray[_pUnit[i].id] = 1;
		else
			_debugArray[_pUnit[i].id]++;
			
		// Add an object that holds all data that we will need for locating it
		_chests.push({
						x: _pUnit[i].roomx*5 + _pUnit[i].x,
						y: _pUnit[i].roomy*5 + _pUnit[i].y,
						classid: _pUnit[i].id
					});
	}
	
	for(var i = 0; i < _debugArray.length; i++)
	{
		if(_debugArray[i])
			Print("Classid " + i + ": " + _debugArray[i]);
	}
	
	// Define a sort function that will sort the given objects by distance to controlled unit in descending order:
	_chests.sorter = function(a, b)
	{
		if(GetDistance(me.x, me.y, a.x, a.y) < GetDistance(me.x, me.y, b.x, b.y))
			return 1; // Place b before a
    
		return -1; // Place a before b
	};
	
	while(_chests.length > 0)
	{
		_chests.sort(_chests.sorter); // Sort chests by distance - closest one will be moved to last index
		_chest = _chests.pop(); // Remove the last element and return it
		
		if(!NTM_MoveTo(me.areaid, _chest.x + 1, _chest.y + 1, 3))
			continue;

		if(NTC_OpenChest(MWL_FindContainerUnit(_chest)))
			NTSI_PickItems();
	}
}
Anmerkung: Die Kistenansage von Muddy hab ich drin gelassen weil ich sie ganz cool finde, nötig ist sie nicht.

Ebenfalls in der MWLoot.ntl weiter unten bei
Code:
function MWL_IsLootableChest(classid)
Code:
case 169:
hinzufügen.

Die ID 169 steht für "Hollow Log" (Baumstumpf). Da die recht häufig sind also unbedingt einfügen.

Nun hier das UK Script:
Erstellt eine neue Datei die bspw uk.ntj heißt. und kopiert den Code hinein.
Die Datei "uk.ntj" muss im Order "Bots" sein.
Code:
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(me.act, true))
	{
		NTC_SendMsgToScript("MWBotGame.ntj", NTTM_CheckAct, 18, me.act, true);
		return;
	}

	NTTMGR_TownManager();

	if(!NTTM_TownMove("waypoint"))
	{
		NTC_SendMsgToScript("MWBotGame.ntj", NTTM_TownMove, 26, "waypoint");
		return;
	}

   if(!NTM_TakeWaypoint(79))
	{
		NTC_SendMsgToScript("MWBotGame.ntj", NTM_TakeWaypoint, 32, 79);
		return;
	}

   NTP_DoPrecast(true);

   Delay(500);
   
   _unit = GetPresetUnits(me.areaid, NTC_UNIT_OBJECT);

   if(_unit)
   {
      for(n = 0 ; n < _unit.length ; n++)
      {
         if(_unit[n].id == 580)
         {
            NTM_MoveTo(me.areaid, _unit[n].roomx*5+_unit[n].x, _unit[n].roomy*5+_unit[n].y);
           
            _chest = NTC_FindUnit(NTC_UNIT_OBJECT, GetLocaleString(3260), 1);
            if(_chest)
               {
                  do
                  {
                     if(NTC_OpenChest(_chest))
                     NTSI_PickItems();
                  }while(_chest.GetNext());
               }
         }
         else if(_unit[n].id == 104 || _unit[n].id == 105 || _unit[n].id == 106 || _unit[n].id == 107)
         {
            NTM_MoveTo(me.areaid, _unit[n].roomx*5+_unit[n].x, _unit[n].roomy*5+_unit[n].y);
           
            _chest = NTC_FindUnit(NTC_UNIT_OBJECT, GetLocaleString(3247));
            if(_chest)
               {
                  do
                  {
                     if(NTC_OpenChest(_chest))
                     NTSI_PickItems();
                  }while(_chest.GetNext());
               }   
               
            _chest = NTC_FindUnit(NTC_UNIT_OBJECT, GetLocaleString(3248));
            if(_chest)
               {
                  do
                  {
                     if(NTC_OpenChest(_chest))
                     NTSI_PickItems();
                  }while(_chest.GetNext());
               }         
         }
         
      }
   }

MWL_LootAreaChests(); 
   
   NTC_SendMsgToScript("MWBotGame.ntj", "SCRIPT_END");
}
Der Bot telt nun zuerst zu den Supertruhen und Waffenständern und öffnet danach (fast) alle Truhen in ganz UK.

Wer nur die Supertruhen öffnen will muss im Script
Code:
MWL_LootAreaChests();
einfach nur weglassen

Um in OberKurast auch nur alle Chests zu looten folgendes Script in den Botsordner kopieren und nennt es bspw "ok.ntj" :
Code:
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(me.act, true))
	{
		NTC_SendMsgToScript("MWBotGame.ntj", NTTM_CheckAct, 18, me.act, true);
		return;
	}

	NTTMGR_TownManager();

	if(!NTTM_TownMove("waypoint"))
	{
		NTC_SendMsgToScript("MWBotGame.ntj", NTTM_TownMove, 26, "waypoint");
		return;
	}

	if(!NTM_TakeWaypoint(81))
	{
		NTC_SendMsgToScript("MWBotGame.ntj", NTM_TakeWaypoint, 32, 81);
		return;
	}

	NTP_DoPrecast(true);

	MWL_LootAreaChests(); // Call MWL_LootAreaChests
	
	NTC_SendMsgToScript("MWBotGame.ntj", "SCRIPT_END")
}
Für KurastBasar ebenfalls in dem Ordner Bots eine Datei erstellen bspw "kb.ntj" und folgenden Code hinein kopieren:
Code:
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(me.act, true))
	{
		NTC_SendMsgToScript("MWBotGame.ntj", NTTM_CheckAct, 18, me.act, true);
		return;
	}

	NTTMGR_TownManager();

	if(!NTTM_TownMove("waypoint"))
	{
		NTC_SendMsgToScript("MWBotGame.ntj", NTTM_TownMove, 26, "waypoint");
		return;
	}

	if(!NTM_TakeWaypoint(80))
	{
		NTC_SendMsgToScript("MWBotGame.ntj", NTM_TakeWaypoint, 32, 80);
		return;
	}

	NTP_DoPrecast(true);

	MWL_LootAreaChests(); // Call MWL_LootAreaChests
	
	NTC_SendMsgToScript("MWBotGame.ntj", "SCRIPT_END")
}
Nun in die jeweilige Charconfig gehen und eure Scripte dort einfügen.
So zum Beispiel:
Code:
MWConfig_Script.push(["MWuk.ntj", 10]); 
MWConfig_Script.push(["MWkb.ntj", 10]); 
MWConfig_Script.push(["MWok.ntj", 10]);
Thanks geht natürlich an Muddy und an Blizzhackers.

Kind regards
papachef is offline  
Thanks
3 Users
Old 04/18/2012, 20:28   #2
Administrator
 
Muddy Waters's Avatar
 
elite*gold: 41364
Join Date: Jan 2010
Posts: 22,727
Received Thanks: 12,654
Irgendwie ist die Umsetzung für UK reichlich schlampig im Vergleich zu der für die anderen ebenen. Das könnte man durchaus noch optimieren.
Muddy Waters is offline  
Old 04/18/2012, 22:44   #3
 
elite*gold: 0
Join Date: Apr 2009
Posts: 49
Received Thanks: 9
Ja ich bin dabei aber auch hier muss ich erstmal wirklich warm werden.
Erstmal läuft es so und wer es will kann es so nutzen.
Ich werde sicher in Zukunft mal eine bessere Version editieren die schöner aufgebaut ist aber ich bekomme zum jetzigen Zeitpunkt die Supertruhen nicht unter MWL_IsLootableChest eingebunden.
Ich werd das schon hinbekommen aber good Thinks needs time to learn.
papachef is offline  
Reply


Similar Threads Similar Threads
Muddy´s D2nt Problem pls help
02/24/2012 - Diablo 2 - 9 Replies
Hi ich habe ein Problem mit dem D2nt Bot von Muddy. Also ich wollte Org sets farmen, also habe ich in der char config countess, summoner, nihlatak und organ harvest angemacht. Dann fängt er an keys zu sammel und wenn oben steht : Running OrganHarvest. Dann friert das D2 fenster und da steht "keine Rückmeldung" Im manager sagt er immer noch -->
Muddy’s D2NT – FAQ [NO QUESTIONS]
12/12/2011 - Diablo 2 Programming - 17 Replies
Hey folks, As I’m almost done with the upcoming update I figured it might be a good idea to start the FAQ right away. I did a bit of brainstorming on how to approach this and then came up with the idea of including everyone in its creation. So many of you already did such a great job at answering questions in the release topic and helping users with various issues, so why do all the work myself when you could as well give me a hand with this? :) What I’d basically like you to do is to pick...
hab ne frage zu d2nt muddy bot
11/23/2011 - Diablo 2 - 2 Replies
hey leute vl bin ich falsch hier kenn mich nicht aus :S ich habe so gut wie alles config .. es ist ein druid .. er macht kein boo er precastet alles bis auf dass er boo macht was hab ich falsch gemacht ich hatte früher andere bots aber da hatt er es automatisch gemacht :S bzw er swicht die waffe nicht von selber !
[Release] WrathHunter script für Muddy Waters D2NT
06/22/2011 - Diablo 2 Programming - 31 Replies
Update auf v1.2.1 changelog v1.2.1 - Akt 2 Tombs hinzu. - looten von Chests wieder standardmäßig aktiviert (siehe Tipps). v1.2 - Weitere Gebiete hinzugefügt - MWC_Initialize(); Aufruf ersetzt durch NTA_Initialize();



All times are GMT +1. The time now is 08:35.


Powered by vBulletin®
Copyright ©2000 - 2026, Jelsoft Enterprises Ltd.
SEO by vBSEO ©2011, Crawlability, Inc.
This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

Support | Contact Us | FAQ | Advertising | Privacy Policy | Terms of Service | Abuse
Copyright ©2026 elitepvpers All Rights Reserved.