CountUniques

I found countUniques function (it’s about unique monsters packs, not items) in Attack.js
I wanted to use something like this (or even excactly this) for a long time.

Because, as you can know, most packs of unique monsters at map are usualy spawned near each other.

For example:
If map contains 5 packs of unique monsters > you’ll met 3~ packs near each other.
If map contains 7 packs of unique monsters > you’ll met 5~ packs near each other.

How countUniques can be used (for exmple with MFHelper)?

Any help?

I am uncertain if I know how to do this, yet, can you clarify what you wish your MFHelper to do?
Are you wanting your MFHelper to go straight to where there are large packs of unique monsters?

If that is the case, then you may want to look at this condition in the Attack.js script, as it is centred on only uniques and boss monsters:

  • (target.spectype & 0x7)

As the while loop cycles through the monsterList array, it focuses the char attacks upon solely unique and boss monsters.

1 Like

I’ll try to clarify in shorter words:

That’s not about difference of MFLeader/MFHelper.
So I suppose that we are talking about ClearAnyArea script (or any other script with any MFLeader/MFHelper settings).

I want to:

  1. Add check/condition of certain amount of unique/champion monsters packs were found in certain area.
  2. If/when bot find (and maybe kill) specified amount of packs of unique/champion monsters (IN CERTAIN AREA), bot should finish this area/script / go to town / go next area/script.

By “area” I mean areas that are specifying via:

Not some parts of these locations.

I don’t know where this check/condition (of certain amount of unique/champion monsters) should be added (probably into script that bot is running or maybe into Attack.js or somewhere else).

What will be difference from?
Config.ClearType = 0x7
(in config file)

The problem of using casual Config.ClearType is that bot check all area. But I’d wish to:

I didn’t get this point.
What do you mean by “large packs of unique monsters”?
I’d wish bot to go straight to where there are LARGE AMOUNT OF PACKS of unique monsters.

Anyway thanks for clarifiyng this moment in discussion.
I hope that you understood what I mean.

Look what I mean:

  1. Character entered City of Damned.
  2. He see some amount of unique monsters nearby.
  3. I’d wish him to kill them.
  4. And go to next area:

    (he enters Plains of Despair and again sees some amount of unique packs nearby each other)

And so on (kill em and go to next area):


(Outer Steppes)

I think that this can let us save some important time.

Good morning,

  • I know that you can set your character profile file (Sorceress_yourcharname.js) to only kill uniques and bosses, it will avoid any of the regular monsters:
    Config.ClearType = 0x7; // Monster spectype to kill in level clear scripts (ie. Mausoleum). 0xF = skip normal, 0x7 = champions/bosses, 0 = all

  • if you wish to just clear the unique monsters near to the wp you are at, then you may need to call upon this function from the Attack,js file:
    clear: function (range, spectype, bossid, sortFunc, pickit) { … }

Just set the range when you call upon that function, e.g.:

  • clear: function (40, 0x7, , ,true);
    40 for the range to clear around the wp, 0x7 to avoid all the normal monsters, and true for pickit

What I think that you are asking requires you to alter one or more bot scripts. Or, you can create your own where your char goes to the wp, calls upon the clear: function (40, 0x7, , ,true); and then returns to town to continue.

I’ll try to describe you the “problem” of this way (with using Config.ClearType = 0x7 with Attack.clearLevel that is in ClearAnyArea.js):
Let’s say bot started clearing some area (with specified type etc), he meets unique packs and kills them.
But by default bot CHECK ALL AREA – that’s the problem (what I’m asking about).
I’d wish to stop/finish current area when bot met/kill some amount of uniques monsters packs in this area.

Seems that clear: function has potential, but it looks like too “static” – you became “fixed” just to WP (or somewhere else).

With using clear: function it’s necessary to make bot move in some/random way/direction and after finding/killing some amount of unique monsters stop this script/cycle – how to do that?

I want to make bot move (“wander”) in the area like with usual Attack.clearLevel until bot find/kill some (specified by me) amount of unique packs (that I suppose / I’m sure well be nearby each other with some variability – so bot’s moving shouldn’t be “fixed” and should be more dynamic/random, more like “wandering”).

What I need is (in shorter than in previous message words):

  1. Wander in some area like with usual Attack.clearLevel.
  2. Find some amount of unique packs.
  3. When bot found/killed them, do something else (finish this area/script / go to town / go next area/script).

Let’s look another example:

3 teleports = 5 packs met.

I’d like to make bot:
Find (some amount of) packs (not just move in some fixed direction, but preferable random/“wandering”).
Kill them.
Finish script.
And to be able to do this with any area / multiple areas.

1 Like

Ah. Yeah, sorry. That is all that I know about.
I hope someone else can chime in and share their ideas, too.
What I can see, while looking at what you need, you will probably have to write a complete script solely for the types of attacks that you hope to achieve. That is going to take a bit of time, tweaking, and then refining.

Well, if I think of anything else, I will share. But, I am stuck on just being able to clear around the wp and unable to figure out how to scan for unique packs, so as to head straight for them and for nothing else.

1 Like

I made copy (and named it clearLevel2) of whole clearLevel part in Attack.js

I changed content of ClearAnyArea.js

from:

to:

and added:

to clearLevel2 (which is in Attack.js).

so it looks like:

– it’s simple unique check and seems it works (bot starts next area when met some uniques).

But how to make counter?

Maybe some way to combine with:

(also from Attack.js)

But I dunno how.

Maybe someone is good enough at coding or interested in this too to make this possible.