Thread Tools Display Modes
09-21-06, 05:44 AM   #81
Gello
A Molten Giant
AddOn Author - Click to view addons
Join Date: Jan 2005
Posts: 521
Sorry for lack of responses in this thread. A big caveat before I get to responses: I've not tested a single line of the code examples that follow. So some tweaking may be required for typos or 7am grogginess.

re crusader-per-weapon event

I'd suggest finding out what event happens when a crusader proc happens. (probably CHAT_MSG_SPELL_SELF_BUFF, but could be others--DevTools is a great mod to discover it. Do /dtchatevent with DevTools installed) With that you can use a combination of GetInventoryItemLink and GetTime() to see what's equipped and time since the last proc.

trigger: CHAT_MSG_SPELL_SELF_BUFF -- needs confirmed
delay: 0
if arg1="You gain Holy Strength" then -- the combat text needs confirmed
if IsSetEquipped("Bloodlord's Defender") then
EquipSet("Ancient Hakkari Manslayer")
elseif IsSetEquipped("Ancient Hakkari Manslayer") then
EquipSet("Warblade of the Hakkari")
else
EquipSet("Bloodlord's Defender")
end

Then another event could watch for the last crusader fading.

trigger: ITEMRACK_BUFFS_CHANGED
delay: 0
if not arg1["Interface\\Icons\\Spell_Holy_BlessingOfStrength"] and not IsSetEquipped("Bloodlord's Defender") then
EquipSet("Bloodlord's Defender")
end

Obviously it gets more complicated when dealing with offhand too.

re buff event maker

That nil error should go away if you download the most recent one. I'll update it tho to use the new events.

Out of combat and at full mana or more than 99% to swap to a specific set

trigger: PLAYER_REGEN_ENABLED
delay: 0
if UnitMana("player")/UnitManaMax("player")>=.99 then
EquipSet()
end

In combat and at a certain % or less to swap to a specific set

trigger: UNIT_MANA
delay: 0
if UnitAffectingCombat("player") and UnitMana("player")/UnitManaMax("player")<.50 and not IsSetEquipped() then
EquipSet()
end

At anytime if innervate is received SaveSet(), EquipSet(), then when it expires LoadSet()

trigger: ITEMRACK_BUFFS_CHANGED
delay: 0
local f = arg1["Innervate"]
if f and not IR_INNERVATE then
EquipSet() IR_INNERVATE = 1
elseif not f and IR_INNERVATE then
LoadSet() IR_INNERVATE = nil
end

re command to toggle events

/script ItemRack_ToggleEvents()

re arcane shot

Unlike evocation which has a duration (8 sec?), arcane shot is an instant effect so the SPELLCAST_STOP will fire immediately after. Global cooldown issue aside (you can't immediately cast arcane shot after a weapon swap while in combat), what you're probably seeing is weapons are still in the process of being swapped (notifications coming back from the server) so it appears that you're still wearing your old set when it goes to unequip what it thinks should be the new set.

I suggest adding a delay after an arcane shot. You could do it from combat log, maybe SPELLCAST_STOP if you check if arcane shot is on cooldown.

re overpower

Unfortunately this mod, and no mod in existence, can automatically swap you into battle stance when an opponent dodges without some sort of hardware event (mouse click or keypress). So you'll need to be in battle stance for the swaps to automatically happen.

That's not very practical since most warriors spend most of their time jumping from stance to stance, but it's there mostly as a demonstration. Scripts here obey all the restrictions of mods.

If you want to remove the check if you're in battle stance (since you'll probably be switching) you can change this line:

local _,_,i = GetShapeshiftFormInfo(1)

to this:

local i=1

and it will swap in weapons no matter what stance you're in, so you can swap to battle stance at your liesure. (It used to do this, but there were a lot of complaints that it was a bug since warriors can't overpower outside of battle stance heh)

re plaguelands

Oops definitely fixed now sorry. I keep forgetting about that. The next update shouldn't break it again.

re primal blessing

If you just want to say something in reaction, find out what the text is when the weapon procs. With that you could do:

trigger: CHAT_MSG_SPELL_SELF_BUFF
delay: 0
if arg1=="You gain Primal Blessing." then
SendChatMessage("A tiger?! In "..(GetRealZoneText() or "Africa?!"))
end

re FD

Try PLAYER_ALIVE? I can't test now, but I have a hunch that PLAYER_ALIVE fires when a hunter stands up from FD. You'd want to check to make sure you're not FD also since that event fires when you FD too. Something like:

trigger: PLAYER_ALIVE
delay: 0.2
if not ItemRack.Buffs["Feign Death"] then
-- not FD'ed
end

re fist of stone

Cool glad you figured it out. Sorry again responses have been sporatic here.

re overpower again

There's a pair of default events called Overpower Begin and Overpower End. But as mentioned above, it won't swap you into battle stance.
  Reply With Quote
09-21-06, 11:04 PM   #82
halwa
A Kobold Labourer
Join Date: Sep 2006
Posts: 1
Trinket Priority Queues

Posted on ItemRack file comments as well.

Thanks
Halwa.

--- post copy ----
I saw a post on the Itemrack - Events this AM which described a script to prioritize trinkets and switch to them based on ITEMRACK_NOTIFY and ITEMRACK_ITEMUSED events (Thanks Ansum, sorry if I got the nick wrong).

The caveat with that script was that the notify portion would work only if the cooldown was complete, i.e. if ITEMRACK_NOTIFY triggered 30 sec ahead of the cooldown ending it wouldnt get equipped. A little bit of tinkering got the NOTIFY portion working.

People trying to get a priority queue going heres how to do it. Make two events, copying the "Insignia" and "Insignia Used" events from default ItemRack configuration. Now in both these new events, remove the code from the text box below the "Delay" column in the ItemRack UI. Add the following LUA script.

local trinketslot, _ = GetInventorySlotInfo("Trinket1Slot");
local trinkets = {
"Insignia of the Horde",
"Barov Peasant Caller",
"Defiler's Talisman",
"Blackhand's Breadth"
};
for _, t in ipairs(trinkets) do
local inv,bag,slot = Rack.FindItem(nil, t);
local s, d, e, c;
local ignore=false;
if inv == trinketslot then
s, d, e = GetInventoryItemCooldown("player", inv);
elseif bag and slot then
s, d, e = GetContainerItemCooldown(bag,slot);
else
ignore=true;
end
c = GetTime();
if ( not ignore and (s + d - c <= 30 )) then
if not inv and bag and slot then
if UnitAffectingCombat("player") or Rack.IsPlayerReallyDead() then
local _,itemID = Rack.GetItemInfo(bag, slot)
Rack.AddToCombatQueue(trinketslot ,itemID)
else
PickupContainerItem(bag,slot);
PickupInventoryItem(trinketslot);
end;
end;
break;
end;
end;

The script walks a list of items, calculates the cooldown associated with them and equips the first one that doesnt have a cooldown or whose cooldown is at most 30 sec. I am not LUA programmer so there might be errors in the script (I havent taken care of negative values during substraction for one, though it doesnt seem to matter in my testing). I havent yet tested this script in combat.

In the meanwhile I would like to map whatever my current trinket slot 1 holds to a single icon on my toolbar (and hence a single keypress). The idea being to use the same keypress to trigger my trinket based cooldowns. It would be great if the LUA experts on the board can help me with this.

Thanks
Halwa
  Reply With Quote
09-22-06, 01:49 AM   #83
Gello
A Molten Giant
AddOn Author - Click to view addons
Join Date: Jan 2005
Posts: 521
In the meanwhile I would like to map whatever my current trinket slot 1 holds to a single icon on my toolbar (and hence a single keypress). The idea being to use the same keypress to trigger my trinket based cooldowns. It would be great if the LUA experts on the board can help me with this.
Two approaches:

Alt+click a trinket slot on the character sheet to create a bar or add the slot to the bar. You can set a key binding to the slot via the normal key bindings window.

If you want to use normal action bars, grab the mod Equipped Macro Icons ( http://gello.wowinterface.com/downlo...fo.php?id=4737 ) and then make a macro with /script UseInventoryItem(13) and choose the first trinket icon. The icon will change to reflect the icon of the trinket currently worn. (13 to 14 for bottom trinket slot of course)

On the trinket queue script, it looks like it should work fine. If you find problems with it (hopefully you don't), I've been suggesting TrinketMenu for the time being which has full automatic trinket queue support that will make its way to ItemRack 2.0. You set up a priority of trinkets, enter a delay to keep some trinkets equipped after use (ie, Earthstrike for 20 seconds), and it will manage swaps on its own, in/out of combat/death.
  Reply With Quote
09-29-06, 08:06 PM   #84
bril
A Defias Bandit
Join Date: Jun 2006
Posts: 1
Quick question, I created a script that will allow me to swap between two weapon sets but my problem is figuring out how to activate it.

Here is the script:
if IsSetEquipped("Sword") then
EquipSet("Dagger-2")
else
EquipSet("Sword")
end

It tests out fine, so what I am looking for is a way to tie this to a key command? Thanks for any help and great mod!
  Reply With Quote
09-29-06, 09:18 PM   #85
Gello
A Molten Giant
AddOn Author - Click to view addons
Join Date: Jan 2005
Posts: 521
Originally Posted by bril
Quick question, I created a script that will allow me to swap between two weapon sets but my problem is figuring out how to activate it.

Here is the script:
if IsSetEquipped("Sword") then
EquipSet("Dagger-2")
else
EquipSet("Sword")
end

It tests out fine, so what I am looking for is a way to tie this to a key command? Thanks for any help and great mod!
You can make a macro:

/script EquipSet(IsSetEquipped("Sword") and "Dagger-2" or "Sword")

There's a ToggleSet() also if you're looking to just toggle "Sword"

/script ToggleSet("Sword")
  Reply With Quote
09-30-06, 09:29 AM   #86
Brandubh
A Murloc Raider
 
Brandubh's Avatar
Join Date: Nov 2005
Posts: 4
Lightbulb Raid Call Trigger

I've been playing with making a script that will run whenever a specific resist is called for in the raid channel by the raid leader, but so far I've had little luck getting it made.

For instance, we're about to stick it to HuHu and the RL calls for NR. The script would just chose the defined set (either Nature Resist or Nature Hybrid, in my case) and automatically equip it. This would assist those of us who either (1) miss the call and (2) are just plain lazy. Automation is Fun!

I have a script made, but unfortunately it's on my other PC, but I'll post it later. In hte meantime, if anyone has a script that accomplishes this action that works for them, please feel free to post it!
  Reply With Quote
10-03-06, 08:27 PM   #87
Vakgraun
A Kobold Labourer
Join Date: Oct 2006
Posts: 1
I need more help with this script, im big NOOB with scripting, and i dont knwo wich trigger i should use and I suppose that "Rune der Perfektion" is in German or something like that, i need to translate those?

thxs in advance for your time


Originally Posted by Aeneas-KuM
In ITEMUSED and NOTIFY I have the same script. It rotates the trinkets upon priority and if the CD is over.
Code:
local trinketslot, _ = GetInventorySlotInfo("Trinket1Slot");
local trinkets = {
   "Großmeister der Arena",
   "Insignien der Allianz",
   "Mal der Resolution",
   "Talisman von Arathor",
   "Barov-Arbeiterrufer",
   "Rune der Perfektion"
};

for _, t in ipairs(trinkets) do
   local inv,bag,slot = Rack.FindItem(nil, t);
   local s, d, e;
   local ignore=false;

   if inv == trinketslot then
      s, d, e = GetInventoryItemCooldown("player", inv);
   elseif bag and slot then
      s, d, e = GetContainerItemCooldown(bag,slot);
   else
      ignore=true;
   end
   
   if ( not ignore and (s + d <= 30 )) then
      if not inv and bag and slot then
	 if UnitAffectingCombat("player") or Rack.IsPlayerReallyDead() then
	    local _,itemID = Rack.GetItemInfo(bag, slot)
	    Rack.AddToCombatQueue(trinketslot ,itemID)
	 else
	    PickupContainerItem(bag,slot);
	    PickupInventoryItem(trinketslot);
	 end;
      end;
      break;
   end;
end;
  Reply With Quote
10-09-06, 03:31 PM   #88
joeshmo416
A Kobold Labourer
Join Date: Oct 2006
Posts: 1
Innervate/blued dragon part2

ok, thanks to the event maker mod i got to make my itemrack work on both events with the aura triggers. However i wish to use a mana check trigger along with the aura one, is this possible? like i will only equip the items if and only if player's mana < .95 (percent) is this possible??
  Reply With Quote
10-19-06, 11:34 PM   #89
bwl
A Kobold Labourer
Join Date: Oct 2006
Posts: 1
Originally Posted by wyldhawke
I know I want to use the ZONE_CHANGED_NEW_AREA trigger.. i'd like it to swap into my pvp set as soon as I pop into a BG (warsong, arathi, or alterac).. and when I leave, to switch to last-equipped set .. I've tried, but I can't seem to get it working.. I just keep popping up errors.. or it doesn't switch.

Any help? .. Also, an event like this would be helpful to have as part of the default sets, I know a lot of people who are looking for one like it.
I am trying to get a similar event to work for when I go into nefs room to equip ony cloak(yeah I forget sometimes and get wtfpwnd) I tried to use what I could off of the plaugelands one but I am stuck
  Reply With Quote
11-01-06, 05:55 AM   #90
Eselgeist
A Kobold Labourer
Join Date: Nov 2006
Posts: 1
Smile Help with item swapping after its chance-on-hit ability.

I love this mod! I'm an idiot, so please bear with me, I hope this isn't too complicated:

I'm a warrior, I dual wield and have this nifty axe [Stalvan's Reaper] which will regularly
debuff the mob I'm fighting by reducing all their stats by 2 for one minute. That is quite
useful to me.

I've now levelled past the general damage usefulness of the axe. However, the axe's
ability happens very dependably - every fight it seems to go off within a few swings.

1. What I would like to do is begin combat with the Axe and my offhand weapon/sheild.
2. Use it until the ability goes off.
3. Then switch to my main weapon for better DPS.
4. If I'm still in combat after a mintue (the axe's cool down) I'd like to re-equip it until the
ability goes off again, etc.

I don't mind fighting with it until it goes off because I'm usually tanking and not -so-
concerned about overall DPS.

Can you please provide any help with how to write this script? Would this be difficult to
code?

Thanks again!

Chris
  Reply With Quote
11-01-06, 08:14 AM   #91
gato
A Kobold Labourer
Join Date: Nov 2006
Posts: 1
events don't work?

hi, thx for this great addon! manually changing equip works great! but using the stance-events with a warrior won't work - did all as described in the manual.txt, but it doesn't do anything when i change the stances. did i understand this correctly, the events will change my defined set eg. 1h+shield if i am in def stance automatically? so how can i get this working or is it "nerfed" since any patch? thx
  Reply With Quote
12-02-06, 04:12 PM   #92
Butch82
A Murloc Raider
Join Date: Dec 2006
Posts: 5
Originally Posted by bwl
I am trying to get a similar event to work for when I go into nefs room to equip ony cloak(yeah I forget sometimes and get wtfpwnd) I tried to use what I could off of the plaugelands one but I am stuck
I tried the same, with no luck either :-/

My Event:

Code:
Trigger: MINIMAP_ZONE_CHANGED 
Delay: 1 

local minimapzone = GetMinimapZoneText()
if (minimapzone =="Nefarians Lair") 
then EquipSet() 
end
Can anyone tell me what i'm doing wrong? :-(
  Reply With Quote
12-03-06, 11:53 AM   #93
Random
A Warpwood Thunder Caller
AddOn Author - Click to view addons
Join Date: Jan 2005
Posts: 93
Im trying to make an event for when I go in to stealth to switch my dagger into the main hand and just put my sword in my backpack until I break stealth and then go back to sword MH, dagger OH.

Does anyone know how to do this??
__________________

Reallyadude: OMG Blizz nerfed crashing
Iriel: Tem will find a workaround. I have faith.
  Reply With Quote
12-03-06, 01:04 PM   #94
Gello
A Molten Giant
AddOn Author - Click to view addons
Join Date: Jan 2005
Posts: 521
The default stealth event should do that.

On Nefarian's Lair, I'm not sure why you guys aren't getting it to swap in. Are you sure the result of GetMinimapZoneText() is "Nefarians Lair" with no punctuation?

Stances should work. (Working for my warrior atm)

On the debuff axe, yeah that's possible but a bit more involved than most. You would basically make three events:

PLAYER_REGEN_DISABLED: equip the axe
CHAT_MSG_something (don't know what it'd be, when axe procs): equip dps
CHAT_MSG_something with 60 sec delay: equip the axe

It would take research to discover what the exact debuff message is in the combat log, and the CHAT_MSG_ event that's triggered when it happens.

And actually now that I think about it, CHAT_MSG_something may go off more than once every 60 seconds for other skills, so you'd want to scrap the second and create a timer in the first to re-equip the axe after 60 seconds. Doable, but complicated.
  Reply With Quote
12-03-06, 01:15 PM   #95
awar
A Defias Bandit
Join Date: Dec 2006
Posts: 2
Events macro

Ok i have a question regarding the enable events check box? Known as the master switch... Basically i want to know what is the way that you bind a key to enable or disable this master switch. I see it says you can do it but there is nothing that says how and it's really anoying because i want to disable it in pvp so i don't get stuck in combat with my mount gear all the time but i don't want to have to keep clicking i'd rather just hit a button on my keyboard... thanks and i hope someone know how, argh.
  Reply With Quote
12-03-06, 01:26 PM   #96
Butch82
A Murloc Raider
Join Date: Dec 2006
Posts: 5
Originally Posted by Gello

On Nefarian's Lair, I'm not sure why you guys aren't getting it to swap in. Are you sure the result of GetMinimapZoneText() is "Nefarians Lair" with no punctuation?
Yes, i triple-checked ... is there any way to insert wildcards to work around the problem?

Something like
Code:
if (minimapzone =="*Nefar*")
would be nice :-/
  Reply With Quote
12-03-06, 01:27 PM   #97
Random
A Warpwood Thunder Caller
AddOn Author - Click to view addons
Join Date: Jan 2005
Posts: 93
Originally Posted by Gello
The default stealth event should do that.
Im guessing I have to make some change to it? because it currently doesnt do that for me.

I have the enable events box checked, also.
__________________

Reallyadude: OMG Blizz nerfed crashing
Iriel: Tem will find a workaround. I have faith.

Last edited by Random : 12-03-06 at 01:33 PM.
  Reply With Quote
12-03-06, 04:03 PM   #98
awar
A Defias Bandit
Join Date: Dec 2006
Posts: 2
so.... does anyone know how i can do that?
  Reply With Quote
12-03-06, 05:17 PM   #99
Gello
A Molten Giant
AddOn Author - Click to view addons
Join Date: Jan 2005
Posts: 521
On disabling events with a key bind, hit ESC until you get the game menu. Then go to Key Bindings, then scroll down to ItemRack and bind a key to Toggle Events. Then you can hit that key to turn events on or off.

On Nefarian's Lair, if you've checked then a wildcard isn't really needed but you can do if string.find(minimapzone,"Nefar"). The next step I'd do is to ensure the event MINIMAP_ZONE_CHANGED actually fires. You can put this at the start of the script:

DEFAULT_CHAT_FRAME:AddMessage("MINIMAP_ZONE_CHANGED fired!")

and it will spam that when the event happens. If it's not firing, I'd try ZONE_CHANGED instead of MINIMAP_ZONE_CHANGED and keep the GetMinimapZoneText() etc bit.

On rogue stealth, I'll double check with my rogue alt on live. Unfortunately I can't test stealth on beta.
  Reply With Quote
12-03-06, 05:34 PM   #100
Gello
A Molten Giant
AddOn Author - Click to view addons
Join Date: Jan 2005
Posts: 521
Originally Posted by Random
Im guessing I have to make some change to it? because it currently doesnt do that for me.

I have the enable events box checked, also.
I just tested live on my rogue alt and it seems to work ok. Can you do me a favor and associate a different set with stealth to test if it's not the set? Oh and let me know if it's on beta/PTR too.
  Reply With Quote

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


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