kolton / d2bot-with-kolbot

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

Take screenshots? #1356

Open oband2 opened 5 years ago

oband2 commented 5 years ago

Wasnt able to find anything about this so here we go.

I know the bot takes screenshot if its hostiled and kills someone, but is there any way i can program it so it will also take screenshot whenever i pick up a HR, or anything special. Would like to see where i find it exactly, area is not enough.

can i do this? what would the code look like, and where to place it? ty in advance.

noah- commented 5 years ago

takescreenshot();

you would need to add this in the pickit code somewhere with some conditions when it should take the screenshot

oband2 commented 5 years ago

so like this? takescreenshot(); [name] >= pulrune && [name] <= zodrune ?

noah- commented 5 years ago

no, it would need to be in the code that checks when items are kept you can't add it to the .nip files themselves, though I like that as an feature idea, adding predicates to pickits

oband2 commented 5 years ago

So what you're saying is, that its unable to function atm?

noah- commented 5 years ago

takescreenshot functions, you need to modify kolbot pick items code (.js file) to get the feature you want, you can't add it as a condition in the nip file

oband2 commented 5 years ago

Any chance u can be more specific about how to do it when picking up hrs? what would the code look like, and where to place it? sorry but im pretty retarded about creating these codes and how it exactly works

mf022 commented 5 years ago

for any item picked up, maybe you should look to Pickit.js, ~lines 158 ++

                    // Item can fit - pick it up
                    if (canFit) {
                        this.pickItem(pickList[0], status.result, status.line);
                        takescreenshot();
                    }

or maybe you should try only to add the rune condition for picked items, in lines 277++

                if (Config.FastPick < 2) {
                    Misc.click(0, 0, item);
                    if (item.itemType === 74) {
                        takescreenshot();
                    }
                } else {
                    sendPacket(1, 0x16, 4, 0x4, 4, item.gid, 4, 0);
                    if (item.itemType === 74) {
                        takescreenshot();
                    }
                }