why for i=1,#a do not working ? menu

User Tag List

Results 1 to 6 of 6
  1. #1
    wowmacro's Avatar Member
    Reputation
    7
    Join Date
    Oct 2013
    Posts
    93
    Thanks G/R
    1/1
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    why for i=1,#a do not working ?

    local slowIDs = {
    1715,
    236027,
    12323 ,
    211793 }
    function shouldslow(unit)
    for i=1,#slowIDs do
    local slowdebuff, _, _, _, _, _, slowdebuffExp = UnitDebuff(unit,slowIDs[i])
    if slowdebuff and slowdebuffExp - GetTime() > 2
    and not UnitDebuff(unit,135299)
    then
    return false
    else
    return true
    end
    end
    end


    why it aways return true...
    Last edited by wowmacro; 06-01-2017 at 06:14 PM.

    why for i=1,#a do not working ?
  2. #2
    ev0's Avatar ★ Elder ★ murlocs.com

    CoreCoins Purchaser Authenticator enabled
    Reputation
    1850
    Join Date
    Jul 2012
    Posts
    2,737
    Thanks G/R
    313/377
    Trade Feedback
    16 (100%)
    Mentioned
    7 Post(s)
    Tagged
    7 Thread(s)
    Code:
    function isSlowed()
      local slow={
        6343,
        183218,
        205273,
        204242,
        5116,
        194279,
      }
      for i=1,#slow do
        if(UnitBuff("target",slow[i])) then
          return true
        end
      end
    end
    It should work? what errors do you get?
    Need a guild in the US? Visit murlocs.com

  3. Thanks bynike (1 members gave Thanks to ev0 for this useful post)
  4. #3
    wowmacro's Avatar Member
    Reputation
    7
    Join Date
    Oct 2013
    Posts
    93
    Thanks G/R
    1/1
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    function isSlowed()
    local slow={
    6343,
    183218,
    205273,
    204242,
    5116,
    194279,
    }
    for i=1,#slow do
    if(UnitBuff("target",slow[i])) then
    return true
    end
    end
    end

    test with my pally. /run if isSlowed() == true then print("1") end

    no error. but it will not return true...and I changed the lua. it aways return true.
    Last edited by wowmacro; 06-02-2017 at 02:36 AM.

  5. #4
    ev0's Avatar ★ Elder ★ murlocs.com

    CoreCoins Purchaser Authenticator enabled
    Reputation
    1850
    Join Date
    Jul 2012
    Posts
    2,737
    Thanks G/R
    313/377
    Trade Feedback
    16 (100%)
    Mentioned
    7 Post(s)
    Tagged
    7 Thread(s)
    Originally Posted by wowmacro View Post
    function isSlowed()
    local slow={
    6343,
    183218,
    205273,
    204242,
    5116,
    194279,
    }
    for i=1,#slow do
    if(UnitBuff("target",slow[i])) then
    return true
    end
    end
    end

    test with my pally. /run if isSlowed() == true then print("1") end

    no error. but it will not return true...and I changed the lua. it aways return true.
    let's throw a few more checks/boolean in there. I'll work on this tonight with you (shoot me a PM on discord - Discord)
    Need a guild in the US? Visit murlocs.com

  6. #5
    wowmacro's Avatar Member
    Reputation
    7
    Join Date
    Oct 2013
    Posts
    93
    Thanks G/R
    1/1
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    not idea why i cant pm u
    but I fix this lua with the following way..

    for i=1,40 do local debuffid = select(11,UnitDebuff(unit,i))
    for k=1,#slow do
    if debuffid == slow[k]
    then
    XXXXXXXXX
    end
    end
    end

    but the old Lua was working in WOD 6.x

  7. #6
    ChrisIsMe's Avatar Contributor
    Reputation
    164
    Join Date
    Apr 2017
    Posts
    210
    Thanks G/R
    67/100
    Trade Feedback
    0 (0%)
    Mentioned
    3 Post(s)
    Tagged
    0 Thread(s)
    Originally Posted by wowmacro View Post
    local slowIDs = {
    1715,
    236027,
    12323 ,
    211793 }
    function shouldslow(unit)
    for i=1,#slowIDs do
    local slowdebuff, _, _, _, _, _, slowdebuffExp = UnitDebuff(unit,slowIDs[i])
    if slowdebuff and slowdebuffExp - GetTime() > 2
    and not UnitDebuff(unit,135299)
    then
    return false
    else
    return true
    end
    end
    end


    why it aways return true...
    # will use the index given so the first one is 6343 if you wanted to truly use the # you'd have to write it like this

    local slow = { [1] = 6343, [2] = 183218,}

    so on so forth.

Similar Threads

  1. PQR for Wrath not working on certain Molten WoW Realm why?
    By DragonfireEX402 in forum WoW Bots Questions & Requests
    Replies: 4
    Last Post: 02-26-2015, 11:54 AM
  2. Data Patches not working for ya?!
    By Jaguar in forum WoW ME Tools & Guides
    Replies: 22
    Last Post: 09-09-2008, 04:29 PM
  3. Skins not working for me HALP!
    By zerolimite in forum WoW ME Questions and Requests
    Replies: 0
    Last Post: 05-17-2008, 04:07 PM
  4. Why is my shoutbawx not working?
    By Pyr0 in forum Community Chat
    Replies: 1
    Last Post: 01-31-2008, 01:02 PM
  5. [ Q ] Model Edit Fix not working for 2.2.3
    By treyska in forum WoW ME Questions and Requests
    Replies: 15
    Last Post: 11-03-2007, 11:02 AM
All times are GMT -5. The time now is 11:13 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