Skip to content

질문/답변

카우방 스크립트 위족 제거 어떻게 하나요?

조회 수 269 추천 수 0
안녕하세요. 헬카우방의 포탈을 열 때, 워트의 족을 넣지않고 큐빙하게끔 설정을 하고 싶습니다.
여러 방법으로 시도해 보았지만, 잘 해결이 되지 않아 질문을 드려봅니다.


(아래 스크립트는 본문입니다.)

//////////////////////////////////////////////////////////////////////
// Script public variables
//////////////////////////////////////////////////////////////////////
// General variables
var WXP_KillRakanishu = true;
var WXP_PortalClearMsg = "Portal clear"; // Display the public message
var WXP_CowPortalMsg = "Portal is now up"; // Message when portal is up
var WXP_OpenOnly = false;   // Set to true to open the portal only and quit
var WXP_WaitForPortal=false;   // Set to true to wait until the portal is open by someone else
var WXP_KillKing = false;   // Do we want to kill the king or not
var WXP_PortalDelay = 1000;   // Delay to wait before entering the portal in Cairn Stones

//////////////////////////////////////////////////////////////////////
// Script private variables
//////////////////////////////////////////////////////////////////////
var _WXP_UseLoader = false;
var _WXP_CanKillKing = false;
// Classes
var commPather = false;

//////////////////////////////////////////////////////////////////////
// CowsXP functions
//////////////////////////////////////////////////////////////////////
function WXP_PickItem(item) {
 for (var x=0; x < 3; x+=1) {
  if (item.mode==3 || item.mode==5) {
   while (me.mode == 7 || me.mode == 8 || (me.mode >= 10 && me.mode <= 16) || me.mode == 18) {
    DC_DoDel(20);
    _totaltime+=20;
    if (_totaltime >= 1000) { break; }
   }
   if (me.mode == 7 || me.mode == 8 || (me.mode >= 10 && me.mode <= 16) || me.mode == 18) { continue; }
   DC_DoClick(0,0,item);
   if (item.mode===0) { return true; }
  }
 }
 DC_DoDel(200);
 if (item.mode===0) { return true; }
 return false;
}
function WXP_GetLeg() {
 // Do precasts before going into the portal
 XP_Precasts();
 // Use the WP to go to the Stony Field
 DM_UsePortal("Waypoint",0x04);
 // Do precasts after going into the portal
 XP_Precasts();
 // Move from WP to Cairn Stones
 _retval = commPather.GotoNPC(737,4,20,false,false);
 if (!_retval) { DC_ThrowException("CowsXP","Unable to path to Cairn Stones"); }
 // If we want to kill Rakanishu, do it now
 if (WXP_KillRakanishu) {
  XP_KillBoss( "Rakanishu", 20, 0x01, false, _WXP_UseLoader );
 }
 // Take portal to Tristram
 delay(WXP_PortalDelay);
 DM_UsePortal("Portal", 38);
 // Go besides Wirt's body
 commPather.GotoDest(25048,5181);
 // Kill monsters around to be safe
 XP_ClearPosition(20);
 // Tele beside Wirt's body if I'm too far
 if (Math.abs(25048 - me.x) > 5 || Math.abs(5181 - me.y) > 5) { commPather.GotoDest(25048,5181); }
 // get the body of Wirt
 var _wirtbody;
 for (var x=0; x < 5; x+=1) {
  _wirtbody=getUnit(2,268);
    if (_wirtbody) { break; }
    delay(50);
   }
 // Throw a exception if no body is found
 if (typeof _wirtbody == "undefined") { DC_ThrowException("CowsXP", "Could not find Wirt's body."); }
 // Interact with Wirt
 for (x=0; x < 3 && _wirtbody.mode != 2; x+=1) {
  DC_DoClick(0,0,_wirtbody);
  delay(500);
 }
 // Get the leg dropped by Wirt's body
 var _leg;
 for (x=0; x < 5; x+=1) {
  _leg=getUnit(4,"leg");
    if (_leg) { break; }
      delay(50);
   }
   if (typeof _leg == "undefined") { DC_ThrowException("CowsXP", "Could not find Wirt's leg."); }
 // Pick the leg
 if (!WXP_PickItem(_leg)) { DC_ThrowException("CowsXP", "Cannot pick Wirt's leg"); }
 // Check for items
 DSN_PickItems();
}
function WXP_OpenPortal() {
 // Make 100% sure we have items because we crash if we don't, choose the right tome
 // Get the extra tome in inventory
 var _xtratome = getUnit(4,"tbk");
 while (_xtratome) {
  if (_xtratome.mode === 0) {
   if (_xtratome.itemloc === 0) {
    var _ignoreitem = (DT_Columns[_xtratome.y][_xtratome.x]===0);
    if (_ignoreitem) {
     if (_xtratome.getNext("tbk")) { continue; }
     else { _xtratome=false; }
    }
   }
  }
  // If the tome is on the ground, pick it
  else if (_xtratome.mode == 3) {
   WXP_PickItem(_xtratome);
   _xtratome = getUnit(4,"tbk");
   continue;
  }
  else {
   if (_xtratome.getNext("tbk")) { continue; }
   else { _xtratome=false; }
  }
  break;
 }
 // if no tome is found, return
 if (!_xtratome) { return "no tome."; }
 // get the leg in inventory
 var _leg=getUnit(4,"leg");
 if (_leg) {
  if (_leg.mode !== 0) {
   if (_leg.mode == 3) {
    WXP_PickItem(_leg);
    _leg=getUnit(4,"leg");
    if (_leg.mode !== 0) { _leg=false; }
   }
   else { _leg=false; }
  }
 }
 // If no leg is found, return
 if (!_leg) { return "No leg found!"; }
 // Get the stash object
 var _mychest = getUnit(2,"bank");
 if (!_mychest) { return "No stash found!"; }
 // Check if we got the cube
 var _mycube = getUnit(4, "box");
 if (!_mycube) { return "No cube. CowsXP requires a cube to run !"; }
 // Clear the cube of any items
 DT_DoInteract(_mychest);
 DCU_CheckInventory();
 DCU_ClearCube();
 // Put leg and tome in cube
 DCU_ReEnterStash();
 DCU_MoveItemToCube(_leg, 0, 0);
 DCU_MoveItemToCube(_xtratome, 1, 0);
 // Transmute
 DT_DoInteract(_mycube);
 DCU_UseCube();
 DT_MenuCancel(_mycube,0);
 for (var x=1000; !getUIFlag(0x19) && x > 0; x-=25) { delay(25); } // Wait for stash UI to apear
 DT_MenuCancel(_mychest,0);
 // Return the success of the portal opening
 return "sucess";
}
function WXP_ClearArea() {
 // If we see The Cow King very close, abort
 var _cowking = getUnit(1,"The Cow King");
 if (_cowking) {
  if ( DA_GetRange( _cowking ) < 20 ) {
   DC_ThrowException("CowsXP", "The Cow King is already too close");
  }
 }
 // Warn fellow ppl
 if (XP_RunMode > 0) { say ("Come in only when I tell you that the portal is safe!"); }
 // Call the function
 XP_KillMonsters();
 // For public games, make a tp and call followers/leechers in
 if (XP_RunMode > 1) {
  DM_MakeTP();
  say(XP_TPLeechMessage);
 }
 // Start exploring the area
 _retval = commPather.ExploreLevel(false,XP_KillMonsters,XP_KillMonsters,false);
 if (!_retval) { DC_ThrowException("CowsXP","Unable to explore the area"); }
}
function WXP_Prepare() {
 // Add leg into ignored items list for cow run duration
 DT_IgnoredItems.push("leg");
 // Check if we need to buy a TP book
 var _needtptome=true;
 var _ignoreitem;
 var _xtratome=getUnit(4,"tbk");
 if (_xtratome) { do {
  if (_xtratome.mode === 0) {
   if (_xtratome.itemloc === 0) {
    _ignoreitem = (DT_Columns[_xtratome.y][_xtratome.x]===0);
    if (!_ignoreitem) {
     _needtptome=false;
     break;
    }
   }
   else {
    _needtptome=false;
    break;
   }
  }
  else if (_xtratome.mode == 3) {
   if (WXP_PickItem(_xtratome)) {
    _needtptome=false;
    break;
   }
  }
 } while(_xtratome.getNext("tbk")); }
 // Check if we need a leg
 var _needleg=true;
 var _leg=getUnit(4,"leg");
 if (_leg) {
  if (_leg.mode === 0) { _needleg=false; }
  else if (_leg.mode == 3) {
   if (WXP_PickItem(_leg)) { _needleg=false; }
  }
 }
 // Go grab Wirt's leg if needed and make sure we are in Act 1
 if (_needleg) {
  // Go to the waypoint area
  if (XP_UseOverheads) { me.overhead("Walking to WayPoint"); }
  commPather.GotoWaypoint(me.area,8,false,false);
  WXP_GetLeg();
  if (DM_MakeTP(me.area,1) === false) {
   DC_ThrowException("CowsXP","Unable to go to town!");
  }
 }
 else if (me.act != 1) {
  // Go to the waypoint area
  if (XP_UseOverheads) { me.overhead("Walking to WayPoint"); }
  commPather.GotoWaypoint(me.area,8,false,false);
  DM_UsePortal("Waypoint",0x01);
 }
 // If we need a TP book, go to Akara, buy a tp tome and do healer stuff too
 if (_needtptome) {
  if (XP_UseOverheads) { me.overhead("Walking to Akara"); }
  commPather.GotoNPC(148,1,8,false,false);
  var npc = DC_getNPC(148);
  if (!npc || !DT_DoInteract(npc)) { DC_ThrowException("CowsXP", "Unable to interact with Akara !"); }
  DT_DoTrade(npc);
  if (_XP_GetNumUnId > 0) { XP_CheckItems(npc); }
  var _tptome = DT_GetTome(1);
  if (!_tptome) { DT_BuyScrolls(npc,1,1); }
  else if (_tptome.getStat(70) < 7) { DT_FillTome(npc,1); }
  var _tbk = DT_GetTome(1,npc.name);
  if (_tbk) { DT_BuyItem(_tbk,npc,2); }
  if (XP_UseBeltManager && DT_CheckBelt()) { DT_FillBelt(npc); }
  DT_MenuCancel(npc,1);
 }
 // Go to stash
 if (XP_UseOverheads) { me.overhead("Walking to Stash"); }
 commPather.GotoObject(2,267,267,me.area,3,false,false);
 // Open portal to Cow Level
 var result = WXP_OpenPortal();
 // There was an error opening portal, abort run
 if (result != "sucess") {
  // Drop any extra tbk
  _xtratome = getUnit(4,"tbk", 0);
  if (_xtratome) { do {
   if (_xtratome.itemloc === 0) {
    _ignoreitem = (DT_Columns[_xtratome.y][_xtratome.x]===0);
    if (!_ignoreitem) { DT_DropItem(_xtratome); }
   }
  } while(_xtratome && _xtratome.getNext("tbk", 0)); }
  DC_ThrowException("CowsXP", "Error Opening Cow Portal : " + result);
 }
 // Remove leg from ignored items list
 DT_IgnoredItems.pop();
}
//////////////////////////////////////////////////////////////////////
// CowsXP libs loading
//////////////////////////////////////////////////////////////////////
// Main function
function CowsXP() {
 // Initialize the script
 DC_LoadInclude("XP/Libs/XP_Load.d2l");
 XP_LoadLibs();
 XP_StartScript( "CowsXP", "WXP", WXP_Variables, false, false );
 // Start the event handler if we want automatic BO check and refresh
 if (XP_AutoBOCheck) { registerEvent( EVENT_PLAYERSTATE, XP_EventPlayerState ); }
 // If you don't use LoaderXP, invite the followers
 if (!_WXP_UseLoader && XP_RunMode == 2) {
  // determine the gamename/password format depending on the join cmd
  _gameinfo = " " + me.gamename;
  _gamepass = (!me.gamepassword) ? "" : me.gamepassword;
  if (XP_JoinMessage == "=JOIN") {
   _gameinfo = (_gamepass === "") ? _gameinfo : _gameinfo + " " + _gamepass;
  }
  else {
   _gameinfo = (_gamepass === "") ? _gameinfo : _gameinfo + "/" + _gamepass;
  }
  // Send the join message to the followers if we set Teambot mode
  say("/f m " + XP_JoinMessage + _gameinfo);
 }
 // Load the PartyUp file for public games
 if (XP_RunMode > 0) {
  // Load the PartyXP script for invites if it isn't loaded yet
  if ( !DC_FindScript(XP_PartyPath) ) {
   load(XP_PartyPath);
  }
  DT_DrinkAll=true;
 }
 // Tell followers to wait in town
 if (XP_RunMode == 2) { say( XP_WaitTownMessage ); }
 // Do town stuff
 XP_TownManager();
 // If we want to open the portal only and the quest is done, throw a exception
 if (WXP_OpenOnly && (me.getQuest(4,10) || !me.getQuest(40,0))) {
  DC_ThrowException("CowsXP", "WXP_OpenOnly is set to true but the quest is completed or Baal is not killed in that difficulty");
 }
 // If the quest is done or Baal is not killed
 if (me.getQuest(4, 10) || !me.getQuest(40,0)) {
  DC_Print("I can't open the Cow Portal, so I can kill the Cow King!");
  _WXP_CanKillKing = true;
  if (!WXP_WaitForPortal) { DC_ThrowException("CowsXP", "I can't open the Cow portal anymore !!"); }
 }
 // Prepare for the Cows by getting the items and opening the portal
 WXP_Prepare();
 // For public games
 if (XP_RunMode) { say(WXP_CowPortalMsg); }
 // If the bot want to do more than opening the portal, do the rest
 if (!WXP_OpenOnly) {
  // Check if we are in the right place
  if (XP_UseOverheads) { me.overhead("Walking to Stash"); }
  commPather.GotoObject(2,267,267,me.area,3,false,false);
  // Load King watch if we don't want him dead
  if (!WXP_KillKing) { load("tools/KingWatchXP.d2j"); }
  // Set the array of skills for area cleaning
  if (me.classid == 1) { XP_SetMonsterSkills(); }
  // Do precasts before going into the portal
  XP_Precasts();
  // Take the portal to cow level
  DM_UsePortal("Portal", 39);
  // Do precasts after going into the portal
  XP_Precasts();
  // Clear the cow level
  try { WXP_ClearArea(); }
  catch (e if e instanceof DC_ExceptionClass) {
   if (e.name != "King Found")  { throw e; }
   else {
    DC_Print("Cow King Found!  Ending CowsXP module!");
    DC_LogToautod2jsp("Cow King Found!  Ending CowsXP module!");
   }
  }
  // Increase the kills counter then leave the game
  // For WXP,a kill is equal to a completed run so with a small note, it is fine as is.
  DL_AddKill();
  // Stop KingWatchXP if it is running
  if (!WXP_KillKing) {
   if (DC_StopScript("KingWatchXP.d2j")) {
    DC_Print("KingWatchXP stopped");
   }
  }
 }
 if (XP_RunMode > 0) {
  var _partyscript = DC_FindScript(WXP_PartyPath);
  if (_partyscript) {
   _partyscript.stop();
   DC_Print("PartyXP script Stopped!");
  }
 }
 // Quit the game
 XP_CloseScript();
}
// Error handling
function main() {
 // Include the base d2jsp lib
 include("common/d2jsp-common.d2l");
 DC_LoadInclude("XP/Libs/XP_Exceptions.d2l");
 // Check if this script is loaded by LoaderXP
 if (DC_FindScript("LoaderXP.d2j")) { _WXP_UseLoader = true; }
 // Set the maximum game delay before aborting if the script is running standalone
 if (!_WXP_UseLoader) { me.gamelength=300000; }
 // configure the debug and error log paths
 DC_DebugLogPath = "output/XP-DebugLogs/" + me.name + "-WXP-DebugLog.html";
 DC_ErrorLogPath = "output/XP-ErrorLogs/" + me.name + "-XP-ErrorLog.html";
 // Call the main function to check for exceptions
     try { CowsXP(); }
 // Then catch and log any exception throwed by the script before quitting
 catch (WXP_Exception) {
  XP_HandleException( WXP_Exception, "WXP", _WXP_UseLoader );
     }
}
디아의 향수에 푹 빠져 돌아오게 되었습니다 반갑습니당!!
  • 네이년 2018.12.13 01:34
    현재, 위족 제외하고 큐빙하게 설정은 완료했습니다.
    그런데 포탈책을 넣고 큐빙표시를 누르지 않아서 포탈이 안열리고 에러로 팅기네요.
    도와주세요!
  • 다두것엉77 2018.12.13 11:28
    어렵다

질문/답변

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

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

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

번호 분류 제목 글쓴이 날짜 조회
공지   게시판 푸시 알림 / 통합 앱 서비스 35 file 트디개발자 2023.09.20 962.0k
공지   댓글이 도움되었다면 댓글을 추천 해주세요. 28 트디개발자 2021.04.16 86.4k
공지   [주의사항] 원격제어를 받으시면 시디키가 유출됩니다. 131 [버스&인첸방] 2017.04.17 97.7k
공지   정확한 답변을 받으려면 본문에 캡쳐를 첨부해주세요. 45 우녕자 2014.12.16 98.5k
공지   맨땅 초보자 가이드 617 file 뮤리아 2020.10.16 1017.6k
공지   카카오톡 1:1 채팅방 만드는 법 106 트디개발자 2018.05.20 431.1k
12164   드디어 오늘인거죠 ? bonowo 2018.12.08 153
12163   도움부탁드립니다.. ChocoBard 2018.12.08 139
12162   안녕하세요. 질문하나드립니다!! ChocoBard 2018.12.08 147
12161   치킨나면 로딩뜨면서 재접이 안되는 상황... 1 신쥬 2018.12.08 329
12160   부푼 마음으로 시작한 시즌에 오류가 장난 아니네요. 구두쇠 2018.12.08 498
12159   제가 스탠은 처음입니다 초보마한 2018.12.09 144
12158   BH 인젝터 관련 문의드립니다 (settings 안보이는 현상..) 사막의별 2018.12.09 744
12157   오래된 봇이긴 한데, 질문드립니다. 3 네이년 2018.12.09 145
12156   d2nt 41차 첫 방만들기 or 첫공개방 입장은 가능하나 나오면 튕깁니다 이유 아시는분 ㅠ 최철탑 2018.12.09 160
12155   팔라방패4솟 이거 쓰나여? 7 개쵸딩 2018.12.10 630
12154   디아방개설시 가끔실패뜨던데 1 개쵸딩 2018.12.10 435
12153   래더3개 창고계정하나 켜놓고...일갔다가 집에오니.. 5 끄냥끄냥 2018.12.10 589
12152   다들 지금 nt 제대로 돌아가시나요? 멋진마사루군 2018.12.11 190
12151   현재 서버상태 좋은가요? epox 2018.12.11 130
12150   41차는 잘 안쓰시나요? 다스9 2018.12.11 98
12149   지금 버전이바뀐후 온리맵핵 프로그램은 적용이안되나요? 5 사린자링 2018.12.12 155
>   카우방 스크립트 위족 제거 어떻게 하나요? 2 네이년 2018.12.12 269
12147   1.2에 팝니다 이런게 무슨뜻이죠?? 1 푸딩푸딩 2018.12.12 142
12146   d2nt 실행중 이니 수정 적용 않되나요? 23487 2018.12.12 316
12145   어제까지 잘돌리던 디아가 갑자기 패치가 적용이 되네요...;; 28 아름다운세상 2018.12.12 519