• Dear Guest,

    You're browsing our forum as a Guest meaning you can only see a portion of the forum in read-only mode.
    To view all forum nodes and be able to create threads/posts please register or log-in with your existing account.

    TwinStar team

[Request] [Help] ItemRack fix

AG007

Authorized
Joined
Aug 16, 2015
[FONT=&quot]Hello!
I've recently started using ItemRack and I must say it has some potential for being a very nice addon, however some of its features doesn't work properly which is quite annoying imo. I've tried to fix it myself but unfortunatly i'm a noob when it comes to scripting. Therefore I seek someone who is experienced with addon scripting to help me out.

[/FONT]

[FONT=&quot]First of all a quick explanation of what ItemRack is, for those of you who aren't familiar with it:
ItemRack is an addon that lets you swap gear faster. Whats interesting about it is that it has a queue function and can equip items automatically, pretty much similar to TrinketMenu. With ItemRack you can use wow's API events to set a "trigger event" for a set of gear that you've made and also make it run a script when that trigger event is met. To give a quick example:[/FONT]

[FONT=&quot]
Trigger: PLAYER_REGEN_ENABLED
Delay: 0.5 sec
Script: EquipSet("PvP Gear")

So what that tells me is that it should automatically equip my set "PvP Gear" 0.5 seconds after PLAYER_REGEN_ENABLED (i.e. when i'm out of combat).[/FONT]

[FONT=&quot]
Now this feature allows for some interesting stuff. For example what i'm trying to do:

Trigger: ITEMRACK_ITEMUSED
Delay: 0.5
Script: if arg1=="Goblin Rocket Helmet" then EquipSet("PvP Helm") end

What this does is, equipping my set "PvP Helm" 0.5 seconds after I have used Goblin Rocket Helmet. Unfortunatly this works in an awkward way, because if I click my equipped Goblin Rocket Helmet, ItemRack will register it as the item being used even though it isn't, and equip my PvP Helm right away. I basically have to target an enemy, be in range, and be able to use Goblin Rocket Helmet BEFORE I click it, in order to make it work.

[/FONT]

[FONT=&quot]So what I need help with is to make this work properly. ItemRack should only register an item being used, when its actually used.
Another thing is (not as important though), as stated, ItemRack is meant to read API events for its trigger function, however it doesn't seem to work for all API events.

[/FONT]

[FONT=&quot]I've already talked to Bit aka. shirsig about this issue. He told me that the addon is missing a verification step to tell when something has actually been cast/used, however there's no need to detect if the spell actually went through, so a solution would be to check cooldown.

[/FONT]

[FONT=&quot]I hope someone can help me with this, I would really appreciate it and i'm sure others would too! :)

Thanks in advance!

TL;DR: ItemRack not working properly - it registeres items being used even though they aren't. Need help from experienced addon developer to fix problem.[/FONT]

[FONT=&quot]
ItemRack v1.975 : https://wow.curseforge.com/projects/itemrack/files?sort=game-version[/FONT]
 
Try
Code:
[COLOR=#999999][FONT=&amp] if arg1=="Goblin Rocket Helmet" and GetItemCooldown(arg1)>0 then EquipSet("PvP Helm") end[/FONT][/COLOR]
If this code is actually executed 0.5 seconds after using the item, it should be fine (as long as you don't click it while it's on CD perhaps?). If that doesn't work, you can try making a macro for the Helmet that makes sure that it will be used after you click it (this won't work 100% of the time, however). For example:

Code:
/run local c='Goblin Rocket Helmet' if string.gfind(GetInventoryItemLink('player', 1),c)(1) and GetItemCooldown(c)==0 and UnitName('target') and UnitIsEnemy('player','target') and UnitIsPlayer('target') and IsActionInRange(SLOTNUM) then UseItemByName(c) end
This requires you to put some item or spell that has the same range as the helmet (i.e. 30yd.. so Jujus maybe?) on the ActionBar at slot number SLOTNUM (e.g. put 1 instead of SLOTNUM if the item is on the first button; that particular actionbar doesn't have to be visible at all; here's the list of all slot numbers: http://i52.tinypic.com/2w3oyfm.jpg).

A longer macro could also check if you are stunned or polymorphed or lagging too much etc, before trying to use the item, but for that you'd need the SuperMacro addon and some neat functions (it's probably an overkill). Good luck.

P.S.
The "correct" way of doing this would be to register spell events and scan the combat log for your successful casts of "Reckless Charge", but that takes more typing :)
 
Last edited:
Hey Drood!

Thanks a lot for your response.

I've actually solved this somewhat. I found that in ItemRack.lua line 1690
Code:
if cooldown==0 then
I could change this to
Code:
if cooldown > 0 then

By doing this i'm telling the addon not to register items as being used before its "used" when it has a cooldown. It's still functions kinda awkward but at least it better than before.

The problem now though, with this change I have to click the item twice. Once for using the item and twice for putting next item in queue. And I am not allowed to click the item right after it is equipped because of the 30 seconds cooldown, otherwise it will queue the next item and equip it right away if i'm out of combat.

I know there are ways to work around the whole thing with wow-macros but the thing is I don't have room for more macros (not using supermacro though) and I don't have any more room on my action bars, there for I need an addon that can do this for me.

However I will try the first ItemRack macro that you wrote. However with my modification I think it has to look like this:
Code:
if arg1=="Goblin Rocket Helmet" and GetItemCooldown(arg1)==0 then EquipSet("PvP Helm") end

I'll test it tomorrow, and see what happens. :)
 
Update:
I've reverted the modification I did to the addon, back to what it was before. Instead I went with this in-game ItemRack macro:
Code:
if arg1=="Goblin Rocket Helmet" and GetInventoryItemCooldown("player",1)>0 then EquipSet("PvP HELM") end

Now it works exactly the way I want it :D

Once again, thank you for your help Drood :)
 
Top Bottom