• Visit Rebornbuddy
  • Visit Panda Profiles
  • Visit LLamamMagic
  • Lua.GetReturnVal<bool> Errors Happens too often.

    Discussion in 'Honorbuddy Forum' started by Killzone667, Sep 5, 2016.

    1. Killzone667

      Killzone667 Community Developer

      Joined:
      Sep 20, 2015
      Messages:
      87
      Likes Received:
      0
      Trophy Points:
      6
      Log("START");
      Log(Lua.GetReturnVal<bool>("return GuildBankFrame:IsVisible()", 0));
      In command line.
      This happens sometimes on like a half of my bots:
      https://puu.sh/r0KZY/712bcbac02.jpg
       
    2. MaiN

      MaiN Moderator Staff Member Moderator Buddy Core Dev

      Joined:
      Jan 15, 2010
      Messages:
      1,017
      Likes Received:
      35
      Trophy Points:
      48
      GuildBankFrame is most likely nil. Try the code directly inside WoW and it should give you an error as well.
      The code should probably look like:
      Code:
      Lua.GetReturnVal<bool>("return GuildBankFrame and GuildBankFrame:IsVisible()", 0);
       
    3. Killzone667

      Killzone667 Community Developer

      Joined:
      Sep 20, 2015
      Messages:
      87
      Likes Received:
      0
      Trophy Points:
      6
    4. andy012345

      andy012345 New Member

      Joined:
      Jan 15, 2010
      Messages:
      21
      Likes Received:
      0
      Trophy Points:
      0
      That's why MaiN's code is correct and yours isn't.

      GuildBankFrame is nil until the guild bank is opened at least once. You need to check for this in your code because calling IsVisible while it's nil will throw a lua error.

      Once the guild bank has been opened and closed it will then be a valid frame with IsVisible as false. Further UI reloads resets it back to nil.
       

    Share This Page