Register for your free account! | Forgot your password?

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

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

Advertisement



empty inventory before going to worldstone chamber

Discussion on empty inventory before going to worldstone chamber within the Diablo 2 Programming forum part of the Diablo 2 category.

Reply
 
Old   #1
 
elite*gold: 0
Join Date: Jun 2009
Posts: 10
Received Thanks: 2
empty inventory before going to worldstone chamber

I just copy pasted this from my post on GV because I am lazy, lol

icu requested this a day or 2 ago and the easy fix was NTTMGR_VisitTown();

I decided to play around with it a bit and came up with this and decided I would post it here so the pub runners around here would have it before the next etalBot update and also to help drum up some more channel runners for op gotv
before I forget thanks to icu for helping me test this

this also will help the bug of missed items after killing baal, going to town and then going back to worldstone for items


first you need to add these lines to your character configs in with the other baal configs
Code:
				NTConfig_TownBeforeBaal = true;//check inventory and go to town if any items before going to worldstone to kill baal.  must have NTConfig_FreeSpace configured correctly			
			NTConfig_FreeSpaceBeforeBaal = 6;//# of free columns you want if less than that it bot will town
next open up your scripts/libs/common/NTTown.ntl and at the bottom add this
Code:
function NTT_CheckInventoryBeforeBaal()
{
	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;
			}
		}
	}

	_freecolss = new Array(10);

	for(x = 0 ; x < 10 ; x++)
		_freecolss[x] = 0; 

	for(x = 0 ; x < 10 ; x++)
	{
		for(y = 0 ; y < 4 ; y++)
		{
			if(_invspace[y][x] == 1)
			{
				_freecolss[x] = 1;
				break;
			}
		}
	}

	_numfreecolss = 0;

	for(x = 0 ; x < 10 ; x++)
	{ 
		if(_freecolss[x] == 0)
			_numfreecolss++;
	}

	if(NTConfig_FreeSpaceBeforeBaal > _numfreecolss)
	{
		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;
}
could have modded the checkinventory function here but I seem to have an affinity for screwing things up when I modd existing functions, lol

now going into your bots/NTBaal.ntj and add the red part
Code:
	
	if(NTConfig_KillBaal)
	{
		var _portal;

		if(NTConfig_PublicMode)
			Say(Baal_KillBaalMessage);

		[COLOR="red"][B]if(NTConfig_TownBeforeBaal && NTT_CheckInventoryBeforeBaal())
			NTTMGR_VisitTown(); 
[/B][/COLOR]
		if(!NTTMGR_CheckSafe(NTConfig_CheckSelfSafe, NTConfig_CheckMercSafe))
		{
			NTC_SendMsgToScript("NTBotGame.ntj", "NTTMGR_CheckSafe()");
			return;
		}

		NTM_MoveTo(me.areaid, 15092, 5010);
configure the NTConfig_FreeSpaceBeforeBaal = ; to how many free columns you want to have before going to baal. If it is less than that the bot will town before

you can use this for chaos script by adding the line in before killing diablo also

I only lightly tested this, but seems to work perfect
enjoy!!!
stairbuilder is offline  
Old 08/22/2010, 19:24   #2
Administrator
 
Muddy Waters's Avatar
 
elite*gold: 41364
Join Date: Jan 2010
Posts: 22,727
Received Thanks: 12,652
I actually think it wasn't even necessary writing a function for this, cause there are standard D2NT that do pretty much the same, but anyway.

If I were you, I'd do something about those nasty undeclared variables in there.

Regards
Muddy
Muddy Waters is offline  
Old 08/22/2010, 20:28   #3
 
elite*gold: 0
Join Date: Jun 2009
Posts: 10
Received Thanks: 2
Quote:
Originally Posted by Muddy_Waters View Post
I actually think it wasn't even necessary writing a function for this, cause there are standard D2NT that do pretty much the same, but anyway.

If I were you, I'd do something about those nasty undeclared variables in there.

Regards
Muddy
actually covered that
Quote:
Originally Posted by stairbuilder View Post
could have modded the checkinventory function here but I seem to have an affinity for screwing things up when I modd existing functions, lol
always remember that I am an old carpenter that until about 2 years ago could barely check his e-mail, lmao
there are huge benefits growing up in the age most of you did. The only thing I was exposed to in school was dos.

I'm just happy when things work as expected, more or less, and as I continue to learn I revisit my work and put a better polish on them

thanks for the input always appreciated

*edtit
btw this is just a renamed version of the check inventory function with a couple changes made to it
not really sure where you are seeing undeclared variables either
bottom line is as I said it works and was just trying to give something here on pvp's because I look at the work people do around here quite a bit.
stairbuilder is offline  
Reply


Similar Threads Similar Threads
LF Walker Script for Chamber of Delusion
04/29/2010 - Lineage 2 - 0 Replies
Hi lf scritp about i port in after 42min port again in and agin again again the Chamber is 40min NPC - Guardian of Eastern Seal - Text - Enter the Eastern Seal - If Chamber over after 40min i stay very near to npc and i think now make script for report not need more
(Rappelz) Server: Bahamut WTB Empty-Angels, Empty-Kentas
09/25/2009 - Rappelz Trading - 1 Replies
WTB empty angels and empty kentas on bahamut. Private messege or post the cost of each empty angel/kenta and the number of cards your selling. Paying real cash via paypal.
WTB 2 empty blode or 2 emptyshuta and empty karkean [BRUMHART]
03/03/2009 - Archlord Trading - 0 Replies
pm me here or ingame Shien, Soulasylum n Vash73 if u have the items so we can make a deal, preferably empty. paying thru paypal only. tell me ur prices.
Brumhart-WTT Okheros(stamina lvl3), Okheros empty and Biglos empty for Karkaen Necky
01/14/2009 - Archlord Trading - 0 Replies
Hi, i want to trade Okheros(stamina lvl3), Okheros empty and Biglos empty for Karkaen Necky. Brumhart server. I can offer cc instead or added, and gold. Maybe buy trhough paypal, just let your ideas here.
Ontop of Thrall´s Chamber
12/12/2006 - WoW Exploits, Hacks, Tools & Macros - 0 Replies
Für die Allianzler evtl. zu gebrauchen =P http://costaserver.kicks-ass.net/stuff/arrow.gif Klick mich!



All times are GMT +1. The time now is 16:50.


Powered by vBulletin®
Copyright ©2000 - 2025, 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 ©2025 elitepvpers All Rights Reserved.