[LUA] Loop or something else? menu

User Tag List

Results 1 to 2 of 2
  1. #1
    G0tha's Avatar Member
    Reputation
    9
    Join Date
    Jul 2013
    Posts
    76
    Thanks G/R
    4/4
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    [LUA] Loop or something else?

    Code:
    Table = {a,b,c,d,e,f,x} -- Table with tons of elements
    
    if  Table[1] == x 
    and Table[2] == x 
    and Table[3] == x 
    and Table[4] == x 
    and Table[5] == x 
    and Table[6] == x 
    and Table[7] == x 
    then return true end
    Im looking for solution to short this abit since my table is bigger
    Last edited by G0tha; 07-10-2014 at 11:01 AM.

    [LUA] Loop or something else?
  2. #2
    l0l1dk's Avatar Elite User

    Reputation
    499
    Join Date
    Sep 2010
    Posts
    342
    Thanks G/R
    1/6
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Code:
    Table = {a,b,c,d,e,f,x} -- Table with tons of elements
    
    for Key, Value in pairs(Table) do
    	if Value ~= x then
    		return false
    	end
    end
    
    return true

Similar Threads

  1. How to automatically login and select character with Lua or something else?
    By cute_star in forum Elder Scrolls Online General
    Replies: 0
    Last Post: 04-16-2014, 07:32 PM
  2. DC-Loop replaced by something else.
    By LuckLuka in forum World of Warcraft Exploration
    Replies: 2
    Last Post: 09-02-2012, 06:41 AM
  3. Scorch/Icelance > Something else?
    By nonono in forum WoW ME Questions and Requests
    Replies: 1
    Last Post: 06-14-2007, 04:50 PM
  4. [REQUEST] Troll Male to Something else
    By Yum1999 in forum WoW ME Questions and Requests
    Replies: 0
    Last Post: 04-03-2007, 08:22 PM
All times are GMT -5. The time now is 03:54 PM. 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