Skip to content
View in the app

A better way to browse. Learn more.

WRobot

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Totown state?

Featured Replies

Hello,

Is there a way that I can add a check to see if the bot is in the "ToTown" state?

 

I am tinkering with a bot pausing that I like as I find the functionality in advanced settings to be unreliable, which is a different issue. Even with 500 yards and 0 seconds run time it does not pause

I would like to create a stopbot function that respects players vicinity and pauses straight away, however does not break the "totown" functionality

I am using the below (from the StopBot.cs) to identify when a player is near, and adding a check for an extended pause duration

The problem is that once the bot is on the way to town and encounters its first player, it goes into pause. Which would be fine since it will suppress after a duration. However, the bot upon supressing the pause has forgotten it was on the way to town and goes back to the grinding spot

Is there a way that I can add a check to see if the bot was in the "ToTown" state, so that it does not force the bot to pause, but allows it to run

 

Thanks!


               foreach (var wowPlayer in ObjectManager.GetObjectWoWPlayer() )
               {
                  if (wowPlayer.Name != null && wowPlayer.GetDistance<60 && !ObjectManager.Target.IsAlive)
                  {
                        playerPresent = 1;
                        Logging.Write("Other Player in range detected: "+wowPlayer.Name+" "+wowPlayer.GetDistance.ToString());
                        //Lua.LuaDoString("Dismount();");
                        //Thread.Sleep(10);
                        //Products.InPause = true;
                        
                    }
               }
               if (playerPresent == 0)
                {
                    
                    Products.InPause = false;
                    Thread.Sleep(10);
                } else {
		    Logging.Write("Currently been waiting for: "+timeinpause);
		    timeinpause = timeinpause +1;
			Thread.Sleep(1000);
		}

	     if (timeinpause > 10) {
		    Products.InPause = false;
		    Logging.Write("I probably got stuck on my way to town, surpressing for 40 sec");
		    timeinpause = 0;
                    Thread.Sleep(40000);

	     } 

 


bool goToTown = false;


public void Initialize(){ 
  initializeToTownWatcher();
}

private void initializeToTownWatcher() {
        robotManager.Events.FiniteStateMachineEvents.OnRunState += (engine, state, cancelable) =>
        {
            if (state != null && state.DisplayName == "To Town")
            {
             
                    goToTown = true;
                    Logging.Write("Going to Town State has been initiated.");
            }
        };

        robotManager.Events.FiniteStateMachineEvents.OnAfterRunState += (engine, state) =>
        {
            if (state != null && state.DisplayName == "To Town")
            {
                goToTown = false;
                Logging.Write("We have completed going To Town State.");
                

            }
        };

    }

I recommend doing it by watching for state change. I've not used Matenia's version, but if that doesn't work you can use my code and use the goToTown boolean. 

 

 

Edited by Avvi

Create an account or sign in to comment

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.