Skip to content

질문/답변

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

조회 수 259 추천 수 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
    어렵다

질문/답변

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

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

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

번호 분류 제목 글쓴이 날짜 조회
공지   게시판 푸시 알림 / 통합 앱 서비스 32 file 트디개발자 2023.09.20 877.0k
공지   댓글이 도움되었다면 댓글을 추천 해주세요. 28 트디개발자 2021.04.16 78.2k
공지   [주의사항] 원격제어를 받으시면 시디키가 유출됩니다. 131 [버스&인첸방] 2017.04.17 89.1k
공지   정확한 답변을 받으려면 본문에 캡쳐를 첨부해주세요. 45 우녕자 2014.12.16 89.8k
공지   맨땅 초보자 가이드 603 file 뮤리아 2020.10.16 1003.1k
공지   카카오톡 1:1 채팅방 만드는 법 103 트디개발자 2018.05.20 427.4k
10536   플레이중 팅기는 오류 2 오가는길 2018.12.14 134
10535   쫄봇시 프리캐스트를 안하는데 설정 좀 봐주세요. 3 구두쇠 2018.12.14 805
10534   플레이어 찿을수없습니다 해결방법 6 쎄리뽕 2018.12.14 154
10533   아이템이니 검사 키보드 "0" 눌러도 반응이 없습니다. 5 사막의별 2018.12.14 615
10532   이젠 포기했습니다. 다~~ 28 o영혼o 2018.12.14 705
10531   이것저것 해봐도 참.. AutoHunt - 캐릭터명 잘 적어도 설정한 사냥터 문제.. 사막의별 2018.12.13 216
10530   모두 수고하십니다. 시피 처리 관련문의입니다. o영혼o 2018.12.13 130
10529   이번 섭다 상황에서 플레이어를 찾을수 없는 문구 8 d1 2018.12.13 158
10528   프리서버 봇 설정방법이나 설치가능하신분찾아요 1 얃조랴 2018.12.13 273
10527   d2nt 쓰시는분들.. 다다리 2018.12.13 132
10526   동일한 케릭터이니로 돌리는데 한케릭은 잘되고 한케릭은 이상하네요... 9 노력중이요 2018.12.12 644
10525   오늘 저만 그러나요~ 플레이어를 찾을수 없습니다. 1 홈팡가나 2018.12.12 150
10524   출첵 2 조토오 2018.12.12 141
10523   ntmap 자동 텔포 해제 어떻게 하나요? 오예룬 2018.12.12 497
10522   d2nt 요오우우 2018.12.12 120
10521   어제까지 잘돌리던 디아가 갑자기 패치가 적용이 되네요...;; 28 아름다운세상 2018.12.12 511
10520   d2nt 실행중 이니 수정 적용 않되나요? 23487 2018.12.12 311
10519   1.2에 팝니다 이런게 무슨뜻이죠?? 1 푸딩푸딩 2018.12.12 134
>   카우방 스크립트 위족 제거 어떻게 하나요? 2 네이년 2018.12.12 259
10517   지금 버전이바뀐후 온리맵핵 프로그램은 적용이안되나요? 5 사린자링 2018.12.12 148