kolton / d2bot-with-kolbot

d2bot game manager by D3STROY3R with kolbot libs by kolton for d2bs
346 stars 332 forks source link

How to add enchant #1687

Closed ARkaine2 closed 4 years ago

ARkaine2 commented 5 years ago

There's BATTLE ORDERS SCRIPT in default character config. But how to add in such way enchant?

I added this part of code:

    // ENCHANT SCRIPT -- use this for 2+ characters (for example ench sorc + sorc)
    Scripts.Enchant = true;

But what else should I add (and probably what else should i do?) to make my sharacter receive enchant from sorc that will enter the game, give enchant and then leave the game.

DarkHorseDre commented 5 years ago

You dont need to add anything, ALWAYS read your char configs as the comments are there to help. In this case their self explanatory:

Scripts.Enchant = false;
        Config.Enchant.Triggers = ["chant", "cows", "wps"]; // Chat commands for enchant, cow level and waypoint giving
        Config.Enchant.GetLeg = false; // Get Wirt's Leg from Tristram. If set to false, it will check for the leg in town.
        Config.Enchant.AutoChant = false; // Automatically enchant nearby players and their minions
        Config.Enchant.GameLength = 20; // Game length in minutes
ARkaine2 commented 5 years ago

Okay, now i see. Excuse for troubling and thanks for answer. But now i got another question about running supporter enchant (and/or BO) and team mf at all.

Should i run enchant sorceress (and/or BO barb) with with its own character config and profile? Or probably that can be specified in some config file (like with muling)?

Generaly my question is about: How to make them run together?

DarkHorseDre commented 5 years ago

lol np

each character has its own config (unless you understand how to make common configs - lets leave that out of this) - each char can run their own scripts and some scripts work together (e.g. leader running baal, follower running autobaal - again this is detailed in the config comments and on the wiki on this site) heres an example: https://github.com/kolton/d2bot-with-kolbot/wiki/Team-MFing

I have not ran chant script but it is not an mf script - AFAIK it will wait around to chant similar to the BO script.

you can run BO barb who will wait at catacombs and bo (it has limitations - check you are running the latest copy of kolbot and search the issues on this github if you have issues) or you can have the barb run with mfhelper but it wont specifically BO its teammates without customisation. The enchant sorc doesn't auto enchant teammates AFAIK.

ARkaine2 commented 5 years ago

Okay. I started run follower script successfully (it joins created by leader profile game and accepts party), but it acts in some strange way.

Leader creates game. Follower (ench sorc) joins game. Leader and follower make party.

Leader starts his first script (area/boss) to run (let's say it's pit). And at that time follower DOESN'T GIVE ENCHANT -- that's the problem. Follower succesfully starts Enchant script, but follower doesn't give enchant to leader and its merc at start of the run. Follower just runs to wait near TP area in town.

And only when leader comes back to town (let's say from pit) follower gives enchant to leader and its merc (who came back from town portal). Probably that's becuase of: Config.Enchant.AutoChant = true; // Automatically enchant nearby players and their minions

But how to make ench sorc behave adequately and give leader and its merc enchant from begining of run/game?

ARkaine2 commented 5 years ago

The enchant sorc doesn't auto enchant teammates AFAIK.

I unterstand this. But probably there's some another (smart) way to make "enchant bot"? :) Let's say ench sorc that willl act like BOer (and probably will be based on BattleOrders script).

DarkHorseDre commented 5 years ago

i pasted the information you needed - did you read the comments in the config file that I also pasted above?

please read everything that has been written and take time to familiarise yourself with the files.

ARkaine2 commented 5 years ago

i pasted the information you needed - did you read the comments in the config file that I also pasted above?

Of course yes.

I tried to use Enchant script described in this message:

Scripts.Enchant = false; Config.Enchant.Triggers = ["chant", "cows", "wps"]; // Chat commands for enchant, cow level and waypoint giving Config.Enchant.GetLeg = false; // Get Wirt's Leg from Tristram. If set to false, it will check for the leg in town. Config.Enchant.AutoChant = false; // Automatically enchant nearby players and their minions Config.Enchant.GameLength = 20; // Game length in minutes

But i got problem described in my next message.

DarkHorseDre commented 5 years ago

so... you want autochant. good to know.

where is the follower and leader when it chants the leader after its run?

ARkaine2 commented 5 years ago

(the game is created by leader profile and joined by follower profile) They (leader and follower) both are in town of first act.

Leader immediately starts run (goes to waypoint or to NPC and then to waypoint in town). At the same time chant sorc joins game and starts Enchant script. If leader didn't left town and if chant sorc joined game in tme and if leader with its merc near chant sorc then chant sorc gives enchant to leader and its merc (seems, that it's AutoChant's work). But sometimes leader lefts town and chant sorc joins the game a little too late.

After join game ench sorc goes to location in town where usualy opened town portals.

Then our next chance to get AutoChant is when leader comes back to town (by town portal). Chant sorc stays in town near TP area. Leader enters town by TP. And chant sorc gives enchant to leader and its merc. Then leader continious run with other scripts (in other areas/acts).

Chant sorc is always in first act. Leader runs through different acts and accordingly starts game in different acts (because sometimes exits by chiken). But even if game finished without chickens (because leader's route starts and ends in first act) and if leader started next game in first act chant sorc not always gives enchant to leader and its merc (because as i described abow: chant sorc joins game with little delay and sometimes leader already left town).

DarkHorseDre commented 5 years ago

alright, so I looked at the enchant.js, looks pretty straightforward.

the chanter will 1) need to be in party, 2) need to be at portal spot of any of the towns (or it seems act 1 for autochant), 3) be 35 yards or less from leader to chant (or 40 yards for autochant).

when you read it, you'll see the error messages it will print.

what does the console of the enchanter say? observe it from the time it starts enchant script until it ends and report the errors, If I read the script correctly, autochant is act 1 only, which kinda makes sense.

you can always make changes you want to these parameters to suit your needs

ARkaine2 commented 5 years ago

dsfsddsdf

Chant bot stays in town and waiting when leader will come back to town by TP, and ONLY THEN chant bot gives enchant to leader.

DarkHorseDre commented 5 years ago

I took a quick look at the enchant.js script, seems to be as designed.

if (me.act > 1) {
            Town.goToTown(1);
        }

        if (Config.Enchant.AutoChant) {
            this.autoChant();
        }

basically says to goto act 1 and if not in act 1, go there. then to portal sport. then autochant if configured. it references the other config.enchant.blah within the char config file. you havent shared your config so..