Jump to content

Close game when Teleported --> Stop bot when Teleported


Recommended Posts

Does anyone know the method that is handling this or how to recreate it?

When I'm botting and I'm physically at the computer I don't want the game to be closed when teleported, rather I would like the bot to stop / close.

I tried looking in the DLL but man, those random names are messing me up so bad.

Link to comment
Share on other sites

Hello, I am not sure to understand what you want but:

robotManager.Events.FiniteStateMachineEvents.OnRunState += 
delegate(robotManager.FiniteStateMachine.Engine engine, robotManager.FiniteStateMachine.State state, System.ComponentModel.CancelEventArgs cancelable)
{
    if (state is wManager.Wow.Bot.States.StopBotIf && state.DisplayName == "Security/Stop game")
    {
        // sample to disable tp detection:
        wManager.wManagerSetting.CurrentSetting.CloseIfPlayerTeleported = false;
        wManager.Wow.Bot.States.StopBotIf.ForcePvpMode = true;
        wManager.Wow.Bot.States.StopBotIf.LastPos = wManager.Wow.ObjectManager.ObjectManager.Me.Position;

        // how to wrobot check if your char is tp:
        if (wManager.Wow.Bot.States.StopBotIf.LastPos != null &&
            wManager.Wow.Helpers.Conditions.InGameAndConnectedAndAlive && 
            wManager.Wow.ObjectManager.ObjectManager.Me.Position.DistanceTo(wManager.Wow.Bot.States.StopBotIf.LastPos) >= 450)
        {
            // close bot...
        }
    }
};

 

Link to comment
Share on other sites

On 19. 11. 2017 at 12:02 PM, Droidz said:

Hello, I am not sure to understand what you want but:

robotManager.Events.FiniteStateMachineEvents.OnRunState += 
delegate(robotManager.FiniteStateMachine.Engine engine, robotManager.FiniteStateMachine.State state, System.ComponentModel.CancelEventArgs cancelable)
{
    if (state is wManager.Wow.Bot.States.StopBotIf && state.DisplayName == "Security/Stop game")
    {
        // sample to disable tp detection:
        wManager.wManagerSetting.CurrentSetting.CloseIfPlayerTeleported = false;
        wManager.Wow.Bot.States.StopBotIf.ForcePvpMode = true;
        wManager.Wow.Bot.States.StopBotIf.LastPos = wManager.Wow.ObjectManager.ObjectManager.Me.Position;

        // how to wrobot check if your char is tp:
        if (wManager.Wow.Bot.States.StopBotIf.LastPos != null &&
            wManager.Wow.Helpers.Conditions.InGameAndConnectedAndAlive && 
            wManager.Wow.ObjectManager.ObjectManager.Me.Position.DistanceTo(wManager.Wow.Bot.States.StopBotIf.LastPos) >= 450)
        {
            // close bot...
        }
    }
};

 

BTW, what does wManager.Wow.Bot.States.StopBotIf.ForcePvpMode = true; do?

EDIT: any idea how to test it? Tried with using HS but that apparently didn't work.

Link to comment
Share on other sites

Just now, Avvi said:

To test Teleporting, you can use a hearthstone or use a mage portal / game portal etc.

Thanks, so smething must be wrong. Tried with HS and it didn't work.

What I don't get is the first IF statement:

 if (state is wManager.Wow.Bot.States.StopBotIf && state.DisplayName == "Security/Stop game")

 

Link to comment
Share on other sites

state comes from the FiniteStateMachine 

robotManager.FiniteStateMachine.Engine engine, robotManager.FiniteStateMachine.State state, System.ComponentModel.CancelEventArgs cancelable

 

To be honest, I have implemented what Droidz has , but in my RoboAlert plugin. I implemented it a little differently through looking at his code in dotPeek. One problem with the code snippet Droidz provided is that it's missing the continent change. The above code might not catch that.

Link to comment
Share on other sites

You may want to just try the below in its own method with a while loop (for testing).

        // how to wrobot check if your char is tp:
        if (wManager.Wow.Bot.States.StopBotIf.LastPos != null &&
            wManager.Wow.Helpers.Conditions.InGameAndConnectedAndAlive && 
            wManager.Wow.ObjectManager.ObjectManager.Me.Position.DistanceTo(wManager.Wow.Bot.States.StopBotIf.LastPos) >= 450)
        {
            // close bot...
        }

That should probably work

Link to comment
Share on other sites

Tried using it in a plugin. Didn't work with blink, both for the event and the while loops

Spoiler
using wManager.Wow.ObjectManager;
using wManager.Wow.Bot.Tasks;
using System;
using System.Collections.Generic;
using System.Threading;
using robotManager.Helpful;
using robotManager.Products;
using robotManager.Events;
using wManager.Plugin;
using wManager.Wow.Helpers;
using System.Configuration;
using System.ComponentModel;
using System.IO;
using System.Windows.Forms;
using wManager.Wow.Enums;
using System.Linq;

public class Main : wManager.Plugin.IPlugin
{	
	
    public void Initialize()
    {
		robotManager.Events.FiniteStateMachineEvents.OnRunState += 
		delegate(robotManager.FiniteStateMachine.Engine engine, robotManager.FiniteStateMachine.State state, System.ComponentModel.CancelEventArgs cancelable)
		{
			if (state is wManager.Wow.Bot.States.StopBotIf && state.DisplayName == "Security/Stop game")
			{
				// sample to disable tp detection:
				wManager.wManagerSetting.CurrentSetting.CloseIfPlayerTeleported = false;
				wManager.Wow.Bot.States.StopBotIf.ForcePvpMode = true;
				wManager.Wow.Bot.States.StopBotIf.LastPos = wManager.Wow.ObjectManager.ObjectManager.Me.Position;

				// how to wrobot check if your char is tp:
				if (wManager.Wow.Bot.States.StopBotIf.LastPos != null &&
					wManager.Wow.Helpers.Conditions.InGameAndConnectedAndAlive && 
					wManager.Wow.ObjectManager.ObjectManager.Me.Position.DistanceTo(wManager.Wow.Bot.States.StopBotIf.LastPos) >= 15)
				{
					robotManager.Products.Products.ProductStop();
				}
			}
		};
		/* while (Conditions.ProductIsStartedNotInPause)
		{
			// sample to disable tp detection:
			wManager.wManagerSetting.CurrentSetting.CloseIfPlayerTeleported = false;
			wManager.Wow.Bot.States.StopBotIf.ForcePvpMode = true;
			wManager.Wow.Bot.States.StopBotIf.LastPos = wManager.Wow.ObjectManager.ObjectManager.Me.Position;

			// how to wrobot check if your char is tp:
			if (wManager.Wow.Bot.States.StopBotIf.LastPos != null &&
				wManager.Wow.Helpers.Conditions.InGameAndConnectedAndAlive && 
				wManager.Wow.ObjectManager.ObjectManager.Me.Position.DistanceTo(wManager.Wow.Bot.States.StopBotIf.LastPos) >= 15)
			{
				robotManager.Products.Products.ProductStop();
			}
			Thread.Sleep(5);
		} */
    }

    public void Dispose()
    {
    }
	
	public void Settings()
    {
    }
}

 

 

Link to comment
Share on other sites

Can you try the below? 

 

using wManager.Wow.ObjectManager;
using wManager.Wow.Bot.Tasks;
using System;
using System.Collections.Generic;
using System.Threading;
using robotManager.Helpful;
using robotManager.Products;
using robotManager.Events;
using wManager.Plugin;
using wManager.Wow.Helpers;
using System.Configuration;
using System.ComponentModel;
using System.IO;
using System.Windows.Forms;
using wManager.Wow.Enums;
using System.Linq;

public class Main : wManager.Plugin.IPlugin
{	
	
    public void Initialize()
    {
		pluginLoop();

    }

  	public void pluginLoop()
    {

        while (Products.IsStarted && _isLaunched)
        {

            if (!Products.InPause)
            {
		        checkForTeleport()
            }
        }

    }
  
    public void checkForTeleport() {
  
         // how to wrobot check if your char is tp:
        if (wManager.Wow.Bot.States.StopBotIf.LastPos != null &&
            wManager.Wow.Helpers.Conditions.InGameAndConnectedAndAlive && 
            wManager.Wow.ObjectManager.ObjectManager.Me.Position.DistanceTo(wManager.Wow.Bot.States.StopBotIf.LastPos) >= 450)
        {
            Logging.Write("[Teleport Tester] PLAYER HAS TELEPORTED.");
          	robotManager.Products.Products.ProductStop();
        }
  
    }

  
    public void Dispose()
    {
    }
	
	public void Settings()
    {
    }
}

 

Link to comment
Share on other sites

My recommendation is to take a look / decompile the WRobot code using dotPeek to figure out how Droidz does it. In his above snippet, he is omitting a lot - such as checking for when character is dead / character moved to different continent, etc.

 

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
 Share

×
×
  • Create New...