[Bug] MyNW.Classes.Power.IsOnCooldown()

Post Reply
Orion33
Contributor
Contributor
Posts: 631
Joined: Sat Jan 07, 2017 4:00 pm

[Bug] MyNW.Classes.Power.IsOnCooldown()

Post by Orion33 » Wed Dec 05, 2018 3:17 pm

Works incorrectly. I tried to determine end of power cooldown.

Code: Select all

            var currPower = Powers.GetPowerBySlot((int)slot);

            while (currPower.IsOnCooldown())
            {
                Thread.Sleep(200);
            }
But on Hunter or Cleric when I switch to TAB mode, IsOnCooldown() returns false and my programm try to change not recharged power with ingame error.
I tried to do that

Code: Select all

            while (currPower.IsOnCooldown() || currPower.SubCombatStatePowers.Exists(x => x.IsOnCooldown()))
            {
                Core.DebugWriteLine(currPower.PowerDef.DisplayName);
                Thread.Sleep(200);
            }
But same result.
And then

Code: Select all

            while (currPower.RechargeTime > 0 || currPower.SubCombatStatePowers.Exists(x => x.RechargeTime > 0))
            {
                Core.DebugWriteLine(currPower.PowerDef.DisplayName);
                Thread.Sleep(200);
            }
works correctly.

I misunderstand the logic of IsOnCooldown()?

User avatar
Jarod46
Administrator
Administrator
Posts: 1746
Joined: Fri Aug 13, 2010 12:31 pm

Re: [Bug] MyNW.Classes.Power.IsOnCooldown()

Post by Jarod46 » Thu Dec 06, 2018 2:20 pm

IsOnCooldown() just return ActiveSubCombatStatePower.RechargeTime != 0
Honestly game logic with powers is a pain is the ass and I don't remember correctly how everything work, I developed that at the beginning of the bot with the UCC.
You can found the a part of spell ucc action here if can help you https://pastebin.com/iiBk1m6m
Only account support via private messages
Low English level, sorry

Orion33
Contributor
Contributor
Posts: 631
Joined: Sat Jan 07, 2017 4:00 pm

Re: [Bug] MyNW.Classes.Power.IsOnCooldown()

Post by Orion33 » Thu Dec 06, 2018 8:43 pm

Thank you for help. I just save this solution.
Have you forget how everything works? Haven't you played for a long time?

User avatar
Jarod46
Administrator
Administrator
Posts: 1746
Joined: Fri Aug 13, 2010 12:31 pm

Re: [Bug] MyNW.Classes.Power.IsOnCooldown()

Post by Jarod46 » Thu Dec 06, 2018 9:27 pm

I talking about how that work in game memory, not in-game mechanics.
Only account support via private messages
Low English level, sorry

Post Reply

Who is online

Users browsing this forum: No registered users and 35 guests