Auto Repair/Sell Junk
Does automatically repair your items (with personal money) and sells grey items.
Will show the cost and money earned in chat.
|
|
| Quick Facts |
|---|
Does automatically repair your items (with personal money) and sells grey items.
Will show the cost and money earned in chat.
Contains custom functions.
Code has been reviewed and is safe to use, custom functions might affect in-game performance.
{
"m": "d",
"d": {
"outline": "OUTLINE",
"color": [
1,
1,
1,
1
],
"displayText": "Auto Repair",
"shadowYOffset": -1,
"anchorPoint": "CENTER",
"customTextUpdate": "update",
"automaticWidth": "Auto",
"actions": {
"start": [],
"init": [],
"finish": []
},
"triggers": {
"1": {
"trigger": {
"type": "custom",
"custom_type": "event",
"custom_hide": "timed",
"event": "Chat Message",
"subeventPrefix": "SPELL",
"names": [],
"subeventSuffix": "_CAST_START",
"custom": "function()\n local repairAllItems = function()\n local repairAllCost, canRepair = GetRepairAllCost()\n if (canRepair and (repairAllCost > 0)) then\n RepairAllItems()\n print(\"Repaired for\", GetCoinTextureString(repairAllCost))\n end\n end\n \n local getItemPrice = function(link) \n return select(11, GetItemInfo(link))\n end\n \n local getItemQuality = function(link) \n return select(3, GetItemInfo(link))\n end\n \n local isPoorQuality = function(link)\n return getItemQuality(link) == 0\n end\n \n local sellGreyItems = function()\n local totalSold = 0\n local count = 0\n for bag=0,4 do\n for slot=0,GetContainerNumSlots(bag) do\n if (count < 12) then\n local link = GetContainerItemLink(bag, slot)\n if link and isPoorQuality(link) then\n local price = getItemPrice(link)\n if (price > 0) then\n ShowInventorySellCursor()\n UseContainerItem(bag, slot)\n totalSold = totalSold + price\n count = count + 1\n end\n end\n else\n break\n end\n end\n end\n if (totalSold > 0) then\n print(\"Sold\", count, \"grey items for\", GetCoinTextureString(totalSold))\n end\n end\n \n if (not IsShiftKeyDown()) then\n sellGreyItems()\n repairAllItems()\n end\nend",
"spellIds": [],
"unit": "player",
"events": "MERCHANT_SHOW",
"unevent": "auto",
"debuffType": "HELPFUL"
},
"untrigger": []
},
"activeTriggerMode": -10
},
"internalVersion": 44,
"selfPoint": "BOTTOM",
"font": "Friz Quadrata TT",
"height": 12.089,
"load": {
"role": {
"multi": []
},
"talent": {
"multi": []
},
"class": {
"multi": []
},
"spec": {
"multi": []
},
"size": {
"multi": []
}
},
"fontSize": 12,
"shadowXOffset": 1,
"regionType": "text",
"fixedWidth": 200,
"authorOptions": [],
"animation": {
"start": {
"duration_type": "seconds",
"type": "none",
"easeStrength": 3,
"easeType": "none"
},
"main": {
"duration_type": "seconds",
"type": "none",
"easeStrength": 3,
"easeType": "none"
},
"finish": {
"duration_type": "seconds",
"type": "none",
"easeStrength": 3,
"easeType": "none"
}
},
"justify": "LEFT",
"tocversion": 30300,
"id": "AutoRepair",
"xOffset": 0,
"frameStrata": 1,
"width": 74.667,
"config": [],
"uid": "PaQLrqAsosy",
"yOffset": -270,
"wordWrap": "WordWrap",
"shadowColor": [
0,
0,
0,
1
],
"conditions": [],
"information": {
"ignoreOptionsEventErrors": true
},
"anchorFrameType": "SCREEN"
},
"s": "3.2.3",
"v": 1421
}