12-08-05, 09:16 PM | #1 |
ItemRack - Events
Version 1.7 of ItemRack introduces event-driven scripts to swap gear. You can grab it here: http://www.wowinterface.com/download...fo.php?id=4148
The purpose of this thread is for a place to ask questions about how to make events in ItemRack or to post events that you make. I'm going to post the events manual here and in the next post I'll be putting events as I come across them for anyone to use. The intent is to have users scripting the events. They are just like macros, they use the exact language for everything that comes after a /script in a macro, except they run in response to game events. Using Events In the options window when you right-click the minimap button are three tabs. All event setup is done in the Events tab. Events are disabled initially. To begin using events you need to enable it with the "Enable Events" checkbox at the top of the Events tab. This is the "master switch". You can set up a key binding to toggle all events on or off as well. In that tab you'll see a list of events with a red question mark beside it. Click the question mark to choose what set to equip for the event. When you've chosen a set it will be enabled. You won't be able to enable an event until you've associated a set for it. (even if the event script doesn't rely on a defined script) To disable/enable a set with an associated event, uncheck the event. Alternately, you can click Delete to remove the set association and have it drop down to the bottom of the list. Deleting an event not associated with a set will completely remove it if no other characters use that event. Editing or Creating Events If you hit Edit or New at the bottom of the events tab you'll be brought to the event script editor. Here you define when the event runs and what it does. You can copy-paste into/out of these boxes. The four boxes are: Name: This is the name you'll see in the event list, ie Mount, Warrior:Berserker, Swimming, etc. Trigger: This is the WoW-generated event you want the event to trigger from. ie PLAYER_AURAS_CHANGED, CHAT_MSG_COMBAT_SELF_HITS, etc Delay: This is the time, in seconds, after the last occurance of the Trigger before the script runs. Script: This is the actual script that runs. You can use any lua construct or make it as complicated as you want. The code is directly run without any parsing. Some knowledge of WoW Lua and scripting will help a great deal in editing and creating events. An excellent resource is the wiki: http://www.wowwiki.com/Interface_Customization In the lower left is a Test button. You can use this to run the script once to make sure there are no syntax or other obvious errors. But it can't test if the trigger works or anything beyond stuff that would prompt a red error box. If at any time you've messed up your default events and want them back: /itemrack reset events. This will not touch your custom events. It will just recreate the default events. Event Specifics Event Name
Originally I had hoped to keep the mod's primary purpose evenly split between being a bar mod to swap individual slots on the fly, and a gear sets mod to swap entire sets of gear at once. As the events concept has fleshed out it's becoming apparent that this mod will have three purposes: bar, sets, events. It will probably be broken into a more modular form in the future, so that those who never use the bar can delete it, and those who never use the events can delete that as well. The goals when adding events were:
Thanks to everyone who helped in the beta of this. It was a fun technical challenge and I enjoyed it immensely. |
|
12-08-05, 09:16 PM | #2 |
Some events. I'll add more as I run across them. Feel free to add your own also!
Skinning From an idea posted by Liler: http://forums.worldofwarcraft.com/th...ation&t=276284 This event will swap in your skinning gear (likely Finkles) when you mouseover something that can be skinned. It swaps back to your normal gear when you mouseover something/someone else. A variation can be made to switch to skinning gear if you trigger on UI_ERROR_MESSAGE with the exact text when your skill is too low, then swap out when you finish looting on trigger LOOT_CLOSE. Not having a skinner I really can't test this. Feel free to post if you do make one :) Event: Skinning Trigger: UPDATE_MOUSEOVER_UNIT Delay: 0 Script: if UnitIsDead("mouseover") and GameTooltipTextLeft3:GetText()=="Skinnable" then if not SKINNINGMODE then SaveSet() EquipSet() SKINNINGMODE=1 end elseif SKINNINGMODE then LoadSet() SKINNINGMODE=nil end --[[Equips a set when you mouseover something that can be skinned.]] Evocation This macro/event pair will swap in your spirit gear when you begin casting Evocation and then swap it out when you're done. 1. Make this macro to cast Evocation: /script EVOCING=1 SaveSet("Spirit Gear") EquipSet("Spirit Gear") /cast Evocation 2. Make this event: Event: Mage:Evocation Trigger: SPELLCAST_STOP Delay: 1 Script: if EVOCING and not CastingBarFrame.channeling then EVOCING=nil LoadSet() end --[[Unequips a set when done casting Evocation]] 3. Associate the set "Spirit Gear" to the event. (can name it anything you want, doesn't need to be "Spirit Gear") |
|
12-09-05, 04:51 AM | #3 |
wrt your skinning script:
Using UNIT_SKINNABLE instead of "Skinnable" should make the script language independent just have a look at globalstrings.lua for more of this 'auto localized' strings |
|
12-09-05, 12:40 PM | #4 |
That's a good point. But I'm hoping to cast the events as just normal macros anyone can create and GlobalStrings are rarely used in macros.
|
|
12-09-05, 01:57 PM | #5 |
How do you create an ItemRack event, for example ..
When event = PLAYER_REGEN_ENABLED then equip WeaponA else if PLAYER_REGEN_DISABLED then equip WeaponB ? Thanks ! |
|
12-09-05, 02:51 PM | #6 |
In its simplest form:
Event: In Combat Trigger: PLAYER_REGEN_DISABLED Delay:0 Script: EquipSet() Event: Out of Combat Trigger: PLAYER_REGEN_ENABLED Delay: 0 Script: EquipSet() Then associate the weapon sets you want to each condition. |
|
12-13-05, 02:29 PM | #7 |
I'm looking for a way to swap weapons if I run out of mana, taking the skinning mode example, i was wondering if the following would work?
Event: ManaWeaponChange Trigger: UNIT_MANA Delay: 0 Script: if UnitMana("player") <= 40 then if OOM then SaveSet() EquipSet() OOM=1 end elseif OOM then LoadSet() OOM=nil end |
|
12-13-05, 03:01 PM | #8 |
Yep that should work. Tho to make it less annoying when you're casting on mana fumes:
if UnitMana("player") <= 40 then if OOM then SaveSet() EquipSet() OOM=1 end elseif OOM and UnitMana("player")>150 then LoadSet() OOM=nil end That will swap to a set when you go below or equal to 40 mana, and swap back when mana is over 150. If you wanted to swap at 40% mana, change UnitMana("player") to UnitMana("player")*100/UnitManaMax("player") |
|
12-19-05, 12:27 PM | #9 |
hmm, i am a noob when it comes to all these lua scripts.
Lets say I want to trigger a weapon swap with PLAYER_REGEN_DISABLED but only at 80% mana is reached, how do I do that ? Many thanks ! |
|
12-19-05, 04:44 PM | #10 |
Do you mean if you drop below 80% mana while in combat?
Trigger: UNIT_MANA Delay:0 Script: if UnitAffectingCombat("player") and (UnitMana("player")/UnitManaMax("player"))<.8 then EquipSet() end If you mean when you're below 80% when PLAYER_REGEN_DISABLED fires: Trigger: PLAYER_REGEN_DISABLED Delay: 0 Script: if (UnitMana("player")/UnitManaMax("player"))<.8 then EquipSet() end |
|
12-19-05, 06:52 PM | #11 | |
Weapon swap on condition that I am in combat and my mana is below 80%. Thanks alot ! |
||
12-20-05, 01:10 AM | #12 |
First of all, thank you, thank you, thank you for this!
I recently switched over to a Warrior after numerous amounts of Mages on different servers, and I've been searching high and low for a macro that would swap to a 2-h weapon when I did Overpower. My workaround was creating a macro that swapped weapons and clicking that before hitting the Overpower key, but sometimes I'd take to long to swap and lose the opportunity. Now, I'm not very good at this lua mumbojumbo so I don't have the foggiest idea how to create and event, but the problem I have is that I accidentally deleted the Warrior:Overpower End event when I was first fiddling with the addon. I tried deleting the folder and re-installing the addon, but it's still not showing up. I generally use dual wield when I'm in Battle Stance and would like to swap back to dual wield after Overpower. Can you post the event here so I can cut and paste it? Also, how would I go about creating an event that switches to Defensive Stance and 1h+shield when I want to do a Shield Bash? I've already defined 1h+shield as my equipment for Defensive Stance. Thanks in advance. I hope that by looking at some examples, I'll be able to figure out how to create my own events. |
|
12-20-05, 06:57 AM | #13 |
If you do "/itemrack reset events" it will restore the default events.
On defensive+shield, events can't change forms or do other things that require a hardware event, like using abilities or items. Both the form changing and shield bashing can't be automated. |
|
12-21-05, 06:53 AM | #14 |
Gouge
Can someone please post an event for gouge so that when a enemy is gouged it will swap your MH sword into a dagger. When it comes to LUA (or pretty much all other forms of programming) i dont have a clue...yet
Thanks |
|
12-21-05, 05:13 PM | #15 |
Try this:
Name: Gouged Trigger: UNIT_AURA Delay: 0 Script: if arg1=="target" then local i for i=1,16 do if UnitDebuff("target",i)=="Interface\\Icons\\Ability_Gouge" then EquipSet() i=17 end end I'm not sure what the debuff texture is for gouge. If Interface\\Icons\\Ability_Gouge doesn't work another rogue may need to help. |
|
12-22-05, 07:03 PM | #16 |
Can there be an event that swaps to 2-h after becoming Enraged? How would I create that?
|
|
12-22-05, 07:14 PM | #17 |
Name: Enraged
Trigger: PLAYER_AURAS_CHANGED Delay: 0 Script: local i for i=1,24 do if string.find(UnitBuff("player",i) or "","UnholyFrenzy$") thenendEquipSet()end Should work |
|
01-07-06, 09:11 AM | #18 |
Hi, Could you please help me on this event:
When vanish cooldown is up, equip set fullnightslayer basically i have macro to equip mix & match set when I click on vanish, not much trouble there. I can't however seem to get the reverse right; check my cooldown on vanish, once cooldown is finished, equip full nightslayer set so to be ready when I need to vanish I can take advantage on the 8 piece NS bonus to gain 500HP on vanish. I posted on wow ui forum about this as well, not sure if u frequent the site, so here I am. Thank you a lot if you see this! |
|
01-07-06, 09:20 PM | #19 |
I realized that the event script i made didnt work because somehow I couldnt find the right trigger.
script: local e, f, g = GetSpellCooldown(48, SpellBookFrame.bookType);if (f <= 0) then SaveSet() EquipSet() end works when i made it into a macro and test it. somehow it just wont trigger, i tried many events, just wont work. If you could help me on what event trigger to use which fires when your cooldown ends, that would be great. 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 |
|
01-08-06, 05:07 AM | #20 |
Hi Gello
Love the work, BEST OUTFIT/WARDROBE Mod. Issues with Same Items/Different Enchants I was having some issues with the mount/dismount event. So after deleting the ItemRack Directory and the savedvaribles file and re-installing it (I also removed TitanRider .lua and .xml from the Titan Directory) the same problem occurs. I found what appeared to be an issue with events. In my case the Mount-Dismount event. Here is my set up. I have everything the same except for my Trinket, Boots and Gloves. These are the same type Shadowcraft Boots, one with +Agil on them and the others with Mith Spurs, also Shadowcraft Gloves with +Agil on one pair and Riding Enchant on the other. So I have these 2 different sets done. One for Mounted and the other I call Skull-Any, due the the Skullforge Reaver I wear. I set the Skull-Any up and saved them. Then clicked the equip. I then set up the Mount select and saved it, and allocted it to the mount event in the events panel, and activate the "Events" box. When I mount and mismount it leaves the +Agil Gloves and Boots on for both outfits, but switches the Trinkets assigned. After some testing I think I have found the issue. As both Boots and Gloves are of the same type (Shadowcraft), but have different Enchants, it does register them as being different, but as the same. I did this testing by getting another set of Gloves and Boots I have and switching them in the "Mount" Profile, I kept the other "Skull-Any" Profile as is. I then mounted and dismounted and the different Gloves and Boots items switched back and forwards with no problems. Has this issue come up before, any ideas about a work around to detect that they are same type/piece, but with different enchants? Is there a way to make a custom script for this? Cheers Talone |
|
WoWInterface » AddOns, Compilations, Macros » Released AddOns » ItemRack - Events |
«
Previous Thread
|
Next Thread
»
|
Display Modes |
Linear Mode |
Switch to Hybrid Mode |
Switch to Threaded Mode |
|
|