d2bs 아이템옮기기관련 질문드립니다
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 파일에 이식을 도움주시면 감사하겠습니다(__)..

