Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function NTMain() {
- Include("libs/common/NTCommon.ntl");
- NTC_IncludeLibs();
- NTC_IncludeConfig("NTBot/char_configs");
- NT_LoadConfig();
- NTSI_LoadNIPFiles("NTBot/item_configs");
- NTA_Initialize();
- NTConfig_DancingSorc = true;
- if(!NTTM_CheckAct(1)){
- NTC_SendMsgToScript("NTBotGame.ntj", "NTTM_CheckAct()");
- return;
- }
- NTTMGR_TownManager();
- if(!me.GetQuest(4, 10)){
- if(!NT_CheckCowPortal()){
- var _wirtbody, _cube, _leg, _portal, _stash, _items, i, _npc, prearea;
- for (i = 0; i < 10; i++){
- _cube = NTC_FindUnit(NTC_UNIT_ITEM, 549);
- if (_cube)
- break;
- }
- _items = me.GetItems();
- for (i = 0; i < _items.length;i++){
- if (_items[i].classid == 549) {
- Print ("Already Got CUbe");
- _cube = _items[i];
- break;
- }
- }
- if (!_cube){
- GetCube();
- }
- for (i = 0; i < 10; i++){
- _leg = NTC_FindUnit(NTC_UNIT_ITEM, 88);
- if(_leg)
- break;
- }
- _items = me.GetItems();
- for (i = 0; i < _items.length;i++){
- if (_items[i].classid == 88) {
- Print ("Already Got Leg");
- _leg = _items[i];
- }
- }
- if (!_leg){
- if(!NTTM_TownMove("waypoint")){
- NTC_SendMsgToScript("NTBotGame.ntj", "NTTM_TownMove()");
- return;
- }
- if(!NTM_TakeWaypoint(4)){
- NTC_SendMsgToScript("NTBotGame.ntj", "NTM_TakeWaypoint()");
- return;
- }
- NTP_DoPrecast();
- if(!NTM_MoveToPresetUnit(me.areaid, NTC_UNIT_MONSTER, 737, 10, 10)){
- NTC_SendMsgToScript("NTBotGame.ntj", "NTM_MoveToPresetUnit()");
- return;
- }
- if(!NTM_UsePortal("Portal", 38)){
- NTC_SendMsgToScript("NTBotGame.ntj", "NTM_UsePortal()");
- return;
- }
- NTM_MoveTo(me.areaid, 25047, 5178);
- if(NTA_ClearPosition(10)){
- if(NTConfig_IdInField){
- if (!NTT_CheckSpace(NTConfig_FreeSpaceXY[0], NTConfig_FreeSpaceXY[1])) {
- NT_FieldID();
- }
- }
- NTSI_PickItems();
- if(NTConfig_IdInField){
- if (!NTT_CheckSpace(NTConfig_FreeSpaceXY[0], NTConfig_FreeSpaceXY[1])) {
- NT_FieldID();
- }
- }
- }
- _wirtbody = NTC_FindUnit(NTC_UNIT_OBJECT, 268);
- if(!_wirtbody){
- NTC_SendMsgToScript("NTBotGame.ntj", "Wirt's body not found.");
- return;
- }
- if(NTM_MoveTo(_wirtbody.areaid, _wirtbody.x+3, _wirtbody.y)){
- if(NTC_OpenChest(_wirtbody)){
- NTC_PingDelay(500);
- for (i = 0; i < 10; i++){
- _leg = NTC_FindUnit(NTC_UNIT_ITEM, 88);
- if (_leg)
- break;
- }
- if(!NTT_CheckSpace(_leg.xsize, _leg.ysize)){
- _prearea = me.areaid
- if(NTTM_CheckAct()){
- NTTMGR_TownManager(true);
- NTTM_TownMove("portalspot")
- NTM_UsePortal("BluePortal", _prearea)
- }
- }
- for (i = 0; i < 20; i++){
- if ((i % 5) == 0){
- if (_leg.mode == 3 || _leg.mode == 5){
- if (NTC_ClearCursor())
- NTC_DoClick(NTC_CLICK_LDOWN, NTC_SHIFT_NONE, _leg);
- }
- }
- NTC_PingDelay(100);
- if (_leg.mode != 3 && _leg.mode != 5){
- Print(COLOR_4 + "Got Leg");
- NTC_PingDelay(200);
- break;
- }
- }
- }
- }
- if(!_leg){
- NTC_SendMsgToScript("NTBotGame.ntj", "No leg found.");
- return;
- }
- NTM_MakeTP(1);
- }
- else{
- if(!NTT_CheckSpace(_leg.xsize, _leg.ysize)){
- _prearea = me.areaid;
- if(NTTM_CheckAct()){
- NTTMGR_TownManager(true);
- NTTM_TownMove("portalspot")
- NTM_UsePortal("BluePortal", _prearea)
- }
- }
- for (i = 0; i < 20; i++){
- if ((i % 5) == 0){
- if (_leg.mode == 3 || _leg.mode == 5){
- if (NTC_ClearCursor())
- NTC_DoClick(NTC_CLICK_LDOWN, NTC_SHIFT_NONE, _leg);
- }
- }
- NTC_PingDelay(100);
- if (_leg.mode != 3 && _leg.mode != 5){
- Print(COLOR_4 + "Who carries a leg around?");
- NTC_PingDelay(200);
- Print(COLOR_4 + "Dude, thats sick.");
- break;
- }
- }
- }
- if(NTCW_AlreadyTombs()){
- if(!NTTM_CheckAct()){
- NTC_SendMsgToScript("NTBotGame.ntj", "NTTM_CheckAct()");
- return;
- }
- NTTM_TownMove("akara");
- for(var i = 0 ; i < 10 ; i++){
- _npc = NTC_FindUnit(NTC_UNIT_NPC, NTC_NPC_ID_AKARA);
- if(_npc)
- break;
- }
- if(_npc){
- if(NTT_DoInteract(_npc)){
- if(NTT_DoTrade(_npc)){
- _NTR_DoID = NTT_CheckUnids();
- if(_NTR_DoID)
- NTTMGR_IDItems(_npc);
- NTT_FillTome(_npc, 1);
- NTT_FillTome(_npc, 0);
- NTT_SecondTomeTP(_npc, "tbk", 1);
- _portal = NTR_GetTP();
- if(!_portal){
- NTC_SendMsgToScript("NTBotGame.ntj", "No extra tome of townportal found.");
- return;
- }
- }
- }
- me.Cancel(1);
- }
- }
- else
- _portal = NTR_GetTP();
- NTTM_TownMove("stash");
- for(var i = 0 ; i < 10 ; i++){
- _stash = NTC_FindUnit(NTC_UNIT_OBJECT, NTC_UNIT_STASH);
- if(_stash)
- break;
- }
- if(_stash){
- if(NTM_GetCloserInt(_stash)){
- if(NTT_DoInteract(_stash)){
- _items = me.GetItems(NTC_UNIT_CUBE);
- _cube = _items[0];
- if(!_cube){
- NTC_SendMsgToScript("NTBotGame.ntj", "No cube found.");
- return;
- }
- if(NTCU_CheckCubeInventoryInt() > 0){
- NTCU_OpenCubeInt(_cube)
- if(NTCU_ClearCubeInt() < 1){
- NTC_SendMsgToScript("NTBotGame.ntj", "Cube cannot be emptied.");
- return;
- }
- NTCU_CloseCubeInt();
- }
- NTCU_MoveItemToCubeInt(_cube,_leg)
- NTCU_MoveItemToCubeInt(_cube,_portal)
- NTCU_OpenCubeInt(_cube);
- if(Transmute()){
- NTC_PingDelay(1000);
- NTCU_CloseCubeInt();
- NTC_PingDelay(1000);
- NTC_CancelMenus();// added this for testing
- NTC_PingDelay(parseInt((1000 / 2), 10));
- }
- else{
- NTC_PingDelay(1000);
- NTCU_CloseCubeInt();
- NTC_PingDelay(1000);
- NTC_CancelMenus();// added this for testing
- NTC_PingDelay(parseInt((1000 / 2), 10));
- }
- }
- }
- }
- NTC_PingDelay(1000);
- }
- if(NT_CheckCowPortal()){
- Delay(Random(1000,2000));
- Print(COLOR_4 + "Cow portal is up, guess it's time to go in!");
- Delay(Random(1000,2000));
- }
- if(!NT_TakeCowPortal()){
- NTC_SendMsgToScript("NTBotGame.ntj", "Failed to take Cow Portal.");
- return;
- }
- if(NTConfig_CowKingChicken > 0) {
- Load("NTBot/tools/NTKingLifeWatch-v2.ntj");
- }
- NTP_DoPrecast();
- NTR_ClearRooms();
- NTC_SendMsgToScript("NTBotGame.ntj", "SCRIPT_END");
- }
- else{
- me.maxgametime = 0;
- var AntiIdleMoo = ["waypoint", "portalspot", "exit", "stash", "gheed", "charsi", "akara", "kashya", "cain", "warriv"];
- Print(COLOR_4 + "Cow quest has been completed, why are trying to do it?");
- SetStatusText(COLOR_8 + "Cow King Dead ~ Anti-Idle ON");
- while(1){
- t = Random(0,9);
- Say("!I'm going to go ahead and move to " + AntiIdleMoo[t] + "!");
- Delay(Random(1000,2000));
- if(!NTTM_TownMove(AntiIdleMoo[t])) {
- NTC_SendMsgToScript("NTBotGame.ntj", "NTTM_TownMove()");
- return;
- }
- Delay(Random(3000,8000));
- }
- }
- }
- // Internal functions
- function NT_CheckCowPortal()
- {
- var _portal = NTC_GetUnit(NTC_UNIT_OBJECT, GetLocaleString(3226));
- if(_portal){
- if(_portal.subareaid == 295 || _portal.subareaid == 39){
- return true;
- }
- }
- else
- return false;
- }
- function NTR_GetTP(){
- var _portals = me.GetItems("tbk");
- if (_portals){
- for (var i = 0; i < _portals.length; i++){
- if (_portals[i].mode == 0 && (_portals[i].itemloc != 0 || NTConfig_Columns[_portals[i].y][_portals[i].x] > 0)){
- return _portals[i];
- }
- }
- }
- return false;
- }
- function abs(integer){
- if(integer < 0){
- integer = -integer;
- }
- return integer;
- }
- function NTR_TakeCowPortal(range){
- var _portal = NTC_FindUnit(NTC_UNIT_OBJECT, GetLocaleString(3226));
- if (_portal){
- var _isClick;
- var _preAreaId = me.areaid;
- do{
- if (GetDistance(me, _portal) < range && _portal.mode == 2){
- for (var i = 0; i < 40; i++){
- if ((i % 10) == 0){
- if(NTM_GetCloserInt(_portal))
- _isClick = NTC_DoClick(NTC_CLICK_LDOWN, NTC_SHIFT_NONE, _portal);
- }
- if (_isClick){
- NTC_Delay(200);
- break;
- }
- }
- NTC_PingDelay(1000);
- var j = 0;
- var check = true;
- do{
- if (me.areaid != _preAreaId){
- NTC_PingDelay(500);
- return true;
- check = false;
- }
- j++;
- } while(j < 40 && check == true);
- }
- } while (_portal.GetNext());
- }
- return false;
- }
- function NTA_MonsterStats(unit) {
- this.name = unit.name;
- this.x = unit.x;
- this.y = unit.y;
- this.gid = unit.gid;
- this.classid = unit.classid;
- this.spectype = unit.spectype;
- }
- function NTT_SecondTomeTP(npc, type, amount){
- var _items;
- var _counter = 0;
- if(arguments.length < 1)
- return false;
- if(arguments.length < 2)
- type = 0;
- if(arguments.length < 0)
- amount = 1;
- if(amount == 0)
- return false;
- if(type)
- _items = npc.GetItems("tbk");
- if(_items){
- if(_items.length > 0){
- for(var i = 0 ; i < amount ; i++){
- if(NTT_ShopItem(_items[0], npc, 2))
- _counter++;
- }
- }
- }
- return (_counter > 0);
- }
- function NTCW_AlreadyTombs()
- {
- var portalbook = me.GetItems("tbk");
- if(portalbook && portalbook.length <= 1)
- return true;
- else
- return false;
- }
- function NT_TakeCowPortal()
- {
- var _prearea = me.areaid
- var _portal = NTC_GetUnit(NTC_UNIT_OBJECT, GetLocaleString(3226));
- if(_portal){
- do{
- if(_portal.subareaid == 295 || _portal.subareaid == 39){
- while(_portal.mode != 2){
- Delay(500)
- }
- break;
- }
- } while(_portal.GetNext());
- for(var i = 0 ; i < 40 ; i++){
- if(NTM_GetCloserIntS(_portal)){
- NTC_DoClick(NTC_CLICK_LDOWN, NTC_SHIFT_NONE, _portal);
- }
- if(me.areaid != _prearea){
- break;
- }
- }
- }
- return (me.areaid == 39);
- }
- function NTCS_Preattack(name) {
- var i, n, target, pos, positions;
- target = NTC_FindUnit(1, name, 10);
- switch (me.classid) {
- case 0:
- break;
- case 1:
- break;
- case 2:
- break;
- case 3:
- if (!target) {
- return;
- }
- positions = [[6, 11], [0, 8], [8, -1], [-9, 2], [0, -11], [8, -8]];
- for (i = 0; i < positions.length; i += 1) {
- if (CheckCollision(me.areaid, target.x + positions[i][0], target.y + positions[i][1], 1)) { // check if we can move there
- Print("Preattack position: " + positions[i][0] + " " + positions[i][1]);
- NTM_MoveTo(108, target.x + positions[i][0], target.y + positions[i][1]);
- NTC_PutSkill(NTConfig_AttackSkill[2], NTC_HAND_RIGHT);
- for (n = 0; n < 8; n += 1) {
- NTC_CastSkill(NTConfig_AttackSkill[1], 2);
- }
- break;
- }
- }
- break;
- case 4:
- if (!target || NTConfig_AttackSkill[0] < 0) {
- return;
- }
- pos = me.GetOptimalAttackPos(target.areaid, target.x, target.y, 20, 4);
- if (pos) {
- NTM_MoveTo(108, pos[0], pos[1]);
- }
- for (i = 0; i < 2; i += 1) {
- NTC_CastSkill(130, NTC_HAND_RIGHT);
- NTC_Delay(150);
- }
- break;
- case 5:
- break;
- case 6:
- break;
- }
- }
- function NTT_CheckPotionSafe() {
- var i, items, hpCheck, mpCheck;
- items = me.GetItems();
- if (NTConfig_BeltColType.indexOf("hp") > -1) {
- for (i = 0; i < items.length; i += 1) {
- if (!hpCheck && items[i].mode === 2 && items[i].code.indexOf("hp") > -1) {
- hpCheck = true;
- }
- }
- } else {
- hpCheck = true;
- }
- if (NTConfig_BeltColType.indexOf("mp") > -1) {
- for (i = 0; i < items.length; i += 1) {
- if (!mpCheck && items[i].mode === 2 && items[i].code.indexOf("mp") > -1) {
- mpCheck = true;
- }
- }
- } else {
- mpCheck = true;
- }
- return !(hpCheck && mpCheck);
- }
- function NTA_Dodge(target, distance) {
- var i, j, coordx, coordy, monster, count,
- maxcount = 999,
- coords = [],
- goodCoords = [],
- monList = [],
- angles = [45, 90, 135, 180, 225, 270, 305, 360];
- for (i = 0; i < angles.length; i += 1) {
- coordx = Math.round((Math.cos(angles[i] * Math.PI / 180)) * distance + target.x);
- coordy = Math.round((Math.sin(angles[i] * Math.PI / 180)) * distance + target.y);
- if (CheckCollision(me.areaid, coordx, coordy, 1)) {
- coords.push([coordx, coordy]);
- }
- }
- if (coords.length === 0) { // no valid positions - don't move
- return true;
- }
- coords.sort(NTA_SortRooms);
- monster = GetUnit(1);
- if (monster) {
- do {
- if (monster.hp > 0) {
- monList.push(new NTA_MonsterStats(target));
- }
- } while (monster.GetNext());
- }
- for (i = 0; i < coords.length; i += 1) {
- count = 0;
- for (j = 0; j < monList.length; j += 1) {
- if (monList[j].hp > 0 && GetDistance(monList[j].x, monList[j].y, coords[i][0], coords[i][1]) < 10) {
- count += 1;
- }
- }
- if (count < maxcount) {
- goodCoords = [coords[i][0], coords[i][1]];
- maxcount = count;
- if (count === 0) {
- break;
- }
- }
- }
- if (goodCoords.length > 0) { // just in case goodCoords is empty (shouldn't happen)
- if (Math.abs(me.x - goodCoords[0]) < 3 && Math.abs(me.y - goodCoords[1]) < 3) { // close enough
- return true;
- }
- Say("!Dodge " + target.name);
- NTM_MoveTo(me.areaid, goodCoords[0], goodCoords[1]);
- }
- return true;
- }
- function NTCS_ClearPosition(range, sortFunc, spectype, classid) {
- var _orgx, _orgy;
- var _spectype = [0x0A, 0x01, 0x01];
- //var _spectype = [0x0A, 0x01];
- var _skiplist;
- var _attackcount = 0;
- var _target;
- var _distance, _mingid, _mindistance;
- var _result;
- var _cowKing;
- var _test;
- if (NTConfig_PrioritizeWeakerFoes && NTConfig_PrioritizeWeakerFoesAreaDisable.indexOf(me.areaid) < 0) {
- _spectype = [0x10, 0x01, 0x04, 0x0A];
- }
- if(NTConfig_AttackSkill[1] < 0 || NTConfig_AttackSkill[3] < 0)
- return false;
- switch(arguments.length){
- case 0:
- range = 20;
- case 1:
- pickitem = false;
- case 2:
- safelevel = 0;
- default:
- if ((NTConfig_CheckSelfSafe.length < 1) && (NTConfig_CheckMercSafe.length < 1)) { safelevel = 0; }
- break;
- }
- _orgx = me.x;
- _orgy = me.y;
- for(var i = 0 ; i < _spectype.length ; i++){
- _skiplist = new Array();
- MainLoop : while(_attackcount < (i+1)*100){
- _mindistance = 100000;
- _target = NTC_FindUnit(NTC_UNIT_MONSTER);
- if(_target){
- do{
- if(_skiplist.indexOf(_target.gid) < 0){
- if(_target.IsAttackable() && (_target.spectype&_spectype[i])){
- if ((me.classid === 1 || me.classid === 2 || me.classid === 6) && NTConfig_Dodge_Cows && GetDistance(me, _target) < 7) {
- NTA_Dodge(_target, 15);
- continue MainLoop;
- }
- if(GetDistance(_orgx, _orgy, _target.x, _target.y) <= range && NTA_IsValidMonster(_target)){
- _distance = GetDistance(me, _target);
- if(_distance < _mindistance){
- _mingid = _target.gid;
- _mindistance = _distance;
- }
- if ((MonstersToAttackFirst.indexOf(_target.classid) > -1) && _distance < _minshamandistance) {
- _minshamangid = _target.gid;
- _minshamandistance = _distance;
- }
- }
- } else { _skiplist.push(_target.gid); }
- }
- } while(_target.GetNext());
- }
- if(_mindistance < 100000){
- _target = NTC_FindUnit(NTC_UNIT_MONSTER, _mingid);
- if(_target){
- _cowKing = GetUnit(NTC_UNIT_MONSTER, GetLocaleString(2850));
- if(_cowKing){
- return true;
- }
- _result = NTA_Attack(_target, (_attackcount % 30) === 0);
- switch(_result){
- case 1: _skiplist.push(_mingid); break;
- case 2:
- case 3:
- if (_target.mode === 0 || _target.mode === 12) {
- NTSI_FastPick();
- }
- _attackcount++;
- _sorcattack++;
- break;
- default: return false;
- }
- }
- }
- else { break; }
- }
- }
- if (me.classid == NTC_CHAR_CLASS_PALADIN) {
- if (_attackcount > 2 && ((parseFloat(me.hp * 100 / me.hpmax) < NTConfig_UseRedemptionHP) || (parseInt(me.mp * 100 / me.mpmax, 10) < NTConfig_UseRedemptionMP))) {
- if (NTC_PutSkill(124, NTC_HAND_RIGHT)) { NTC_PingDelay(1000); }
- }
- } else if (me.classid == NTC_CHAR_CLASS_NECROMANCER) {
- NTA_SkeletonArmy(NTConfig_SkeletonArmy);
- NTA_MageArmy(NTConfig_MageArmy);
- NTA_ReviveArmy(NTConfig_ReviveArmy);
- } else if (me.classid == NTC_CHAR_CLASS_BARBARIAN) {
- if (NTConfig_UseFindItem && _attackcount > 2) {
- if (!NTA_CheckForCloseMonsters(10)) {
- //Print(COLOR_25 + "No Monsters close - looting");
- NTA_FindItem(NTConfig_FindItemRange);
- }
- }
- }
- _cowKing = GetUnit(NTC_UNIT_MONSTER, GetLocaleString(2850));
- if(_cowKing){
- return true;
- }
- //if(failed == false){
- //if (NTConfig_OpenChest) {
- //_target = NTC_GetSpecialChest();
- //if (_target && GetDistance(_orgx, _orgy, _target.x, _target.y) <= range && NTC_OpenChest(_target)) { _attackcount++; _sorcattack++; }
- //}
- //if (NTConfig_OpenChestsInAreaClearing && NTConfig_AreasToOpenChestClearing.indexOf(me.areaid) != -1) {
- //NTC_OpenChestsInAreaNear(_orgx, _orgy, range);
- //}
- if(NTConfig_IdInField){
- if (!NTT_CheckSpace(NTConfig_FreeSpaceXY[0], NTConfig_FreeSpaceXY[1])) {
- NT_FieldID();
- } // id in field add
- }
- //if (pickitem && _attackcount > 0) { NTSI_PickItems(); }
- if (_attackcount > 0) {
- NTSI_PickItems();
- }
- if(NTConfig_IdInField){
- if (!NTT_CheckSpace(NTConfig_FreeSpaceXY[0], NTConfig_FreeSpaceXY[1])) {
- NT_FieldID();
- } // id in field add
- }
- //}
- return true;
- }
- function NTR_ClearRooms(){
- var failcount = 0, precount = 0, x, y, offx = 0, offy = 0, goalx = 0, goaly = 0, cowoffx = 0, cowoffy = 0;
- var toggle = true;
- var _cowKing;
- var _faillast;
- x = me.x;
- y = me.y;
- //NTC_PingDelay(5000);
- while (failcount <= 25){
- if(toggle == true && offx == goalx){
- if(goaly < 0){
- goaly=(0-(goaly-20));
- }else{
- goaly=(0-(goaly+20));
- }
- toggle = false;
- }
- if(toggle == false && offy == goaly){
- if(goaly < 0){
- goalx=(0-(goalx-20));
- }else{
- goalx=(0-(goalx+20));
- }
- toggle = true;
- }
- if(offy > goaly){
- offy-=20;
- y-=20;
- }
- if(offy < goaly){
- offy+=20;
- y+=20;
- }
- if(offx < goalx){
- offx+=20;
- x+=20;
- }
- if(offx > goalx){
- offx-=20;
- x-=20;
- }
- _cowKing = GetUnit(NTC_UNIT_MONSTER, GetLocaleString(2850));
- if(!_cowKing){
- //NTR_ClearPosition(20, true, 0, _faillast);
- NTCS_ClearPosition(20, true, 0, _faillast);
- if(((GetTickCount()-precount)/1000) >= 30 && 30 >= 0){
- NTP_DoPrecast();
- precount = GetTickCount();
- }
- }
- if(!NTM_MoveTo(me.areaid, x, y)){
- failcount++;
- _faillast = true;
- }else{
- _faillast = false;
- }
- }
- return true;
- }
- function NTA_SortRooms(a, b) {
- if (GetDistance(me.x, me.y, a[0], a[1]) < GetDistance(me.x, me.y, b[0], b[1])) {
- return -1;
- }
- return 1;
- }
- //Cube start
- function GetCube(){
- if(me.diff == 0){
- if(!NTTM_TownMove("waypoint")) {
- NTC_SendMsgToScript("NTBotGame.ntj", "NTTM_TownMove()");
- return;
- }
- if(!NTM_TakeWaypoint(57)) {
- NTC_SendMsgToScript("NTBotGame.ntj", "NTM_TakeWaypoint()");
- return;
- }
- NTP_DoPrecast(true);
- if(!NTM_MoveToStair(me.areaid, 60)) {
- NTC_SendMsgToScript("NTBotGame.ntj", "NTM_MoveToStair()");
- return;
- }
- if(!NTM_TakeStair(60)) {
- NTC_SendMsgToScript("NTBotGame.ntj", "NTM_TakeStair()");
- return;
- }
- NTP_DoPrecast(true);
- if(!NTM_MoveToPresetUnit(me.areaid, NTC_UNIT_OBJECT, 354, -5, -5)) {
- NTC_SendMsgToScript("NTBotGame.ntj", "NTM_MoveToPresetUnit()");
- return;
- }
- NTA_ClearPosition(30, false);
- //NTSI_PickItems();
- _Cube = NTC_FindUnit(NTC_UNIT_OBJECT, 354);
- if(_Cube) {
- if(NTM_MoveTo(_Cube.areaid, _Cube.x+3, _Cube.y)) {
- NTA_ClearPosition(30, false);
- //NTSI_PickItems();
- }
- if(NTC_OpenChest(_Cube)) {
- NTC_PingDelay(100);
- //NTSI_PickItems();
- }
- NTA_ClearPosition(30, false);
- //NTSI_PickItems();
- //if(NTConfig_IdInField){
- //NT_FieldID();
- }
- }
- NTM_MakeTP();
- Say("Cube tp up come grabe cube and get back to town!");
- Movetocube();
- NTA_ClearPosition(30, false);
- StashCube();
- return;
- }
- //}
- function Movetocube(){
- var _cube = NTC_FindUnit(NTC_UNIT_ITEM, 549);
- if(!_cube){Say("You have the cube man");return false;}
- if (_cube.mode == 3 || _cube.mode == 5){
- NTM_MoveTo(me.areaid, _cube.x, _cube.y);
- NTC_Delay(1000)
- Say("Picking up Cube");
- NTC_PingDelay(100);
- NTC_DoClick(NTC_CLICK_LDOWN, NTC_SHIFT_NONE, _cube);
- NTC_Delay(1000)
- }
- NTC_PingDelay(100);
- return true;
- }
- function StashCube(){
- NTM_UsePortal("BluePortal", 40, me.charname);
- NTTM_TownMove("stash");
- NTC_PingDelay(100);
- for(var i = 0 ; i < 10 ; i++){
- _stash = NTC_FindUnit(NTC_UNIT_OBJECT, NTC_UNIT_STASH);
- if(_stash)
- break;
- }
- if(NTT_DoInteract(_stash)){
- _cube = me.GetItems(NTC_UNIT_CUBE);
- _Items = _cube[0];
- if(_cube){
- for(var i = 0 ; i < _cube.length ; i++){
- if(_cube[i].classid == 549){
- Say("Stashing Cube");
- NTC_PingDelay(100);
- NTC_ItemToCursor(_cube[i]);
- NTC_PingDelay(200);
- me.ClickItem(0, 0, 0, 4);
- NTC_PingDelay(200)
- NTC_CancelMenus();
- NTC_Delay(250)
- //if (NTC_ClearCursor())
- Say("Cube in Stash");
- //NTC_Delay(250)
- //NTTM_TownMove("portalspot");
- //NTC_Delay(250)
- //NTM_UsePortal("BluePortal", 60, me.charname);
- //NTC_Delay(250)
- //NTSI_PickItems();
- Say("Done");
- //NTM_MakeTP();
- //NTM_UsePortal("BluePortal", 40, me.charname);
- //NTTMGR_TownManager();
- //return true;
- if(!NTTM_CheckAct(1)){
- NTC_SendMsgToScript("NTBotGame.ntj", "NTTM_CheckAct()");
- return true;
- }
- }
- //NTC_SendMsgToScript("NTBotGame.ntj", "SCRIPT_END");
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement