Advertisement
Guest User

Untitled

a guest
Mar 30th, 2020
113
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 4.00 KB | None | 0 0
  1. Message: [string "--[==[ Error in 'Herb/Ore TSU' ]==] return ..."]:115: attempt to index global 'TSM_API' (a nil value)
  2. Time: Mon Mar 30 21:35:19 2020
  3. Count: 4
  4. Stack: [string "--[==[ Error in 'Herb/Ore TSU' ]==] return ..."]:115: attempt to index global 'TSM_API' (a nil value)
  5. [string "--[==[ Error in 'Herb/Ore TSU' ]==] return function(allstates, event, prefix, text, channel, sender, target, zoneChannelID, localID, name, instanceID)
  6. function addComas(str)
  7. return #str % 3 == 0 and str:reverse():gsub("(%d%d%d)", "%1,"):reverse():sub(2) or str:reverse():gsub("(%d%d%d)", "%1,"):reverse()
  8. end
  9.  
  10. if event == "CHAT_MSG_ADDON" and prefix == "MBG" then
  11. local length = 0
  12. local globalPrice = 0
  13. local globalCounts = ""
  14. local globalTotal = 0
  15.  
  16. if text == "reset" then
  17. local SenderExists = false
  18. local index
  19. for i, s in ipairs(aura_env.sender) do
  20. if s == sender then
  21. SenderExists = true
  22. index = i
  23. end
  24. end
  25. for itemID, data in pairs(aura_env.count) do
  26. if aura_env.count[itemID][index] then
  27. aura_env.count[itemID][index] = 0
  28. end
  29. end
  30. else
  31. str = " "..text.."\n"
  32. str = str:gsub("%s(%S-)=","\n%1=")
  33. for itemID, value in string.gmatch(str, "(%S-)=(.-)\n") do
  34. local SenderExists = false
  35. local index
  36. for i, s in ipairs(aura_env.sender) do
  37. if s == sender then
  38. SenderExists = true
  39. index = i
  40. end
  41. end
  42. if not SenderExists then
  43. table.insert(aura_env.sender, sender)
  44. index = table.getn(aura_env.sender)
  45. end
  46.  
  47. if aura_env.count[itemID] then
  48. aura_env.count[itemID][index] = value
  49. else
  50. aura_env.count[itemID] = {}
  51. aura_env.count[itemID][index] = value
  52. end
  53. if string.len(tostring(value))+1 > length then
  54. length = string.len(tostring(value))+1
  55. end
  56. end
  57. if length == 0 then
  58. length = 4
  59. end
  60.  
  61. local playerTotals = {}
  62. for i=1, table.getn(aura_env.sender) do
  63. local playerTotal = 0
  64. for itemID, data in pairs(aura_env.count) do
  65. if not data[i] then
  66. data[i] = 0
  67. end
  68. playerTotal = playerTotal + data[i]
  69. end
  70. if string.len(tostring(playerTotal))+1 > length then
  71. length = string.len(tostring(playerTotal))+1
  72. end
  73. playerTotals[i] = playerTotal
  74. globalTotal = globalTotal + playerTotal
  75. end
  76. for i,t in ipairs(playerTotals) do
  77. globalCounts = globalCounts..string.format("%-"..length.."s",t)
  78. end
  79. end
  80. if length == 0 then
  81. length = 4
  82. end
  83. for itemID, data in pairs(aura_env.count) do
  84. if aura_env.IDsArray[itemID] then
  85. local counts = ""
  86. local total = 0
  87. for i,v in ipairs(data) do
  88. counts = counts..string.format("%-"..length.."s",v)
  89. total = total + v
  90. end
  91.  
  92. local TSM = ""
  93. if aura_env.config["TSM"] == 1 then
  94. TSM = "DBMarket"
  95. elseif aura_env.config["TSM"] == 2 then
  96. TSM = "DBMinBuyout"
  97. elseif aura_env.config["TSM"] == 3 then
  98. TSM = "DBHistorical"
  99. elseif aura_env.config["TSM"]
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement