Dia run script erweiterung

07/29/2010 14:20 FoGzone#1
Hey ich hab mir mal folgendes überlegt:

In den ganzen cs runs kommt es immer wieder vor, dass es exp schreine im cs gibt. Hat da jemand schon nen script geschrieben mit dem der Char bevor dia spawnt den shrine picked?

Wäre ganz praktisch für priv runs, dass der leader erst cs säubert und dann vor dia noch den xp shrine used falls vorhanden....

Hätte da jemand lust das zu schreiben falls noch ned vorhanden?
07/29/2010 14:44 sternenlooper#2
Quote:
Originally Posted by Knutschkugel View Post
Hey ich hab mir mal folgendes überlegt:

In den ganzen cs runs kommt es immer wieder vor, dass es exp schreine im cs gibt. Hat da jemand schon nen script geschrieben mit dem der Char bevor dia spawnt den shrine picked?

Wäre ganz praktisch für priv runs, dass der leader erst cs säubert und dann vor dia noch den xp shrine used falls vorhanden....

Hätte da jemand lust das zu schreiben falls noch ned vorhanden?
das nötigste dafür ist doch schon längst vorhanden!
einfach das schrein_search script einbauen für diese eine ebene!

dazu fügst du diese zeile an der stelle ein bei der du den schrein suchen lassen willst im cs!

Code:
FindShrines();
damit der bot auch was anfangen kann fügst die erklärung der funktion ganz unten am ende des scripts ein!
Code:
function FindShrines()	
{
	var ShrineIds = [2, 83, 85, 86, 93, 96, 97, 109, 116, 120, 123, 124, 133, 134, 135, 136, 150, 151, 172, 173, 184, 190, 191, 197, 199, 200, 201, 226, 231, 232, 260, 275, 276, 277, 278, 279, 282, 299, 300, 303, 325, 361, 414, 415, 421, 422, 423, 427, 428, 464, 465, 472, 479, 483, 484, 488, 491, 492, 495, 497, 499, 503, 509, 512, 520, 521, 522];
	var ShrineLocs = [];
	
	var unit = GetPresetUnits(me.areaid);
	
	if(unit)
	{		
		for (var j = 0; j < unit.length; j++){
			for (var c = 0; c < ShrineIds.length; c++){				
				if (ShrineIds[c] == unit[j].id){
						ShrineLocs.push([unit[j].roomx*5+unit[j].x + 3,unit[j].roomy*5+unit[j].y])					
				}
			}
		}
	}
	
	while(ShrineLocs.length > 0)
	{
		ShrineLocs.sort(SortRoomInt);
		var _room = ShrineLocs.shift();
		NTM_MoveTo(me.areaid, _room[0], _room[1]);		
		var shrine = NTC_FindUnit(NTC_UNIT_OBJECT, "shrine");
		if(shrine){
			do{		
				if(GetDistance(me.x,me.y,shrine.x,shrine.y)<5){
					if(shrine.shrinetype == 15)
					{
						NTC_DoClick(NTC_CLICK_LDOWN, NTC_SHIFT_NONE, shrine);
						break;
					}
				}
			}while(shrine.GetNext());
		}
		if(me.GetState(137))
			break;
	}	
}

function SortRoomInt(a, b)
{
	if(GetDistance(me.x, me.y, a[0], a[1]) < GetDistance(me.x, me.y, b[0], b[1]))
		return -1;

	return 1;
}
damit das auch alles wie gewünscht funktioniert musst du natürlich in deiner charconfig catch shrine abschalten da er sonst den ep schrein schon unterwegs nutzt! fals du es aber für andere scripe brauchst fügst du in deinem dia script ganz oben noch das dazu!

Code:
MyConfig_CatchExperienceShrine = false;

und schon wird der bot an der stelle die du eingetragen hast das cs nach einem ep schrein absuchen!
07/29/2010 17:36 FoGzone#3
also sieht es dann bei mir aus:

Code:
//Evrams Multipurpose Chaos Script
function NTMain()
{
	Include("libs/common/NTCommon.ntl");
	NTC_IncludeLibs();
	NTC_IncludeConfig("NTBot/char_configs");

	NT_LoadConfig();
	NTSI_LoadNIPFiles("NTBot/item_configs");

	NTA_Initialize();

	if(!NTTM_CheckAct())
	{
		NTC_SendMsgToScript("NTBotGame.ntj", "NTTM_CheckAct()");
		return;
	}

	NTTMGR_TownManager();

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

	if(!NTM_TakeWaypoint(107))
	{
		NTC_SendMsgToScript("NTBotGame.ntj", "NTM_TakeWaypoint()");
		return;
	}

	NTP_DoPrecast(true);

	if(!NTM_MoveTo(108, 7793, 5577))
	{
		NTC_SendMsgToScript("NTBotGame.ntj", "NTM_MoveTo()");
		return;
	}
	if(NTConfig_ClearEverythingFromEntrance)
{
		NTA_ClearPosition(50, true);
	if(NTConfig_PublicMode)
{
		NTM_MoveTo(108, 7793, 5577);
		NTM_MakeTP();
		
}

		NTM_MoveTo(me.areaid, 7794, 5506);
		NTA_ClearPosition(50, true);
		NTM_MoveTo(me.areaid, 7770, 5475);
		NTA_ClearPosition(50, true);
		NTM_MoveTo(me.areaid, 7819, 5470);
		NTA_ClearPosition(50, true);
		NTM_MoveTo(me.areaid, 7793, 5426);
		NTA_ClearPosition(50, true);
		NTM_MoveTo(me.areaid, 7781, 5384);
		NTA_ClearPosition(50, true);
		NTM_MoveTo(me.areaid, 7819, 5388);
		NTA_ClearPosition(50, true);
		NTM_MoveTo(me.areaid, 7795, 5363);
		NTA_ClearPosition(50, true);
		NTP_DoPrecast(true);
	if(NTConfig_PublicMode)
{
		NTM_MoveTo(me.areaid, 7792, 5291);
		NTM_MakeTP();
		
}
}
	
	if(NTConfig_ClearSpecialsFromEntrance)
{
		NTA_ClearSpecials(50, true);
		NTM_MoveTo(me.areaid, 7794, 5506);
		NTA_ClearSpecials(50, true);
		NTM_MoveTo(me.areaid, 7770, 5475);
		NTA_ClearSpecials(50, true);
		NTM_MoveTo(me.areaid, 7819, 5470);
		NTA_ClearSpecials(50, true);
		NTM_MoveTo(me.areaid, 7793, 5426);
		NTA_ClearSpecials(50, true);
		NTM_MoveTo(me.areaid, 7781, 5384);
		NTA_ClearSpecials(50, true);
		NTM_MoveTo(me.areaid, 7819, 5388);
		NTA_ClearSpecials(50, true);
		NTM_MoveTo(me.areaid, 7795, 5363);
		NTA_ClearSpecials(50, true);
		NTM_MoveTo(me.areaid, 7792, 5291);
		NTA_ClearSpecials(50, true);
		NTP_DoPrecast(true);
		NTM_MoveTo(me.areaid, 7793, 5331);
		NTA_ClearSpecials(50, true);
		NTM_MoveTo(me.areaid, 7747, 5289);
		NTA_ClearSpecials(50, true);
		NTM_MoveTo(me.areaid, 7838, 5289);
		NTA_ClearSpecials(50, true);
		NTM_MoveTo(me.areaid, 7791, 5247);
		NTA_ClearSpecials(50, true);
}

	if(NTConfig_ClearEverythingFromStar)
{
		NTM_MoveTo(me.areaid, 7792, 5291);
		NTA_ClearPosition(30);
	if(NTConfig_PublicMode)
{
		NTM_MoveTo(me.areaid, 7792, 5291);
		NTM_MakeTP();
		
}	
		NTM_MoveTo(me.areaid, 7793, 5331);
		NTA_ClearPosition(50, true);
		NTM_MoveTo(me.areaid, 7747, 5289);
		NTA_ClearPosition(50, true);
		NTP_DoPrecast(true);
}

	if(NTConfig_ClearSpecialsFromStar)
{
		NTM_MoveTo(me.areaid, 7792, 5291);
		NTA_ClearSpecials(30);
		NTM_MoveTo(me.areaid, 7793, 5331);
		NTA_ClearSpecials(50, true);
		NTM_MoveTo(me.areaid, 7747, 5289);
		NTA_ClearSpecials(50, true);
		NTM_MoveTo(me.areaid, 7838, 5289);
		NTA_ClearSpecials(50, true);
		NTM_MoveTo(me.areaid, 7791, 5247);
		NTA_ClearSpecials(50, true);
		NTP_DoPrecast(true);
}

				if(NTConfig_Teleport)
		{
		NTC_SwapWeapons(1)
		}	
	NT_OpenSealsInt();
	
	if(NTConfig_PublicMode)
		

	NTP_DoPrecast(true);
	FindShrines();

	NTM_MoveTo(me.areaid, 7792, 5292);
	
	NTC_FindUnit(NTC_UNIT_MONSTER, 243, 100);
		if(NTConfig_Teleport)
		{
		NTC_SwapWeapons(0)
		}
	NTA_KillMonster(243);
	

	NTSI_PickItems();

	if(NTConfig_PublicMode)
		Say("Next game");

	NTC_SendMsgToScript("NTBotGame.ntj", "SCRIPT_END");
}


// Internal function
function NT_OpenSealsInt()
{
	var i, _unit;
	var _result;

	_unit = GetPresetUnits(me.areaid, NTC_UNIT_OBJECT);

	if(!_unit)
		return false;

	_result = false;

	for(i = 0 ; i < _unit.length ; i++)
	{
		if(_unit[i].id == 396)
		{
			if(_unit[i].roomy*5 + _unit[i].y == 5275)
				_result = NT_OpenVizierSealInt(1);
			else
				_result = NT_OpenVizierSealInt(2);

			break;
		}
	}

	if(!_result)
		return false;

	NTP_DoPrecast(false);

	_result = false;

	for(i = 0 ; i < _unit.length ; i++)
	{
		if(_unit[i].id == 394)
		{
			if(_unit[i].roomx*5 + _unit[i].x == 7773)
				_result = NT_OpenDeSeisSealInt(1);
			else
				_result = NT_OpenDeSeisSealInt(2);

			break;
		}
	}

	if(!_result)
		return false;

	NTP_DoPrecast(false);

	_result = false;

	for(i = 0 ; i < _unit.length ; i++)
	{
		if(_unit[i].id == 392)
		{
			if(_unit[i].roomx*5 + _unit[i].x == 7893)
				_result = NT_OpenVenomSealInt(1);
			else
				_result = NT_OpenVenomSealInt(2);

			break;
		}
	}

	return _result;
}

function NT_OpenVizierSealInt(type)
{

var _monstername = GetLocaleString(2851);
var i, n;

if(NTConfig_ClearEverythingFromEntrance)
{
	var i, n;
	var _attackpos = [7740, 5300, 7740, 5280, 7720, 5280, 7720, 5300];
	

	for(i = 0 ; i < _attackpos.length ; i += 2)
	{
		NTM_MoveTo(me.areaid, _attackpos[i], _attackpos[i+1]);

		NTA_ClearPosition(25, true, 2);
	}
}

if(NTConfig_ClearEverythingFromStar)
{
	var i, n;
	var _attackpos = [7740, 5300, 7740, 5280, 7720, 5280, 7720, 5300];
	

	for(i = 0 ; i < _attackpos.length ; i += 2)
	{
		NTM_MoveTo(me.areaid, _attackpos[i], _attackpos[i+1]);

		NTA_ClearPosition(25, true, 2);
	}
}

if(NTConfig_ClearSpecialsFromEntrance)
{
	var i, n;
	var _attackpos = [7740, 5300, 7740, 5280, 7720, 5280, 7720, 5300];
	

	for(i = 0 ; i < _attackpos.length ; i += 2)
	{
		NTM_MoveTo(me.areaid, _attackpos[i], _attackpos[i+1]);

		NTA_ClearSpecials(25, true, 2);
	}
}

if(NTConfig_ClearSpecialsFromStar)
{
	var i, n;
	var _attackpos = [7740, 5300, 7740, 5280, 7720, 5280, 7720, 5300];
	

	for(i = 0 ; i < _attackpos.length ; i += 2)
	{
		NTM_MoveTo(me.areaid, _attackpos[i], _attackpos[i+1]);

		NTA_ClearSpecials(25, true, 2);
	}
}

	for(i = 0 ; i < 3 ; i++)
	{
		if(type == 1)
		{
			NT_OpenSealInt(395, 7654, 5310);
			NT_OpenSealInt(396, 7659, 5277);

			NTM_MoveTo(me.areaid, 7665, 5277);
		}
		else
		{
			NT_OpenSealInt(395, 7650, 5276);
			NT_OpenSealInt(396, 7651, 5310);
		}

		for(n = 0 ; n < 10 ; n++)
		{
			NTC_Delay(200);
			if(NTConfig_Teleport)
		{
		NTC_SwapWeapons(0)
		}
			if(NTA_KillMonster(_monstername))
			{
if(NTConfig_ClearEverythingFromEntrance)
{				
NTA_ClearPosition();
}
if(NTConfig_ClearEverythingFromStar)
{				
NTA_ClearPosition();
}
if(NTConfig_ClearSpecialsFromEntrance)
{				
NTA_ClearSpecials();
}
if(NTConfig_ClearSpecialsFromStar)
{				
NTA_ClearSpecials();
}
				NTSI_PickItems();
			if(NTConfig_Teleport)
		{
		NTC_SwapWeapons(1)
		}
				return NTM_MoveTo(me.areaid, 7750, 5280);
			}
		}
	}

	return false;
}

function NT_OpenDeSeisSealInt(type)
{
	var i, n;
	var _monstername = GetLocaleString(2852);

if(NTConfig_ClearEverythingFromEntrance)
{
	var _attackpos = [7780, 5255, 7800, 5255, 7800, 5235, 7780, 5235, 7774, 5214];
	var _monstername = GetLocaleString(2852);

	for(i = 0 ; i < _attackpos.length ; i += 2)
	{
		NTM_MoveTo(me.areaid, _attackpos[i], _attackpos[i+1]);

		NTA_ClearPosition(25, true, 2);
	}
}

if(NTConfig_ClearEverythingFromStar)
{
	var _attackpos = [7780, 5255, 7800, 5255, 7800, 5235, 7780, 5235, 7774, 5214];
	var _monstername = GetLocaleString(2852);

	for(i = 0 ; i < _attackpos.length ; i += 2)
	{
		NTM_MoveTo(me.areaid, _attackpos[i], _attackpos[i+1]);

		NTA_ClearPosition(25, true, 2);
	}
}

if(NTConfig_ClearSpecialsFromEntrance)
{
	var _attackpos = [7780, 5255, 7800, 5255, 7800, 5235, 7780, 5235, 7774, 5214];
	var _monstername = GetLocaleString(2852);

	for(i = 0 ; i < _attackpos.length ; i += 2)
	{
		NTM_MoveTo(me.areaid, _attackpos[i], _attackpos[i+1]);

		NTA_ClearSpecials(25, true, 2);
	}
}

if(NTConfig_ClearSpecialsFromStar)
{
	var _attackpos = [7780, 5255, 7800, 5255, 7800, 5235, 7780, 5235, 7774, 5214];
	var _monstername = GetLocaleString(2852);

	for(i = 0 ; i < _attackpos.length ; i += 2)
	{
		NTM_MoveTo(me.areaid, _attackpos[i], _attackpos[i+1]);

		NTA_ClearSpecials(25, true, 2);
	}
}

	for(i = 0 ; i < 3 ; i++)
	{
		if(type == 1)
		{
			NT_OpenSealInt(394, 7769, 5158);

			NTM_MoveTo(me.areaid, 7768, 5206);
		}
		else
		{
			NT_OpenSealInt(394, 7810, 5156);

			NTM_MoveTo(me.areaid, 7773, 5157);
		}

		for(n = 0 ; n < 10 ; n++)
		{
			NTC_Delay(200);
			if(NTConfig_Teleport)
		{
		NTC_SwapWeapons(0)
		}
			if(NTA_KillMonster(_monstername))
			{
if(NTConfig_ClearEverythingFromEntrance)
{				
NTA_ClearPosition();
}
if(NTConfig_ClearEverythingFromStar)
{				
NTA_ClearPosition();
}
if(NTConfig_ClearSpecialsFromEntrance)
{				
NTA_ClearSpecials();
}
if(NTConfig_ClearSpecialsFromStar)
{				
NTA_ClearSpecials();
}
				NTSI_PickItems();
			if(NTConfig_Teleport)
		{
		NTC_SwapWeapons(1)
		}
		if(NTConfig_ClearSpecialsFromStar || NTConfig_ClearSpecialsFromEntrance || NTConfig_ClearEverythingFromStar || NTConfig_ClearEverythingFromEntrance)
		{
		NTP_DoPrecast(true);
		}
		return NTM_MoveTo(me.areaid, 7800, 5255);
			}
		}
	}
	return false;
}

function NT_OpenVenomSealInt(type)
{
	var i, n;
	var _monstername = GetLocaleString(2853);

if(NTConfig_ClearEverythingFromEntrance)
{
	var _attackpos = [7835, 5280, 7835, 5300, 7855, 5300, 7855, 5280];
	

	for(i = 0 ; i < _attackpos.length ; i += 2)
	{
		NTM_MoveTo(me.areaid, _attackpos[i], _attackpos[i+1]);

		NTA_ClearPosition(25, true, 2);
	}
}

if(NTConfig_ClearEverythingFromStar)
{
	var _attackpos = [7835, 5280, 7835, 5300, 7855, 5300, 7855, 5280];
	

	for(i = 0 ; i < _attackpos.length ; i += 2)
	{
		NTM_MoveTo(me.areaid, _attackpos[i], _attackpos[i+1]);

		NTA_ClearPosition(25, true, 2);
	}
}

if(NTConfig_ClearSpecialsFromEntrance)
{
	var _attackpos = [7835, 5280, 7835, 5300, 7855, 5300, 7855, 5280];
	

	for(i = 0 ; i < _attackpos.length ; i += 2)
	{
		NTM_MoveTo(me.areaid, _attackpos[i], _attackpos[i+1]);

		NTA_ClearSpecials(25, true, 2);
	}
}

if(NTConfig_ClearSpecialsFromStar)
{
	var _attackpos = [7835, 5280, 7835, 5300, 7855, 5300, 7855, 5280];
	

	for(i = 0 ; i < _attackpos.length ; i += 2)
	{
		NTM_MoveTo(me.areaid, _attackpos[i], _attackpos[i+1]);

		NTA_ClearSpecials(25, true, 2);
	}
}

	for(i = 0 ; i < 3 ; i++)
	{
		if(type == 1)
		{
			NT_OpenSealInt(393, 7915, 5280);
			NT_OpenSealInt(392, 7895, 5318);

			NTM_MoveTo(me.areaid, 7892, 5298);
		}
		else
		{
			NT_OpenSealInt(393, 7905, 5277);
			NT_OpenSealInt(392, 7916, 5310);

			NTM_MoveTo(me.areaid, 7937, 5305);
		}

		for(n = 0 ; n < 10 ; n++)
		{
			NTC_Delay(200);
			if(NTConfig_Teleport)
		{
		NTC_SwapWeapons(0)
		}
			if(NTA_KillMonster(_monstername))
			{
				NTSI_PickItems();
			if(NTConfig_Teleport)
		{
		NTC_SwapWeapons(1)
		}
				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);

if(NTConfig_ClearEverythingFromEntrance)
{				
NTA_ClearPosition();
}
if(NTConfig_ClearEverythingFromStar)
{				
NTA_ClearPosition();
}
if(NTConfig_ClearSpecialsFromEntrance)
{				
NTA_ClearSpecials();
}
if(NTConfig_ClearSpecialsFromStar)
{				
NTA_ClearSpecials();
}
	_seal = NTC_FindUnit(NTC_UNIT_OBJECT, classid, 5);

	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;
}

function NTA_ClearSpecials(range, pickitem, safelevel)
{
	var _orgx, _orgy;
	var _spectype = [0x0A];
	var _skiplist;
	var _attackcount = 0;
	var _target;
	var _distance, _mingid, _mindistance;
	var _result;

	if(NTConfig_AttackSkill[1] < 1 || NTConfig_AttackSkill[3] < 1)
		return false;

	switch(arguments.length)
	{
	case 0:
		range = 20;
	case 1:
		pickitem = false;
	case 2:
		safelevel = 0;
	default:
		if(NTConfig_CheckSelfSafe < 0x01 && NTConfig_CheckMercSafe < 0x01)
			safelevel = 0;
		break;
	}

	_orgx = me.x;
	_orgy = me.y;

	for(var i = 0 ; i < _spectype.length ; i++)
	{
		_skiplist = new Array();

		while(_attackcount < (i+1)*100)
		{
			_mindistance = 100000;

			_target = NTC_FindUnit(NTC_UNIT_MONSTER);

			if(_target)
			{
				do
				{
					if(_skiplist.indexOf(_target.gid) < 0)
					{
						if(_target.IsAttackable() && (_target.spectype&_spectype[i]))
						{
							if(GetDistance(_orgx, _orgy, _target.x, _target.y) <= range && NTA_IsValidMonster(_target))
							{
								_distance = GetDistance(me, _target);

								if(_distance < _mindistance)
								{
									_mingid = _target.gid;
									_mindistance = _distance;
								}
							}
						}
						else
							_skiplist.push(_target.gid);
					}
				} while(_target.GetNext());
			}

			if(_mindistance < 100000)
			{
				_target = NTC_FindUnit(NTC_UNIT_MONSTER, _mingid);

				if(_target)
				{
					_result = NTA_Attack(_target, (_attackcount%30) == 0);

					switch(_result)
					{
					case 1:
						_skiplist.push(_mingid);
						break;
					case 2:
					case 3:
						_attackcount++;
						break;
					default:
						return false;
					}
				}
			}
			else
				break;
		}
	}

	if(me.classid == NTC_CHAR_CLASS_PALADIN)
	{
		if(_attackcount > 2 && (parseInt(me.hp*100/me.hpmax) < NTConfig_UseRedemptionHP || parseInt(me.mp*100/me.mpmax) < NTConfig_UseRedemptionMP))
		{
			if(NTC_PutSkill(124, NTC_HAND_RIGHT))
				NTC_PingDelay(1000);
		}
	}

	if(NTConfig_OpenChest)
	{
		_target = NTC_GetSpecialChest();

		if(_target && GetDistance(_orgx, _orgy, _target.x, _target.y) <= range && NTC_OpenChest(_target))
			_attackcount++;
	}

	if(pickitem && _attackcount > 0)
		NTSI_PickItems();

	switch(safelevel)
	{
	case 1:
		return NTTMGR_CheckSafe(0x00, NTConfig_CheckMercSafe&0x01);
	case 2:
		return NTTMGR_CheckSafe(NTConfig_CheckSelfSafe, NTConfig_CheckMercSafe);
	}

	return true;
}
//Evrams Multipurpose Chaos Script

function FindShrines()	
{
	var ShrineIds = [2, 83, 85, 86, 93, 96, 97, 109, 116, 120, 123, 124, 133, 134, 135, 136, 150, 151, 172, 173, 184, 190, 191, 197, 199, 200, 201, 226, 231, 232, 260, 275, 276, 277, 278, 279, 282, 299, 300, 303, 325, 361, 414, 415, 421, 422, 423, 427, 428, 464, 465, 472, 479, 483, 484, 488, 491, 492, 495, 497, 499, 503, 509, 512, 520, 521, 522];
	var ShrineLocs = [];
	
	var unit = GetPresetUnits(me.areaid);
	
	if(unit)
	{		
		for (var j = 0; j < unit.length; j++){
			for (var c = 0; c < ShrineIds.length; c++){				
				if (ShrineIds[c] == unit[j].id){
						ShrineLocs.push([unit[j].roomx*5+unit[j].x + 3,unit[j].roomy*5+unit[j].y])					
				}
			}
		}
	}
	
	while(ShrineLocs.length > 0)
	{
		ShrineLocs.sort(SortRoomInt);
		var _room = ShrineLocs.shift();
		NTM_MoveTo(me.areaid, _room[0], _room[1]);		
		var shrine = NTC_FindUnit(NTC_UNIT_OBJECT, "shrine");
		if(shrine){
			do{		
				if(GetDistance(me.x,me.y,shrine.x,shrine.y)<5){
					if(shrine.shrinetype == 15)
					{
						NTC_DoClick(NTC_CLICK_LDOWN, NTC_SHIFT_NONE, shrine);
						break;
					}
				}
			}while(shrine.GetNext());
		}
		if(me.GetState(137))
			break;
	}	
}

function SortRoomInt(a, b)
{
	if(GetDistance(me.x, me.y, a[0], a[1]) < GetDistance(me.x, me.y, b[0], b[1]))
		return -1;

	return 1;
}
In der charconfig is der shrine catsher aus und hab auch nur in dem dia script was geändert.
Er sucht jetzt leider die shrines ned :(
07/29/2010 17:55 sternenlooper#4
Quote:
Originally Posted by Knutschkugel View Post
also sieht es dann bei mir aus:

Code:
//Evrams Multipurpose Chaos Script
function NTMain()
{
	Include("libs/common/NTCommon.ntl");
	NTC_IncludeLibs();
	NTC_IncludeConfig("NTBot/char_configs");

	NT_LoadConfig();
	NTSI_LoadNIPFiles("NTBot/item_configs");

	NTA_Initialize();

	if(!NTTM_CheckAct())
	{
		NTC_SendMsgToScript("NTBotGame.ntj", "NTTM_CheckAct()");
		return;
	}

	NTTMGR_TownManager();

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

	if(!NTM_TakeWaypoint(107))
	{
		NTC_SendMsgToScript("NTBotGame.ntj", "NTM_TakeWaypoint()");
		return;
	}

	NTP_DoPrecast(true);

	if(!NTM_MoveTo(108, 7793, 5577))
	{
		NTC_SendMsgToScript("NTBotGame.ntj", "NTM_MoveTo()");
		return;
	}
	if(NTConfig_ClearEverythingFromEntrance)
{
		NTA_ClearPosition(50, true);
	if(NTConfig_PublicMode)
{
		NTM_MoveTo(108, 7793, 5577);
		NTM_MakeTP();
		
}

		NTM_MoveTo(me.areaid, 7794, 5506);
		NTA_ClearPosition(50, true);
		NTM_MoveTo(me.areaid, 7770, 5475);
		NTA_ClearPosition(50, true);
		NTM_MoveTo(me.areaid, 7819, 5470);
		NTA_ClearPosition(50, true);
		NTM_MoveTo(me.areaid, 7793, 5426);
		NTA_ClearPosition(50, true);
		NTM_MoveTo(me.areaid, 7781, 5384);
		NTA_ClearPosition(50, true);
		NTM_MoveTo(me.areaid, 7819, 5388);
		NTA_ClearPosition(50, true);
		NTM_MoveTo(me.areaid, 7795, 5363);
		NTA_ClearPosition(50, true);
		NTP_DoPrecast(true);
	if(NTConfig_PublicMode)
{
		NTM_MoveTo(me.areaid, 7792, 5291);
		NTM_MakeTP();
		
}
}
	
	if(NTConfig_ClearSpecialsFromEntrance)
{
		NTA_ClearSpecials(50, true);
		NTM_MoveTo(me.areaid, 7794, 5506);
		NTA_ClearSpecials(50, true);
		NTM_MoveTo(me.areaid, 7770, 5475);
		NTA_ClearSpecials(50, true);
		NTM_MoveTo(me.areaid, 7819, 5470);
		NTA_ClearSpecials(50, true);
		NTM_MoveTo(me.areaid, 7793, 5426);
		NTA_ClearSpecials(50, true);
		NTM_MoveTo(me.areaid, 7781, 5384);
		NTA_ClearSpecials(50, true);
		NTM_MoveTo(me.areaid, 7819, 5388);
		NTA_ClearSpecials(50, true);
		NTM_MoveTo(me.areaid, 7795, 5363);
		NTA_ClearSpecials(50, true);
		NTM_MoveTo(me.areaid, 7792, 5291);
		NTA_ClearSpecials(50, true);
		NTP_DoPrecast(true);
		NTM_MoveTo(me.areaid, 7793, 5331);
		NTA_ClearSpecials(50, true);
		NTM_MoveTo(me.areaid, 7747, 5289);
		NTA_ClearSpecials(50, true);
		NTM_MoveTo(me.areaid, 7838, 5289);
		NTA_ClearSpecials(50, true);
		NTM_MoveTo(me.areaid, 7791, 5247);
		NTA_ClearSpecials(50, true);
}

	if(NTConfig_ClearEverythingFromStar)
{
		NTM_MoveTo(me.areaid, 7792, 5291);
		NTA_ClearPosition(30);
	if(NTConfig_PublicMode)
{
		NTM_MoveTo(me.areaid, 7792, 5291);
		NTM_MakeTP();
		
}	
		NTM_MoveTo(me.areaid, 7793, 5331);
		NTA_ClearPosition(50, true);
		NTM_MoveTo(me.areaid, 7747, 5289);
		NTA_ClearPosition(50, true);
		NTP_DoPrecast(true);
}

	if(NTConfig_ClearSpecialsFromStar)
{
		NTM_MoveTo(me.areaid, 7792, 5291);
		NTA_ClearSpecials(30);
		NTM_MoveTo(me.areaid, 7793, 5331);
		NTA_ClearSpecials(50, true);
		NTM_MoveTo(me.areaid, 7747, 5289);
		NTA_ClearSpecials(50, true);
		NTM_MoveTo(me.areaid, 7838, 5289);
		NTA_ClearSpecials(50, true);
		NTM_MoveTo(me.areaid, 7791, 5247);
		NTA_ClearSpecials(50, true);
		NTP_DoPrecast(true);
}

				if(NTConfig_Teleport)
		{
		NTC_SwapWeapons(1)
		}	
	NT_OpenSealsInt();
	
	if(NTConfig_PublicMode)
		

	NTP_DoPrecast(true);
	FindShrines();

	NTM_MoveTo(me.areaid, 7792, 5292);
	
	NTC_FindUnit(NTC_UNIT_MONSTER, 243, 100);
		if(NTConfig_Teleport)
		{
		NTC_SwapWeapons(0)
		}
	NTA_KillMonster(243);
	

	NTSI_PickItems();

	if(NTConfig_PublicMode)
		Say("Next game");

	NTC_SendMsgToScript("NTBotGame.ntj", "SCRIPT_END");
}


// Internal function
function NT_OpenSealsInt()
{
	var i, _unit;
	var _result;

	_unit = GetPresetUnits(me.areaid, NTC_UNIT_OBJECT);

	if(!_unit)
		return false;

	_result = false;

	for(i = 0 ; i < _unit.length ; i++)
	{
		if(_unit[i].id == 396)
		{
			if(_unit[i].roomy*5 + _unit[i].y == 5275)
				_result = NT_OpenVizierSealInt(1);
			else
				_result = NT_OpenVizierSealInt(2);

			break;
		}
	}

	if(!_result)
		return false;

	NTP_DoPrecast(false);

	_result = false;

	for(i = 0 ; i < _unit.length ; i++)
	{
		if(_unit[i].id == 394)
		{
			if(_unit[i].roomx*5 + _unit[i].x == 7773)
				_result = NT_OpenDeSeisSealInt(1);
			else
				_result = NT_OpenDeSeisSealInt(2);

			break;
		}
	}

	if(!_result)
		return false;

	NTP_DoPrecast(false);

	_result = false;

	for(i = 0 ; i < _unit.length ; i++)
	{
		if(_unit[i].id == 392)
		{
			if(_unit[i].roomx*5 + _unit[i].x == 7893)
				_result = NT_OpenVenomSealInt(1);
			else
				_result = NT_OpenVenomSealInt(2);

			break;
		}
	}

	return _result;
}

function NT_OpenVizierSealInt(type)
{

var _monstername = GetLocaleString(2851);
var i, n;

if(NTConfig_ClearEverythingFromEntrance)
{
	var i, n;
	var _attackpos = [7740, 5300, 7740, 5280, 7720, 5280, 7720, 5300];
	

	for(i = 0 ; i < _attackpos.length ; i += 2)
	{
		NTM_MoveTo(me.areaid, _attackpos[i], _attackpos[i+1]);

		NTA_ClearPosition(25, true, 2);
	}
}

if(NTConfig_ClearEverythingFromStar)
{
	var i, n;
	var _attackpos = [7740, 5300, 7740, 5280, 7720, 5280, 7720, 5300];
	

	for(i = 0 ; i < _attackpos.length ; i += 2)
	{
		NTM_MoveTo(me.areaid, _attackpos[i], _attackpos[i+1]);

		NTA_ClearPosition(25, true, 2);
	}
}

if(NTConfig_ClearSpecialsFromEntrance)
{
	var i, n;
	var _attackpos = [7740, 5300, 7740, 5280, 7720, 5280, 7720, 5300];
	

	for(i = 0 ; i < _attackpos.length ; i += 2)
	{
		NTM_MoveTo(me.areaid, _attackpos[i], _attackpos[i+1]);

		NTA_ClearSpecials(25, true, 2);
	}
}

if(NTConfig_ClearSpecialsFromStar)
{
	var i, n;
	var _attackpos = [7740, 5300, 7740, 5280, 7720, 5280, 7720, 5300];
	

	for(i = 0 ; i < _attackpos.length ; i += 2)
	{
		NTM_MoveTo(me.areaid, _attackpos[i], _attackpos[i+1]);

		NTA_ClearSpecials(25, true, 2);
	}
}

	for(i = 0 ; i < 3 ; i++)
	{
		if(type == 1)
		{
			NT_OpenSealInt(395, 7654, 5310);
			NT_OpenSealInt(396, 7659, 5277);

			NTM_MoveTo(me.areaid, 7665, 5277);
		}
		else
		{
			NT_OpenSealInt(395, 7650, 5276);
			NT_OpenSealInt(396, 7651, 5310);
		}

		for(n = 0 ; n < 10 ; n++)
		{
			NTC_Delay(200);
			if(NTConfig_Teleport)
		{
		NTC_SwapWeapons(0)
		}
			if(NTA_KillMonster(_monstername))
			{
if(NTConfig_ClearEverythingFromEntrance)
{				
NTA_ClearPosition();
}
if(NTConfig_ClearEverythingFromStar)
{				
NTA_ClearPosition();
}
if(NTConfig_ClearSpecialsFromEntrance)
{				
NTA_ClearSpecials();
}
if(NTConfig_ClearSpecialsFromStar)
{				
NTA_ClearSpecials();
}
				NTSI_PickItems();
			if(NTConfig_Teleport)
		{
		NTC_SwapWeapons(1)
		}
				return NTM_MoveTo(me.areaid, 7750, 5280);
			}
		}
	}

	return false;
}

function NT_OpenDeSeisSealInt(type)
{
	var i, n;
	var _monstername = GetLocaleString(2852);

if(NTConfig_ClearEverythingFromEntrance)
{
	var _attackpos = [7780, 5255, 7800, 5255, 7800, 5235, 7780, 5235, 7774, 5214];
	var _monstername = GetLocaleString(2852);

	for(i = 0 ; i < _attackpos.length ; i += 2)
	{
		NTM_MoveTo(me.areaid, _attackpos[i], _attackpos[i+1]);

		NTA_ClearPosition(25, true, 2);
	}
}

if(NTConfig_ClearEverythingFromStar)
{
	var _attackpos = [7780, 5255, 7800, 5255, 7800, 5235, 7780, 5235, 7774, 5214];
	var _monstername = GetLocaleString(2852);

	for(i = 0 ; i < _attackpos.length ; i += 2)
	{
		NTM_MoveTo(me.areaid, _attackpos[i], _attackpos[i+1]);

		NTA_ClearPosition(25, true, 2);
	}
}

if(NTConfig_ClearSpecialsFromEntrance)
{
	var _attackpos = [7780, 5255, 7800, 5255, 7800, 5235, 7780, 5235, 7774, 5214];
	var _monstername = GetLocaleString(2852);

	for(i = 0 ; i < _attackpos.length ; i += 2)
	{
		NTM_MoveTo(me.areaid, _attackpos[i], _attackpos[i+1]);

		NTA_ClearSpecials(25, true, 2);
	}
}

if(NTConfig_ClearSpecialsFromStar)
{
	var _attackpos = [7780, 5255, 7800, 5255, 7800, 5235, 7780, 5235, 7774, 5214];
	var _monstername = GetLocaleString(2852);

	for(i = 0 ; i < _attackpos.length ; i += 2)
	{
		NTM_MoveTo(me.areaid, _attackpos[i], _attackpos[i+1]);

		NTA_ClearSpecials(25, true, 2);
	}
}

	for(i = 0 ; i < 3 ; i++)
	{
		if(type == 1)
		{
			NT_OpenSealInt(394, 7769, 5158);

			NTM_MoveTo(me.areaid, 7768, 5206);
		}
		else
		{
			NT_OpenSealInt(394, 7810, 5156);

			NTM_MoveTo(me.areaid, 7773, 5157);
		}

		for(n = 0 ; n < 10 ; n++)
		{
			NTC_Delay(200);
			if(NTConfig_Teleport)
		{
		NTC_SwapWeapons(0)
		}
			if(NTA_KillMonster(_monstername))
			{
if(NTConfig_ClearEverythingFromEntrance)
{				
NTA_ClearPosition();
}
if(NTConfig_ClearEverythingFromStar)
{				
NTA_ClearPosition();
}
if(NTConfig_ClearSpecialsFromEntrance)
{				
NTA_ClearSpecials();
}
if(NTConfig_ClearSpecialsFromStar)
{				
NTA_ClearSpecials();
}
				NTSI_PickItems();
			if(NTConfig_Teleport)
		{
		NTC_SwapWeapons(1)
		}
		if(NTConfig_ClearSpecialsFromStar || NTConfig_ClearSpecialsFromEntrance || NTConfig_ClearEverythingFromStar || NTConfig_ClearEverythingFromEntrance)
		{
		NTP_DoPrecast(true);
		}
		return NTM_MoveTo(me.areaid, 7800, 5255);
			}
		}
	}
	return false;
}

function NT_OpenVenomSealInt(type)
{
	var i, n;
	var _monstername = GetLocaleString(2853);

if(NTConfig_ClearEverythingFromEntrance)
{
	var _attackpos = [7835, 5280, 7835, 5300, 7855, 5300, 7855, 5280];
	

	for(i = 0 ; i < _attackpos.length ; i += 2)
	{
		NTM_MoveTo(me.areaid, _attackpos[i], _attackpos[i+1]);

		NTA_ClearPosition(25, true, 2);
	}
}

if(NTConfig_ClearEverythingFromStar)
{
	var _attackpos = [7835, 5280, 7835, 5300, 7855, 5300, 7855, 5280];
	

	for(i = 0 ; i < _attackpos.length ; i += 2)
	{
		NTM_MoveTo(me.areaid, _attackpos[i], _attackpos[i+1]);

		NTA_ClearPosition(25, true, 2);
	}
}

if(NTConfig_ClearSpecialsFromEntrance)
{
	var _attackpos = [7835, 5280, 7835, 5300, 7855, 5300, 7855, 5280];
	

	for(i = 0 ; i < _attackpos.length ; i += 2)
	{
		NTM_MoveTo(me.areaid, _attackpos[i], _attackpos[i+1]);

		NTA_ClearSpecials(25, true, 2);
	}
}

if(NTConfig_ClearSpecialsFromStar)
{
	var _attackpos = [7835, 5280, 7835, 5300, 7855, 5300, 7855, 5280];
	

	for(i = 0 ; i < _attackpos.length ; i += 2)
	{
		NTM_MoveTo(me.areaid, _attackpos[i], _attackpos[i+1]);

		NTA_ClearSpecials(25, true, 2);
	}
}

	for(i = 0 ; i < 3 ; i++)
	{
		if(type == 1)
		{
			NT_OpenSealInt(393, 7915, 5280);
			NT_OpenSealInt(392, 7895, 5318);

			NTM_MoveTo(me.areaid, 7892, 5298);
		}
		else
		{
			NT_OpenSealInt(393, 7905, 5277);
			NT_OpenSealInt(392, 7916, 5310);

			NTM_MoveTo(me.areaid, 7937, 5305);
		}

		for(n = 0 ; n < 10 ; n++)
		{
			NTC_Delay(200);
			if(NTConfig_Teleport)
		{
		NTC_SwapWeapons(0)
		}
			if(NTA_KillMonster(_monstername))
			{
				NTSI_PickItems();
			if(NTConfig_Teleport)
		{
		NTC_SwapWeapons(1)
		}
				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);

if(NTConfig_ClearEverythingFromEntrance)
{				
NTA_ClearPosition();
}
if(NTConfig_ClearEverythingFromStar)
{				
NTA_ClearPosition();
}
if(NTConfig_ClearSpecialsFromEntrance)
{				
NTA_ClearSpecials();
}
if(NTConfig_ClearSpecialsFromStar)
{				
NTA_ClearSpecials();
}
	_seal = NTC_FindUnit(NTC_UNIT_OBJECT, classid, 5);

	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;
}

function NTA_ClearSpecials(range, pickitem, safelevel)
{
	var _orgx, _orgy;
	var _spectype = [0x0A];
	var _skiplist;
	var _attackcount = 0;
	var _target;
	var _distance, _mingid, _mindistance;
	var _result;

	if(NTConfig_AttackSkill[1] < 1 || NTConfig_AttackSkill[3] < 1)
		return false;

	switch(arguments.length)
	{
	case 0:
		range = 20;
	case 1:
		pickitem = false;
	case 2:
		safelevel = 0;
	default:
		if(NTConfig_CheckSelfSafe < 0x01 && NTConfig_CheckMercSafe < 0x01)
			safelevel = 0;
		break;
	}

	_orgx = me.x;
	_orgy = me.y;

	for(var i = 0 ; i < _spectype.length ; i++)
	{
		_skiplist = new Array();

		while(_attackcount < (i+1)*100)
		{
			_mindistance = 100000;

			_target = NTC_FindUnit(NTC_UNIT_MONSTER);

			if(_target)
			{
				do
				{
					if(_skiplist.indexOf(_target.gid) < 0)
					{
						if(_target.IsAttackable() && (_target.spectype&_spectype[i]))
						{
							if(GetDistance(_orgx, _orgy, _target.x, _target.y) <= range && NTA_IsValidMonster(_target))
							{
								_distance = GetDistance(me, _target);

								if(_distance < _mindistance)
								{
									_mingid = _target.gid;
									_mindistance = _distance;
								}
							}
						}
						else
							_skiplist.push(_target.gid);
					}
				} while(_target.GetNext());
			}

			if(_mindistance < 100000)
			{
				_target = NTC_FindUnit(NTC_UNIT_MONSTER, _mingid);

				if(_target)
				{
					_result = NTA_Attack(_target, (_attackcount%30) == 0);

					switch(_result)
					{
					case 1:
						_skiplist.push(_mingid);
						break;
					case 2:
					case 3:
						_attackcount++;
						break;
					default:
						return false;
					}
				}
			}
			else
				break;
		}
	}

	if(me.classid == NTC_CHAR_CLASS_PALADIN)
	{
		if(_attackcount > 2 && (parseInt(me.hp*100/me.hpmax) < NTConfig_UseRedemptionHP || parseInt(me.mp*100/me.mpmax) < NTConfig_UseRedemptionMP))
		{
			if(NTC_PutSkill(124, NTC_HAND_RIGHT))
				NTC_PingDelay(1000);
		}
	}

	if(NTConfig_OpenChest)
	{
		_target = NTC_GetSpecialChest();

		if(_target && GetDistance(_orgx, _orgy, _target.x, _target.y) <= range && NTC_OpenChest(_target))
			_attackcount++;
	}

	if(pickitem && _attackcount > 0)
		NTSI_PickItems();

	switch(safelevel)
	{
	case 1:
		return NTTMGR_CheckSafe(0x00, NTConfig_CheckMercSafe&0x01);
	case 2:
		return NTTMGR_CheckSafe(NTConfig_CheckSelfSafe, NTConfig_CheckMercSafe);
	}

	return true;
}
//Evrams Multipurpose Chaos Script

function FindShrines()	
{
	var ShrineIds = [2, 83, 85, 86, 93, 96, 97, 109, 116, 120, 123, 124, 133, 134, 135, 136, 150, 151, 172, 173, 184, 190, 191, 197, 199, 200, 201, 226, 231, 232, 260, 275, 276, 277, 278, 279, 282, 299, 300, 303, 325, 361, 414, 415, 421, 422, 423, 427, 428, 464, 465, 472, 479, 483, 484, 488, 491, 492, 495, 497, 499, 503, 509, 512, 520, 521, 522];
	var ShrineLocs = [];
	
	var unit = GetPresetUnits(me.areaid);
	
	if(unit)
	{		
		for (var j = 0; j < unit.length; j++){
			for (var c = 0; c < ShrineIds.length; c++){				
				if (ShrineIds[c] == unit[j].id){
						ShrineLocs.push([unit[j].roomx*5+unit[j].x + 3,unit[j].roomy*5+unit[j].y])					
				}
			}
		}
	}
	
	while(ShrineLocs.length > 0)
	{
		ShrineLocs.sort(SortRoomInt);
		var _room = ShrineLocs.shift();
		NTM_MoveTo(me.areaid, _room[0], _room[1]);		
		var shrine = NTC_FindUnit(NTC_UNIT_OBJECT, "shrine");
		if(shrine){
			do{		
				if(GetDistance(me.x,me.y,shrine.x,shrine.y)<5){
					if(shrine.shrinetype == 15)
					{
						NTC_DoClick(NTC_CLICK_LDOWN, NTC_SHIFT_NONE, shrine);
						break;
					}
				}
			}while(shrine.GetNext());
		}
		if(me.GetState(137))
			break;
	}	
}

function SortRoomInt(a, b)
{
	if(GetDistance(me.x, me.y, a[0], a[1]) < GetDistance(me.x, me.y, b[0], b[1]))
		return -1;

	return 1;
}
In der charconfig is der shrine catsher aus und hab auch nur in dem dia script was geändert.
Er sucht jetzt leider die shrines ned :(
er sucht auch nur die schreine ab wenn es dort schreine gibt ;)
wenn kein schrein da muss er auch nicht schauen ob ein ep schrein dabei ist ^^
ausserdem hat das schreine suchen eine begrenzung in der er scant! also wenn ein schrein zu weit weg ist schaut er auch nicht nach!

man könnte auch einbauen das er das cs dann kurzzeitig verlässt und in anderen ebenen nach schreinen sucht (wie zb beim schrein such script komplett akt 1 absuchen) aber ob sich das zeitlich lohnt bleibt fraglich! ;)
07/29/2010 19:17 FoGzone#5
ich mein er beginnt nichtmal zu suchen
er cleant da letzte siegel und geht direkt zum diaspot
sprich er macht keinerlei anstanden zu suchen, obs überhaupt nen shrine hat
07/29/2010 19:26 sternenlooper#6
Quote:
Originally Posted by Knutschkugel View Post
ich mein er beginnt nichtmal zu suchen
er cleant da letzte siegel und geht direkt zum diaspot
sprich er macht keinerlei anstanden zu suchen, obs überhaupt nen shrine hat
der bot hat einen größeren scanbereich als dein bildschirm ;)

er weiß genau ob sich schreine in seinem einzugsgebiet befinden! sollte er einen schrein entdecken telt er hin und schaut ob es ein ep schrein ist! findet er in seinem bereich KEINEN schrein braucht er auch nicht hintelen!

wohin denn auch gibt ja nichts! also beendet er seinen scan/suche und geht zum nächsten punkt! kill diablo!