Skip to content

안녕하세요
제가 프리서버유저라 우족없이 포탈스크롤하나로만 카우포탈을 열수있습니다
그문제까지는 주석으로 해결했습니다만
카우포탈을들어가자마자 경험치얼마먹었다뜨고 나가버리고 다음방으로가버리네요.
의견주시면 지속적으로 실험해볼까합니다.
많은도움 부탁드릴게요
감기조심하세요 ~

현재의 마이카우봇 이니 전체입니다.

function MyMain()
{
 Print("ÿc5날아다녀의 '카우봇' 세계에 오신 것을 환영합니다.");

 MyVi_TownManager();

 _MyCu_isTelekinesisStash = false;

 if (!MyCoB_MakeCowPortal())
 {
 _MyCu_isTelekinesisStash = true;

 MyMI_ArrangeLeg();

 NTC_StopScript("NTToolsThread_CowBot.ntj");
 return "MyCoB_MakeCowPortal()";
 }

 _MyCu_isTelekinesisStash = true;

 if (MyConfig_CowBotPortalOpen)
 {
 NTC_StopScript("NTToolsThread_CowBot.ntj");
 return "MyMain()";
 }

 NTP_DoPrecast(true);

 MyCoB_ClearRooms(_MyAt_MONSTER_TYPE_ALL, 150, NTC_UNIT_MONSTER, 773, 100);

 NTC_StopScript("NTToolsThread_CowBot.ntj");

 return "MyMain()";
}

function MyCoB_ClearRooms(specType, range, unitType, unitId, distance)
{
 var i;
 var _count;
 var _units, _preRoom;
 var _addRooms = new Array();
 var _removeRooms = new Array();

 if (distance > 0)
 {
 _units = GetPresetUnits(me.areaid, unitType, unitId);
 if (!_units || _units.length < 1)
 return false;
 }

 _preRoom = GetRoom();
 if (!_preRoom)
 return false;

 do
 {
 if (distance < 1 || GetDistance(_preRoom.x * 5, _preRoom.y * 5, _units[0].roomx * 5, _units[0].roomy * 5) > distance)
 _addRooms.push([_preRoom.x * 5, _preRoom.y * 5]);
 } while (_preRoom.GetNext());

 _count = _addRooms.length;
 if (_count > 0)
 {
 MyAt_ClearPosition(30, specType, true);

 _preRoom = [me.x, me.y];
 }

 while (_addRooms.length > 0)
 {
 _addRooms.sort(function (a, b) { return (GetDistance(_preRoom[0], _preRoom[1], a[0], a[1]) - GetDistance(_preRoom[0], _preRoom[1], b[0], b[1])); });
 _removeRooms.push([_addRooms[0][0], _addRooms[0][1]]);

 for (i = 1; i < _addRooms.length; i++)
 {
 if (GetDistance(_preRoom[0], _preRoom[1], _addRooms[i][0], _addRooms[i][1]) <= GetDistance(_preRoom[0], _preRoom[1], _addRooms[0][0], _addRooms[0][1]))
 _removeRooms.push([_addRooms[i][0], _addRooms[i][1]]);
 else
 break;
 }

 if (_removeRooms.length > 1)
 {
 _removeRooms.sort(function (a, b) { return (b[0] - a[0]); });
 if (_removeRooms[0][0] <= _preRoom[0])
 {
 _removeRooms.sort(function (a, b) { return (b[1] - a[1]); });
 if (_removeRooms[0][1] <= _preRoom[1])
 {
 _removeRooms.sort(function (a, b) { return (a[0] - b[0]); });
 if (_removeRooms[0][0] >= _preRoom[0])
 _removeRooms.sort(function (a, b) { return (a[1] - b[1]); });
 }
 }
 }

 if (!range || GetDistance(me.x, me.y, _removeRooms[0][0], _removeRooms[0][1]) <= range)
 {
 if (MyMo_MoveTo(me.areaid, _removeRooms[0][0], _removeRooms[0][1], 1, true, specType))
 _preRoom = _removeRooms[0];
 }

 for (i = 0; i < _addRooms.length; i++)
 {
 if (_addRooms[i][0] == _removeRooms[0][0] && _addRooms[i][1] == _removeRooms[0][1])
 {
 _addRooms.splice(i, 1);

 Say("!사냥 중 (" + (_count - _addRooms.length) + "/" + _count + ")");
 break;
 }
 }

 _removeRooms.length = 0;
 }

 Say("!사냥 완료!")

 return true;
}

function MyCoB_MakeCowPortal()
{
 var _cube, _leg, _portal;
 var _preX, _preY;

 switch (MyCoB_CheckCowPortal(true))
 {
 case -1: return false;
 case 1: return true;
 }

 _cube = MyMI_GetCube();
 if (!_cube)
 return false;

 if (!MyMI_ClearCube(false))
 return false;

 MyMI_PickItems(true, "", true);

 MyCo_CancelMenu();

 //_leg = MyCoB_CheckLeg();
 //if (!_leg)
 //return (MyCoB_CheckCowPortal(false) == 1);

 MyCo_CancelMenu();

 if (MyConfig_AssasinBurstOfSpeed && !me.GetState(157))
 NTC_CastSkill(258, NTC_HAND_RIGHT);

 if (!NTTM_CheckAct(1))
 return false;

 _portal = MyCoB_CheckPortal();
 if (!_portal)
 return false;

 //if (MyMI_MoveItemTo(_leg, _MyMI_LOCATION_ITEM_CUBE) != 1) return false;
 if (MyMI_MoveItemTo(_portal, _MyMI_LOCATION_ITEM_CUBE) != 1) return false;

 if (MyConfig_CowBotPortalXy != 0)
 {
 switch ((MyConfig_CowBotPortalXy != 5) ? MyConfig_CowBotPortalXy : Random(1, 4))
 {
 case 1: if (MyMo_TownMove("akara")) MyMo_MoveTo(me.areaid, me.x + 24, me.y - 18); break;
 case 2: if (MyMo_TownMove("portalspot")) MyMo_MoveTo(me.areaid, me.x + 69, me.y + 42); break;
 case 3: if (MyMo_TownMove("gheed")) MyMo_MoveTo(me.areaid, me.x - 29, me.y + 20); break;
 case 4: if (MyMo_TownMove("charsi")) MyMo_MoveTo(me.areaid, me.x - 25, me.y - 24); break;
 }
 }

 if (!MyMI_Transmute(_cube))
 return false;

 if (MyConfig_CowBotPortalXy == 0)
 {
 NTC_PingDelay(500);
 MyCo_CancelMenu();
 }
 else
 {
 NTC_PingDelay(1000);
 MyCo_CancelMenu();
 Delay(1000);
 MyCo_CancelMenu();
 }

 if (MyConfig_CowBotPortalOpen)
 return true;

 _preX = me.x;
 _preY = me.y;

 MyVi_TownManager();

 if (GetDistance(me.x, me.y, _preX, _preY) > 7)
 {
 if (!MyMo_MoveTo(me.areaid, _preX, _preY))
 return false;
 }

 while (!Load("NTBot/tools/NTToolsThread_CowBot.ntj"))
 Delay(1000);

 return MyTP_UsePortal("", 15, 10);
}

function MyCoB_CheckCowPortal(isSimple)
{
 var _player,_portal;
 var _cowPortal = null;

 _player = GetPlayerUnit();
 if (!_player || !_player.GetNext())
 return 0;

 if (!NTTM_CheckAct(1))
 return -1;

 if (isSimple)
 {
 _portal = NTC_FindUnit(NTC_UNIT_OBJECT, _MyTP_STRING_PORTAL, 1);
 if (_portal)
 {
 do
 {
 if (_portal.name == _MyTP_STRING_PORTAL && (_portal.subareaid == 39 || _portal.subareaid == (39 + 256)))
 {
 _cowPortal = _portal;
 break;
 }
 } while (_portal.GetNext());
 }
 }
 else
 {
 var _moveList = ["stash", "akara", "portalspot", "gheed", "charsi"];

 for (var i = 0; i < _moveList.length; i++)
 {
 if (MyMo_TownMove(_moveList[i]))
 {
 _portal = NTC_FindUnit(NTC_UNIT_OBJECT, _MyTP_STRING_PORTAL, 1);
 if (_portal)
 {
 do
 {
 if (_portal.name == _MyTP_STRING_PORTAL && (_portal.subareaid == 39 || _portal.subareaid == (39 + 256)))
 {
 _cowPortal = _portal;
 i = _moveList.length;
 break;
 }
 } while (_portal.GetNext());
 }
 }
 }
 }

 if (_cowPortal)
 {
 MyVi_TownManager();

 if (!MyMo_MoveTo(_cowPortal.areaid, _cowPortal.x, _cowPortal.y))
 return -1;

 while (!Load("NTBot/tools/NTToolsThread_CowBot.ntj"))
 Delay(1000);

 return (MyTP_UsePortal("", 0, 0, _cowPortal) ? 1 : -1);
 }

 return 0;
}

function MyCoB_CheckLeg()
{
 var _attackXy = [[25111, 5129, 25181, 5208], [25040, 5129, 25110, 5208], [25040, 5048, 25110, 5128], [25111, 5048, 25181, 5128]];
 var _leg;

 _leg = MyMI_GetLeg();
 if (_leg)
 return _leg;

 if (!MyMo_TakeTownWaypoint(4))
 return false;

 NTP_DoPrecast(true);

 if (!MyMo_MoveToPresetUnit(me.areaid, NTC_UNIT_OBJECT, 61, 0, 0, MyConfig_CowBotClear[0][0], MyConfig_CowBotClear[0][1], 40))
 return false;

 NTC_FindUnit(NTC_UNIT_MONSTER, GetLocaleString(2872), 10);

 MyAt_KillBoss(GetLocaleString(2872), [25, _MyAt_MONSTER_TYPE_MINION]);

 if (!MyTP_UsePortal("", 0, 10))
 return false;

 if (MyConfig_CowBotGriswold)
 {
 if (MyMo_MoveTo(me.areaid, 25140 + 1, 5183, 3, MyConfig_CowBotClear[1][0] == 1, MyConfig_CowBotClear[1][1]))
 MyAt_KillBoss(365, null);
 }

 if (MyConfig_CowBotClear[1][0] == 2)
 MyAt_ClearXy(_attackXy, MyConfig_CowBotClear[1][1]);

 if (!MyMo_MoveTo(me.areaid, 25050, 5182, 3, MyConfig_CowBotClear[1][0] == 1, MyConfig_CowBotClear[1][1]))
 return false;

 if (!NTT_CheckSpace(2, 3))
 {
 if (!MyMo_TownManager(true, true, false))
 return false;
 }

 if (!MyCo_OpenChest(268))
 return false;

 _leg = NTC_FindUnit(NTC_UNIT_ITEM, 88, 5);
 if (!_leg)
 return false;

 return (MySI_PickUpItem(_leg, 0) && MyMo_MoveToTown() && MyMI_GetLeg());
}

function MyCoB_CheckPortal()
{
 var _portal, _npc;

 _portal = MyCoB_GetPortal();
 if (_portal)
 return _portal;

 if (!MyMo_TownMove("akara"))
 return null;

 _npc = NTC_FindUnit(NTC_UNIT_NPC, NTC_NPC_ID_AKARA, 5);
 if (!_npc)
 return null;

 if (!MyVi_DoInteract(_npc)) return null;
 if (!NTT_DoTrade(_npc)) return null;

 _portal = _npc.GetItems(529);
 if (!_portal || _portal.length < 1)
 return null;

 if (!NTT_ShopItem(_portal[0], _npc, 2))
 return null;

 MyCo_CancelMenu();

 return MyCoB_GetPortal();
}

function MyCoB_GetPortal()
{
 var _portals = me.GetItems(529);

 if (_portals)
 {
 for (var i = 0; i < _portals.length; i++)
 {
 if (_portals[i].mode == _MyMI_MODE_ITEM_STORE && (_portals[i].itemloc != _MyMI_LOCATION_ITEM_INVENTORY || NTConfig_Columns[_portals[i].y][_portals[i].x] == 1))
 return _portals[i];
 }
 }

 return null;
}