Elitist Jerks
Register
Blogs
Urban Rivals
Forums
New Posts


Go Back   Elitist Jerks > Public Discussion > User Interface and AddOns
Elitist Jerks Login

gamerDNA Login

Welcome to Elitist Jerks
We're testing some new features on the site regarding OpenID registration and coordination with gamerDNA. If you experience any issues with registering an account, please take the time to fill out a report and send it to this e-mail address. We would appreciate any assistance you could provide in making sure everything is functioning as intended. Thanks!

If this is your first visit, please be sure to check out the FAQ and the forum rules. Users must register to post and new registrations are subject to a one day "mute" period to get acquainted with the community.

Reply
 
LinkBack (18) Thread Tools
Old 09/06/09, 10:38 AM   #176
Negheos
Glass Joe
 
Night Elf Druid
 
Wrathbringer (EU)
Another idea I´m working on is automatic buffcanceling:

local i = 1
while true do
   local name,_,_,_,_,_,expires,_ = UnitAura("player",i,"HELPFUL")
      if not name then
         break
      elseif name == "AURATOCANCEL" then
         local rem = expires - GetTime()
            if rem<TIMEREMAININGTOCANCEL then
               CancelUnitBuff("player","AURATOCANCEL")
            end
      end
      i=i+1
end
I´m struggling with the OnEvent - for testing I tried
self:RegisterEvent("UNIT_SPELLCAST_START")
(I´m using this with kgpanels). But this will only update the value of "rem" each time a spell is cast. Afterwards "rem" remains constant until a new spell is cast. The idea was to have a certain aura with low time remaining (maybe eclipse) automatically canceled right before a certain spell ends (maybe starfire) so the aura can come up again and the spell receives still a maximum of the auras benefit. Therefore the aura must be canceled at the very end of the spell so a lag induced timeshift between "spell complete" and "aura cancelled" lets the server allow another upcome of the aura.

To clarify: Maybe there are already addons around for this but I´m sure it can be done in simple luatext input I just need an idea how to do the time management without the "UpdateIn(t)" function.
 
User is offline.
Reply With Quote
Old 09/17/09, 6:11 AM   #177
Fanto
Glass Joe
 
Dwarf Paladin
 
Thrall (EU)
Originally Posted by ctrlfrk View Post
Here is a small Luatext to show how far away the unit is from you:

local rc = LibStub("LibRangeCheck-2.0")
local minRange, maxRange = rc:getRange(unit)
UpdateIn(1.0)
return "|cff404040%s",  tostring(maxRange or "Far")

You may need to install LibRangeCheck for it to work.
Has anyone got this code to work with the new version of PB (>beta5)? I just updated PB, so I think no other addon may cause the following error (librangecheck-2-0 is located in the Interface folder) :

[2009/09/16 00:42:40-3431-x1]: <string>:"PitBull4_LuaTexts:Target:range":1: Cannot find a library instance of "LibRangeCheck-2.0". 
PitBull4_LuaTexts-v4.0.0-beta5\LuaTexts.lua:1153: in function `AddFontString' 
PitBull4-v4.0.0-beta5\ModuleHandling\TextProviderModule.lua:118: in function `UpdateFrame' 
PitBull4-v4.0.0-beta5\ModuleHandling\Module.lua:319: in function `Update' 
PitBull4-v4.0.0-beta5\UnitFrame.lua:636: in function `Update' 
PitBull4-v4.0.0-beta5\UnitFrame.lua:662: in function `UpdateGUID' 
PitBull4-v4.0.0-beta5\Main.lua:1330: in function `CheckGUIDForUnitID' 
PitBull4-v4.0.0-beta5\Main.lua:1341: in function `?' 
CallbackHandler-1.0-3:146: in function <non> 
<string>:"safecall Dispatcher[1]":4: in function <string> 
<in>: ? 
<string>:"safecall Dispatcher[1]":13: in function `?' 
CallbackHandler-1.0-3:91: in function `Fire' 
AceEvent-3.0-3 (Bagnon):119: in function <ace> 
<in>: in function `TargetUnit' 
Interface\FrameXML\SecureTemplates.lua:379: in function `handler': 
Interface\FrameXML\SecureTemplates.lua:487: in function `SecureActionButton_OnClick': 
Interface\FrameXML\SecureTemplates.lua:528: in function <Interface>:
EDIT: Problem is solved if the LibRange is copied into the Libs Folder of PB4 and one includes the lib manually by editing the libs.xml. Not very comfortable but it works..

Last edited by Fanto : 09/17/09 at 11:41 AM.
 
User is offline.
Reply With Quote
Old 10/15/09, 11:51 AM   #178
mareri
Glass Joe
 
Night Elf Druid
 
Sargeras
Druid Hot Text

I was hoping someone would be able to help me. This is what I'm trying to do.

Show a countdown of each of the hot spells that I cast on a unit. The countdown should be in a specific color to indicate which spell it is.

I know very little about LUA and have attempted to get something working by looking at examples in this forum and other forums. Below are my attempts. They either show an error or the duration doesn't display correctly and doesn't count down. I've only coded my examples for rejuvenation until I know that spell is working. I add the text to LUA text for pitbull; I don't change any other settings except for I set the event to UNIT_AURA. Is there anything other event I should use? Anything else I need to do to make sure it works correctly? What is the best way to code what I want to do? Where am I going wrong in my examples?

Thank you so much for your time and help!

Attempt #1 (would have to update all the spells to be like rejuvenation)
local text = ""
Outline()

 local name,_,icon,_,_,_,expires,caster = UnitAura(unit,"Rejuvination")
 if name == "Rejuvination" and caster == "player" then
  UpdateIn(.1)
  local rem = GetTime() - expires
  text = text .. format("|cffff0000%s|r[%d]", rem)
 end
 
if UnitAura(unit, "Regrowth") ~= nil then
text = text .. format("|cff00ff00%s|r","R")
end

if UnitAura(unit, "Wild Growth") ~= nil then
text = text .. format("|cffffff00%s|r","WG")
end

if UnitAura(unit, "Lifebloom") ~= nil then
_,_,_,count = UnitAura(unit, "Lifebloom")
text = text .. format("|cffffff00%s|r[%d]","LB",count)
end

return text
Attempt #2 (would have to create an elseif for each spell)
 local text = ""
 local i = 1
while true do
 local name,_,icon,_,_,_,expires,caster = UnitAura(unit,i,"HELPFUL")
 if not name then
   break
 elseif name == "Rejuvination" and caster == "player" then
  UpdateIn(.1)
  local rem = GetTime() - expires
  text = text .. format("|cffff0000%s|r[%d]", rem)
  break
 end
 i=i+1
end
 
User is offline.
Reply With Quote
Old 10/15/09, 1:21 PM   #179
ShadowEric
Piston Honda
 
Human Rogue
 
Terenas
I can't help you much because I'm not home right now, but you've misspelled RejuvEnation (look at the letter I've capitalized).
 
User is offline.
Reply With Quote
Old 10/23/09, 3:00 AM   #180
Katassta
Glass Joe
 
Draenei Hunter
 
Blackhand
Originally Posted by Fanto View Post
Has anyone got this code to work with the new version of PB (>beta5)? I just updated PB, so I think no other addon may cause the following error (librangecheck-2-0 is located in the Interface folder) :

.......

EDIT: Problem is solved if the LibRange is copied into the Libs Folder of PB4 and one includes the lib manually by editing the libs.xml. Not very comfortable but it works..
Is there a way to get the range check to work without changing the PB4 libs.xml?

I don't like having to fix it every time I update the addon.
 
User is offline.
Reply With Quote
Old 10/27/09, 8:41 AM   #181
Fanto
Glass Joe
 
Dwarf Paladin
 
Thrall (EU)
Originally Posted by Katassta View Post
Is there a way to get the range check to work without changing the PB4 libs.xml?

I don't like having to fix it every time I update the addon.
Another solution was posted a couple of weeks ago in the WowAce Forums - View Single Post - LuaTexts Official Thread
 
User is offline.
Reply With Quote
Old 11/04/09, 6:51 PM   #182
Ich
Glass Joe
 
Night Elf Hunter
 
Laughing Skull
I am in need of some assistance. Im using pitbull 4 with the targets cast bars enabled. I want the Lua:Class to be located on the cast bar, but I want the class text to disappear when the target begins to cast and reappear when they are finished casting/its interrupted. Ive looked in alot of places to no avail. Could anyone point me in the right direction? Thanks

Edit: Nvm I got it
I added in this little bit of code to the Lua:Class code sequence:

local casting = CastData(unit)
if casting then
return
else
//random stuff involving class info
end

Last edited by Ich : 11/04/09 at 7:05 PM.
 
User is offline.
Reply With Quote
Old Yesterday, 7:09 PM   #183
Eurytos
Von Kaiser
 
Eurytos's Avatar
 
Orc Hunter
 
Zul'Jin
Wow... I am so lost with this new syntax. Here's what I want to do for my target's power text in a nutshell:

If unit isNPC then
threatpercent
else
currentPower "/" maxPower
end

Can anyone help me out with this?
 
User is offline.
Reply With Quote
Reply

Go Back   Elitist Jerks > Public Discussion > User Interface and AddOns

Thread Tools


Similar Threads
Thread Thread Starter Forum Replies Last Post
The DogTags 3.0 Thread Trouble User Interface and AddOns 622 10/06/09 3:51 PM
[DogTags] - Share yours! Fulnir User Interface and AddOns 164 03/30/08 2:30 AM