Jump to content

Go To Trainers command (for all classes)


ScripterQQ

Recommended Posts

Hello, I would like to include a step that forces the character going to the trainer of his class. Now I know there is plugin trainlevel.cs, customizable with levels and so on, but if I'm grinding with quester Pulse > Level 10 to 15, and the plugin is set to 13 for trainer visit for example, it simply doesn't go, because I believe the bot is still finishing the 10 to 15 pulse so it ignores the plugin. Also I'm trying to do a Quester 1-80 that fits all classes so I can't put a Step > GoToAndInteractWithNpc because every class has different trainer, so my idea was between each pulse of zone level, force the bot to visit the trainer like it would do normally, I mean knowning exactly the class and knowing where is located his trainer (but this isn't a problem, I added npc in the profile).

TLDR: Is there a "Go to trainers" button/C# code that fits all classes?

Thanks ?

Link to comment
Share on other sites

  • 3 weeks later...
  • 1 month later...
  • 3 months later...
  • 10 months later...
  • 8 months later...

This isn't ever going to happen. But you can just select a trainer type for your class from the NpcDB and go to it, then train shit.
That's like 3 more lines of code than forcing it.

Link to comment
Share on other sites

4 hours ago, Droidz said:

wManager.Wow.Bot.States.Trainers.ForceGoClassTrainer();

 

Hi, Can you tell me how this code works ? , because I need code to train after interacting with the trainer

10.jpg

Link to comment
Share on other sites

Code like this should help

// train skills by name //
if (wManager.Wow.Bot.Tasks.GoToTask.ToPositionAndIntecractWithNpc(new robotManager.Helpful.Vector3(5813.14f, 475.205f, 658.7826f), 31238))
{
  
	wManager.Wow.Helpers.Usefuls.SelectGossipOption(wManager.Wow.Enums.GossipOptionsType.trainer);
	Thread.Sleep(1000);
  
	// spell 1 //
	if (!Lua.LuaDoString<bool>("if IsSpellKnown(54197) then return true end") && Lua.LuaDoString<bool>("for i=1,GetNumTrainerServices() do serviceName,_,serviceType,_=GetTrainerServiceInfo(i) if serviceName == 'Cold Weather Flying' and serviceType == 'available' then return true end end"))
	{
        	Lua.LuaDoString("for i=1,GetNumTrainerServices() do serviceName,_,_,_=GetTrainerServiceInfo(i) if serviceName == 'Cold Weather Flying' then BuyTrainerService(i) end end");
		Thread.Sleep(1000);
	}
  
	// spell 2 //
	if (!Lua.LuaDoString<bool>("if IsSpellKnown(33391) then return true end") && Lua.LuaDoString<bool>("for i=1,GetNumTrainerServices() do serviceName,_,serviceType,_=GetTrainerServiceInfo(i) if serviceName == 'Journeyman Riding' and serviceType == 'available' then return true end end"))
	{
		Lua.LuaDoString("for i=1,GetNumTrainerServices() do serviceName,_,_,_=GetTrainerServiceInfo(i) if serviceName == 'Journeyman Riding' then BuyTrainerService(i) end end");
		Thread.Sleep(1000);
	}
  	
}

 

Link to comment
Share on other sites

@Droidz The Force go Train code doesnt work at all, 

 

i tried adding npc to database | i tried making my own quester with pre training npc added with runcode " 

wManager.Wow.Bot.States.Trainers.ForceGoClassTrainer();

 

It doesnt go to trainer.

 

Update : it runs if i use a runcode in quester, but its not letting me use the database for inside a plugin.

Edited by Smokie
Link to comment
Share on other sites

  • 4 months later...

Just to help others, here is to go to a trainer and learn spell or spells.

Custom Code > Quester

 

public static class Trainer_Learn
{

    public static List<Tuple<string, uint>> SpellsList = new List<Tuple<string, uint>>
    {
            new Tuple<string, uint>("Charge", 5),
            new Tuple<string, uint>("Rend", 5),
            new Tuple<string, uint>("Thunder Clap", 5),
            new Tuple<string, uint>("Parry", 5),
            new Tuple<string, uint>("Battle Shout", 5),

    };

    public static void LearningSpells(string SpellName)
    {
        Lua.LuaDoString(string.Format(@"
        for i=1,GetNumTrainerServices() do
        local name = GetTrainerServiceInfo(i)
        if (name == '{0}') then
            BuyTrainerService(i)
         end
        end
        ", SpellName.Replace("'", "\'")));
    }

    public static void SpellINdex(Vector3 Vect, int npc, bool LearnAll)
    {
        if (LearnAll == true)
        {
            Trainer.TrainingSpell();
            Thread.Sleep(100);
        }
        uint lastLevelCheck = 0;
        foreach (var SpellIndex in SpellsList)
        {
            var level = ObjectManager.Me.Level;
            if (level >= SpellIndex.Item2)
            {
                if (SpellManager.KnowSpell(SpellIndex.Item1.ToString()) == false)
                {
                    while (GoToTask.ToPositionAndIntecractWithNpc(Vect, npc))
                    {
                        Usefuls.SelectGossipOption(GossipOptionsType.trainer);
                        Thread.Sleep(100);
                        LearningSpells(SpellIndex.Item1);
                        Thread.Sleep(100);

                    }
                }
            }
            lastLevelCheck = level;
        }
    }
}

Useage : 

Trainer_Learn.SpellINdex(new Vector3(-639.344f, -4230.19f, 38.13411f), 3153, false);

 

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...