Thread Tools Display Modes
04-27-11, 03:17 PM   #1
Narinka
A Chromatic Dragonspawn
Join Date: Oct 2008
Posts: 165
Unhappy Scripted vars

Just migrated from 7.4.9 (don't laugh) and from what can see features now use more strict conditions when using vars. If var was not "declared" you can't use it. Quite logical, but I'm sad panda now T T.

Before I had self made "feature" for tracking raid buffs, it used one scripted var, where I declared many at once and then used them. Worked fine

Code:
local function CheckBuffs(buffs)
  n = #buffs;
  varsc = true;
  for i = 1,n do
    if  UnitBuff("player", buffs[i]) then varsc = false end;
  end;
  return varsc;
end

varsc_bok = CheckBuffs({"Знак дикой природы", "Благословение королей"});
varsc_bom = CheckBuffs({"Благословение могущества", "Сила поганища", "Высвобожденная ярость", "Аура меткого выстрела"});
varsc_wf = CheckBuffs({"Цепкие ледяные когти", "Тотем неистовства ветра", "Групповая охота"});
varsc_stam = CheckBuffs({"Слово силы: Стойкость", "Кровавый союз", "Командирский крик"});
varsc_armor = CheckBuffs({"Аура благочестия", "Totem"});
varsc_flask = CheckBuffs({"Настой стальной кожи", "Настой силы титанов"});
varsc_food = CheckBuffs({"Сытость"});
Sorry for locale, I hope you catch an idea, there are names of buffs.

Now the only way to do the same is to declare 7 scripted vars one by one?
  Reply With Quote
04-28-11, 03:21 AM   #2
sigg
Featured Artist
 
sigg's Avatar
Featured
Join Date: Aug 2008
Posts: 1,251
Hi Narinka

Yes add 7 scripts in your design.
I may suggest that you can use the powerfull RDX API instead of your code

Replace

Code:
for i = 1,n do
    if  UnitBuff("player", buffs[i]) then varsc = false end;
end;
By

Code:
if unit:HasBuff("buff1") or unit:HasBuff("buff2") then  ... end
In the same concept with cooldown

Code:
unit:HasUsedCooldownBySpellid(spellid)
unit:HasAvailCooldownBySpellid(spellid)
Use the event "UNIT_COOLDOWN" as the trigger

One day I will publish the API of RDX.

BTW, do you have any update of the ruRU langage pack ?

Cheers
__________________
RDX manager
Sigg
  Reply With Quote
04-28-11, 10:34 AM   #3
Narinka
A Chromatic Dragonspawn
Join Date: Oct 2008
Posts: 165
Not yet, sorry. Will take a look at spells DB, but interface part was always out of my sight. To be honest in my case it looks like:
Code:
local RDX_translation = {
};

VFL.Internationalize("ruRU", RDX_translation);


ps: to be honest it will be better to cut it out in your release also, in many cases translations do not fit in buttons or features, in some cases it is hard to understand what they mean at all. locale.ruRu was done long before me, I tried at some point, but gave up, sorry Too much work for my time in WoW and I prefer english interface anyways.

If you or any Ru users really need it I can help of cause, but without any promises.
  Reply With Quote
06-13-11, 06:05 PM   #4
Narinka
A Chromatic Dragonspawn
Join Date: Oct 2008
Posts: 165
Sigg, dunno why, but your suggested code works not well enough with Latch repaint and I don't like to set up periodic repaint in every window I use.

Just try to do something like simple frame with scripted var + texture + show/hide feature or whatever..

Scripted var with buff event checked:
vBuff = true;
if unit:HasBuff("YourBuffGoesHere") then vBuff = false end

Window with latch repaint.

Now drop your buff, buff it back etc.. it just updates in some weird way.

If you change scripted var to something like:
vBuff = true;
if UnitBuff("player", "YourBuffGoesHere") then vBuff = false end;
Then everything works fine.

Last edited by Narinka : 06-13-11 at 06:10 PM. Reason: Alternative way works fine
  Reply With Quote

WoWInterface » Featured Projects » OpenRDX » OpenRDX Support » OpenRDX: Feature Requests » Scripted vars

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