Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /*///////////////////////////////////////////////////////////////
- Author: DysfunctionaI @ BlizzHackers, DysfunctionaI @ D2JSP
- /////////////////////////////////////////////////////////////////
- This is the command file, where you may edit or make new commands.
- Potential commands are limitless, but I have written up most of
- the more useful ones here. Adding commands became really popular
- in my last release, so I decided to make it easier for people to
- write their own commands.
- The layout is simple. You get two variables to work with:
- 'command' is the command that the leader typed
- 'variable' is the payload (if any), which comes after a command
- Example:
- The leader types "-dropgold 500"
- The 'command' would be 'dropgold'
- The 'variable' would be '500'
- Example 2:
- The leader types "-walk"
- The 'command' would be 'walk'
- The 'variable' would be 'undefined'
- You may also use the functions available in the NTHelperBot.ntj
- script. Not all of them will work with your custom commands
- perfectly, so check them out before using them. If they don't fit
- your needs, I advise against editing the function, and instead,
- just writing a new one here, because your edits could easily break
- the bot.
- Don't forget to put return; at the end of your commands.
- //////////////////////////////////////////////////////////////////
- Have fun! Command section below!
- ////////////////////////////////////////////////////////////////*/
- function NTH_Commands(command, variable)
- {
- /////////////////
- // town
- /////////////////
- if(command == "town")
- {
- if(NTC_InTown())
- {
- NTH_Say("Doing town stuff");
- NTTMGR_TownManager();
- NTTM_TownMove("portalspot");
- }
- else
- NTH_Say("I'm not in town!");
- return;
- }
- /////////////////
- // tp
- /////////////////
- if(command == "tp")
- {
- NTH_Say("Taking your TP");
- if(NTC_InTown())
- {
- NTTM_TownMove("portalspot");
- NTH_UsePortal(_leadername);
- while(!NTH_GetLeader())
- {
- if(_attack)
- NTH_ClearPosition(true);
- Delay(500);
- }
- }
- else
- {
- NTH_UsePortal(_leadername);
- while(!NTH_GetLeader())
- Delay(500);
- }
- return;
- }
- ///////////////////////////
- //// gold //////////////
- ///////////////////
- if(command == "gold")
- {
- _gold = me.GetStat(14);
- if(variable != "")
- {
- if( parseInt(variable) <= 50000 && parseInt(variable) >= 1 )
- {
- if(parseInt(variable) <= _gold)
- {
- Gold(0, parseInt(variable))
- }
- else
- {
- Say("Sorry, I am out of gold!");
- }
- NTC_Delay(3);
- }
- else
- {
- Say("Invalid variable. Valid range is 1-10000.");
- }
- }
- else
- {
- Say("Invalid variable. Valid range is 1-10000.");
- }
- }
- /////////////////
- // safe
- /////////////////
- if(command == "safe")
- {
- if(NTC_InTown())
- {
- NTTM_TownMove("portalspot");
- if(NTH_UsePortal(_leadername))
- NTT_GetCorpses();
- while(!NTH_GetLeader())
- {
- if(_attack)
- NTH_ClearPosition(true);
- Delay(500);
- }
- }
- return;
- }
- /////////////////
- // precast
- /////////////////
- if(command == "precast")
- {
- NTP_DoPrecast(true);
- return;
- }
- /////////////////
- // goto
- /////////////////
- if(command == "goto")
- {
- if(variable == 'trist')
- {
- if(!NTTM_CheckAct(1))
- {
- NTC_SendMsgToScript("NTBotGame.ntj", "NTTM_CheckAct()");
- return;
- }
- NTTMGR_TownManager();
- NTTM_TownMove("waypoint");
- NTM_TakeWaypoint(4);
- if(!NTM_MoveToPresetUnit(me.areaid, NTC_UNIT_MONSTER, 737, 10, 10, false))
- {
- NTM_MakeTP();
- Say("Failed to move to unit");
- //Delay(7500);
- //NTC_SendMsgToScript("NTBotGame.ntj", "NTM_MoveToPresetUnit()");
- return;
- }
- NTA_ClearPosition( 20 );
- NTM_MakeTP();
- }
- else
- if(me.areaid === parseInt(variable))
- {
- if(parseInt(msg3) >= 0 && parseInt(msg4) >= 0)
- {
- Say("Moving to: " + msg3 + ", " + msg4);
- if(!NTM_MoveTo(parseInt(variable), parseInt(msg3), parseInt(msg4)))
- {
- Say("!Failed to move");
- }
- }
- }
- return;
- }
- /////////////////
- // come
- /////////////////
- if(command == "come")
- {
- _stay = false;
- NTH_Say("I'll follow you");
- ClickMap(NTC_CLICK_LDOWN, NTC_SHIFT_NONE, _leader.x, _leader.y);
- ClickMap(NTC_CLICK_LUP, NTC_SHIFT_NONE, null);
- return;
- }
- /////////////////
- // stay
- /////////////////
- if(command == "stay")
- {
- NTH_Say("I'll stay here");
- _stay = true;
- return;
- }
- /////////////////
- // pick
- /////////////////
- if(command == "pick")
- {
- NTH_Say("Picking up items");
- NTH_PickItems();
- return;
- }
- /////////////////
- // body
- /////////////////
- if(command == "body")
- {
- NTH_Say("Getting my body");
- NTT_GetCorpses();
- return;
- }
- /////////////////
- // help
- /////////////////
- if(command == "help")
- {
- NTH_Say("stay | come | attack on/off | tp | maketp | safe | aura (name) | wp | talk | shrine | town | precast | pick | body | verbal | gold");
- return;
- }
- /////////////////
- // maketp
- /////////////////
- if(command == "maketp")
- {
- if(!NTC_InTown())
- {
- if(NTM_MakeTP())
- NTH_Say("TP up");
- else
- NTH_Say("I don't have any TPs!");
- }
- else
- NTH_Say("I can't TP here!");
- return;
- }
- /////////////////
- // verbal
- /////////////////
- if(command == "verbal")
- {
- if(variable == undefined || (variable != "on" && variable != "off"))
- {
- if(_verbal)
- Say("Verbal messages ON");
- else
- Say("/w "+_leadername+" Verbal messages are OFF");
- Delay(50);
- }
- else
- {
- if(variable == "on")
- {
- _verbal = true;
- NTH_Say("Verbal messages ON");
- }
- else
- {
- _verbal = false;
- Say("/w "+_leadername+" Verbal messages OFF");
- }
- }
- return;
- }
- /////////////////
- // attack
- /////////////////
- if(command == "attack")
- {
- if(variable == undefined || (variable != "on" && variable != "off"))
- {
- if(_attack)
- NTH_Say("Attack is ON");
- else
- NTH_Say("Attack is OFF");
- }
- else
- {
- if(variable == "on")
- {
- _attack = true;
- NTH_Say("I'll attack at will");
- }
- else
- {
- _attack = false;
- NTH_Say("I won't attack anymore");
- }
- }
- return;
- }
- /////////////////
- // shrine
- /////////////////
- if(command == "shrine")
- {
- _target = NTC_FindUnit(NTC_UNIT_OBJECT, "shrine");
- if(!_target)
- _target = NTC_FindUnit(NTC_UNIT_OBJECT, "well");
- if(_target)
- {
- do
- {
- if(GetDistance(_leader.x, _leader.y, _target.x, _target.y) < 15)
- break;
- } while(_target.GetNext());
- if(GetDistance(_leader.x, _leader.y, _target.x, _target.y) < 15)
- {
- NTH_Say("Grabbing shrine");
- if(GetDistance(me.x, me.y, _target.x, _target.y) > 3)
- NTH_MoveTo(_target.areaid, _target.x+5, _target.y+5, 10);
- NTC_DoClick(NTC_CLICK_LDOWN, NTC_SHIFT_NONE, _target);
- Delay(500);
- }
- else
- NTH_Say("Which shrine?");
- }
- else
- NTH_Say("I don't see a shrine!");
- return;
- }
- /////////////////
- // talk
- /////////////////
- if(command == "talk")
- {
- if(!NTC_InTown())
- {
- NTH_Say("No one to talk to out here!");
- return;
- }
- var _npc = false;
- var _target = NTC_FindUnit(NTC_UNIT_NPC);
- if(_target)
- {
- do
- {
- if(_target.classid > 6 && _target.name != "an evil force" && GetDistance(_leader.x, _leader.y, _target.x, _target.y) < 10)
- {
- var _npc = true;
- NTH_Say("I'll talk to "+_target.name);
- /*
- if(NTC_DoClick(NTC_CLICK_LDOWN, NTC_SHIFT_NONE, _target))
- {
- Delay(1000);
- if(_target.classid == 155) // Warriv A1
- me.SelectNPCMenu(0x0D36);
- else if(_target.classid == 155) // Warriv A2
- me.SelectNPCMenu(0x0D37);
- else if(_target.classid == 210) // Meshif A2
- me.SelectNPCMenu(0x0D38);
- else if(_target.classid == 264) // Meshif A3
- me.SelectNPCMenu(0x0D39);
- else if(_target.classid == 367) // Tyrael A4
- me.SelectNPCMenu(0x58D2);
- else
- {
- me.SelectNPCMenu(0x0000);
- me.Cancel(0);
- me.Cancel(1);
- }
- while(!NTH_GetLeader())
- Delay(500);
- }
- else
- {
- Delay(1000);
- NTH_Say("I had a problem talking to that NPC...");
- }*/
- break;
- }
- } while(_target.GetNext());
- if(!_npc)
- NTH_Say("Show me what NPC to talk to!");
- return;
- }
- return;
- }
- /////////////////
- // aura
- /////////////////
- if(command == "aura")
- {
- if(me.classid != NTC_CHAR_CLASS_PALADIN)
- return;
- var _aura = 0;
- if(variable == "prayer" || variable == "pray")
- _aura = 99;
- else if(variable == "cleansing" || variable == "clean")
- _aura = 109;
- else if(variable == "med" || variable == "meditation")
- _aura = 120;
- else if(variable == "vigor" || variable == "vig")
- _aura = 115;
- else if(variable == "salv" || variable == "salvation")
- _aura = 125;
- else if(variable == "might")
- _aura = 98;
- else if(variable == "conc" || variable == "concentration")
- _aura = 113;
- else if(variable == "fana" || variable == "fanaticism")
- _aura = 122;
- else if(variable == "convic" || variable == "conviction")
- _aura = 123;
- if(_aura)
- {
- if(NTC_GetSkillLevel(_aura))
- {
- NTH_Say("OK, I'll use that aura");
- NTC_PutSkill(_aura, NTC_HAND_RIGHT);
- NTConfig_AttackSkill[2] = _aura;
- NTConfig_AttackSkill[4] = _aura;
- }
- else
- NTH_Say("I don't have that aura!");
- }
- else
- NTH_Say("I don't recognize that aura!");
- return;
- }
- /////////////////
- // wp
- /////////////////
- if(command == "wp")
- {
- _target;
- var _wp = null;
- switch(me.areaid)
- {
- case 3:
- _wp = 119;
- break;
- case 4:
- _wp = 119;
- break;
- case 5:
- _wp = 119;
- break;
- case 6:
- _wp = 119;
- break;
- case 27:
- _wp = 119;
- break;
- case 29:
- _wp = 157;
- break;
- case 32:
- _wp = 119;
- break;
- case 35:
- _wp = 157;
- break;
- case 42:
- _wp = 156;
- break;
- case 43:
- _wp = 156;
- break;
- case 44:
- _wp = 156;
- break;
- case 46:
- _wp = 402;
- break;
- case 48:
- _wp = 323;
- break;
- case 52:
- _wp = 288;
- break;
- case 57:
- _wp = 156;
- break;
- case 74:
- _wp = 402;
- break;
- case 76:
- _wp = 237;
- break;
- case 77:
- _wp = 237;
- break;
- case 78:
- _wp = 237;
- break;
- case 79:
- _wp = 237;
- break;
- case 80:
- _wp = 237;
- break;
- case 81:
- _wp = 237;
- break;
- case 83:
- _wp = 237;
- break;
- case 101:
- _wp = 324;
- break;
- case 106:
- _wp = 238;
- break;
- case 107:
- _wp = 238;
- break;
- case 111:
- _wp = 496;
- break;
- case 112:
- _wp = 496;
- break;
- case 113:
- _wp = 511;
- break;
- case 115:
- _wp = 511;
- break;
- case 117:
- _wp = 496;
- break;
- case 118:
- _wp = 511;
- break;
- case 129:
- _wp = 494;
- break;
- }
- if(_wp != null)
- {
- NTH_Say("Grabbing waypoint");
- NTM_MoveToPresetUnit(me.areaid, NTC_UNIT_OBJECT, _wp, 1, 1);
- _target = NTC_FindUnit(NTC_UNIT_OBJECT, _wp);
- if(_target)
- {
- if(GetDistance(me, _target) > 2)
- NTM_MoveTo(_target.areaid, _target.x+1, _target.y);
- Delay(500);
- NTC_DoClick(NTC_CLICK_LDOWN, NTC_SHIFT_NONE, _target);
- Delay(1000);
- me.Cancel(1);
- }
- }
- else
- NTH_Say("There's no waypoint here!");
- return;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement