[PQR] multiple targets in UnitHealth()? menu

User Tag List

Results 1 to 4 of 4
  1. #1
    doguking's Avatar Corporal
    Reputation
    1
    Join Date
    Oct 2013
    Posts
    21
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    [PQR] multiple targets in UnitHealth()?

    Hi guys,

    Would really appreciate some advice from somebody more experienced than myself in LUA...I'm quite sure the UnitHealth() function may only have one unit (eg. "player", "target" etc), but I'm stumped to an alternative for querying the HP of my whole party. I'm going crazy right now D:

    Code:
    for _,k in ipairs(PQ_Party) do
    	local unitHealth = 100 * UnitHealth(k) / UnitHealthMax(k)
    	for _,m in ipairs(PQ_DispelDefensive)
    	if UnitBuffID(k,m)
    		and not LineOfSight(k)
    		and not unitHealth(k) <= 30
    	then
    		SpellStopCasting()
    		CastSpellByID(527,k)
    Sorry for my English, it is not my first language.

    Thanks in anticipation,
    Regards,
    doguking

    [PQR] multiple targets in UnitHealth()?
  2. #2
    ATscripts's Avatar Private
    Reputation
    5
    Join Date
    Jun 2014
    Posts
    7
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Here's very simple example for "multiple" targets.

    for i=1,5 do
    local partyUnit = "party"..i
    if UnitHealth(partyUnit)/UnitHealthMax(partyUnit) < 0.50
    then
    CastSpellByID(0000, partyUnit)
    end
    end

    To explain it simply, it loops script 5 times; first party1, then party2 and so on.

    Example what I use to make healing simplified as hybrid in 3v3 on ele shaman;

    LazyHealUnits = {
    "player",
    "party1",
    "party2",
    "party1pet",
    "party2pet" }

    function LazyHeal()
    for i=1, #LazyHealUnits do
    if UnitHealth(LazyHealUnits[i])/UnitHealthMax(LazyHealUnits[i] ) <= 0.5
    then

    CastSpellByName("Lesser Healing Wave", LazyHealUnits[i])

    print("\124cFF15E61CHealing:", LazyHealUnits[i])
    break
    elseif UnitHealth("player")/UnitHealthMax("player") <= 0.75
    then
    CastSpellByName("Lesser Healing Wave", "player")
    print("\124cFF15E61CHealing:", "SELF")
    end
    end
    end

  3. #3
    doguking's Avatar Corporal
    Reputation
    1
    Join Date
    Oct 2013
    Posts
    21
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Really appreciate the reply, I'm not sure how I'd implement that though as I'm using ipairs() iterators?

    One more question if you don't mind guys, I've written this, and whilst it works great in 3v3, if party1 and/or party2 doesn't exist, it simply won't cast (making it unusable in duels/2s)

    Code:
    for _,d in ipairs(PQ_DispelOffensive) do
    	local playerHealth = UnitHealth("player") / UnitHealthMax("player") * 100
    	local partyoneHealth = UnitHealth("party1") / UnitHealthMax("party1") * 100
    	local partytwoHealth = UnitHealth("party2") / UnitHealthMax("party2") * 100
    	if UnitBuffID(v,d)
    		and not LineOfSight(v)
    		and playerHealth > 50
    		and partyoneHealth > 50
    		and partytwoHealth > 50
    	then
    		SpellStopCasting()
    		CastSpellByID(527,v)
    	end
    end
    Is there any way I can query party1/2 and if it doesn't return true ignore them? Forgive me my programming skills are limited lol.

    Thanks in anticipation once again :>
    Last edited by doguking; 06-27-2014 at 05:30 PM.

  4. #4
    zpzp's Avatar Member
    Reputation
    1
    Join Date
    Jan 2014
    Posts
    1
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    dlqwteardfxcesdzf
    Last edited by zpzp; 07-18-2014 at 02:02 AM.

Similar Threads

  1. [Buying] WTB: Pro PQR PVP only rotations for multiple toons and also Rare mounts
    By dmbfan1717 in forum World of Warcraft Buy Sell Trade
    Replies: 2
    Last Post: 02-08-2013, 09:34 AM
  2. is PQR raid targeting possible?
    By joneskull in forum WoW Bots Questions & Requests
    Replies: 1
    Last Post: 11-17-2012, 03:43 PM
  3. how to always face target? Lazybot + PQR
    By jaeson in forum WoW Bots Questions & Requests
    Replies: 0
    Last Post: 07-23-2012, 04:09 PM
  4. Multiple target tanking
    By Theanimal in forum WoW Instances & Raiding
    Replies: 2
    Last Post: 07-07-2008, 12:16 AM
  5. [Shaman]Earthshield multiple targets
    By Hotan in forum World of Warcraft Exploits
    Replies: 7
    Last Post: 04-14-2007, 06:37 PM
All times are GMT -5. The time now is 02:47 PM. Powered by vBulletin® Version 4.2.3
Copyright © 2024 vBulletin Solutions, Inc. All rights reserved. User Alert System provided by Advanced User Tagging (Pro) - vBulletin Mods & Addons Copyright © 2024 DragonByte Technologies Ltd.
Digital Point modules: Sphinx-based search