Pour tout ce tutoriel, ainsi que tout ceux de GMS se rapportant à la création/modification de script, je vous conseille d'utiliser le Notepad++
Pour une meilleure lecture, et dans le cadre des scripts de D2NT (et je pense de D2Bs) cliquez sur langage, puis mettez-vous en javascript. =)
AVANT TOUTE CHOSE : le bot qui créer les games doit OBLIGATOIREMENT avoir le jeu en anglais !!
Mettre Diablo 2 en anglais
Configurer le bot pour le démarrer en anglais
I. Préparation des fichiers requis
Avant de rentrer dans le vif du sujet, c'est à dire follow avec d2nt, il faut préparer les scripts.
Alors, on va dans le dossier D2NT\scripts\NTBot\bots, une fois dedans, clique droit > nouveau fichier texte, et on le nommes de cette manière :
NTBaalLeechFight.ntj // il s'agit du script leech pour baal, celui de diablo vient juste après, pas de panique.
Une fois ceci fait, vous l'ouvrez avec le notepad++, et vous collez dedans ce script :
function NTMain() { Include("libs/common/NTCommon.ntl"); NTC_IncludeLibs(); NTC_IncludeConfig("NTBot/char_configs"); NT_LoadConfig(); NTSI_LoadNIPFiles("NTBot/item_configs"); NTA_Initialize(); // 10 if(!NTTM_CheckAct()) { NTC_SendMsgToScript("NTBotGame.ntj", "NTTM_CheckAct()"); return; } if(me.areaid != 109) { if(!NTTM_TownMove("waypoint")) { NTC_SendMsgToScript("NTBotGame.ntj", "NTTM_TownMove()"); return; } if(!NTM_TakeWaypoint(109)) { NTC_SendMsgToScript("NTBotGame.ntj", "NTM_TakeWaypoint()"); return; } } NTTMGR_TownManager(); NTTM_TownMove("portalspot"); for(i = 0; i <= 100; i++) { if(NTC_InMyParty(NTConfig_Leader)) break; Delay(200); } while(me.areaid == 109 && NTC_InMyParty(NTConfig_Leader)) { NTM_UsePortal("BluePortal", 131, NTConfig_Leader); // 50 Delay(1000); } NTP_DoPrecast(true); while(NTC_InMyParty(NTConfig_Leader)) { NT_ClearThroneInt(); while(1) { 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, 5040); if(me.GetState(2)) NTC_PutSkill(109, NTC_HAND_RIGHT); for(i = 0 ; i < 6 ; i++) { _wave = NT_ThroneCheckInt(); if(_wave > 0) break; NTC_Delay(500); } _starttick = GetTickCount(); while(_wave == 0) { if(!NT_ThronePreAttackInt()) NTC_Delay(200); if(GetTickCount()-_starttick > 15000) { NT_ClearThroneInt(); _starttick = GetTickCount(); } _wave = NT_ThroneCheckInt(); } switch(_wave) { case 1: NTA_ClearPosition(40, true, 1); NTP_DoPrecast(true); break; case 3: NTA_ClearPosition(40, true, 2); 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; } if(NTConfig_KillBaal) { var _portal; if(!NTTMGR_CheckSafe(NTConfig_CheckSelfSafe|0x01, NTConfig_CheckMercSafe)) { NTC_SendMsgToScript("NTBotGame.ntj", "NTTMGR_CheckSafe()"); return; } NTM_MoveTo(me.areaid, 15092, 5010); NTP_DoPrecast(true); while(NTC_FindUnit(NTC_UNIT_MONSTER, 543)) NTC_Delay(500); _portal = NTC_FindUnit(NTC_UNIT_OBJECT, 563, 1); if(!_portal) { NTC_SendMsgToScript("NTBotGame.ntj", "NTC_FindUnit()"); return; } if(!NTM_UsePortal("Portal", 132, null, _portal)) { NTC_SendMsgToScript("NTBotGame.ntj", "NTM_UsePortal()"); return; } NTM_MoveTo(me.areaid, 15138, 5916); if(!NTA_KillMonster(544)) { NTC_SendMsgToScript("NTBotGame.ntj", "NTA_KillMonster()"); return; } NTSI_PickItems(); } } NTC_SendMsgToScript("NTBotGame.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(25, true, 2); } } 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() { if(me.classid == NTC_CHAR_CLASS_SORCERESS) { if(NTConfig_AttackSkill[3] == 56 || NTConfig_AttackSkill[3] == 59) return NTC_CastSkill(NTConfig_AttackSkill[3], 2, 15092, 5028); } else if(me.classid == NTC_CHAR_CLASS_PALADIN) { if(NTConfig_AttackSkill[3] == 112) { if(NTConfig_AttackSkill[4] > 0) NTC_PutSkill(NTConfig_AttackSkill[4], NTC_HAND_RIGHT); return NTC_CastSkill(NTConfig_AttackSkill[3], 2); } } return false; }
On sauvegarde, et voilà.
Maintenant, pour Diablo, c'est pratiquement la même chose. Créez "NTDiabloLeechFight.ntj" et copiez à l'intérieur ce qui suit :
function NTMain() { Include("libs/common/NTCommon.ntl"); NTC_IncludeLibs(); NTC_IncludeConfig("NTBot/char_configs"); NT_LoadConfig(); NTSI_LoadNIPFiles("NTBot/item_configs"); NTA_Initialize(); // 10 if(!NTTM_CheckAct()) { NTC_SendMsgToScript("NTBotGame.ntj", "NTTM_CheckAct()"); return; } if(me.areaid != 103) { if(!NTTM_TownMove("waypoint")) { NTC_SendMsgToScript("NTBotGame.ntj", "NTTM_TownMove()"); return; } if(!NTM_TakeWaypoint(103)) { NTC_SendMsgToScript("NTBotGame.ntj", "NTM_TakeWaypoint()"); return; } } NTTMGR_TownManager(); NTTM_TownMove("portalspot"); for(i = 0; i <= 100; i++) { if(NTC_InMyParty(NTConfig_Leader)) break; Delay(200); } while(me.areaid == 103 && NTC_InMyParty(NTConfig_Leader)) { NTM_UsePortal("BluePortal", 108, NTConfig_Leader); // 50 Delay(1000); } NTP_DoPrecast(true); if(!NTM_MoveTo(108, 7797, 5560)) { NTC_SendMsgToScript("NTBotGame.ntj", "NTM_MoveTo()"); return; } if(NTConfig_PublicMode) { var _attackpos = [7792, 5525, 7793, 5501, 7773, 5495, 7768, 5480, 7767, 5458, 7770, 5438, 7774, 5417, 7767, 5391, 7768, 5369, 7769, 5345, 7770, 5320, 7780, 5308]; if(!NTM_MoveTo(me.areaid, 7790, 5544)) { NTC_SendMsgToScript("NTBotGame.ntj", "NTM_MoveTo()"); return; } NTA_ClearPosition(20, false, 2); NTM_MoveTo(me.areaid, 7790, 5544); NTC_PingDelay(1000); NTA_ClearPosition(20, true, 2); NTM_MoveTo(me.areaid, 7790, 5544); for(var i = 0 ; i < _attackpos.length ; i += 2) { NTM_MoveTo(me.areaid, _attackpos[i], _attackpos[i+1]); NTA_ClearPosition(25, true, 2); } NTP_DoPrecast(true); } if(!NT_OpenSealsInt()) { NTC_SendMsgToScript("NTBotGame.ntj", "NT_OpenSealsInt()"); return; } NTP_DoPrecast(true); if(!NTM_MoveTo(me.areaid, 7792, 5292)) { NTC_SendMsgToScript("NTBotGame.ntj", "NTM_MoveTo()"); return; } if(!NTTMGR_CheckSafe(NTConfig_CheckSelfSafe|0x01, NTConfig_CheckMercSafe)) { NTC_SendMsgToScript("NTBotGame.ntj", "NTTMGR_CheckSafe()"); return; } NTC_FindUnit(NTC_UNIT_MONSTER, 243, 100); if(!NTA_ClearPosition(25, true, 2)) { NTA_ClearPosition(); } NTSI_PickItems(); NTC_SendMsgToScript("NTBotGame.ntj", "SCRIPT_END"); } // Internal function function NT_OpenSealsInt() { var i, _unit; var _result; _unit = GetPresetUnits(me.areaid, NTC_UNIT_OBJECT); if(!_unit) return false; _result = false; for(i = 0 ; i < _unit.length ; i++) { if(_unit[i].id == 396) { if(_unit[i].roomy*5 + _unit[i].y == 5275) _result = NT_OpenVizierSealInt(1); else _result = NT_OpenVizierSealInt(2); break; } } if(!_result) return false; NTP_DoPrecast(false); _result = false; for(i = 0 ; i < _unit.length ; i++) { if(_unit[i].id == 394) { if(_unit[i].roomx*5 + _unit[i].x == 7773) _result = NT_OpenDeSeisSealInt(1); else _result = NT_OpenDeSeisSealInt(2); break; } } if(!_result) return false; NTP_DoPrecast(false); _result = false; for(i = 0 ; i < _unit.length ; i++) { if(_unit[i].id == 392) { if(_unit[i].roomx*5 + _unit[i].x == 7893) _result = NT_OpenVenomSealInt(1); else _result = NT_OpenVenomSealInt(2); break; } } return _result; } function NT_OpenVizierSealInt(type) { var i, n; var _attackpos = [7740, 5300, 7740, 5280, 7720, 5280, 7720, 5300]; var _monstername = GetLocaleString(2851); for(i = 0 ; i < _attackpos.length ; i += 2) { NTM_MoveTo(me.areaid, _attackpos[i], _attackpos[i+1]); NTA_ClearPosition(25, true, 2); } for(i = 0 ; i < 3 ; i++) { if(type == 1) { NT_OpenSealInt(395, 7654, 5310); NT_OpenSealInt(396, 7659, 5277); NTM_MoveTo(me.areaid, 7665, 5277); } else { NT_OpenSealInt(395, 7650, 5276); NT_OpenSealInt(396, 7651, 5310); } for(n = 0 ; n < 10 ; n++) { NTC_Delay(200); if(NTA_KillMonster(_monstername)) { NTA_ClearPosition(); NTSI_PickItems(); return NTM_MoveTo(me.areaid, 7750, 5280); } } } return false; } function NT_OpenDeSeisSealInt(type) { var i, n; var _attackpos = [7780, 5255, 7800, 5255, 7800, 5235, 7780, 5235]; var _monstername = GetLocaleString(2852); for(i = 0 ; i < _attackpos.length ; i += 2) { NTM_MoveTo(me.areaid, _attackpos[i], _attackpos[i+1]); NTA_ClearPosition(25, true, 2); } for(i = 0 ; i < 3 ; i++) { if(type == 1) { NT_OpenSealInt(394, 7769, 5158); NTM_MoveTo(me.areaid, 7771, 5196); } else { NT_OpenSealInt(394, 7810, 5156); NTM_MoveTo(me.areaid, 7770, 5169); } for(n = 0 ; n < 10 ; n++) { NTC_Delay(200); if(NTA_KillMonster(_monstername)) { NTA_ClearPosition(30); NTSI_PickItems(); return NTM_MoveTo(me.areaid, 7800, 5255); } } } return false; } function NT_OpenVenomSealInt(type) { var i, n; var _attackpos = [7835, 5280, 7835, 5300, 7855, 5300, 7855, 5280]; var _monstername = GetLocaleString(2853); for(i = 0 ; i < _attackpos.length ; i += 2) { NTM_MoveTo(me.areaid, _attackpos[i], _attackpos[i+1]); NTA_ClearPosition(25, true, 2); } for(i = 0 ; i < 3 ; i++) { if(type == 1) { NT_OpenSealInt(393, 7915, 5280); NT_OpenSealInt(392, 7895, 5318); NTM_MoveTo(me.areaid, 7892, 5298); } else { NT_OpenSealInt(393, 7905, 5277); NT_OpenSealInt(392, 7916, 5310); NTM_MoveTo(me.areaid, 7937, 5305); } for(n = 0 ; n < 10 ; n++) { NTC_Delay(200); if(NTA_KillMonster(_monstername)) { NTSI_PickItems(); if(NTC_PutSkill(124, NTC_HAND_RIGHT)) NTC_PingDelay(1000); return true; } } } return false; } function NT_OpenSealInt(classid, x, y) { var _seal; NTM_MoveTo(me.areaid, x, y); NTA_ClearPosition(25, true, 2); _seal = NTC_FindUnit(NTC_UNIT_OBJECT, classid, 5); if(!_seal) return false; if(_seal.mode > 0) return true; return true; for(var i = 0 ; i < 4 ; i++) { if((i % 2) == 0) { if(GetDistance(me, _seal) > 2) NTM_MoveTo(_seal.areaid, _seal.x+1, _seal.y); NTC_DoClick(NTC_CLICK_LDOWN, NTC_SHIFT_NONE, _seal); } NTC_Delay(500); if(_seal.mode > 0) return true; } return false; }
Maintenant que les fichiers de leech sont crées, passons à la suite. =)
Vous trouverez en pièce jointes l'archive "NTBotLeech.rar", téléchargez-la, et faites une extraction du script qui se trouve dedans dans :
D2NT\scripts // vous devez également avoir NTMap.ntj, ainsi NTBot.ntj =)
Ouvrez-le avec le notepad++ pour éditer certaines parties (n'ayez pas peur

var joinChannelInChat = ""; // leave blank to not join a private channel <-- pour rejoindre un channel spécifique var JoinFromChat = true; // <-- pour se connecter à un channel (si vous voulez rejoindre un channel spécifique, vous devez mettre true var leaderAccountName = "darkness-stone"; <-- le nom du COMPTE (et j'insiste bien du compte) du char qui bot (le hammer par exemple)
Ensuite, on sauvegarde, puis dans : D2NT\scripts\libs vous y trouverez le fichier "ControlInfo.ntj".
Ouvrez-le avec le notepad++ et cherchez ces deux lignes :
this.controls.lobby.chat.textBox = new Array(); this.controls.lobby.chat.textBox.channelName = [4,28,138,354,60];Vous placez juste en dessous cette nouvelle ligne :
this.controls.lobby.chat.textBox.channelText = [4,28,410,354,298];Ce petit ajout permet simplement au bot de "lire" la friend list. =)
Vous devez obtenir ceci, si tout est correctement fait :
this.controls.lobby.chat.textBox = new Array(); this.controls.lobby.chat.textBox.channelName = [4,28,138,354,60]; this.controls.lobby.chat.textBox.channelText = [4,28,410,354,298]; this.controls.lobby.chat.location = [
On enregistre. Voilà, la partie "dure" est finie... On passe au plus simple. ;D
II. Activation des scripts pour le leecher
Voilà, maintenant, vous allez dans le "char_config" habituel, et vous créez le fichier de configuration de votre personnage de matière habituelle (et n'oubliez pas de mettre les attaques employées, le bot va dans le tas

Au tout début de votre "liste de boss" vous placez ceci :
NTConfig_Leader = "YourLeader_Name" // Your Leader name - CaSe sensitive <-- cette fois-ci, c'est le nom du char du bot (par exemple, tartanpion, et c'est case sensible, pour le fichier, Tartanpion est différent de tartanpion, attention) NTConfig_Script.push("NTDiabloLeechFight.ntj"); NTConfig_Script.push("NTBaalLeechFight.ntj"); NTConfig_KillBaal = true;
Pour annuler, ajoutez simplement "//" devant un des deux scripts de leech (mais surtout pas devant "NTConfig_Leader" !!!)
III. Configuration dans le manager
Bon, c'est cool tout ça, mais maintenant, il faut le dire au manager..

Si vous bottez leech+bot d'un même pc, il vous faudra créer une clé cd mpq pour le bot =) (je vous renvoie à ce très bon tuto cd-key mpq d'Euclide_ )
Bref, remplissez les champs comme il se doit.. Cependant :
Laissez room name et password sur "random"
Dans "entry point" juste au dessus de "ok" sélectionnez "NTBotLeech.ntj"..

Faites "ok", puis "save"...
Ensuite, c'est simple.. lancez d'abord le leecher, et ensuite le bot (car le leecher attends que le bot créer pour rejoindre) et admirez...
Petite remarque importante : à chaque fin de game, après avoir tué Baal (dans le cas d'un leech baal donc) vous aurez ce message d'erreur :
NTBaalLeechFight.ntj : NTC_FindUnit() Failed (La Chambre de la Pierre Monde/WorldStone Chamber)
Bon leech. ^^
SOURCES :
- Original Baal Leech Bot Script par Beo900 : http://www.edgeofnow...ic.php?t=450711
- Original Baal/dia Fight Leech par Beo900 : http://www.edgeofnow...ic.php?t=451462
Je n'ai fais que traduire la guide d'installation, aucunes des modifications ne sont de moi. =)
darkness-stone