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.

Calling FightClass from Product

Featured Replies

Hi! I'm writing a new product but I don't quite know how to call a fight class from it.

 

for another bot, I simply called

CustomClasses.Instance.Current.Fight(ObjectManager.Instance.Units.Where(x => x.IsInCombat));

but for wRobot, I don't quite know what to call...

 

do I simply do this?

    internal class Fight : TreeTask
    {
        public override int Priority => 1000;

        public override bool Activate()
        {
            return Party.GetParty().Any(x => x.InCombat) && !ObjectManager.Me.IsSwimming;
        }

        public override void Execute()
        {
            CustomClass.LoadCustomClass();
        }
    }

 

Edited by krycess

  • Author

image.png.4643a5be5ed2151c57b2fc7357854538.png

It still isn't clicking for me. Is this the right "state" that you are talking about?

 

    internal class Fight : TreeTask
    {
        public Fight()
        {
            GrindingState = new Grinding();
        }

        public override int Priority => 1000;

        public override bool Activate()
        {
            return Party.GetParty().Any(x => x.InCombat) && !ObjectManager.Me.IsSwimming;
        }

        public override void Execute()
        {
            GrindingState.Run();
        }

        Grinding GrindingState { get; }
    }

 

Edited by krycess

If you're not using the FSM, you need to write your combat behavior completely from scratch.
Look into what the class "Fight" actually does. Just instantiating a state does nothing. 

Decompile and look at it. Take a look at the Grinder project that Droidz uploaded as an example for products.

  • Author

yeah I wasn't planning on using the FSM so I would need to add combat behavior from scratch.

I have written all of this before for another platform so I would just have to port it over.

It would require a totally different type of "fightclass" however... so maybe it should be all inclusive before I release

image.png.05ba1b7f8f6aa8eec5ec82e788c038b6.png

Edited by krycess

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.