View Single Post
08-07-17, 06:47 PM   #36
MunkDev
A Scalebane Royal Guard
 
MunkDev's Avatar
AddOn Author - Click to view addons
Join Date: Mar 2015
Posts: 431
I downloaded Bang Bang! just to check it out and the design is simply atrocious. Ever heard of local variables?
Because it's basically 100% spaghetti coded you must be using a ton of memory compared to what you should be using for a mod like this.

Also, why would you put a Sell Junk button in an addon aimed towards recounting your PvP activity?
Lua Code:
  1. -- found in core.lua
  2. function VENDER()
  3.     total = 0
  4.     for bolsos = 0,4 do
  5.         for huecos = 1, GetContainerNumSlots(bolsos) do
  6.             producto = GetContainerItemLink(bolsos, huecos)
  7.                 if producto then
  8.                     _, _, raro, _, _, _, _, _, _, _, precio = GetItemInfo(producto)
  9.                     _, items = GetContainerItemInfo(bolsos, huecos)
  10.                     if raro == 0 and precio ~= 0 then
  11.                         total = total + (precio * items)
  12.                         print("|cff555555Sold "..items.." "..producto.. " |cff555555" .. GetCoinTextureString(precio * items))
  13.                         UseContainerItem(bolsos, huecos)
  14.                     end
  15.                 end
  16.         end
  17.     end
  18.     if total ~= 0 then
  19.         print("|cff555555--")
  20.         print("Total money gained: " .. GetCoinTextureString(total))
  21.     else
  22.         print("|cff555555No grey items to sell.")
  23.     end
  24. end
  25.  
  26. local BotonVender = CreateFrame( "Button" , nil, MerchantFrame, "UIPanelButtonTemplate" )
  27. BotonVender:SetText("Sell Junk")
  28. BotonVender:SetWidth(90)
  29. BotonVender:SetHeight(21)
  30. BotonVender:SetPoint("TopRight", -180, -30 )
  31. BotonVender:RegisterForClicks("AnyUp")
  32. BotonVender:SetScript("Onclick", VENDER)
  33. --
__________________

Last edited by MunkDev : 08-07-17 at 06:56 PM.
  Reply With Quote