Skip to content

질문/답변

d2bs 아이템옮기기관련 질문드립니다

조회 수 1,146 추천 수 0

nt에서 오토아이템처럼 자동으로 보관함+스태쉬+큐브까지 채워주는 스크립트를 이용하고 싶은데


기본으로 들어가면 기능이 없는거 같아서요~ 해커스에서 스크립트로 찾긴했는데 


default파일안에 짜집해서 집어넣으면 오류가 나서 되지가 않아서 2틀째 화가나네요 ㅋ


죄송하지만 고수분들의 도움부탁드리겠습니다(__)...


우선 default 파일기본형식입니다.



// default.dbj gets executed upon gamejoin

js_strict(true);


include("json2.js");

include("NTItemParser.dbl");

include("OOG.js");

include("AutoMule.js");

include("Gambling.js");

include("CraftingSystem.js");

include("TorchSystem.js");

include("MuleLogger.js");

include("common/Attack.js");

include("common/Cubing.js");

include("common/CollMap.js");

include("common/Config.js");

include("common/Loader.js");

include("common/Misc.js");

include("common/Pickit.js");

include("common/Pather.js");

include("common/Precast.js");

include("common/Prototypes.js");

include("common/Runewords.js");

include("common/Storage.js");

include("common/Town.js");


function main() {

D2Bot.init(); // Get D2Bot# handle

D2Bot.ingame();


// wait until game is ready

while (!me.gameReady) {

delay(50);

}


if (!getScript("tools/heartbeat.js")) {

load("tools/heartbeat.js");

}


if (getScript("d2botmap.dbj")) {

load("tools/mapthread.js");

load("tools/ToolsThread.js");


while (true) {

delay(1000);

}

}


// don't load default for mules

if (getScript("D2BotMule.dbj")) {

return true;

}


// MuleLogger handler

if (MuleLogger.inGameCheck()) {

return true;

}


var i, sojPause, stats, anni,

sojCounter = 0,

startTime = getTickCount();


this.itemEvent = function (gid, mode, code, global) {

if (gid > 0 && mode === 0) {

Pickit.gidList.push(gid);

}

};


this.scriptEvent = function (msg) {

switch (msg) {

case "soj":

sojPause = true;

sojCounter = 0;


break;

}

};


this.copyDataEvent = function (mode, msg) {

if (mode === 0 && msg === "mule") { // "Mule Profile" option from D2Bot#

if (AutoMule.getInfo() && AutoMule.getInfo().hasOwnProperty("muleInfo")) {

if (AutoMule.getMuleItems().length > 0) {

D2Bot.printToConsole("Mule triggered");

scriptBroadcast("mule");

scriptBroadcast("quit");

} else {

D2Bot.printToConsole("No items to mule.");

}

} else {

D2Bot.printToConsole("Profile not enabled for muling.");

}

}

};


// Initialize libs - load config variables, build pickit list, attacks, containers and cubing and runeword recipes

Config.init(true);

Pickit.init(true);

Attack.init();

Storage.Init();

CraftingSystem.buildLists();

Runewords.init();

Cubing.init();


// AutoMule handler

if (AutoMule.inGameCheck()) {

return true;

}


// TorchSystem handler

if (TorchSystem.inGameCheck()) {

return true;

}


// Gambling System handler

if (Gambling.inGameCheck()) {

return true;

}


// Crafting System handler

if (CraftingSystem.inGameCheck()) {

return true;

}


me.maxgametime = Config.MaxGameTime * 1000;

stats = DataFile.getStats();


// Check for experience decrease -> log death. Skip report if life chicken is disabled.

if (stats.name === me.name && me.getStat(13) < stats.experience && Config.LifeChicken > 0) {

D2Bot.printToConsole("You died in last game", 9);

D2Bot.printToConsole("Experience decreased by " + (stats.experience - me.getStat(13)), 9);

DataFile.updateStats("deaths");

D2Bot.updateDeaths();

}


DataFile.updateStats(["experience", "name"]);


// Load events and threads

addEventListener("scriptmsg", this.scriptEvent);

addEventListener("copydata", this.copyDataEvent);

load("tools/ToolsThread.js");


if (Config.TownCheck || Config.TownHP || Config.TownMP) {

load("tools/TownChicken.js");

}


if (Config.PublicMode) {

load("tools/Party.js");

}


if (Config.AntiHostile) {

load("tools/AntiHostile.js");

}


if (Config.FastPick) {

print("c2Fast pickit active.");

addEventListener("itemaction", this.itemEvent);

}


// One time maintenance - get corpse, clear leftover items, pick items in case anything important was dropped

if (!Scripts.UserAddon && !Scripts.Test) {

Town.getCorpse();

Town.clearBelt();

Town.clearInventory();

//Pickit.pickItems();

}


me.automap = Config.AutoMap;



// Next game = drop keys

if (TorchSystem.keyCheck()) {

scriptBroadcast("torch");

}


// Go

Loader.init();


if (Config.MinGameTime && getTickCount() - startTime < Config.MinGameTime * 1000) {

try {

Town.goToTown();


while (getTickCount() - startTime < Config.MinGameTime * 1000) {

me.overhead("Stalling for " + Math.round(((startTime + (Config.MinGameTime * 1000)) - getTickCount()) / 1000) + " Seconds");

delay(1000);

}

} catch (e1) {

print(e1);

}

}


DataFile.updateStats("gold");


if (sojPause) {

try {

Town.goToTown();

Town.doChores();


me.maxgametime = 0;


while (sojCounter < Config.SoJWaitTime) {

me.overhead("Waiting for SoJ sales... " + (Config.SoJWaitTime - sojCounter) + " min");

delay(6e4);


sojCounter += 1;

}

} catch (e2) {

print(e2);

}

}


if (Config.LastMessage) {

switch (typeof Config.LastMessage) {

case "string":

say(Config.LastMessage.replace("$nextgame", DataFile.getStats().nextGame, "i"));


break;

case "object":

for (i = 0; i < Config.LastMessage.length; i += 1) {

say(Config.LastMessage[i].replace("$nextgame", DataFile.getStats().nextGame, "i"));

}


break;

}

}


if (AutoMule.muleCheck()) {

scriptBroadcast("mule");

}


// Anni handler. Mule Anni if it's in unlocked space and profile is set to mule torch/anni.

anni = me.findItem(603, 0, -1, 7);


if (anni && !Storage.Inventory.IsLocked(anni, Config.Inventory) && AutoMule.getInfo() && AutoMule.getInfo().hasOwnProperty("torchMuleInfo")) {

scriptBroadcast("muleAnni");

}


if (CraftingSystem.checkFullSets()) {

scriptBroadcast("crafting");

}


if (TorchSystem.keyCheck()) {

scriptBroadcast("torch");

}


scriptBroadcast("quit");


return true;

}





=================================================================


이부분에 반자동의 클릭형식의 옮기기를 넣고 싶은데 이자료는 이식하기가 힘드네요...


function AutoDrop() {

        var abort = false, actions = [],

 

                // 103 - Numpad 7

                dropInvent = 103,

                // 104 - Numpad 8

                dropStash = 104,

                // 105 - Numpad 9

                dropCube = 105,

                // 100 - Numpad 4

                pickItems = 100,

                // 102 - Numpad 6

                stashItems = 102,

                // 96 - Numpad 0

                removeAction = 96,

                // 97 - Numpad 1

                clearAction = 97,

                // 98 - Numpad 2

                abortAction = 98;

 

        this.clearInvent = function () {

                var i, items = me.findItems(-1, 0, 3);

 

                if (items) {

                        for (i = 0; i < items.length; i += 1) {

                                if (abort) {

                                        abort = false;

 

                                        break;

                                }

                               

                                if (items[i].classid !== 549) {

                                        me.overhead("Dropping inventory");

 

                                        Packet.dropItem(items[i]);

                                }

                        }

                }

 

                return true;

        };

 

        this.clearStash = function () {

                var i, items;

 

                if (!Town.openStash()) {

                        return false;

                }

 

                items = me.findItems(-1, -1, 7);

 

                if (items) {

                        for (i = 0; i < items.length; i += 1) {

                                if (abort) {

                                        abort = false;

 

                                        break;

                                }

 

                                if (items[i].classid !== 549) {

                                        me.overhead("Dropping stash");

 

                                        Packet.dropItem(items[i]);

                                }

                        }

                }

 

                me.cancel();

 

                return true;

        };

 

        this.clearCube = function () {

                var i, items;

 

                if (!Town.openStash() || !me.getItem(549)) {

                        return false;

                }

 

                // me.findItems(-1, -1, 6) - this doesn't always work - have to use getItems and check location

                items = me.getItems(-1, -1);

 

                if (items) {

                        Cubing.openCube();

 

                        for (i = 0; i < items.length; i += 1) {

                                if (abort) {

                                        abort = false;

 

                                        break;

                                }

 

                                if (items[i].location === 6) {

                                        me.overhead("Dropping cube");

 

                                        Packet.dropItem(items[i]);

                                }

                        }

                }

 

                me.cancel();

 

                return true;

        };

 

        this.pickStuff = function () {

                var item, list;

 

                // item on ground

                item = getUnit(4, -1, 3);

                list = [];

 

                if (item) {

                        do {

                                // don't pick up trash

                                if (Town.ignoredItemTypes.indexOf(item.itemType) === -1) {

                                        list.push(copyUnit(item));

                                }

                        } while (item.getNext());

                }

 

                while (list.length > 0) {

                        me.overhead("Picking items");

 

                        if (abort) {

                                abort = false;

 

                                break;

                        }

 

                        list.sort(Sort.units);

                        Pickit.pickItem(list.shift());

                }

        };

 

        this.stashStuff = function () {

                var i,

                        items = me.findItems(-1, 0, 3);

 

                if (items) {

                        for (i = 0; i < items.length; i += 1) {

                                if (abort) {

                                        abort = false;

 

                                        break;

                                }

 

                                if (Storage.Stash.CanFit(items[i])) {

                                        me.overhead("Stashing items");

 

                                        Storage.Stash.MoveTo(items[i]);

                                }

                        }

                }

        };     

 

        addEventListener("keyup", function (key) {

                switch (key) {

                case dropInvent:

                case dropStash:

                case dropCube:

                case pickItems:

                case stashItems:

                        actions.push(key);

 

                        if (actions.length > 1) {

                                print("Added drop action to the que");

                        }

 

                        break; 

                case removeAction:

                        if (actions.length) {

                                actions.pop();

 

                                print("Removing drop action. Remaining actions: " + actions.length);

                        } else {

                                print("No actions to remove");

                        }      

 

                        break;

                case clearAction:

                        if (actions.length) {

                                actions = [];

 

                                print("All pending actions removed");

                        } else {

                                print("No actions to remove");

                        }      

 

                        break;

                case abortAction:

                        print("Aborting current drop action");

 

                        abort = true;

 

                        break;                                                         

                }

        });

 

        while (true) {

                if (actions.length) {

                        switch (actions[0]) {

                        case dropInvent:

                                this.clearInvent();

 

                                actions.shift();

 

                                break;

                        case dropStash:

                                this.clearStash();

 

                                actions.shift();

 

                                break;

                        case dropCube:

                                this.clearCube();

 

                                actions.shift();

 

                                break;

                        case pickItems:

                                this.pickStuff();

 

                                actions.shift();

 

                                break;

                        case stashItems:

                                this.stashStuff();

 

                                actions.shift();

 

                                break;                                 

                        }

                }

 

                delay(500);

        }

 

        return true;

}

===========



AutoDrop.js  이 파일을 default 파일에 이식을 도움주시면  감사하겠습니다(__)..

감사합니다~

질문/답변

댓글을 추천하시면 답변으로 채택됩니다.

댓글을 추천하면 글 작성자와 댓글 작성자 둘 다 경험치를 획득합니다.

자세한 내용은 업데이트 공지를 참고해주시기 바랍니다.

번호 분류 제목 글쓴이 날짜 조회
공지   게시판 푸시 알림 / 통합 앱 서비스 34 file 트디개발자 2023.09.20 946.0k
공지   댓글이 도움되었다면 댓글을 추천 해주세요. 28 트디개발자 2021.04.16 86.3k
공지   [주의사항] 원격제어를 받으시면 시디키가 유출됩니다. 131 [버스&인첸방] 2017.04.17 97.6k
공지   정확한 답변을 받으려면 본문에 캡쳐를 첨부해주세요. 45 우녕자 2014.12.16 98.4k
20549   래더 지금 시즌하고 있는거 언제 종료되나요 ? bonowo 2015.08.16 576
20548   템창 꽉찼는데 창고지기 방에 들어가서 템을 버리질 않네요.. 우끼끼33 2015.08.16 622
20547   아이템이니 에서 상급 스컬 먹어오지 못하게 할려면 어케 해야할가여 ? 4 이지ez 2015.08.17 501
20546   길찾기 제보여 계속 근처에서 맴도네요. 아베상 2015.08.17 144
20545   크랩큐빙용 아이템이니좀 .. 1 망간 2015.08.17 177
20544   d2nt 봇 실행시 재시작 시간 설정 어떻게 하나요 ? 1 bonowo 2015.08.17 721
20543   맵핵사용법 1 아디카아 2015.08.17 212
20542   상급보석,최상급보석 팔기 질문드립니다 1 CHGOD 2015.08.17 219
20541   40차 창고지기 보관 개수 관련 질문드립니다 1 zenetic 2015.08.17 215
20540   망명템을 못먹네요... 1 4leaf 2015.08.17 161
20539   36차 쓰고 있는데요 햄딘이 디아블로를 안잡습니다. 2 fdsafdasfzcxv 2015.08.17 176
20538   기사가 방을 만들고 부기사,쫄봇들이 새로운방만들고있어요... 1 sfsegsg 2015.08.17 409
20537   4계정으로 디발런하는데요 1 뇌거슨 2015.08.17 154
20536   자동사냥 핀들스킨에게 너무 가까이 다가가는 문제가... 2 언젠간 2015.08.17 276
>   d2bs 아이템옮기기관련 질문드립니다 dongsan 2015.08.17 1.1k
20534   40차 쫄봇 무한대기 질문드립니다 1 알감자당 2015.08.17 627
20533   이런 질문 드려 죄송 합니다,,,혹시 버스같은건 안하시나요? 1 뽀글이 2015.08.17 345
20532   맵핵사용시 1 아디카아 2015.08.18 156
20531   질문있습니다 2 Haee 2015.08.18 201
20530   핸드투핸드가 뭔가요? 어쌔신 무기같은데.. 1 허니버터소서 2015.08.18 204