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
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?
Yeah my guess aswell, althow i think the problem lies with the milliseconds part ie, not stopping its action or not doing anything.
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.
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.
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); }
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.
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.
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.
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.
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; }); } } }
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.
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!
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.
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.
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.
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.
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