hey guys what do i need to edit in NTbaal.ntj so my bot will make a tp and say safe message or just say the safe message after each wave... coz some times my leecher is late ( it does some mf ) and it doesnt enter the tp if he misses the safe message and i dont want to make it enter unsafe tps coz if its on time it can die in throne ( died alrdy with one leecher )
EDIT: I figured out the code ;) so if some one else needs this use htat code for ntbaal.ntj
EDIT: I figured out the code ;) so if some one else needs this use htat code for ntbaal.ntj
Code:
/** * This file was modified by [Only registered and activated users can see links. Click Here To Register...] * Check the programming section for updates and further scripts * Last Update: 21:04 14.08.2011 */ var _MWB_LastWave = 0; function NTMain() { Include("libs/common/NTCommon.ntl"); NTC_IncludeLibs(); NTC_IncludeConfig("NTBot/char_configs"); NT_LoadConfig(); NTSI_LoadNIPFiles("NTBot/item_configs"); MWC_Initialize(); var i; var _wave, _monsterCount, _starttick, _loops, _placedTraps; if(!NTTM_CheckAct(me.act, true)) { NTC_SendMsgToScript("MWBotGame.ntj", NTTM_CheckAct, 24, me.act, true); return; } NTTMGR_TownManager(); if(!NTTM_TownMove("waypoint")) { NTC_SendMsgToScript("MWBotGame.ntj", NTTM_TownMove, 32, "waypoint"); return; } if(!NTM_TakeWaypoint(129)) { NTC_SendMsgToScript("MWBotGame.ntj", NTM_TakeWaypoint, 38, 129); return; } NTP_DoPrecast(true); for(i = 0; i < 2; i++) { if(!NTM_MoveToStair(me.areaid, 130 + i)) { NTC_SendMsgToScript("MWBotGame.ntj", NTM_MoveToStair, 48, me.areaid, 130 + i); return; } if(!NTM_TakeStair(130 + i)) { NTC_SendMsgToScript("MWBotGame.ntj", NTM_TakeStair, 54, 130 + i); return; } } if(MW_MoveToThrone()) { if(!NTM_MoveTo(me.areaid, 15112, 5068)) { NTC_SendMsgToScript("MWBotGame.ntj", NTM_MoveTo, 63, me.areaid, 15112, 5068); return; } _monsterCount = MW_CountMonstersInThrone(100, true); if(NTConfig_PublicMode) { if(_monsterCount > 1 && MWConfig_Announcements.BaalThrone) Say(MWConfig_Announcements.BaalThrone.replace(/%d/gi, _monsterCount)); NTM_MoveTo(me.areaid, 15116, 5068); _monsterCount = MW_CountMonstersInThrone(20); if(_monsterCount > 1) { if(_monsterCount < 3 && MWConfig_Announcements.BaalTpCold) Say(MWConfig_Announcements.BaalTpCold.replace(/%d/gi, _monsterCount)); else if(_monsterCount < 6 && MWConfig_Announcements.BaalTpWarm) Say(MWConfig_Announcements.BaalTpWarm.replace(/%d/gi, _monsterCount)); else if(MWConfig_Announcements.BaalTpHot) Say(MWConfig_Announcements.BaalTpHot.replace(/%d/gi, _monsterCount)); } else if(MWConfig_Announcements.BaalTpNone) Say(MWConfig_Announcements.BaalTpNone); NTM_MakeTP(); NTA_ClearPosition(25, true, 2); } NT_ClearThroneInt(); if(NTConfig_PublicMode) { NTM_MoveTo(me.areaid, 15112, 5004, 1, true); NTM_MakeTP(); if(MWConfig_Announcements.BaalTpSafe) Say(MWConfig_Announcements.BaalTpSafe); } while(true) { if(me.classid == NTC_CHAR_CLASS_PALADIN || me.classid == NTC_CHAR_CLASS_BARBARIAN) NTM_MoveTo(me.areaid, 15092, 5028); else NTM_MoveTo(me.areaid, 15092, 5044); if(_wave == 1) NTP_DoPrecast(true); if(MWConfig_Announcements.BaalTpSafe) Say(MWConfig_Announcements.BaalTpSafe); if(me.classid == NTC_CHAR_CLASS_PALADIN && !MWC_CheckForExpShrineUsers()) NTC_PutSkill(109, NTC_HAND_RIGHT); for(i = 0; i < 6; i++) { _wave = NT_ThroneCheckInt(); if(_wave > 0 || me.classid == NTC_CHAR_CLASS_ASSASSIN) break; NTC_Delay(500); } if(_wave == 2) NTP_DoPrecast(true); if(MWConfig_Announcements.BaalTpSafe) Say(MWConfig_Announcements.BaalTpSafe); _starttick = GetTickCount(); _placedTraps = false; while(_wave == 0) { _wave = NT_ThroneCheckInt(); if(_placedTraps || !NT_ThronePreAttackInt()) NTC_Delay(200); else if(me.classid == NTC_CHAR_CLASS_ASSASSIN) _placedTraps = true; if(GetTickCount() - _starttick > 15000) { NT_ClearThroneInt(); _starttick = GetTickCount(); } } _MWB_LastWave = _wave; switch(_wave) { case 1: NTA_ClearPosition(40, true, 1); break; case 3: NTA_ClearPosition(40, true, 2); NT_CheckHydraInt(); break; case 4: NTA_ClearPosition(40, true, 2); break; case 5: NTA_ClearPosition(40, true); break; default: NTA_ClearPosition(40, true, 1); break; } if(_wave == 5) break; NTP_DoPrecast(false); } if(NTConfig_KillBaal) { var _portal; if(!NTTMGR_CheckSafe(NTConfig_CheckSelfSafe, NTConfig_CheckMercSafe)) { NTC_SendMsgToScript("MWBotGame.ntj", NTTMGR_CheckSafe, 185, NTConfig_CheckSelfSafe, NTConfig_CheckMercSafe); return; } if(NTConfig_PublicMode && MWConfig_Announcements.BaalPreChamber) Say(MWConfig_Announcements.BaalPreChamber); NTM_MoveTo(me.areaid, 15092, 5010); NTP_DoPrecast(true); for(i = 1; i <= 120; i++) { if(!NTC_FindUnit(NTC_UNIT_MONSTER, 543)) break; NTC_Delay(500); if(i % 30 == 0) { NT_ClearThroneInt(); NTM_MoveTo(me.areaid, 15092, 5010); } } if(i > 120) { NTC_SendMsgToScript("MWBotGame.ntj", NTC_FindUnit, 200, NTC_UNIT_OBJECT, 543); return; } _portal = NTC_FindUnit(NTC_UNIT_OBJECT, 563, 1); if(!_portal) { NTC_SendMsgToScript("MWBotGame.ntj", NTC_FindUnit, 219, NTC_UNIT_OBJECT, 563, 1); return; } if(!NTM_UsePortal("Portal", 132, null, _portal)) { NTC_SendMsgToScript("MWBotGame.ntj", NTM_UsePortal, 227, "Portal", 132, null, _portal); return; } NTM_MoveTo(me.areaid, 15138, 5916); if(!NTA_KillMonster(544)) { NTC_SendMsgToScript("MWBotGame.ntj", NTA_KillMonster, 235, 544); return; } NTSI_PickItems(); } } NTC_SendMsgToScript("MWBotGame.ntj", "SCRIPT_END"); } // Internal function function NT_ClearThroneInt() { var _attackpos = [15112, 5068, 15075, 5065, 15114, 5045, 15114, 5012, 15095, 5024, 15078, 5013, 15092, 5040]; for(var i = 0; i < _attackpos.length; i += 2) { NTM_MoveTo(me.areaid, _attackpos[i], _attackpos[i+1]); NTA_ClearPosition(30, true, 2); } } function MW_MoveToThrone() { var _positions = [new Point(15113, 5205), new Point(15115, 5107)]; for(var i = 0; i < _positions.length; i++) { NTM_MoveTo(me.areaid, _positions[i].x, _positions[i].y); if(MWConfig_SkipBaalOnSouls && NTC_FindUnit(NTC_UNIT_MONSTER, 641)) { if(NTConfig_PublicMode) Say("Skipping Baal due to Black Souls..."); else Print("ÿc1Skipping Baal due to Black Souls..."); } else if(MWConfig_SkipBaalOnDolls && NTC_FindUnit(NTC_UNIT_MONSTER, 691)) { if(NTConfig_PublicMode) Say("Skipping Baal due to Dolls..."); else Print("ÿc1Skipping Baal due to Dolls..."); } else continue; if(NTM_MoveToStair(me.areaid, 130)) NTM_TakeStair(130); return false; } return true; } function NT_ThroneCheckInt() { var _monster; if(!NTC_FindUnit(NTC_UNIT_MONSTER, 543)) return 5; _monster = NTC_FindUnit(NTC_UNIT_MONSTER); if(_monster) { do { if(NTA_IsValidMonster(_monster)) { if(_monster.classid == 23 || _monster.classid == 62) return 1; if(_monster.classid == 105 || _monster.classid == 381) return 2; if(_monster.classid == 557) return 3; if(_monster.classid == 558) return 4; if(_monster.classid == 571) return 5; } } while(_monster.GetNext()); } return 0; } function NT_ThronePreAttackInt() { var _index, _trapPos; if(!MWConfig_DoBaalPreAttack || me.mp / me.mpmax < 0.5) return false; if(me.classid == NTC_CHAR_CLASS_SORCERESS) { _index = NTConfig_AttackSkill.indexOf(38); // Check attack skills for Charged Bolt if(_index > -1) return NTC_CastSkill(NTConfig_AttackSkill[_index], NTC_HAND_RIGHT, 15092, 5028); _index = NTConfig_AttackSkill.indexOf(56); // Check attack skills for Meteor if(_index > -1 && _MWB_LastWave + 1 != 5) return NTC_CastSkill(NTConfig_AttackSkill[_index], NTC_HAND_RIGHT, 15092, 5028); _index = NTConfig_AttackSkill.indexOf(59); // Check attack skills for Blizzard if(_index > -1) return NTC_CastSkill(NTConfig_AttackSkill[_index], NTC_HAND_RIGHT, 15092, 5028); if(NTC_GetSkillLevel(55) > 0) return NTC_CastSkill(55, NTC_HAND_RIGHT, 15092, 5028); } else if(me.classid == NTC_CHAR_CLASS_PALADIN) { _index = NTConfig_AttackSkill.indexOf(112); // Check attack skills for Blessed Hammer if(_index > -1) { if(NTConfig_AttackSkill[_index + 1] > 0) NTC_PutSkill(NTConfig_AttackSkill[_index + 1], NTC_HAND_RIGHT); return NTC_CastSkill(NTConfig_AttackSkill[_index], 2); } } else if(me.classid == NTC_CHAR_CLASS_NECROMANCER) { _index = NTConfig_AttackSkill.indexOf(66); // Check attack skills for Amplify Damage if(_index > -1) return !NTC_CastSkill(NTConfig_AttackSkill[_index], NTC_HAND_RIGHT, 15092, 5028); _index = NTConfig_AttackSkill.indexOf(87); // Check attack skills for Decepify if(_index > -1) return !NTC_CastSkill(NTConfig_AttackSkill[_index], NTC_HAND_RIGHT, 15092, 5028); } else if(me.classid == NTC_CHAR_CLASS_ASSASSIN) { _trapPos = new Array(2); _trapPos[0] = [15094, 5038, 15090, 5034, 15098, 5034]; _trapPos[1] = [15092, 5036, 15096, 5036]; _index = NTConfig_AttackSkill.indexOf(MWS_LIGHTNING_SENTRY); // Check attack skills for Lightning Sentry if(_index > -1) { for(var i = 0; i < _trapPos[0].length; i += 2) NTC_CastSkill(NTConfig_AttackSkill[_index], NTC_HAND_RIGHT, _trapPos[0][i], _trapPos[0][i + 1]); } _index = NTConfig_AttackSkill.indexOf(MWS_DEATH_SENTRY); // Check attack skills for Death Sentry if(_index > -1) { for(var i = 0; i < _trapPos[1].length; i += 2) NTC_CastSkill(NTConfig_AttackSkill[_index], NTC_HAND_RIGHT, _trapPos[1][i], _trapPos[1][i + 1]); } return true; } return false; } function NT_CheckHydraInt() { var _hydra1, _hydra2, _hydra3; _hydra1 = NTC_FindUnit(NTC_UNIT_MONSTER, 351); _hydra2 = NTC_FindUnit(NTC_UNIT_MONSTER, 352); _hydra3 = NTC_FindUnit(NTC_UNIT_MONSTER, 353); if((_hydra1 && _hydra1.GetStat(172) != 2 && _hydra1.GetState(105)) || (_hydra2 && _hydra2.GetStat(172) != 2 && _hydra2.GetState(105)) || (_hydra3 && _hydra3.GetStat(172) != 2 && _hydra3.GetState(105))) { NTM_MoveTo(me.areaid, 15112, 5004); if(me.GetState(2)) NTC_PutSkill(109, NTC_HAND_RIGHT); NTC_PingDelay(3000); } } function MW_CountMonstersInThrone(range, showMonsters) { var _monster, _count, _monsterData, _output, _chatOutput; var i; if(arguments.length < 1) range = 100; if(arguments.length < 2) showMonsters = false; _count = 0; _monsterData = new Array(); _monster = NTC_FindUnit(NTC_UNIT_MONSTER); if(_monster) { do { if(NTA_IsValidMonster(_monster) && _monster.IsAttackable() && _monster.y <= 5090 && GetDistance(me, _monster) < range) { for(i = 0; i < _monsterData.length; i++) { if(_monsterData[i][0] == _monster.classid) { if(_monsterData[i][1] == "" && !(_monster.spectype&0x0E)) _monsterData[i][1] = _monster.name; _monsterData[i][2]++; break; } } if(i >= _monsterData.length) { _monsterData.push([_monster.classid, "", 1]); if(!(_monster.spectype&0x0E)) _monsterData[_monsterData.length - 1][1] = _monster.name; } _count++; } } while(_monster.GetNext()); } if(showMonsters) { Print("ÿc1" + _count + " ÿc8monster(s) in Throne:"); _chatOutput = "Monster type(s): "; for(i = 0; i < _monsterData.length; i++) { _output = "ÿc8" + _monsterData[i][1]; if(_chatOutput.indexOf('[') > -1) _chatOutput += ", "; _chatOutput += _monsterData[i][1] + " [" + _monsterData[i][2] + "]"; if(_monsterData[i][1].indexOf("Fury") > -1) _output = _output.replace("Fury", "Furies"); else if(_monsterData[i][1].indexOf("Witch") > -1 || _monsterData[i][1].indexOf("Magus") > -1) _output += "es"; else _output += 's'; _output += ": ÿc1" + _monsterData[i][2]; Print(_output); } Say(_chatOutput); } return _count; }