Thread Tools Display Modes
01-10-06, 04:27 PM   #21
Gello
A Molten Giant
AddOn Author - Click to view addons
Join Date: Jan 2005
Posts: 521
Originally Posted by Needy
I realized that the event script i made didnt work because somehow I couldnt find the right trigger.
...
I tried
SPELL_UPDATE_USABLE
ACTIONBAR_UPDATE_USABLE
ACTIONBAR_UPDATE_COOLDOWN

for some reason they dont fire when my cooldown ends, I tested it wit spell 47 which is my stealth, which should change to the set when my 10s cooldown of stealth ends. (I stealth and unstealth, which brings 10s CD on the spell, then waited it out the 10s, nothing happened.)

I also tried delay set to 0.5 and 0 and 1 s
I've researched this a bit more and I can't find an event that triggers when a spell comes off cooldown. Maybe someone else knows. This sounds like something you'll need a timer mod for. To have something run 10 seconds after you use a vanish macro.
  Reply With Quote
01-16-06, 02:06 PM   #22
Cladhaire
Salad!
 
Cladhaire's Avatar
Premium Member
AddOn Author - Click to view addons
Join Date: Jul 2005
Posts: 1,935
Just hit 53 on my druid and I've been working WP/EP a bit, so I have my trinket (Which works just fine) my problem is when a battleground comes up, I port in with my trinket on.

I'm looking for a way (either using zones, or BATTLEFIELD_STATUS_UDPATE or whatever it is) to switch to my PVP outfit at that point.

Thanks for giving us such flexibility =)
  Reply With Quote
01-16-06, 03:30 PM   #23
Gello
A Molten Giant
AddOn Author - Click to view addons
Join Date: Jan 2005
Posts: 521
Hmm CHAT_MSG_BG_SYSTEM_NEUTRAL may be a good one:

CHAT_MSG_BG_SYSTEM_NEUTRAL

Fired for non faction specific events in the battlegrounds such as the battle start announcement.
You can use IsSetEquipped too:

Name: Battlegrounds
Trigger: CHAT_MSG_BG_SYSTEM_NEUTRAL
Delay: 0
Script: if not IsSetEquipped("pvp") then EquipSet() end

For equipping pvp gear when you enter BG and un-equipping when you leave, probably ZONE_CHANGED_NEW_AREA would be better. I vaguely recall this gave a generic result for instances but I'll check it out.

And it just occured to me that IsSetEquipped() should be allowed to use the associated set. It doesn't yet woops!
  Reply With Quote
01-21-06, 08:31 AM   #24
JIM the Inventor
A Cyclonian
 
JIM the Inventor's Avatar
AddOn Author - Click to view addons
Join Date: Oct 2005
Posts: 42
Verified

Originally Posted by Gello
I've researched this a bit more and I can't find an event that triggers when a spell comes off cooldown. Maybe someone else knows. This sounds like something you'll need a timer mod for. To have something run 10 seconds after you use a vanish macro.
Having just completed a mod that cares about this stuff, I can verify Gello's findings: There is no "event", as such, that occurs when cooldowns finish.

In Blizzard's own Cooldown.lua, there's this function that you can override:

CooldownFrame_OnAnimFinished

... however, this function is only called for ActionButtons that are in the visible action bar(s? May just be the primary one), and if you use it, you'll need to translate the button frame object into the action it represents, etc..

So perhaps not a great option, but it exists.
  Reply With Quote
01-24-06, 01:37 PM   #25
Garalor
A Kobold Labourer
Join Date: Jan 2006
Posts: 1
hi,
i love this mod, and the ideas of events.

is there a way for an event, that switches your set(in this situation staff and wand) if i get an innervate with my priest? or / and if my darkmooncard: Blue dragon procs? i want to switch to spirit wappons when i get an innervate.

i'm totaly a noob in scripting. can someone help me?

thx and greetings
Garalor
  Reply With Quote
02-02-06, 03:59 PM   #26
ziekke
A Defias Bandit
Join Date: Feb 2006
Posts: 2
Just wondering... is there any way I can create an event that swaps out weapons/armor depending on the TYPE of target I have acquired? Like... Undead, Humanoid, Beast.. etc.?
If I could get an example that would be great
Thanks!
  Reply With Quote
02-02-06, 06:02 PM   #27
Gello
A Molten Giant
AddOn Author - Click to view addons
Join Date: Jan 2005
Posts: 521
For innervate or procs yeah it's doable. I would suggest going by the combat log event for those. You could do UNIT_AURA also but that will fire a lot more than the combat one. Events are being rewritten this weekend I'll try and remember to make an example of either to post.

For an event based on target type, you would want to trigger on PLAYER_TARGET_CHANGED and I suggest a delay of 0.25 or 0.5 since the event fires in pairs when you go from one target to another. The functions to check would probably be http://www.wowwiki.com/API_UnitCreatureType
  Reply With Quote
02-05-06, 05:06 PM   #28
ziekke
A Defias Bandit
Join Date: Feb 2006
Posts: 2
Originally Posted by Gello
For innervate or procs yeah it's doable. I would suggest going by the combat log event for those. You could do UNIT_AURA also but that will fire a lot more than the combat one. Events are being rewritten this weekend I'll try and remember to make an example of either to post.

For an event based on target type, you would want to trigger on PLAYER_TARGET_CHANGED and I suggest a delay of 0.25 or 0.5 since the event fires in pairs when you go from one target to another. The functions to check would probably be http://www.wowwiki.com/API_UnitCreatureType
I appreciate your quick response to my original question. I admittedly don't know the first thing about LUA. However I do have some coding experience. Could you point me to an event that would be constructed similar to the on PLAYER_TARGET_CHANGED so that I have a foundation to start on?

[edit]
This is what I get.. will be testing it..

if (UnitCreatureType("target") == "Undead") then
EquipSet()
end --[[Equip a set when targeting Undead.]]

[edit]

Works like a charm. Just gotta get it to unequip when I change targets.

Last edited by ziekke : 02-05-06 at 05:22 PM.
  Reply With Quote
02-06-06, 03:43 PM   #29
Gello
A Molten Giant
AddOn Author - Click to view addons
Join Date: Jan 2005
Posts: 521
Oops sorry for late reply. A change was in progress in how events work so put off replying. If you have 1.9-beta3, all you need to do is add an else:

if (UnitCreatureType("target") == "Undead") then
EquipSet()
else
LoadSet()

end --[[Equip a set when targeting Undead.]]

EquipSet and LoadSet both check if a set is equipped before running so they're safe to run many times. If there's ever a need you can still use global variables like the older scripts did (in fact all the older ones will run without change), but the performance difference will be negligible.
  Reply With Quote
03-06-06, 03:51 PM   #30
MacDude
A Murloc Raider
Join Date: Mar 2006
Posts: 7
In Town event

Wowwiki list an Event called "PLAYER_UPDATE_RESTING", so I'm trying make it so I can have an outfit for town.

I have sets for "Town", "Power" and "Tank" all set. Switching them via hotkey works great.

Since "PLAYER_UPDATE_RESTING" is called when starting or stoping resting in towns and inns, I'm trying to basically toggle based on the event.

Here is what I'm trying:

Name: Town
Trigger: PLAYER_UPDATE_RESTING
Delay: 0
Script:
If IsSetEquipped("Power") or
IsSetEquipped("Tank") then
EquipSet()
else
if IsSetEquipped("Town") then
EquipSet("Power")
end
--[[Equip a set when in town, equip Power when leaving]]


Note, when I use that trigger, I can't event get EquipSet() to work as the script.

Any hope?

[fixed some typos]

Last edited by MacDude : 03-06-06 at 03:55 PM.
  Reply With Quote
03-15-06, 11:10 AM   #31
MacDude
A Murloc Raider
Join Date: Mar 2006
Posts: 7
update

Originally Posted by MacDude
Wowwiki list an Event called "PLAYER_UPDATE_RESTING", so I'm trying make it so I can have an outfit for town.

I have sets for "Town", "Power" and "Tank" all set. Switching them via hotkey works great.

Since "PLAYER_UPDATE_RESTING" is called when starting or stoping resting in towns and inns, I'm trying to basically toggle based on the event.

Here is what I'm trying:

Name: Town
Trigger: PLAYER_UPDATE_RESTING
Delay: 0
Script:
If IsSetEquipped("Power") or
IsSetEquipped("Tank") then
EquipSet()
else
if IsSetEquipped("Town") then
EquipSet("Power")
end
--[[Equip a set when in town, equip Power when leaving]]


Note, when I use that trigger, I can't event get EquipSet() to work as the script.

Any hope?

[fixed some typos]
Update: I got the plain old EquipSet() to work, but I can't get the logic down to determine if the "town" set is already worn, to switch to the "Power" set.
  Reply With Quote
03-15-06, 02:58 PM   #32
ravagernl
Proceritate Corporis
Premium Member
AddOn Author - Click to view addons
Join Date: Feb 2006
Posts: 1,176
Gello, thanks for your itemrack. It really is superiour to stancesets

I have a problem though. I have set up my argent dawn commison trinket as a set and associated it with the correct event. Now my problem is it only swaps when I walk into the plaguelands, either by mount or by foot, it does not switch when I come from the griphon. Is there a way to fix this?
  Reply With Quote
03-17-06, 09:03 PM   #33
Mamamu
A Defias Bandit
Join Date: Feb 2006
Posts: 2
Great mod!!!

Was trying to trigger an itemswap when flurry procced but I cant seem to find the right name for the flurry buff in the UnitBuff command so some help would be really nice! What I want is a switch when flurry proccs and a switch back when it ends.

Thanks in advance!
  Reply With Quote
03-18-06, 06:18 AM   #34
Gello
A Molten Giant
AddOn Author - Click to view addons
Join Date: Jan 2005
Posts: 521
Wowwiki list an Event called "PLAYER_UPDATE_RESTING", so I'm trying make it so I can have an outfit for town.
Try this:

Name: Town
Trigger: PLAYER_UPDATE_RESTING
Delay: 0
Script:
if IsResting() then
EquipSet()
else
LoadSet()
end
--[[Equips a set while in a city or inn.]]

Associate a tuxedo or town set to that event. In theory it should equip the set when you begin resting and unequip when you're not.

Now my problem is it only swaps when I walk into the plaguelands, either by mount or by foot, it does not switch when I come from the griphon. Is there a way to fix this?
That's an odd one. I'm making a slight change to events that may affect it. Look for 1.91 sometime this weekend and let me know if it doesn't fix it.

Was trying to trigger an itemswap when flurry procced but I cant seem to find the right name for the flurry buff in the UnitBuff command so some help would be really nice! What I want is a switch when flurry proccs and a switch back when it ends.
I'm adding a small mod to create events such as this. Basically you hit a key and it will take a snapshot of your buffs. You pick one and it will create an event to wear while that buff is up.
  Reply With Quote
03-18-06, 02:25 PM   #35
Mamamu
A Defias Bandit
Join Date: Feb 2006
Posts: 2
Originally Posted by Gello
I'm adding a small mod to create events such as this. Basically you hit a key and it will take a snapshot of your buffs. You pick one and it will create an event to wear while that buff is up.
I found this little script helpfull:
function showAllUnitBuffs(sUnitname)
local iIterator = 1
DEFAULT_CHAT_FRAME:AddMessage(format("[%s] Buffs", sUnitname))
while (UnitBuff(sUnitname, iIterator)) do
DEFAULT_CHAT_FRAME:AddMessage(UnitBuff(sUnitname, iIterator), 1, 1, 0)
iIterator = iIterator + 1
end
DEFAULT_CHAT_FRAME:AddMessage("---", 1, 1, 0)
end

showAllUnitBuffs("Player") returns the name and flurry was named something like GhoulFrenzy so I solved the problem. Thanks anyways!
  Reply With Quote
03-29-06, 07:42 PM   #36
starus
A Murloc Raider
Join Date: Mar 2006
Posts: 4
Mounting question

Hi Gello,
Firstly I should thank you for your efforts in writing quality WoW Add-ons. I now use Recap, Parse and ItemRack and am very impressed with all of them!

I find it particularly good how helpful you are with issues/confusions people have here in the forums.

Keep up the great work!



I've subscribed to these forums specifically to ask a question or two!


I previously used an Add-on dedicated to switching to a mount set. It would queue items for swapping if I was forcibly dismounted (stuck in combat) such that they would be equipped once combat was finished.

I read that ItemRack is capable of queueing one item per slot and that it is capable of detecting mounted state. I have installed the "ismounted" library anyway though.


My questions:
1. Is it possible for ItemRack to remember the set equipped BEFORE a special "mounted" set and automatically switch back to it when dismounting cleanly.

2. Is it possible for ItemRack to queue the change above if the dismount event occurs in combat? (Forcibly dismounted)

Then the hard question!
3. How could I do this please?


Thank you very much,
Starus.
  Reply With Quote
03-29-06, 07:48 PM   #37
Gello
A Molten Giant
AddOn Author - Click to view addons
Join Date: Jan 2005
Posts: 521
1. Is it possible for ItemRack to remember the set equipped BEFORE a special "mounted" set and automatically switch back to it when dismounting cleanly.
That's the default behavior. The Mount event will store what you were wearing prior to mounting, and when you get off the mount it will equip the old gear back.

2. Is it possible for ItemRack to queue the change above if the dismount event occurs in combat? (Forcibly dismounted)
Yeah if you're knocked off your mount (so in combat) it will queue the slots to swap after you drop out of combat.

3. How could I do this please?
First make a set that you want to wear while mounted. You can call it anything, like 'Mounted'
Then go to the events tab and make sure 'Enable Events' is checked at the top (this is the master switch to enable events--it's off by default)
Once done, scroll down to the Mount event, click the red ? and choose the set you created before.

That should be it. Once you dismiss the window the mount event should work. If you're a hunter on a non-enUS client or have some really wierd mount, you may need to grab IsMounted mod. It does a more thorough job of mount checks in a very efficient manner. With that mod installed then ItemRack will use that instead of its own internal check.
  Reply With Quote
03-29-06, 08:38 PM   #38
starus
A Murloc Raider
Join Date: Mar 2006
Posts: 4
Originally Posted by Gello
1. Is it possible for ItemRack to remember the set equipped BEFORE a special "mounted" set and automatically switch back to it when dismounting cleanly.
That's the default behavior. The Mount event will store what you were wearing prior to mounting, and when you get off the mount it will equip the old gear back.
For some reason this wasn't always working for me last night (post patch). It was leaving the mount set equipped after dismounting. I'm at work now but will play around tonight and give you any feedback if I still have the problem.

Originally Posted by Gello
3. How could I do this please?
First make a set that you want to wear while mounted. You can call it anything, like 'Mounted'
Then go to the events tab and make sure 'Enable Events' is checked at the top (this is the master switch to enable events--it's off by default)
Once done, scroll down to the Mount event, click the red ? and choose the set you created before.
I did that thanks. It consistently didn't work when I was forcibly dismounted though? Have I missed something?

Originally Posted by Gello
That should be it. Once you dismiss the window the mount event should work. If you're a hunter on a non-enUS client or have some really wierd mount, you may need to grab IsMounted mod. It does a more thorough job of mount checks in a very efficient manner. With that mod installed then ItemRack will use that instead of its own internal check.
Heh, my main is a Hunter, but I'm on a US Realm and my mount is a standard Epic cat. I'll turn off IsMounted if I don't need it then, just in case there is some kind of interaction issue.

I'll have to re-test this when I'm home in a few hours (I'm Australian) and give you better details of any specific problems. I'm sorry this is so vague now.

Thanks again.
  Reply With Quote
03-30-06, 09:29 PM   #39
starus
A Murloc Raider
Join Date: Mar 2006
Posts: 4
I disabled "IsMounted" and did a bit of testing. ItemRack is working 100% of the time when dismounting, either in or out of combat! So the problem is gone.


When I had the problem it was intermittent with out-of-combat dismounting but seemed consistant when being forcibly dismounted in combat.

If you like, I can re-enable "IsMounted" and test it again?


Perhaps you may consider changing your Add-on notes both here and at Curse-gaming to explicitly state that "IsMounted" should only be used with ItemRack if the automatic event is not working?

Thanks for your time!
  Reply With Quote
04-04-06, 02:08 AM   #40
Vtull
A Kobold Labourer
Join Date: Apr 2006
Posts: 1
Mining

Gello:

Thanks for this mod, its a lifesaver. I was wondering (I've been wracking my brain for hours) how to modify the default "Skinning" event type to do the exact same thing for Mining.

I can't seem to figure out the coding for it. I'm sure you can help.

Thanks,
V
  Reply With Quote

WoWInterface » AddOns, Compilations, Macros » Released AddOns » ItemRack - Events

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off