CurseForge Register Sign In

Our first step of the new Authors Portal is Live! Learn more or click here to check it out!

Authors CurseForge

  • Dashboard
  • Forums
  • Paste
  • Knowledge Base
  • Reward Store
Desktop View
  • Home
  • Member List
  • hizuro_de's Profile
  • Send Private Message
  • View hizuro_de's Profile
  • hizuro_de
  • Curse Premium
  • Member for 16 years, 8 months, and 29 days
    Last active Tue, Mar, 21 2023 19:47:14
  • 0 Followers
  • 3 Total Posts
  • 0 Thanks
  • Posts
  • Forum Posts
  • View hizuro_de's Profile

    0

    Jan 27, 2017
    hizuro_de posted a message on Oneliner to extract ONE variable from a function ?

    I prefer another way  for better performance.

    local _ , id = GetActionInfo(1);

    That is better than select() or a selfwritten function with temporary tables.

     

    Greetings Hizuro

    Posted in: Lua Code Discussion
  • View hizuro_de's Profile

    0

    Jan 26, 2017
    hizuro_de posted a message on Oneliner to extract ONE variable from a function ?

    This is true, but it is shorter than with select().

     

    Sometimes you need all dirty tricks to get all necessary elements in a single macro. :)

     

    Greetings Hizuro ^^

    Posted in: Lua Code Discussion
  • View hizuro_de's Profile

    0

    Jan 23, 2017
    hizuro_de posted a message on Oneliner to extract ONE variable from a function ?
    Quote from Forge_User_94148755 >>

    Hi,

    I am wondering if anyone know of one way of getting this code:

    local _,spellid,_ = GetActionInfo(1)

    print(spellid) -- returns 23242

    to say

    print(GetActionInfo(1)[2]) -- should return 23242

     

    The reason is, the first is just more clutter to my addons..

     

    Thanks in advance!

    Forge_User_94148755

    Another way is:

    print( ({ GetActionInfo(1) })[2] )

     

    Greetings Hizuro :)

    Posted in: Lua Code Discussion
  • To post a comment, please login or register a new account.
  • Creators
    • Build an App
    • Publish a mod
    • Why Overwolf
    • App documentation
    • Mod documentation
    • Creator services
    • Apply for funding
  • Gamers
    • Discover Mods
    • Discover Apps
    • Gameplay First
    • Download Overwolf
    • Suggest a feature
  • Company
    • About us
    • Our story
    • Careers
    • Blog
    • Brand Guidelines
  • Work With Us
    • Partners
    • Advertisers
    • Influencers
    • Game Developers
  • Support & Privacy
    • Help Center
    • Supported Games
    • Terms of service
    • Privacy Policy
    • Overwolf Alphas
    • Licenses
Overwolf 2021