 |
09/26/09, 7:42 AM
|
#401
|
|
Von Kaiser
Blood Elf Rogue
Frostmane (EU)
|
It seems that it doesn't switch to a default set with me could that be because I got scripts for my default sets? (primary talents for Mutilate and secondary Talents for my combat set)
If so would it maybe be possible to make a 4th set and let the script switch to that 4th set that just has your instant or wound poison dagger in it?
To clarify I would equip my 3rd set before a boss fight this set has my DP weapon equipped then the script would switch to set 4 which has my proper offhand with instant/woundpoison on.
This way I can keep scripts going on my primary 2 sets and then have a 3rd and 4th set for bossfights.
Last edited by Aéquitas : 09/26/09 at 7:48 AM.
|
|
|
|
|
09/26/09, 7:53 AM
|
#402
|
|
Von Kaiser
Troll Rogue
Азурегос (EU)
|
Originally Posted by Landerolin
Any chance you could show a suitable script for that scenario (WP default, DP coded outfit)?
|
Here it goes, with the following code you will need to manually equip OH_DP set to start switching weapons. It will unequip it if enough DP stacks/remaining time is available, and re-equip if DP is about to expire.
-- $EVENTS TIMER UNIT_COMBAT
local dp_name="Deadly Poison IX"
local switch_time = 5
if UnitAffectingCombat("player") then
for i=1,40 do
local n,_,_,s,_,_,x,c,_=UnitDebuff("target",i);
if n==dp_name and c=="player" then
equip = not ( x-GetTime() > switch_time and s == 5 )
end
end
else
equip = false
end
Originally Posted by Aéquitas
It seems that it doesn't switch to a default set with me could that be because I got scripts for my default sets? (primary talents for Mutilate and secondary Talents for my combat set)
If so would it maybe be possible to make a 4th set and let the script switch to that 4th set that just has your instant or wound poison dagger in it?
To clarify I would equip my 3rd set before a boss fight this set has my DP weapon equipped then the script would switch to set 4 which has my proper offhand with instant/woundpoison on.
This way I can keep scripts going on my primary 2 sets and then have a 3rd and 4th set for bossfights.
|
That's strange, I also have 2 sets for Mutilate/Combat, with scripts on them to equip on primary/secondary talents. However, it works fine.
As for 4-th set, the problem is, that Outfitter scripts work only with current set, and not the others.
Last edited by korner : 09/26/09 at 2:21 PM.
Reason: Optimized version of the script
|
|
|
|
|
09/26/09, 8:12 AM
|
#403
|
|
Von Kaiser
Blood Elf Rogue
Frostmane (EU)
|
Originally Posted by korner
Here it goes, with the following code you will need to manually equip OH_DP set to start switching weapons. It will unequip it if enough DP stacks/remaining time is available, and re-equip if DP is about to expire.
-- $EVENTS UNIT_COMBAT
local dp_name="Deadly poison IX"
local switch_time = 5
if UnitAffectingCombat("player") then
for i=1,40 do
local n,_,_,s,_,_,x,c,_=UnitDebuff("target",i);
if n==dp_name and c=="player" then
local rem_time = x-GetTime()
if rem_time > switch_time and s == 5 then
if isEquipped then
equip = false
end
else
if not isEquipped then
equip = true
end
end
end
end
else
if isEquipped then
equip = false
end
end
That's strange, I also have 2 sets for Mutilate/Combat, with scripts on them to equip on primary/secondary talents. However, it works fine.
As for 4-th set, the problem is, that Outfitter scripts work only with current set, and not the others.
|
The way I have it set is as follows:
Mutilate set with my instant poison offhand ( my best offhand ) Script= primary talents
Combat set with my wound poison offhand ( my best offhand again ) Script= secondary talents
Deadly Poison set with my deadly poison offhand (my 2nd best offhand ) Script= custom (the 2nd one you posted)
Before I start the fight I switch to the deadly poison set.
But during the fight it just keeps on refreshing deadly poison right away so nothing is happening.
Is there a certain setting I might be missing in outfitter itself?
|
|
|
|
|
09/26/09, 8:15 AM
|
#404
|
|
Piston Honda
Troll Rogue
Genjuros (EU)
|
I needed to make sure both sets where "complete" sets before it worked, but otherwise it's quite reliable.
Gotta admit I think 3mb for an addon to perform such a little task is quite alot, so I'm still hoping someone will script it properly and put it into a separate addon.
|
|
|
|
|
09/26/09, 8:33 AM
|
#405
|
|
Von Kaiser
Troll Rogue
Азурегос (EU)
|
Originally Posted by Aéquitas
The way I have it set is as follows:
Mutilate set with my instant poison offhand ( my best offhand ) Script= primary talents
Combat set with my wound poison offhand ( my best offhand again ) Script= secondary talents
Deadly Poison set with my deadly poison offhand (my 2nd best offhand ) Script= custom (the 2nd one you posted)
Before I start the fight I switch to the deadly poison set.
But during the fight it just keeps on refreshing deadly poison right away so nothing is happening.
Is there a certain setting I might be missing in outfitter itself?
|
Ok, I was able to recreate the issue.
The problem is, if you equip DP_OH manually, Outfitter will not always mark corresponding set as equipped.
So you need not just equip DP weapon, but equip Outfitter item set with it (using Outfitter UI, or by assigning a keybind to that item set)
@bural, if you already are using Outfitter, that's not an issue. However, it looks reasonable to write a dedicated addon for use with embedded Equipment Manager for those concerned about memory usage.
|
|
|
|
|
09/26/09, 8:42 AM
|
#406
|
|
Von Kaiser
Blood Elf Rogue
Frostmane (EU)
|
Originally Posted by korner
Ok, I was able to recreate the issue.
The problem is, if you equip DP_OH manually, Outfitter will not always mark corresponding set as equipped.
So you need not just equip DP weapon, but equip Outfitter item set with it (using Outfitter UI, or by assigning a keybind to that item set)
@bural, if you already are using Outfitter, that's not an issue. However, it looks reasonable to write a dedicated addon for use with embedded Equipment Manager for those concerned about memory usage.
|
I already do this.
I switch to combattalents (script changes my set to combat)
I switch back to mutilate talents (script changes my set to mutilate)
I then press the minimap icon to open outfitter and select deadly poison set
I start attacking. After that nothing happens it will not change from the deadly poison set anymore.
I thought it might have to do with conflicting addons but I'm not getting any lua errors.
I'm gonna try uninstalling outfitter clearing wtf for it and then freshly installing it and see if that helps.
Edit: We did the debugging through PM's and the problem was that Deadly Poison has to be in uppercasings. Deadly poison doesn't work.
Last edited by Aéquitas : 09/26/09 at 10:03 AM.
|
|
|
|
|
09/26/09, 9:33 AM
|
#407
|
|
Glass Joe
Night Elf Rogue
Madmortem (EU)
|
Thanks for all the work with the weapon-swapping scripts !
However, I've got one problem left: At the moment, I'm using WP default and the coded script for OH_DP, so I have to activate the OH_DP set manually if I want to start switching weapons. Everything okay so far. I also use a button to return to my default OH_WP set manually, in case I need to switch the target for a quick burst, e.g. Jaraxxus portals.
However, if my DP on the target (in this case, Jaraxxus) has fewer than 5 stacks or less than 3 seconds remaining, and I switch manually to the OH_WP set to prepare for the incoming portal, the script automatically switches back to the OH_DP set.
So my question is: Is there any way to implement a code into the OH_WP set which toggles the script for the OH_DP, so that, when I manually activate my OH_WP, it doesn't swap back to OH_DP no matter what until I manually reactivate the OH_DP set?
|
|
|
|
|
09/26/09, 10:04 AM
|
#408
|
|
Von Kaiser
Tauren Druid
Dragonmaw (EU)
|
I had to change the "poison" to capital letter for korner's above posted script to work (enGB client).
local dp_name="Deadly poison IX"
to
local dp_name="Deadly Poison IX"
|
|
|
|
|
09/26/09, 10:08 AM
|
#409
|
|
Von Kaiser
Troll Rogue
Азурегос (EU)
|
Originally Posted by Gogge
I had to change the "poison" to capital letter for korner's above posted script to work (enGB client).
|
Original post edited as well, so now it should work for enGB users too.
|
|
|
|
|
09/26/09, 10:50 AM
|
#410
|
|
Von Kaiser
Troll Rogue
Азурегос (EU)
|
Originally Posted by Petergriffin
So my question is: Is there any way to implement a code into the OH_WP set which toggles the script for the OH_DP, so that, when I manually activate my OH_WP, it doesn't swap back to OH_DP no matter what until I manually reactivate the OH_DP set?
|
That can be done.
Use the following script:
-- $EVENTS UNIT_COMBAT
local dp_name="Deadly poison IX"
local switch_time = 5
if ws_disable_weapon_swap == nil then
if UnitAffectingCombat("player") then
for i=1,40 do
local n,_,_,s,_,_,x,c,_=UnitDebuff("target",i);
if n==dp_name and c=="player" then
local rem_time = x-GetTime()
if rem_time > switch_time and s == 5 then
if isEquipped then
equip = false
end
else
if not isEquipped then
equip = true
end
end
end
end
else
if isEquipped then
equip = false
end
end
end
To toggle script activity, use the following macro:
/run if ws_disable_weapon_swap then ws_disable_weapon_swap=nil else ws_disable_weapon_swap=1 end
On first use it will disable weapon swapping completely, on second - re-enable it and so on.
However, on entering the game, the script will be turned on, as global variables do not persist through relogin/disconnect etc.
Note: Variable name is intentionally that long, to not overlap with any addons.
P.S. @moderators: maybe we need to fork all this weapon swapping discussion off the "incoming rogue changes" thread to a new one?
|
|
|
|
|
09/26/09, 11:56 AM
|
#411
|
|
Great Tiger
Night Elf Rogue
Lightning's Blade
|
I have a question about these scripts. Using the switch time of 5 is supposed to switch DP dagger back when 5 seconds are remaining on the DP buff; however there seems to be a delay of about 2-3 seconds. When DP is refreshed, there is also about 1-2 seconds delay before the switch occurs; oddly this delay seems shorter. Is that a latency issue or cpu processing time issue? Can this delay be reduced potentially by script changes (How often does the script check on time remaining on deadly poison) or by using a different less heavy addon (I know ItemRack allows scripts too)? A delay of 1 second can be worth more than 100 dps, so I am trying to see if there is a way to minimize it.
|
|
|
|
|
09/26/09, 12:25 PM
|
#412
|
|
Von Kaiser
Troll Rogue
Азурегос (EU)
|
Originally Posted by Mavanas
I have a question about these scripts. Using the switch time of 5 is supposed to switch DP dagger back when 5 seconds are remaining on the DP buff; however there seems to be a delay of about 2-3 seconds. When DP is refreshed, there is also about 1-2 seconds delay before the switch occurs; oddly this delay seems shorter. Is that a latency issue or cpu processing time issue? Can this delay be reduced potentially by script changes (How often does the script check on time remaining on deadly poison) or by using a different less heavy addon (I know ItemRack allows scripts too)? A delay of 1 second can be worth more than 100 dps, so I am trying to see if there is a way to minimize it.
|
Did some testing, and there seems to be some delay on weapon switch itself (using this script, or using Equipment Manager, or by manually right-clicking item in the inventory), something like ~1s.
On script execution frequency: UNIT_COMBAT event (on which the script is called) is launched 2-3 times in a second even on target dummy testing, in raid situatiin that should be even more frequent.
On CPU usage: measured by fubar_performanceFu CPU usage meter, during the combat Outfitter does not consume any significant CPU time at all, Satrina Buff frames and IceHUD eat much more CPU power. However, maximum is 5%, so I think that's not an issue.
I'll try to catch the event of actually equipping OH and get some timings between issuing equip command and getting that done, and post results later.
Ok, a small latency test results:
Average lag is ~0.95s.
For equipping, it is 0.85s, for unequipping it is 1.07s, so yes, unequip takes slightly longer. However, samples count is not that big, so that difference can be caused by RNG.
Network latency was 85-90ms during the test.

Equipped with lag of 0.837 s
UnEquipped with lag of 0.772 s
Equipped with lag of 0.320 s
UnEquipped with lag of 1.264 s
Equipped with lag of 0.829 s
UnEquipped with lag of 1.267 s
Equipped with lag of 0.933 s
UnEquipped with lag of 0.573 s
Equipped with lag of 0.404 s
UnEquipped with lag of 1.511 s
Equipped with lag of 1.624 s
UnEquipped with lag of 0.592 s
Equipped with lag of 1.230 s
UnEquipped with lag of 0.745 s
Equipped with lag of 1.885 s
UnEquipped with lag of 0.996 s
Equipped with lag of 0.340 s
UnEquipped with lag of 0.534 s
Equipped with lag of 0.359 s
UnEquipped with lag of 1.216 s
Equipped with lag of 1.132 s
UnEquipped with lag of 1.532 s
Equipped with lag of 0.389 s
UnEquipped with lag of 0.734 s
Equipped with lag of 0.582 s
Equipped with lag of 0.740 s
UnEquipped with lag of 1.515 s
Equipped with lag of 0.707 s
UnEquipped with lag of 1.724 s
Equipped with lag of 1.422 s
UnEquipped with lag of 0.496 s
Equipped with lag of 0.694 s
UnEquipped with lag of 1.077 s
Equipped with lag of 1.130 s
UnEquipped with lag of 1.958 s
Equipped with lag of 0.743 s
UnEquipped with lag of 1.385 s
Equipped with lag of 0.690 s
UnEquipped with lag of 1.650 s
Equipped with lag of 1.415 s
UnEquipped with lag of 1.053 s
Equipped with lag of 0.787 s
UnEquipped with lag of 1.247 s
Equipped with lag of 0.271 s
UnEquipped with lag of 0.757 s
Equipped with lag of 0.744 s
UnEquipped with lag of 1.717 s
Equipped with lag of 1.145 s
UnEquipped with lag of 0.578 s
Equipped with lag of 1.024 s
UnEquipped with lag of 0.726 s
Equipped with lag of 0.737 s
UnEquipped with lag of 0.350 s
Update: More compact version of the script posted at the original post, Incoming Rogue Changes Discussion
Seems to execute faster, at least, visually.
Last edited by korner : 09/26/09 at 2:19 PM.
Reason: Updated script.
|
|
|
|
|
09/26/09, 4:41 PM
|
#413
|
|
Von Kaiser
|
I'm having trouble with targetswitching when using the first script you posted.
If my target dies when I'm using an IP OH, then it doesn't switch back again...
|
|
|
|
|
09/26/09, 5:09 PM
|
#414
|
|
Von Kaiser
Troll Rogue
Азурегос (EU)
|
Originally Posted by Tumblebeer
I'm having trouble with targetswitching when using the first script you posted.
If my target dies when I'm using an IP OH, then it doesn't switch back again...
|
OK, made the script even smaller, and fixed that issue.
Now DP OH will be equipped if your target doesn't have 5 stacks of DP with 5+ seconds left of DP ticks, or if there is no target, or target doesn't have DP on it.
-- $EVENTS TIMER UNIT_COMBAT
local dp_name="Deadly Poison IX"
local switch_time = 5
local dp_detected = false;
for i=1,40 do
local n,_,_,s,_,_,x,c,_=UnitDebuff("target",i);
if n==dp_name and c=="player" then
dp_detected = ( x-GetTime() > switch_time and s == 5 )
end
end
equip = dp_detected;
|
|
|
|
|
09/27/09, 5:32 AM
|
#415
|
|
Glass Joe
|
Originally Posted by korner
Did some testing, and there seems to be some delay on weapon switch itself (using this script, or using Equipment Manager, or by manually right-clicking item in the inventory), something like ~1s.
|
I tested latest version of your nice script last night on target dummy - and experienced dps loss instead.
I wonder if i can blame the weapon swap lag for this.
Tried different kinds of offhand weapons:
a) 1.4 speed 178dps dagger to apply DP
b) 1.5 speed 178dps dagger to swap with IP
c) 1.8 speed 196dps dagger to swap with IP
So i beat dummy for few million damage without switching - several session, lets say average dps was 4500-4600.
Enabled weapon swapping scripts etc, beat dummy again - several sessions - average dps dropped to 4200-4300.
Instead of gaining 200-300 dps i expected, it actually dropped as much.
Swap lag caused DP stack to drop sometimes, as i did not want to use Shiv but just keep to classic Mutilate cycles.
Also i noticed that during swap lag, sometimes i was unable to use specials for 1-2 seconds and energy capped.
Those two were the reason of dps loss, of course.
Now the big question is:
Has anyone has actually witnessed reliable dps gain in game - using this script or any kind of weapon swap at all?
P.S. Right, target dummy test do not prove anything.
But i can tell the difference when hitting dummy completely unbuffed and with only BoK on me, for example.
I did expect weapon swap provide at least same percentage dps gain (3-5%) if not more.
|
|
|
|
|
09/27/09, 5:53 AM
|
#416
|
|
Von Kaiser
Blood Elf Rogue
Frostmane (EU)
|

Originally Posted by Dharenna
I tested latest version of your nice script last night on target dummy - and experienced dps loss instead.
I wonder if i can blame the weapon swap lag for this.
Tried different kinds of offhand weapons:
a) 1.4 speed 178dps dagger to apply DP
b) 1.5 speed 178dps dagger to swap with IP
c) 1.8 speed 196dps dagger to swap with IP
So i beat dummy for few million damage without switching - several session, lets say average dps was 4500-4600.
Enabled weapon swapping scripts etc, beat dummy again - several sessions - average dps dropped to 4200-4300.
Instead of gaining 200-300 dps i expected, it actually dropped as much.
Swap lag caused DP stack to drop sometimes, as i did not want to use Shiv but just keep to classic Mutilate cycles.
Also i noticed that during swap lag, sometimes i was unable to use specials for 1-2 seconds and energy capped.
Those two were the reason of dps loss, of course.
Now the big question is:
Has anyone has actually witnessed reliable dps gain in game - using this script or any kind of weapon swap at all?
P.S. Right, target dummy test do not prove anything.
But i can tell the difference when hitting dummy completely unbuffed and with only BoK on me, for example.
I did expect weapon swap provide at least same percentage dps gain (3-5%) if not more.
|
I noticed that on the dummies I did around the same dps. I have an enhancement shaman alt on a seperate acount and when I dropped windfury totem for my rogue I noticed that I didn't have deadly poison dropping that much. Next to that in raids you do about twice as much envenoms as you do on the dummie thereby increasing your chances that deadly poison won't drop.
One thing to note though is that you have to play a bit more safe when it comes to refreshing snd by envenoming. Wanting to refresh it with 2 seconds remaining and then getting a weaponswap can really mess your rotations up.
Getting reliable data from the game is gonna be pretty hard though.
|
|
|
|
|
09/27/09, 5:59 AM
|
#417
|
|
Glass Joe
Human Rogue
Stormreaver (EU)
|
I equipped 4/5 t8.5 and tried rupture normal rotation gained 4168dps on dummy non buffed
after that I equipped 3 piece of t9 and 2 piece of t8.5 and changed weapon swapping and gained 4240dps on only envenom rotation non buffed...I quess the difference will be bigger based on few raid buffs that increase haste
ps.test was only 6min long which I believe is long enough for dummy testing
Last edited by Maweric : 09/27/09 at 7:37 AM.
|
|
|
|
|
09/27/09, 8:18 AM
|
#418
|
|
Glass Joe
|
Its not even the DP stack dropping that bothered me that much, with raid buffs, haste etc this problem may disappear.
But the other problem will amplify - inability to score finishers or Mutilates... as sometimes game seems to think you are missing melee weapon(s) here during weapon swap "lag".
Or whatever reason it was, i could not hit specials in time and energy capped sometimes.
Maybe i am doing something wrong, i just enabled second Outfitter set as "offhand only slot" not "full outfit" too.
It worked, it swapped, but maybe for some reason it still tried to re-equip main hand weapon too.
I was too disappointed to start to debug the reason behind it, not even sure i know how to ...
|
|
|
|
|
09/27/09, 10:13 AM
|
#419
|
|
Glass Joe
Human Rogue
Stormreaver (EU)
|
I was wondering, why in every calculations its assumed that you switch your OH weapons...why not MH? If it goes to situation where you have 4-5cp when it switches deadly poison weapon on, you have to envenom (in which case MH weapon with DP would be alot more reliable to apply that fast deadlypoison tick)
|
|
|
|
|
09/27/09, 10:25 AM
|
#420
|
|
Piston Honda
Troll Rogue
Genjuros (EU)
|
Because Deadly Poison still uses a fixed chance per hit to apply poison and not a 1.4 speed normalized PPM like Instant and Wound. Thus only hit frequency determins the chance of refreshing Deadly Poison.
|
|
|
|
|
09/27/09, 11:02 AM
|
#421
|
|
Von Kaiser
Troll Rogue
Азурегос (EU)
|
Here's slightly more "bloated" (or advanced, if you like) version of the weapon swapping script.
In addition to weapon swapping itself, this version also collects combat statistics and displays it at the end of combat, namely: - Percentage of time IP (WP) offhand was active during the fight.
- Minimum "DP uptime wasted" value. "DP uptime wasted" is the time remaining on DP duration, at which new DP stack has been applied. Ideally, we want this to reach zero.
- It also makes a suggestion on minimum switch_time variable value, which would not let DP stack drop. This does not take into account DP stack drops, so if you experience DP stack dropping during the fight, you should increase switch_time and ignore script suggestion.

-- $EVENTS TIMER UNIT_COMBAT OUTFIT_EQUIPPED OUTFIT_UNEQUIPPED UNIT_INVENTORY_CHANGED PLAYER_REGEN_ENABLED PLAYER_REGEN_DISABLED
local dp_name="Deadly Poison IX"
local switch_time = 5
local dp_detected = false;
for i=1,40 do
local n,_,_,s,_,_,x,c,_=UnitDebuff("target",i);
if n==dp_name and c=="player" then
dp_detected = ( x - time > switch_time and s == 5 )
if not ( x - time > switch_time and s == 5 ) then
outfit.dpleft = x
end
end
end
equip = dp_detected;
if event == "OUTFIT_EQUIPPED" then
local dp_wasted = outfit.dpleft - time
if dp_wasted < switch_time then
table.insert(outfit.log_t,dp_wasted)
end
end
if event == "UNIT_INVENTORY_CHANGED" then
if isEquipped then
outfit.ip_start_time = time
else
outfit.ip_total_time = outfit.ip_total_time + (time - outfit.ip_start_time)
end
end
if event == "PLAYER_REGEN_DISABLED" then
outfit.log_t = {}
outfit.ip_start_time = time
outfit.ip_total_time = 0
outfit.combat_start = time
outfit.dpleft = time
outfit.drop_detected = false
end
if event == "PLAYER_REGEN_ENABLED" then
if (# outfit.log_t > 0) then
print("---- weapon swapper summary: ----")
print("IP active for " ..string.format("%.1f", 100*(outfit.ip_total_time/(time - outfit.combat_start))) .. "% combat time")
sort(outfit.log_t)
print("Min. DP uptime wasted: " .. string.format("%.2f", outfit.log_t[1]) .. " s.")
print("Suggested switch_time: " .. string.format("%.2f", switch_time - outfit.log_t[1] + 0.1))
print("-----------------------------------------")
end
end
|
|
|
|
|
09/27/09, 11:10 AM
|
#422
|
|
Soda Popinski
Worgen Rogue
Auchindoun (EU)
|
Can we please move this discussion to a seperate thread with the relevant informations gathered? This is by no means on topic here anymore.
|
|
|
|
09/27/09, 11:15 AM
|
#423
|
|
Great Tiger
Night Elf Rogue
Lightning's Blade
|
A few things I wanted to reiterate about weapon swapping effectiveness:
1. It's significantly lower for combat compared to mutilate
2. It's highly dependent on your gear, so for instance for combat, it was not worth the time in 3.1 BiS items unless you did it during heroism. So do not expect to gain dps if you are in low quality gear.
3. It depends on raid buffs even more than gear because of extra haste, melee hit, and spell crit you gain in a raid with full buffs. So testing it on a dummy may even show a dps decrease.
4. You final dps gain in a raid will depend on your ability to execute the strategy well, which involves two things: 1. Ability to time when to swap back to deadly poison; 2. Ability to resume the cycle when dp is refreshed. If you delay these timers, the dps benefit will wane.
EDIT: Based on what Korner posted, the statistics you are gathering is very interesting, but you need to be very careful how you interpret it.
- First, regarding the DP uptime wasted. Ideally, you want DP to be applied immediately as soon as you put the DP dagger on. You gain nothing from waiting for it to be applied at the end of DP debuff. Deadly poison damage is not done when the DP debuff timer reaches certain points (such as 3, 6, 9, and 12 seconds). The timing of DP poison ticks is a fairly complicated mechanics that you can read upon in this thread. In particular, if DP is reapplied after 4 successive DP ticks, the next DP tick is reset and you suffer a loss of deadly poison DPS. So to sum up, DP uptime wasted, the way you calculate it is misleading.
- DP stack dropping should not be avoided completely. By extending the time during which IP/WP dagger is on you are increasing IP dps at the expense of running into risk of dropping DP. Being too conservative and setting the switch time to minimize DP stack dropping will lower your dps up to a point that weapon swapping will become useless. Ideally, the suggestion when to swap the dagger should be done with the simsheet or a calculator of the probability of DP stack drop and DP tick reset. I do not think your script is calculating those probabilities or collecting empirical data on them.
Last edited by Mavanas : 09/27/09 at 11:33 AM.
|
|
|
|
|
09/27/09, 12:46 PM
|
#424
|
|
Von Kaiser
|
I believe the reason there seems to be lag in the weapon swap and in being able to perform an ability after the weapon swap is that you've triggered the GCD. If you've performed an action at the same time the script is trying to swap weapons it'll cause a delay in the weapon swap, same if you try to perform an action immediately after the weapon swap.
I was testing the script last night on the test dummy and had better success if I watched the DP timer and made sure I didn't mutilate when it was reaching the five second mark. On another note, I think the five second setting can be set lower in a raid environment as long as you make sure not to trigger the GCD when your DP stack is reaching the set time.
-edit: Tested a little more. It appears the GCD triggered from weapon swapping acts as normal, locking you out of performing any ability. But, if you trigger the GCD with an ability and swap a weapon a fraction of a second later it performs the swap during the GCD and restarts the GCD without completing the one triggered by the ability use. I was manually swapping a weapon while watching the GCD sweep, I wasn't checking this with the script.
Last edited by Aarcani : 09/27/09 at 12:57 PM.
|
|
|
|
|
09/27/09, 1:25 PM
|
#425
|
|
Piston Honda
|

Originally Posted by korner
Here's slightly more "bloated" (or advanced, if you like) version of the weapon swapping script.
In addition to weapon swapping itself, this version also collects combat statistics and displays it at the end of combat, namely: - Percentage of time IP (WP) offhand was active during the fight.
- Minimum "DP uptime wasted" value. "DP uptime wasted" is the time remaining on DP duration, at which new DP stack has been applied. Ideally, we want this to reach zero.
- It also makes a suggestion on minimum switch_time variable value, which would not let DP stack drop. This does not take into account DP stack drops, so if you experience DP stack dropping during the fight, you should increase switch_time and ignore script suggestion.

-- $EVENTS TIMER UNIT_COMBAT OUTFIT_EQUIPPED OUTFIT_UNEQUIPPED UNIT_INVENTORY_CHANGED PLAYER_REGEN_ENABLED PLAYER_REGEN_DISABLED
local dp_name="Deadly Poison IX"
local switch_time = 5
local dp_detected = false;
for i=1,40 do
local n,_,_,s,_,_,x,c,_=UnitDebuff("target",i);
if n==dp_name and c=="player" then
dp_detected = ( x - time > switch_time and s == 5 )
if not ( x - time > switch_time and s == 5 ) then
outfit.dpleft = x
end
end
end
equip = dp_detected;
if event == "OUTFIT_EQUIPPED" then
local dp_wasted = outfit.dpleft - time
if dp_wasted < switch_time then
table.insert(outfit.log_t,dp_wasted)
end
end
if event == "UNIT_INVENTORY_CHANGED" then
if isEquipped then
outfit.ip_start_time = time
else
outfit.ip_total_time = outfit.ip_total_time + (time - outfit.ip_start_time)
end
end
if event == "PLAYER_REGEN_DISABLED" then
outfit.log_t = {}
outfit.ip_start_time = time
outfit.ip_total_time = 0
outfit.combat_start = time
outfit.dpleft = time
outfit.drop_detected = false
end
if event == "PLAYER_REGEN_ENABLED" then
if (# outfit.log_t > 0) then
print("---- weapon swapper summary: ----")
print("IP active for " ..string.format("%.1f", 100*(outfit.ip_total_time/(time - outfit.combat_start))) .. "% combat time")
sort(outfit.log_t)
print("Min. DP uptime wasted: " .. string.format("%.2f", outfit.log_t[1]) .. " s.")
print("Suggested switch_time: " .. string.format("%.2f", switch_time - outfit.log_t[1] + 0.1))
print("-----------------------------------------")
end
end
|
There are some issues with this script, I believe.
First off, these 2 lines:
dp_detected = ( x - time > switch_time and s == 5 )
if not ( x - time > switch_time and s == 5 ) then
"time" is not defined. I'm assuming you mean GetTime(). You could replace it with that, or add "local time = GetTime()" (without the quotes) at the beginning.
EDIT: You seem to use the time variable several other places, but unless I'm missing something, I don't see it declared anywhere.
Also, there's no more limit on the amount of debuffs you can have on a mob (even though the UI will only display up to 40). I don't know how many debuffs we have on mobs these days (who cares since the limit was removed?), and 40 might be a good number to use in your for..do loop, but technically, it's possible to go above that, so a while..do loop might be better, iterating over each debuff until it returns nil for, say, the name of the next debuff. But as I said, 40 might be practical enough, although you're also wasting CPU time if there's less debuffs than that on the mob.
You can drop the last _ in local n,_,_,s,_,_,x,c,_=UnitDebuff("target",i);
You don't care about the last return, and it will be automatically dropped if it has no variable to assign it to. Also, the semi-colon isn't needed in lua.
Finally, what's outfit? Looks like you're making a global table out of it, which is not a good idea. I would at least give it an intentionally long name to avoid interfering with anything else.
I didn't look at the stats calculation to find out if they were correct or not.
PS: I do agree that this needs its own thread.
Last edited by ShadowEric : 09/27/09 at 3:13 PM.
|
|
|
|
|
|