Skip to content

질문/답변

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

조회 수 1,147 추천 수 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 파일에 이식을 도움주시면  감사하겠습니다(__)..

감사합니다~

질문/답변

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

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

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

번호 분류 제목 글쓴이 날짜 조회
공지   게시판 푸시 알림 / 통합 앱 서비스 35 file 트디개발자 2023.09.20 947.6k
공지   댓글이 도움되었다면 댓글을 추천 해주세요. 28 트디개발자 2021.04.16 86.3k
공지   [주의사항] 원격제어를 받으시면 시디키가 유출됩니다. 131 [버스&인첸방] 2017.04.17 97.6k
공지   정확한 답변을 받으려면 본문에 캡쳐를 첨부해주세요. 45 우녕자 2014.12.16 98.4k
공지   맨땅 초보자 가이드 614 file 뮤리아 2020.10.16 1016.2k
공지   카카오톡 1:1 채팅방 만드는 법 106 트디개발자 2018.05.20 430.8k
2134   아이템이니 관련해서 질문드립니다 [왕초보..] 1 마돋네 2015.08.19 196
2133   한번 런이 끝나면 리스타트로 해서 다시 로긴하고 방 만드는데.. 1 빅히로6 2015.08.19 156
2132   이니 보는데 둘의 차이점을 알고 싶습니다. 2 아카리아 2015.08.19 146
2131   하도 답답해서 질문드려봅니다. 1 WHITEB 2015.08.19 150
2130   앵벌이를 시키면 쓸모없는걸 너무 많이 줏어서 창고에 넣는데 어쩌죠 2 디야블료 2015.08.19 293
2129   한 2년만에 들어 옵니다. 1 GOD웅 2015.08.18 137
2128   자벨마 디발런시 보스몹 실패오류에대하여 아시는분 조언구합니다. 2 싱글만쉐 2015.08.18 682
2127   디발런시 기사가 방만드는 대신 참가를 자꾸 시도하는군요. ㅠㅠ 4 날라리오구 2015.08.18 479
2126   세트아이템 모으는중인데요.. 알더 뚜겅이 1 골뱅이 2015.08.18 719
2125   도와주세요 38차 입니다 8 킁킁똬 2015.08.18 973
2124   도박에 관련 해 질문 드립니다. 1 fdsafdasfzcxv 2015.08.18 605
2123   모나크 아이템이니 수정 좀 봐주세요. 2 언젠간 2015.08.18 181
2122   컴퓨터 2대로 한 파티를 이뤄 사냥하는 법이 있습니까? (4+4) 2 날라리오구 2015.08.18 226
2121   엔티봇신호등 켜고 안정적으로 돌리는데도 렐따가 걸리네요.. 3 우끼끼33 2015.08.18 714
2120   핸드투핸드가 뭔가요? 어쌔신 무기같은데.. 1 허니버터소서 2015.08.18 207
2119   질문있습니다 2 Haee 2015.08.18 201
2118   맵핵사용시 1 아디카아 2015.08.18 157
2117   이런 질문 드려 죄송 합니다,,,혹시 버스같은건 안하시나요? 1 뽀글이 2015.08.17 345
2116   40차 쫄봇 무한대기 질문드립니다 1 알감자당 2015.08.17 627
>   d2bs 아이템옮기기관련 질문드립니다 dongsan 2015.08.17 1.1k