• Visit Rebornbuddy
  • Visit Panda Profiles
  • Visit LLamamMagic
  • Default Combat Discussion

    Discussion in 'Combat Routines' started by Ama, Jan 5, 2015.

    1. Cryogenesis

      Cryogenesis Moderator Moderator

      Joined:
      Jul 13, 2010
      Messages:
      2,128
      Likes Received:
      13
      Trophy Points:
      38
      Hey guys, i may have found the weird running while in need of heal:
      Code:
              private static Composite Rejuvenate
              {
                  get
                  {
                      using (BuddyTor.Memory.AcquireFrame())
                      {
                          return new Action(delegate
                          {
      
                              if (NeedRest())
                              {
                                  while (KeepResting())
                                  {
                                      if (!Me.IsCasting)
                                          AbilityManager.Cast(Me.RejuvenateAbilityName(), Me);
      
                                      Thread.Sleep(100);
                                  }
      
                                  [B]Movement.Move(Buddy.Swtor.MovementDirection.Forward, System.TimeSpan.FromMilliseconds(1));[/B]
                                  return RunStatus.Success;
                              }
      
                              return RunStatus.Failure;
                          });
                      }
                  }
              }
      
      Havent tested it without this line, but may it be this?

      Its inside the Rest.cs
       
    2. alltrueist

      alltrueist Active Member

      Joined:
      Dec 10, 2012
      Messages:
      1,424
      Likes Received:
      16
      Trophy Points:
      38
      Weird, I wonder why he even put that in there? Maybe to cancel the resting? Can someone test it with that line commented out and see if it works?
       
    3. Cryogenesis

      Cryogenesis Moderator Moderator

      Joined:
      Jul 13, 2010
      Messages:
      2,128
      Likes Received:
      13
      Trophy Points:
      38
      Yeah my guess aswell, althow i think the problem lies with the milliseconds part ie, not stopping its action or not doing anything.
       
    4. wired203

      wired203 Community Developer

      Joined:
      Jan 22, 2015
      Messages:
      391
      Likes Received:
      1
      Trophy Points:
      18
      that looks like it's a cancel rest just a bump forward and done with it, however it's outside the area. I would wager that was there to correct the running while trying to rest but it would need to go next to runstatus failure so if rest fails bump forward to stop running so rest can work. I would need to look at joes or unpure for a comparison though.
       
    5. wired203

      wired203 Community Developer

      Joined:
      Jan 22, 2015
      Messages:
      391
      Likes Received:
      1
      Trophy Points:
      18
      So I did some digging within joes combat and found many references to stopmoving as follows. if (!IG && BuddyTor.Me.IsMoving) StopMoving(); no clue what !IG was there but it does appear that they have moving detection and the ability to stop moving.
       
    6. wired203

      wired203 Community Developer

      Joined:
      Jan 22, 2015
      Messages:
      391
      Likes Received:
      1
      Trophy Points:
      18
      So I found that stopmoving was his own function that called a Buddy.Swtor.Input.MoveStopAll(); and I did a little editing to get it in there, currently testing but anyone else want to test?
      Code:
                              if (NeedRest())
                              {
      			[B]if (BuddyTor.Me.IsMoving) Buddy.Swtor.Input.MoveStopAll();[/B]
                                  while (KeepResting())
                                  {
                                      if (!Me.IsCasting)
                                          AbilityManager.Cast(Me.RejuvenateAbilityName(), Me);
      
                                      Thread.Sleep(100);
                                  }
       
      Last edited: Jul 8, 2015
    7. wired203

      wired203 Community Developer

      Joined:
      Jan 22, 2015
      Messages:
      391
      Likes Received:
      1
      Trophy Points:
      18
      So I had to bust out my assassin so I could get some movement while killing, I went into the normal run of death right at the end of a combat which would have kept me in a wall but it did stop instead. Joes had that several times with a thread sleep of 50 but that section of code would loop on it's own until rest could start correctly.

      So what is the echo command to echo to the console? would be nice to see when that does run as a secondary verification.
       
    8. ShinobiAoshi

      ShinobiAoshi Member

      Joined:
      Jul 21, 2010
      Messages:
      143
      Likes Received:
      2
      Trophy Points:
      18
      Add
      Code:
      using Buddy.Common;
      at the beginning of the file, then you can use
      Code:
      Logging.Write("Your message here");
      to print to the console for the bot.
       
    9. Cryogenesis

      Cryogenesis Moderator Moderator

      Joined:
      Jul 13, 2010
      Messages:
      2,128
      Likes Received:
      13
      Trophy Points:
      38
      i dont think there should something to be added to go run. i think that line has to be commented out, nothing more.
      Anyways, post your version, so we can check.
       
    10. wired203

      wired203 Community Developer

      Joined:
      Jan 22, 2015
      Messages:
      391
      Likes Received:
      1
      Trophy Points:
      18
      I posted the portion that I added, it's the single line in bold, the run I verified by using a crummy comp so I would go into rest and to end rest he's bumping forward when your full. It's a very slight movement but it is there. Comment that out and rest wouldn't end.

      Basically I used the same check and stop movement that Joes combat is using without his function wrappers. Easier to add just a line than a whole function that just called the stop movement 3x times over. If you want I can post the full file but you just need to add that single line.
       
    11. Cryogenesis

      Cryogenesis Moderator Moderator

      Joined:
      Jul 13, 2010
      Messages:
      2,128
      Likes Received:
      13
      Trophy Points:
      38
      So this is the part?
      Code:
              private static Composite Rejuvenate
              {
                  get
                  {
                      using (BuddyTor.Memory.AcquireFrame())
                      {
                          return new Action(delegate
                          {
      
                              if (NeedRest())
                              {
                                  if (BuddyTor.Me.IsMoving) Buddy.Swtor.Input.MoveStopAll();
                                  while (KeepResting())
                                  {
                                      if (!Me.IsCasting)
                                          AbilityManager.Cast(Me.RejuvenateAbilityName(), Me);
      
                                      Thread.Sleep(100);
                                  }
      
                                  Movement.Move(Buddy.Swtor.MovementDirection.Forward, System.TimeSpan.FromMilliseconds(1));
                                  return RunStatus.Success;
                              }
      
                              return RunStatus.Failure;
                          });
                      }
                  }
              }
      
       
    12. wired203

      wired203 Community Developer

      Joined:
      Jan 22, 2015
      Messages:
      391
      Likes Received:
      1
      Trophy Points:
      18
      Yeah that would be the whole section, working well for me. If you notice the walk bump is outside of the while which is the rejuvenate portion so that gets called at the end. Joes had several checks for if moving to stop where default didn't. Basically if you had started moving and you jumped into the rest code which had no way to handle it and it went into the while loop trying to enter rest repeatedly which threw the screen error of can't do that while moving. There wasn't any logic to catch the movement and stop like other combat routines have.
       
    13. strepie

      strepie New Member

      Joined:
      Jun 11, 2012
      Messages:
      290
      Likes Received:
      2
      Trophy Points:
      0
      Thx a ton, Wired and Cryo for pointing out the culprit. Wired203, I edited/added that line you suggested, added an echo to screen just to keep an eye on it, but it seems to be running flawlessly now. Only tested on my Sniper and Marauder so far, but I am sure it will be fine for other classes as well. Good stuff!
       
    14. pindleskin

      pindleskin Community Developer

      Joined:
      Oct 24, 2012
      Messages:
      1,124
      Likes Received:
      2
      Trophy Points:
      38
      What does it do exactly?
       
    15. strepie

      strepie New Member

      Joined:
      Jun 11, 2012
      Messages:
      290
      Likes Received:
      2
      Trophy Points:
      0
      Look at Cryo's message (#441) :) The bot sometimes did this weird running without stopping thing when it was supposed to heal/rest. People were asking to have it fixed, and it seems to be fixed now. :)
       
    16. alltrueist

      alltrueist Active Member

      Joined:
      Dec 10, 2012
      Messages:
      1,424
      Likes Received:
      16
      Trophy Points:
      38
      Rest eventually ends after 15 seconds, so wouldn't it be best to just rest for the full 15 than to worry about infinite running? I don't like/want any Thread.Sleep calls in the rotation, it is not optimal.
       
    17. pindleskin

      pindleskin Community Developer

      Joined:
      Oct 24, 2012
      Messages:
      1,124
      Likes Received:
      2
      Trophy Points:
      38
      Haven't seen that for months...

      Then it will always be 15 seconds? I don't think thats a good idea :)
       
      Last edited: Jul 8, 2015
    18. wired203

      wired203 Community Developer

      Joined:
      Jan 22, 2015
      Messages:
      391
      Likes Received:
      1
      Trophy Points:
      18
      The movement that was there is on rest routine exit to stop rest, when the bot bugs and runs non stop it's entering rest. Hence the check for movement before going into the rest routine. Only occurs on a char that's moving when the kill happens so removing the section identified earlier by Cryo would have absolutely no effect on the rest movement bug it would just severely slow down the bot.
       
    19. wired203

      wired203 Community Developer

      Joined:
      Jan 22, 2015
      Messages:
      391
      Likes Received:
      1
      Trophy Points:
      18
      Joes had thread sleep in his function wrappers which we didn't add his whole function, just the nitty gritty. Only change I did was if (BuddyTor.Me.IsMoving) Buddy.Swtor.Input.MoveStopAll(); which is a check before entering the rest routine to check if the bot is moving, and if it is well then stop.
       
    20. Cryogenesis

      Cryogenesis Moderator Moderator

      Joined:
      Jul 13, 2010
      Messages:
      2,128
      Likes Received:
      13
      Trophy Points:
      38
      Shouldnt the routine cancel the rest if its max hp and or nrg anyways or does it stay inside the while statement keepresting untill the rest (15 secs) are done?
      May have to dig some deeper to see how the rest is activated, i would say the addition wired made, is ok, but we take out that moving part. and then check on the Needrest in a while statement to watch it constantly the hp/nrg levels of you and or companion, but this is handled somewhere else... Because when its done, it gets the succes status and should move on, or am i wrong?

      Edit: i think it may had to do with bot being able to get out of the heal state?
      Anyways, the space for rest gave me some ideas for pods using and xp multipliers :)
       
      Last edited: Jul 9, 2015

    Share This Page