@Rubim: I updated the code a bit. I figured I'd help you on your way since a lot of people seem to struggle with mathematics.
Rune cooldown time is affected by haste and haste "effects". Static haste auras like Icy Talons and Windfury Totem does not apply to this, as far as I know. The math then becomes pretty simple.
When you are affected by things like Unholy Frenzy and Time Warp/Heroism/etc, the cooldown is pushed even further down. To calculate this, you use the formula:
10 / ((1 + (hasteBuff1% / 100)) * (1 + (hasteBuff2% / 100)) * ...) * (1 + (haste% / 100))
As most haste effects are universal, you can calculate this by using this little function:
When you implement this into your code, you can determine the current Rune cooldown and the "half" time mark like this:Code:-- Calculate current Rune cooldown time from haste effects. -- Static Auras doesn't apply to this! Things like Icy Talons, Windfury Totems, etc. if UnitBuffID("player",49016) then local RuneCD = (10 / (1.2 * (1 + (UnitSpellHaste("player") / 100)))) else local RuneCD = (10 / (1 + (UnitSpellHaste("player") / 100))) end
The code is very untested, but if there's anything wrong with it, I'll get the correct values as soon as I get home.Code:function RuneCooldown() local FrostRune = 0 -- Frost Runes local UnholyRune = 0 -- Unholy Runes local BloodRune = 0 -- Blood Runes local DeathRune = 0 -- Death Runes -- Calculate current Rune cooldown time from haste effects. -- Static Auras doesn't apply to this! Things like Icy Talons, Windfury Totems, etc. if UnitBuffID("player",49016) then local RuneCD = (10 / (1.2 * (1 + (UnitSpellHaste("player") / 100)))) else local RuneCD = (10 / (1 + (UnitSpellHaste("player") / 100))) end for i=1,6 do if GetRuneType(i) == 1 then if GetRuneCooldown(i) + select(2,GetRuneCooldown(i)) - GetTime() < (RuneCD / 2) then BloodRune = BloodRune + 1 end end ... end end
I hope that helps, at least!
Last edited by Kinky; 11-10-2012 at 01:56 PM.
Any updated Enhancement shaman profiles PVE?
I dont think your code will work, here's why:
IF SpellHaste = 0 wont return 5.
(10 / (1 + (UnitSpellHaste("player") / 100)))
SpellHaste = 0
0 / 100 = 0
1 + 0 = 1
1 / 10 = 0.1
======
local total = 10 - ((10 * (UnitSpellHaste("player")) / 100))
local half = total/2
Assuming Haste = 0
10 * 0 = 0
0 / 100 = 0
10 - 0 = 0
half = 10/0 = 10
Haste 50%
10 * 50 = 500
500 / 100 = 5
10 - 5 = 5
half = 5/2 = 2.5
https://www.ownedcore.com/forums/world-of-warcraft/world-of-warcraft-bots-programs/wow-bot-maps-profiles/385569-pqr-death-knight-monk-tank-dps-profiles.html#post2582063
@Rubim: Ah not really! It returns an error though because I used UnitSpellHaste("player") instead of GetMeleeHaste().
Nonetheless, why reinvent the wheel when we can get the gameclient to do it for us?
That should work perfectly as the second return from GetRuneCooldown() is always updated and taking haste effects and haste from gear into account before calculating the current cooldown time for any given rune.Code:function RuneCooldown() local FrostRune = 0 -- Frost Runes local UnholyRune = 0 -- Unholy Runes local BloodRune = 0 -- Blood Runes local DeathRune = 0 -- Death Runes for i=1,6 do if GetRuneType(i) == 1 then if GetRuneCooldown(i) + select(2,GetRuneCooldown(i)) - GetTime() < (select(2,GetRuneCooldown(i)) / 2) then BloodRune = BloodRune + 1 end end if GetRuneType(i) == 2 then if GetRuneCooldown(i) + select(2,GetRuneCooldown(i)) - GetTime() < (select(2,GetRuneCooldown(i)) / 2) then UnholyRune = UnholyRune + 1 end end if GetRuneType(i) == 3 then if GetRuneCooldown(i) + select(2,GetRuneCooldown(i)) - GetTime() < (select(2,GetRuneCooldown(i)) / 2) then FrostRune = FrostRune + 1 end end if GetRuneType(i) == 4 then if GetRuneCooldown(i) + select(2,GetRuneCooldown(i)) - GetTime() < (select(2,GetRuneCooldown(i)) / 2) then DeathRune = DeathRune + 1 end end end end
Have fun!
https://www.ownedcore.com/forums/world-of-warcraft/world-of-warcraft-bots-programs/wow-bot-maps-profiles/385569-pqr-death-knight-monk-tank-dps-profiles.html#post2582063
@Rubim: Ah, your original code went like this:
Basically you were checking if the current cooldown timer of Rune X is under the current cooldown timer of Rune X. .. I just noticed it when I made the earlier suggestion.Code:if GetRuneType(i) == 4 and select(1,GetRuneCooldown(i)) + select(2,GetRuneCooldown(i)) - GetTime() < select(1,GetRuneCooldown(i)) + select(2,GetRuneCooldown(i)) - GetTime() / 2
select(2,GetRuneCooldown(i)) will always return the cooldown time of Rune X and automatically update while under the influence of other haste effects, buffs and procs. So, dividing this number by 2 will always get you the current half cooldown timer of any given rune. I overlooked it too. :P
Is there a way to implement a really simple pause rotation function? I have searched but no luck
Im not that skilled and i need it for a basic profile im making.
Something like holding down alt, ctrl or shift to pause and resume once released.
http://www.ownedcore.com/forums/worl...-profiles.html ([PQR] Cpoworks's Shaman/Monk profiles)
Last edited by Albanuva; 11-10-2012 at 07:08 PM.
@Albanuva: It's very easy --If you put that at the top of your rotation, when you hold down the Left Shift button, it'll completely stop your profile until you release it.Code:if IsLeftShiftKeyDown() and not GetCurrentKeyBoardFocus() then return true end
Can some Script Noxxic's BM shot rotation please I'm trying too but it's not working for me I'm brand new to coding some probably way out of my ability to do, but really want to learn how to do this.
Nevermind i like kick's better awesome job.
Last edited by NicodemusAtNIMH; 11-10-2012 at 09:34 PM.
Hey, PQR seems to lock up after some time ... to exclude mistakes in my profile, i only coded the mangle ability for my druid. it only contains "return true" which should be no problem but pqr locks up after around a minute. is this a known bug ? when i do this on my pally with cs it doesnt hang up. so maybe only spells involed with only gcd ?
check time is 50, increasing checktime raises time with no lock up ... maybe server side antispam ?
thanks in advance
EDIT: tested spamming mangle via keyboard macro on 25 ms loop no lockup, seems to be pqr problem
Last edited by devilsome; 11-10-2012 at 09:23 PM.
Is there a way to use abilities that involve reticles without having to click my mouse to place the spell where I want it to go?
Like Flamestrike or Death and Decay. Would be great if it could just put it where ever my mouse happened to be at the time or even just on top of my character would be fine.
If there was a function that could simulate me clicking my mouse, that would do it for me.
Last edited by SeveredShadow; 11-10-2012 at 11:10 PM.