Jump to content

购买东西的代码是什么?


woshiyizhiyuhahahaha
 Share

Recommended Posts

if you want to buy a item that has a buy of more then 1 like "Buy 5 per click" but you only want a number of them (like 3) i wrote this function, i know it looks like crap, it kinda is but it works.

enjoy . 

 public static void BuyItem(String ItemName, Int32 quantity)
    {
        Memory.WowMemory.LockFrame();
        try
        {
            var MerchantItemSlot = Lua.LuaDoString<Int32>(@"for i=1, GetMerchantNumItems() do
                                                                    local name = GetMerchantItemInfo(i);
                                                                    if name and string.find(name, '" + ItemName + "') then " +
                                                                   "return i; " +
                                                                "end " +
                                                            "end " +
                                                            "return 0;");
            if (MerchantItemSlot > 0)
            {
                Lua.LuaDoString("OpenStackSplitFrame(" + MerchantItemSlot + ", MerchantItem" + MerchantItemSlot + "ItemButton, 'BOTTOMLEFT', 'TOPLEFT') " +
                                "StackSplitText:SetText(" + quantity + "); " +
                                "StackSplitFrame.split = " + quantity + "; " +
                                "StackSplitOkayButton:Click();");
            }
        }
        catch (Exception ex)
        {
            Logging.WriteError(ex.ToString());
        }
        finally
        {
            Memory.WowMemory.UnlockFrame();
        }
    }

 

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

×
×
  • Create New...