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.

How to intercept corpse-run?

Featured Replies

Might be very stupid question, i'm kind of ill today, so it's hard to think right, sorry for that.

Anyway, simple code like this is not working for me: 

robotManager.Events.FiniteStateMachineEvents.OnBeforeCheckIfNeedToRunState += (engine, state, cancelable) =>
{
	if (condition)
	{
		cancelable.Cancel = true;
		Logging.Write("Message1");
				
		// Do something here
			
		Logging.Write("Message2");
		cancelable.Cancel = false;			
	}
};

The goal is to release spirit but then intercept the act of the corpse-run with a plugin. Problem is: I do get "Message1", so state is canceled, then bot tryes to do the job (// section), but then, for some reason, bot decides to run for a corpse.

If i test it like this: 

cancelable.Cancel = true;
                
Logging.Write("Waiting");
Thread.Sleep(1000*500);
                
Logging.Write("Message2");
cancelable.Cancel = true;

Then i'll get "Waiting" message. Bot will stay for 2-3 seconds but then will run for a corpse anyway. So it's not my code starting the thread again, the thread is starting by itself or (more likely) its a separate thread wich i can't cancel, for some reasone.

Also it doesn't matter wich way i do this, with OnBeforeCheckIfNeedToRunState or OnRunState, result is the same.

I've tryed to cnahge "condition" of my if, to be always true. It spams "Message1", constantly canceling the state, but does not stop the corpse run.

I can pause the bot instead of canceling the state, It will stop the corpse run for sure, but then i will not be able to move it with methods like MovementManager (if i'm not mistaken).

To sum up, is it some sort of state that i can't cancel, or am i just stupid and do it wrong? Maybe the Products.InPause is the way to do it instead, but how do i move then?

Thank you in advance for any tips. 

  • Author

 

5 июн 2019 17H01.log.html

 

Here is a video and a log. I'm trying to make bot to go opposite derection from the corpse. But he does not ever reach first waypoint.

Code that i was testing it with:
 

public void Initialize()
    {
		Logging.Write("Corpse Runner is ON");
        isRunning = true;
	
		
		
        robotManager.Events.FiniteStateMachineEvents.OnBeforeCheckIfNeedToRunState += (engine, state, cancelable) =>
        {
            if ((Me.HaveBuff("Ghost")))
            {
				Logging.Write("Resurrect state is cancelled");
				cancelable.Cancel = true;
				MovementManager.StopMove();
				
				
				
				MovementManager.Go(OppositeDirectionSpiritPath);
				while (MovementManager.InMovement && Conditions.InGameAndConnected && !Conditions.IsAttackedAndCannotIgnore) { Thread.Sleep(300); };
				MovementManager.StopMove();  
				
				
				Logging.Write("WAIT 5000ms");
				Thread.Sleep(5000);
            }
        };
		
		
       
    }

 

  • Author

@Droidz, can you tell me please, is there no such event as "running to retrieve the corpse" and that's why i just can't intercept it, or am i do something wrong?

If there is no such event, then how to retrive corpse with my own code? There is like 20 places atleast, where bot can't get his corpse back, rumming in to the wall or ignores elevator.

can you tell me please, is there no such event such "running to retrive the corpse" and that's why i just can't intercept it, or am i do something wrong?

  • 3 weeks later...
  • Author

So nothing?
I will try to explain. Wrobot does not resurect at some points. Bug on wrobots side that have been reported but have not been solved. Bot also don't know how to pass some elevators, caves, mountains and such. It is also a bug on wrobots side. Also have been reported, also have not been solved.  I am trying to make fix both bugs with a plugin, but i can't intercept a resurect part, wich is also seems like a bug on wrobot side. What should i do?

  • Author

That's what i do. But i can't stop inbuilt corpse run event. Only by pausing the bot, but if i pause it, half of functionality will not work as intended.

  • Author

The problem is. Resurrect state seems to be from "Player is dead" and till you push "Release spirit". So when bot arrives at the graveyard, it is not Ressurect state anymore, and he just runs. But i will recheck that today to confirm.

  • Author

Okay, seems like i have found one more problem. I can stop movement now, but if after i've stoped it, i'll do any Thread.Sleep then it automatically set cancelable.Cancel to false.

Another words, i need to stop current even to preven bot from running. I do stop it. Then i do my own work, but if in a process i will use any Thread.Sleep (wich i will use for elevators or to check something, for example). Then it just unsubscribes from event and bot once again start to run wherever he wants.

I't almost imposible to do not use thread.sleep. Or i will run in circles like a mad, instead of standing still, or i'll burn my cpu.

Any ideas how to avoid that behavior?

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.