[Release] Muddy's D2NT

06/01/2011 11:35 TheCrazy11#2131
Quote:
Originally Posted by Denny456 View Post
ok ich versuche es mal genauer zu erklären. ich habe hier das baal leech script eingefügt und lasse damit 3 chars leechen. wenn ich morgens nachschaue sehe ich das ein bis zwei chars in game stehn und oben in der script info mw XXXXXXXXXXXX stopped und da steht er manchmal 500 min und länger.
So was kam bei mir auch vor, schau mal im Nachrichtenfenster, ob er bei dir einen Fehler gebracht hat.
Bei mir wars dieser hier: [Only registered and activated users can see links. Click Here To Register...]
Lösung hier: [Only registered and activated users can see links. Click Here To Register...]
Durch den Fehler wird imho das aktuelle Script gestoppt und irgendwie greift die me.maxgametime dann nicht.

Quote:
Originally Posted by Denny456 View Post
ich hoffe ich habe es jetzt was genauer erklärt nach 16 std arbeit und 4 std schlaf.
Pfff, Zeitverschwendung! Du hättest noch 4h mehr arbeiten können! :D
06/01/2011 12:22 Denny456#2132
ich habe cuben ausgestellt also kann es dadran nicht liegen
06/01/2011 12:52 TheCrazy11#2133
Poste die Fehlermeldung, die in deinem Nachrichtenfenster in D2 steht.
Sollte da keine stehen, wird es unfein...
06/01/2011 14:43 -Nemesis1337-#2134
Hab jetz noch zusätzlich versucht die est. Time to Lvl Up ausrechnen zu lassen per
Code:
output += ((me.GetStat(13) - GameStartExp) && (GameStartCharLevel == MW_GetRequiredExp(me.GetStat(12))) ? "\nÿc0Est. Time Until Next Level:ÿc8 " + MWC_ConvertTicksToTimeString(( parseInt(GetTickCount() - _MWBG_Statistics.Init.Ticks) / 1E3) % 60) * _runsToLevel : "");
Jedoch gibt es mir nur NaN auf weil ich irgendwo nen Fehler drin hab :D
Er soll die Zeit die er für den aktuellen run gebraucht hat mit den _runsToLevel multiplizieren.
Dazu will ich die Runtime in Sekunden angeben lassen, da Zahlen wie 4:22 ja nicht einfach so multipliziert werden können, und diese Sekundenangabe * _runsToLevel.

Irgendwas wird noch nicht korrekt als Zahl ausgegeben :D
Hat jemand ne Idee?
06/01/2011 14:54 TheCrazy11#2135
Quote:
Originally Posted by -Nemesis1337- View Post
Hab jetz noch zusätzlich versucht die est. Time to Lvl Up ausrechnen zu lassen per
Code:
output += ((me.GetStat(13) - GameStartExp) && (GameStartCharLevel == MW_GetRequiredExp(me.GetStat(12))) ? "\nÿc0Est. Time Until Next Level:ÿc8 " + MWC_ConvertTicksToTimeString(( parseInt(GetTickCount() - _MWBG_Statistics.Init.Ticks) / 1E3) % 60) * _runsToLevel : ""[COLOR="Red"])[/COLOR];
Jedoch gibt es mir nur NaN auf weil ich irgendwo nen Fehler drin hab :D
Er soll die Zeit die er für den aktuellen run gebraucht hat mit den _runsToLevel multiplizieren.
Dazu will ich die Runtime in Sekunden angeben lassen, da Zahlen wie 4:22 ja nicht einfach so multipliziert werden können, und diese Sekundenangabe * _runsToLevel.

Irgendwas wird noch nicht korrekt als Zahl ausgegeben :D
Hat jemand ne Idee?
Welchen Sinn hat die Klammer am Ende? Hab sie dir mal markiert. :D
06/01/2011 15:49 -Nemesis1337-#2136
Quote:
Originally Posted by TheCrazy11 View Post
Welchen Sinn hat die Klammer am Ende? Hab sie dir mal markiert. :D
Ist die Schlussklammer zur ersten Klammer^^
Weil Farben so schön sind :D

Code:
output += [COLOR="Red"]([/COLOR][COLOR="DarkOliveGreen"]([/COLOR]me.GetStat(13) - GameStartExp[COLOR="DarkOliveGreen"])[/COLOR] && [COLOR="DarkOrange"]([/COLOR]GameStartCharLevel == MW_GetRequiredExp[COLOR="Purple"]([/COLOR]me.GetStat[COLOR="Cyan"]([/COLOR]12[COLOR="Cyan"])[/COLOR][COLOR="Purple"])[/COLOR][COLOR="DarkOrange"])[/COLOR] ? "\nÿc0Est. Time Until Next Level:ÿc8 " + MWC_ConvertTicksToTimeString[COLOR="Sienna"]([/COLOR][COLOR="Plum"]([/COLOR] parseInt[COLOR="Blue"]([/COLOR]GetTickCount() - _MWBG_Statistics.Init.Ticks[COLOR="Blue"])[/COLOR] / 1E3[COLOR="Plum"])[/COLOR] % 60[COLOR="Sienna"])[/COLOR] * _runsToLevel : ""[COLOR="Red"])[/COLOR];
Oder brauch ich keine Klammer um gesamte Funktion?^^
Weil die _runsToLevel hat auch eine Klammer komplett drum und funzt:
Code:
((me.GetStat(13) - GameStartExp) && (GameStartCharLevel == MW_GetRequiredExp(me.GetStat(12))) ? "\nÿc0Est. Runs Until Next Level:ÿc8 " + _runsToLevel : "");
06/01/2011 18:38 Muddy Waters#2137
Mir fehlt ehrlich gesagt etwas der Kontext, ist so recht schwer nachzuvollziehen. Wo und wie wird beispielsweise _runsToLevel initialisiert? Und warum rechnest du die absolute Anzahl an Sekunden Modulo 60, wenn du doch gerade erstere verwenden willst?

LG
Muddy
06/01/2011 20:19 JustAnotherKeyshop#2138
Hallo Ihr,
hab seit heute auch ein problemchen -.-
Meine Bots trinken keine Pots mehr, es ging zu anfang mal, doch jetzt plötzlich nicht mehr wodurch ich öfters Chicken drops habe. (Bei nur einem laufendem Bot scheint es zu gehen, sobald aber 2 oder 3 laufen trinken sie nicht mehr)
Ich habe eigentlich nichts geändert zu vorher, hoffe mir kann da jemand helfen.

Hier noch die sachen aus der cfg:

Code:
	//------------------------------------------------------------------------------
	// Misc Configuration
	//------------------------------------------------------------------------------
	
	NTConfig_SkipHealLife = 90;		// If you have more than this percent of life, you won't go to a healer.
	NTConfig_SkipHealMana = 70;		// If you have more than this percent of mana, you won't go to a healer
	NTConfig_UseMerc = true;		// Set to true if you use a mercenary, will revive merc at a reviver npc.
	MWConfig_ResetArmor = false;	// Set to true to reset your Enigma if Teleport skill is missing. WARNING: Activating this feature may - though not likely will - result in the loss of your enigma. Use at your own risk!

	//------------------------------------------------------------------------------
	// Potion Configuration
	//------------------------------------------------------------------------------
	
	NTConfig_LifeThresh = 80;		// Drink a normal potion if under this percent of life.
	NTConfig_LifeRejuvThresh = 60;	// Drink a rejuvenation potion if under this percent of life.
	NTConfig_ManaThresh = 30;		// Drink a normal potion if under this percent of mana.
	NTConfig_ManaRejuvThresh = 0;	// Drink a rejuvenation potion if under this percent of mana.
	
	NTConfig_MercLifeThresh = 50;	// This is the threshold to use a life potion on your merc in percent.
	NTConfig_MercRejuvThresh = 30;	// This is the threshold to use a rejuv potion on your merc in percent.
	
	//------------------------------------------------------------------------------
	// Chicken Configuration
	//------------------------------------------------------------------------------
	
	// This is your chicken life. If you go below this threshhold, your char will exit the game. You can either enter a percentage (1-100), an absolute threshold (>100) or 0 to deactivate life chicken.
	NTConfig_LifeChicken = 20;
	// This is your chicken mana. If you go below this threshhold, your char will exit the game. You can either enter a percentage (1-100), an absolute threshold (>100) or 0 to deactivate mana chicken.
	NTConfig_ManaChicken = 0;
	// This is your merc's chicken life in percent. If your merc goes below this threshhold, your char will exit the game.
	NTConfig_MercChicken = 0;
	
	//------------------------------------------------------------------------------
	// Inventory Configuration
	//------------------------------------------------------------------------------
	
	// Number of free columns. If less full columns are free stashing is set.
	NTConfig_FreeSpace = 5;

	// Each number represents a slot in your inventory.
	// Set to 0 if the slot and its content must not be touched.
	// Set to 1 to allow access to this slot.
	// Set to 2 to select the slot that is used for storing keys. (if keys are kept at another slot, your char will try to move them)
	NTConfig_Columns[0] = [1,1,1,1,1,0,0,0,0,0];
	NTConfig_Columns[1] = [1,1,1,1,1,0,0,0,0,0];
	NTConfig_Columns[2] = [1,1,1,1,1,0,0,0,0,0];
	NTConfig_Columns[3] = [1,1,1,1,2,0,0,0,0,0];

	// Maximum gold amount carried before going to stash.
	NTConfig_MinGoldToStash = 250000;
	
	// Set to true if your char is supposed to carry, buy and pick up keys. You do not need to add keys to your .nip files, they will be picked up anyway if this is set to true.
	MWConfig_CarryKeys = true;

	//------------------------------------------------------------------------------
	// Belt Configuration
	//------------------------------------------------------------------------------
	
	// Determine how many columns for each type of potion are used.
	// Available types : "hp" = health | "mp" = mana | "rv" = rejuvenation
	// The first number indicates how many columns will be used for this type of potion.
	// The second number indicates the minimum amount of potions in one column. If there are less potions in a single column when your char is in town, he will is visit a merchant in order to buy potions.
	// Unlike in vanilla D2NT, there is no need to specify which column is used for certain type of potion, this will be chosen automatically!
	MWConfig_BeltTypeColQuantity["hp"] = [2, 1];
	MWConfig_BeltTypeColQuantity["mp"] = [2, 1];
	MWConfig_BeltTypeColQuantity["rv"] = [0, 0];
	
	// Visit Town and buy potions if your char lacks mana when trying to loot a corpse or teleport.
	MWConfig_BuyPotionsOnLackOfMana = true;
	
	// Set to true to replace low quality potions with higher quality potions that just dropped.
	MWConfig_ReplaceLowQualityPotions = true;
06/01/2011 21:43 chrischris2#2139
Hello,
Is english allowed on this post please ?
I can't read and write german.
Thx
06/01/2011 21:54 Muddy Waters#2140
Quote:
Originally Posted by Insaneety View Post
Hallo Ihr,
hab seit heute auch ein problemchen -.-
Meine Bots trinken keine Pots mehr, es ging zu anfang mal, doch jetzt plötzlich nicht mehr wodurch ich öfters Chicken drops habe. (Bei nur einem laufendem Bot scheint es zu gehen, sobald aber 2 oder 3 laufen trinken sie nicht mehr)
Ich habe eigentlich nichts geändert zu vorher, hoffe mir kann da jemand helfen.

Hier noch die sachen aus der cfg:

Code:
	//------------------------------------------------------------------------------
	// Misc Configuration
	//------------------------------------------------------------------------------
	
	NTConfig_SkipHealLife = 90;		// If you have more than this percent of life, you won't go to a healer.
	NTConfig_SkipHealMana = 70;		// If you have more than this percent of mana, you won't go to a healer
	NTConfig_UseMerc = true;		// Set to true if you use a mercenary, will revive merc at a reviver npc.
	MWConfig_ResetArmor = false;	// Set to true to reset your Enigma if Teleport skill is missing. WARNING: Activating this feature may - though not likely will - result in the loss of your enigma. Use at your own risk!

	//------------------------------------------------------------------------------
	// Potion Configuration
	//------------------------------------------------------------------------------
	
	NTConfig_LifeThresh = 80;		// Drink a normal potion if under this percent of life.
	NTConfig_LifeRejuvThresh = 60;	// Drink a rejuvenation potion if under this percent of life.
	NTConfig_ManaThresh = 30;		// Drink a normal potion if under this percent of mana.
	NTConfig_ManaRejuvThresh = 0;	// Drink a rejuvenation potion if under this percent of mana.
	
	NTConfig_MercLifeThresh = 50;	// This is the threshold to use a life potion on your merc in percent.
	NTConfig_MercRejuvThresh = 30;	// This is the threshold to use a rejuv potion on your merc in percent.
	
	//------------------------------------------------------------------------------
	// Chicken Configuration
	//------------------------------------------------------------------------------
	
	// This is your chicken life. If you go below this threshhold, your char will exit the game. You can either enter a percentage (1-100), an absolute threshold (>100) or 0 to deactivate life chicken.
	NTConfig_LifeChicken = 20;
	// This is your chicken mana. If you go below this threshhold, your char will exit the game. You can either enter a percentage (1-100), an absolute threshold (>100) or 0 to deactivate mana chicken.
	NTConfig_ManaChicken = 0;
	// This is your merc's chicken life in percent. If your merc goes below this threshhold, your char will exit the game.
	NTConfig_MercChicken = 0;
	
	//------------------------------------------------------------------------------
	// Inventory Configuration
	//------------------------------------------------------------------------------
	
	// Number of free columns. If less full columns are free stashing is set.
	NTConfig_FreeSpace = 5;

	// Each number represents a slot in your inventory.
	// Set to 0 if the slot and its content must not be touched.
	// Set to 1 to allow access to this slot.
	// Set to 2 to select the slot that is used for storing keys. (if keys are kept at another slot, your char will try to move them)
	NTConfig_Columns[0] = [1,1,1,1,1,0,0,0,0,0];
	NTConfig_Columns[1] = [1,1,1,1,1,0,0,0,0,0];
	NTConfig_Columns[2] = [1,1,1,1,1,0,0,0,0,0];
	NTConfig_Columns[3] = [1,1,1,1,2,0,0,0,0,0];

	// Maximum gold amount carried before going to stash.
	NTConfig_MinGoldToStash = 250000;
	
	// Set to true if your char is supposed to carry, buy and pick up keys. You do not need to add keys to your .nip files, they will be picked up anyway if this is set to true.
	MWConfig_CarryKeys = true;

	//------------------------------------------------------------------------------
	// Belt Configuration
	//------------------------------------------------------------------------------
	
	// Determine how many columns for each type of potion are used.
	// Available types : "hp" = health | "mp" = mana | "rv" = rejuvenation
	// The first number indicates how many columns will be used for this type of potion.
	// The second number indicates the minimum amount of potions in one column. If there are less potions in a single column when your char is in town, he will is visit a merchant in order to buy potions.
	// Unlike in vanilla D2NT, there is no need to specify which column is used for certain type of potion, this will be chosen automatically!
	MWConfig_BeltTypeColQuantity["hp"] = [2, 1];
	MWConfig_BeltTypeColQuantity["mp"] = [2, 1];
	MWConfig_BeltTypeColQuantity["rv"] = [0, 0];
	
	// Visit Town and buy potions if your char lacks mana when trying to loot a corpse or teleport.
	MWConfig_BuyPotionsOnLackOfMana = true;
	
	// Set to true to replace low quality potions with higher quality potions that just dropped.
	MWConfig_ReplaceLowQualityPotions = true;
Ganz sicher? Das ist dauerhaft der Fall? :confused:

Wenn ja würde ich dir mal einen ToolsThread mit Debug Ausgaben fertig machen, alternativ kannst du das natürlich auch selber machen, sofern Ahnung vorhanden ist. :)

Quote:
Originally Posted by chrischris2 View Post
Hello,
Is english allowed on this post please ?
I can't read and write german.
Thx
It definitely is - feel free to post comments or ask questions in English. :)

Kind Regards
Muddy
06/01/2011 23:24 -Nemesis1337-#2141
Quote:
Originally Posted by Muddy_Waters View Post
Mir fehlt ehrlich gesagt etwas der Kontext, ist so recht schwer nachzuvollziehen. Wo und wie wird beispielsweise _runsToLevel initialisiert? Und warum rechnest du die absolute Anzahl an Sekunden Modulo 60, wenn du doch gerade erstere verwenden willst?

LG
Muddy
Also :)

_runsToLevel wird so initialisiert.
Code:
	var _progressPercent = parseInt(1000 * (_endExp - _endLvlExp) / _ExpToNextLvl[_endLvl]) / 10;
	var _runsToLevel = (100 -_progressPercent) * _ExpToNextLvl[_endLvl] / (100 * _expGained);
	if(_runsToLevel > 10)
		_runsToLevel = parseInt(_runsToLevel);
	else
		_runsToLevel = parseInt(100 * _runsToLevel) / 100;
Ich weiß nur net wie ich die Zeit die z.b. als Duration per
Code:
	_output += "ÿc0Duration:ÿc8 " + MWC_ConvertTicksToTimeString(GetTickCount() - _MWBG_Statistics.Init.Ticks);
ausgegeben wird, mit der ausgerechneten _RunsToLevel Anzahl multiplizieren kann damit ne sinnvolle Zahl rauskommt^^

Oder kann ich die Zeit irgendwie direkt per MWC_ConvertTicksToTimeString in Sekunden anzeigen lassen?

Danke das du dir die Zeit nimmst^.^
06/01/2011 23:59 Muddy Waters#2142
Also ich weiss ja nicht, ob angesichts des morgigen Tages schon frühzeitig mein Verstand aussetzt, aber ich kann deine Rechnung nach wie vor nicht ganz nachvollziehen. :(

Ohne wirklich zu verstehen, was Sache ist, hier mal zwei generelle Anmerkungen:
1.:
Zahlen sind in JavaScript Number Objekte. Für Number Objekte ist die Methode toFixed() definiert. Diese gibt den Zahlenwert des Number Objekts mit der angegebenen Anzahl an Nachkommastellen zurück. Sollen weniger Nachkommastellen zurückgegeben werden, als das Number Objekt eigentlich hat, wird kaufmännisch gerundet.
Als Parameter beim Aufruf wird sinnigerweise ein Integer Wert erwartet, der die gewünschte Anzahl an Nachkommastellen angibt.
So wie du es derzeit machst, klappt es zwar auch, ist aber sehr unübersichtlich und sorgt für schlecht lesbaren Code. ;)

2.:
Schau dir doch erstmal an, was Ticks in diesem Fall sind - nämlich die Anzahl an Millisekunden, die seit einem bestimmten Zeitpunkt in der Vergangenheit (ich weiss gerade nicht, welcher das hier konkret ist) vergangen ist. Für sich genommen erstmal relativ uninteressant.

Interessant wird es erst, wenn man die Ticks zu einem gewissen Zeitpunkt in einer Variable zwischenspeichert und dann mit den aktuellen Ticks vergleicht- wobei Vergleichen hier das Bilden der Differenz bedeutet.
Diese Differenz sagt nun aus, wieviele Millisekunden seit dem Zeitpunkt A, an dem das Speichern in die Variable erfolgte, bis zum Zeitpunkt B, also jetzt bzw. zum Zeitpunkt des Aufrufs von GetTickCount(), vergangen sind.

Man hat nun also irgendeinen Zahlenwert in Millisekunden. Das einzige was man jetzt noch machen muss, ist diesen Wert in die Grundeinheit zu überführen, was ja bei SI-Einheiten nicht weiter schwer ist:
Code:
[COLOR="Red"]x[/COLOR][Strike]ms[/Strike] * 10^-3s / [Strike]ms[/Strike] = [COLOR="Red"]x[/COLOR]s / 10^3
Man könnte natürlich auch einfach sagen, du musst die Differenz der Ticks durch 1000 dividieren, aber so wie oben ist es auf elementare Grundsätze zum Rechnen mit Dimensionen zurückgeführt, von denen eigentlich jeder schonmal etwas in Physik gehört haben sollte - ich hoffe jedenfalls, es wirkt irgendwie vertraut. :)

LG
Muddy
06/02/2011 01:45 Denny456#2143
Quote:
Originally Posted by TheCrazy11 View Post
Poste die Fehlermeldung, die in deinem Nachrichtenfenster in D2 steht.
Sollte da keine stehen, wird es unfein...
sollte das an mich gerichtet sein werde sie heute abend nochmal laufen lassen und dann nach schauen ob das wieder passiert. stimmt chat log habe ich nicht verfolgt als der "fehler" kam. omg wie dumm von mir
06/02/2011 08:16 David Dean#2144
The reason this is all in german chrischris2 is because the author of this mod is german. My advice is to use google translate. It actually works nice to be able to read and understand whats going on.

Just alot of work! :D

Here is a link to it: [Only registered and activated users can see links. Click Here To Register...]
06/02/2011 09:50 chrischris2#2145
Ok.
So Muddy, first thanks for your d2nt bot version, which seems smarter that "official" d2nt.

I'm trying it, and wonder if it's possible to tune it to avoid "regular monsters", which is done with NTConfig_SkipRegularMonsters var in etal's bot.
And im boting witch a bone nec, and moded etal's bot to make nec use rather often "corpse explosion". Is there a possibility to do it in your bot without modify nta_attack function ?

Thx.
Chris.