• Visit Rebornbuddy
  • Visit Panda Profiles
  • Visit LLamamMagic
  • Simulate button clicks on specific GUI elements?

    Discussion in 'Wildbuddy Developers' started by Deathdisguise, Mar 14, 2015.

    1. Deathdisguise

      Deathdisguise Community Developer

      Joined:
      Mar 7, 2015
      Messages:
      678
      Likes Received:
      6
      Trophy Points:
      0
      Anyone able to shed some light/love on the subject? :)
       
    2. Deathdisguise

      Deathdisguise Community Developer

      Joined:
      Mar 7, 2015
      Messages:
      678
      Likes Received:
      6
      Trophy Points:
      0
      Okay! After some in game hunting (urghhh, lua) I've figured out that it's hopefully related to the following class:

      Code:
      public class ConfirmActionButton
      {
          public ConfirmActionButton(string buttonRetrievalLua);
      
          public IntPtr ActionData { get; }
          public bool IsValid { get; }
      
          public void Click();
      
          public enum ConfirmButtonType
          {
              None = 0,
              SendMail = 1,
              CommitTrade = 2,
              DeleteItem = 3,
              SalvageItem = 4,
              EquipItem = 5,
              CraftingAbandon = 6,
              MarketplaceAuctionSellSubmit = 7,
              MarketplaceAuctionBuySubmit = 8,
              MarketplaceCommoditiesSubmit = 9,
              AccountClaimItem = 10,
              AccountTakeItem = 11,
              AccountGiftItem = 12,
              AccountGiftItemReturn = 13,
              CREDDExchangeSubmit = 14,
              AccountCreddRedeem = 15,
              CopyToClipboard = 16,
              MatchingGameRespondToPending = 17,
          }
      }
      So one cookie goes to the winner that can figure out:

      Code:
      string salad = "WHAT GOES HERE LOL";
      
      ConfirmActionButton potato = new ConfirmActionButton(salad);
      potato.Click();
      
      // Attempted strings:
      //
      // string salad = "return Apollo.FindWindowByName('MailForm'):FindChild('CloseButton')"; 
      //     isValid : true, 
      //     ActionData : an actual IntPtr (lol),
      //     Click() : memory error.
      
      
      May the cookie race begin! Srsly, lua? Hate.
       
      Last edited: Mar 16, 2015
    3. Apoc

      Apoc Moderator Staff Member Moderator

      Joined:
      Jan 16, 2010
      Messages:
      2,790
      Likes Received:
      94
      Trophy Points:
      48
      Code:
              public const string GetSendButtonLua =            @"local addon = Apollo.GetAddon('Mail')
      if addon ~= nil then
          local compose = addon.luaComposeMail
          if compose ~= nil then
              return compose.wndSendBtn
          end
      end
      return nil
      ";
      The reason Lua is used, is because we have to pull a specific object out of the Lua "userdata". Carbine basically hard-codes the Lua dependency into certain UI elements, to stop botters. (Which is fine, but fairly trivial to bypass)

      In your specific case, you may want to use the "CurrentMailbox" class.
       
    4. Deathdisguise

      Deathdisguise Community Developer

      Joined:
      Mar 7, 2015
      Messages:
      678
      Likes Received:
      6
      Trophy Points:
      0
      Ah! Yes!

      It was just an example, but I didn't clue in to the part that the lua has an actual ConfirmActionButton class, so my attempts to make it work with 'CloseButton' (a regular Button) was failing gloriously!

      Thanks for the help!

      [​IMG]

      EDIT: LOL that thing is huge without resizing!
       

    Share This Page