Trouble with lua code menu

Shout-Out

User Tag List

Results 1 to 3 of 3
  1. #1
    CrazyCactuaR's Avatar Contributor
    Reputation
    84
    Join Date
    Sep 2008
    Posts
    201
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Trouble with lua code

    Any lua coders mind giving me a hand in fixing this code i've written, doesn't seem to work. It's for use on a paladin.

    Code:
    cast=CastSpellByName
    i=1
    while(i<=40) do a={UnitDebuff("player",i)} 
    	if a[5]=="Poison" or a[5]=="Disease" then cast("Cleanse") break end 
    	i=i+1 
    end
    The problem i'm having with this is that it doesnt seem to work on Disease's, and is very selective about poisons?

    Thanks to all who help out
    Last edited by CrazyCactuaR; 08-06-2011 at 11:56 AM.

    Trouble with lua code
  2. #2
    Ultraviolence's Avatar Active Member
    Reputation
    15
    Join Date
    Aug 2008
    Posts
    102
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    This seems to work fine:
    Code:
    cast=CastSpellByName;
    for i=1,40 do
    local a={UnitDebuff("player",i)};
    	if (a[5]=="Poison" or a[5]=="Disease") then
    		cast("Cleanse")
    	end
    end
    You could always just rip the cleanse code from one of the holy paladin scripts around here if you want to cleanse your entire group. About it being "selective", isn't it suppose to be random like that?

  3. #3
    CrazyCactuaR's Avatar Contributor
    Reputation
    84
    Join Date
    Sep 2008
    Posts
    201
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Originally Posted by Ultraviolence View Post
    This seems to work fine:
    Code:
    cast=CastSpellByName;
    for i=1,40 do
    local a={UnitDebuff("player",i)};
    	if (a[5]=="Poison" or a[5]=="Disease") then
    		cast("Cleanse")
    	end
    end
    You could always just rip the cleanse code from one of the holy paladin scripts around here if you want to cleanse your entire group. About it being "selective", isn't it suppose to be random like that?
    It was against certain mobs it wouldnt cleanse the disease and such, but yeah works fine. Must have been one of those silly things.

Similar Threads

  1. [Request] Help with lua code (Glyph of Fetch)
    By dehahn in forum PE Support forum
    Replies: 2
    Last Post: 11-20-2014, 10:02 AM
  2. Need help with a piece of lua code for an addon.
    By gezus in forum Programming
    Replies: 2
    Last Post: 04-26-2014, 01:02 PM
  3. [Lua] Problem with my lua code
    By ariax1 in forum WoW EMU Questions & Requests
    Replies: 7
    Last Post: 09-26-2008, 02:45 AM
  4. [Lua] Got a problem with my Lua code.
    By sammiboy in forum WoW EMU Questions & Requests
    Replies: 2
    Last Post: 09-25-2008, 09:04 AM
  5. I'm having trouble with lua and cant same to fix it.
    By Bapes in forum World of Warcraft Emulator Servers
    Replies: 6
    Last Post: 04-06-2008, 05:29 PM
All times are GMT -5. The time now is 10:50 AM. Powered by vBulletin® Version 4.2.3
Copyright © 2025 vBulletin Solutions, Inc. All rights reserved. User Alert System provided by Advanced User Tagging (Pro) - vBulletin Mods & Addons Copyright © 2025 DragonByte Technologies Ltd.
Google Authenticator verification provided by Two-Factor Authentication (Free) - vBulletin Mods & Addons Copyright © 2025 DragonByte Technologies Ltd.
Digital Point modules: Sphinx-based search