lotrointerface.com
Search Downloads

LoTROInterface SVN SortPack

[/] [trunk/] [JackdawPlugins/] [SortPack/] [List.lua] - Blame information for rev 110

Go to most recent revision | Details | Compare with Previous | View Log

Line No. Rev Author Line
1 54 MrJackdaw-1942
ItemCategory={}
2 3 MrJackdaw-1942
 
3 53 MrJackdaw-1942
--Trying to fill the holes in Item Category
4 MrJackdaw-1942
--Revise this when Turbine fix the ItemCategory enumeration.
5 MrJackdaw-1942
ItemCategory[89]="BarterReputation"
6 MrJackdaw-1942
ItemCategory[173]= "Special"
7 MrJackdaw-1942
ItemCategory[177]= "BarterSkirmish"
8 MrJackdaw-1942
ItemCategory[178]= "Barter"
9 MrJackdaw-1942
ItemCategory[179]= "ShieldSpikes"
10 70 MrJackdaw-1942
 
11 53 MrJackdaw-1942
ItemCategory[180]= "OutfitFeet"
12 70 MrJackdaw-1942
ItemCategory[181]= "OutfitShoulder"
13 53 MrJackdaw-1942
ItemCategory[182]= "OutfitUpperbody"
14 MrJackdaw-1942
ItemCategory[183]= "OutfitHead"
15 70 MrJackdaw-1942
ItemCategory[184]= "OutfitGloves"
16 MrJackdaw-1942
 
17 53 MrJackdaw-1942
ItemCategory[186]= "SkillScrolls"
18 MrJackdaw-1942
ItemCategory[187]= "ChampionHorns"
19 MrJackdaw-1942
ItemCategory[188]="CraftOptionalIngredient"
20 MrJackdaw-1942
ItemCategory[189]= "Perks"
21 MrJackdaw-1942
ItemCategory[191]= "TravelAndMaps"
22 3 MrJackdaw-1942
 
23 93 MrJackdaw-1942
ItemCategory[194]="RelicScroll"
24 MrJackdaw-1942
 
25 96 MrJackdaw-1942
ItemCategory[195]="WestfoldMetalworkScroll"
26 MrJackdaw-1942
ItemCategory[196]="WestfoldJewellerScroll"
27 90 MrJackdaw-1942
ItemCategory[197]="WestfoldWoodworkScroll"
28 96 MrJackdaw-1942
ItemCategory[198]="WestfoldWeaponsmithScroll"
29 95 MrJackdaw-1942
ItemCategory[199]="WestfoldTailorScroll"
30 97 MrJackdaw-1942
ItemCategory[201]="WestfoldForesterScroll"
31 94 MrJackdaw-1942
ItemCategory[203]="WestfoldCookScroll"
32 95 MrJackdaw-1942
ItemCategory[204]="WestfoldScholarScroll"
33 90 MrJackdaw-1942
 
34 94 MrJackdaw-1942
 
35 54 MrJackdaw-1942
for i,v in pairs(Turbine.Gameplay.ItemCategory) do ItemCategory[v]=i end
36 3 MrJackdaw-1942
 
37 100 MrJackdaw-1942
if Groups==nil then
38 66 MrJackdaw-1942
        Turbine.Shell.WriteLine("<rgb=#00FF00>SortPack loaded. /Sort to sort the backpack, /SortOption to change the order</rgb>")
39 98 MrJackdaw-1942
 
40 54 MrJackdaw-1942
        CraftScroll={
41 MrJackdaw-1942
        "ApprenticeCookScroll",
42 MrJackdaw-1942
        "ApprenticeFarmerScroll",
43 MrJackdaw-1942
        "ApprenticeForestryScroll",
44 MrJackdaw-1942
        "ApprenticeJewellerScroll",
45 MrJackdaw-1942
        "ApprenticeMetalworkScroll",
46 MrJackdaw-1942
        "ApprenticeProspectingScroll",
47 MrJackdaw-1942
        "ApprenticeScholarScroll",
48 MrJackdaw-1942
        "ApprenticeTailorScroll",
49 MrJackdaw-1942
        "ApprenticeWeaponsmithScroll",
50 MrJackdaw-1942
        "ApprenticeWoodworkScroll",
51 MrJackdaw-1942
        "ArtisanCookScroll",
52 MrJackdaw-1942
        "ArtisanFarmerScroll",
53 MrJackdaw-1942
        "ArtisanForestryScroll",
54 MrJackdaw-1942
        "ArtisanJewellerScroll",
55 MrJackdaw-1942
        "ArtisanMetalworkScroll",
56 MrJackdaw-1942
        "ArtisanProspectingScroll",
57 MrJackdaw-1942
        "ArtisanScholarScroll",
58 MrJackdaw-1942
        "ArtisanTailorScroll",
59 MrJackdaw-1942
        "ArtisanWeaponsmithScroll",
60 MrJackdaw-1942
        "ArtisanWoodworkScroll",
61 MrJackdaw-1942
        "ExpertCookScroll",
62 MrJackdaw-1942
        "ExpertFarmerScroll",
63 MrJackdaw-1942
        "ExpertForestryScroll",
64 MrJackdaw-1942
        "ExpertJewellerScroll",
65 MrJackdaw-1942
        "ExpertMetalworkScroll",
66 MrJackdaw-1942
        "ExpertProspectingScroll",
67 MrJackdaw-1942
        "ExpertScholarScroll",
68 MrJackdaw-1942
        "ExpertTailorScroll",
69 MrJackdaw-1942
        "ExpertWeaponsmithScroll",
70 MrJackdaw-1942
        "ExpertWoodworkScroll",
71 MrJackdaw-1942
        "JourneymanCookScroll",
72 MrJackdaw-1942
        "JourneymanFarmerScroll",
73 MrJackdaw-1942
        "JourneymanForestryScroll",
74 MrJackdaw-1942
        "JourneymanJewellerScroll",
75 MrJackdaw-1942
        "JourneymanMetalworkScroll",
76 MrJackdaw-1942
        "JourneymanProspectingScroll",
77 MrJackdaw-1942
        "JourneymanScholarScroll",
78 MrJackdaw-1942
        "JourneymanTailorScroll",
79 MrJackdaw-1942
        "JourneymanWeaponsmithScroll",
80 MrJackdaw-1942
        "JourneymanWoodworkScroll",
81 MrJackdaw-1942
        "MasterCookScroll",
82 MrJackdaw-1942
        "MasterFarmerScroll",
83 MrJackdaw-1942
        "MasterForestryScroll",
84 MrJackdaw-1942
        "MasterJewellerScroll",
85 MrJackdaw-1942
        "MasterMetalworkScroll",
86 MrJackdaw-1942
        "MasterProspectingScroll",
87 MrJackdaw-1942
        "MasterScholarScroll",
88 MrJackdaw-1942
        "MasterTailorScroll",
89 MrJackdaw-1942
        "MasterWeaponsmithScroll",
90 MrJackdaw-1942
        "MasterWoodworkScroll",
91 MrJackdaw-1942
        "SupremeCookScroll",
92 MrJackdaw-1942
        "SupremeFarmerScroll",
93 MrJackdaw-1942
        "SupremeForestryScroll",
94 MrJackdaw-1942
        "SupremeJewellerScroll",
95 MrJackdaw-1942
        "SupremeMetalworkScroll",
96 MrJackdaw-1942
        "SupremeProspectingScroll",
97 MrJackdaw-1942
        "SupremeScholarScroll",
98 MrJackdaw-1942
        "SupremeTailorScroll",
99 MrJackdaw-1942
        "SupremeWeaponsmithScroll",
100 MrJackdaw-1942
        "SupremeWoodworkScroll"}
101 100 MrJackdaw-1942
        CraftScroll.Name="CraftScroll"
102 MrJackdaw-1942
 
103 54 MrJackdaw-1942
        Tool={
104 MrJackdaw-1942
        "Tool"}
105 100 MrJackdaw-1942
        Tool.Name="Tool"
106 3 MrJackdaw-1942
 
107 54 MrJackdaw-1942
        Weapons={
108 MrJackdaw-1942
        "Axe",
109 MrJackdaw-1942
        "Bow",
110 MrJackdaw-1942
        "Club",
111 MrJackdaw-1942
        "Crossbow",
112 MrJackdaw-1942
        "Dagger",
113 MrJackdaw-1942
        "Book",
114 MrJackdaw-1942
        "Halberd",
115 MrJackdaw-1942
        "Hammer",
116 MrJackdaw-1942
        "Instrument",
117 MrJackdaw-1942
        "Javelin",
118 MrJackdaw-1942
        "Mace",
119 MrJackdaw-1942
        "Minstrel",
120 MrJackdaw-1942
        "Spear",
121 MrJackdaw-1942
        "Shield",
122 MrJackdaw-1942
        "Staff",
123 MrJackdaw-1942
        "Sword",
124 MrJackdaw-1942
        "Thrown",
125 MrJackdaw-1942
        "Weapon"}
126 100 MrJackdaw-1942
        Weapons.Name="Weapons"
127 MrJackdaw-1942
 
128 54 MrJackdaw-1942
        Armor={
129 MrJackdaw-1942
        "Armor",
130 MrJackdaw-1942
        "GuardianBelt",
131 MrJackdaw-1942
        "Back",
132 MrJackdaw-1942
        "Chest",
133 MrJackdaw-1942
        "Clothing",
134 MrJackdaw-1942
        "CosmeticBack",
135 MrJackdaw-1942
        "CosmeticHeld",
136 MrJackdaw-1942
        "Feet",
137 MrJackdaw-1942
        "Hands",
138 MrJackdaw-1942
        "Head",
139 MrJackdaw-1942
        "Jewelry",
140 MrJackdaw-1942
        "Legs",
141 MrJackdaw-1942
        "MinstrelBook",
142 MrJackdaw-1942
        "Shoulders",
143 MrJackdaw-1942
        "OutfitFeet",                                                                   --CUSTOM! Remove when Turbine fix the ItemCategory Enumeration
144 70 MrJackdaw-1942
        "OutfitUpperbody",                                                      --CUSTOM! Remove when Turbine fix the ItemCategory Enumeration
145 MrJackdaw-1942
        "OutfitHead",                                                                   --CUSTOM! Remove when Turbine fix the ItemCategory Enumeration
146 MrJackdaw-1942
        "OutfitShoulder",                                                               --CUSTOM! Remove when Turbine fix the ItemCategory Enumeration
147 MrJackdaw-1942
        "OutfitGloves"                                                                  --CUSTOM! Remove when Turbine fix the ItemCategory Enumeration
148 54 MrJackdaw-1942
        }
149 100 MrJackdaw-1942
        Armor.Name="Armor"
150 MrJackdaw-1942
 
151 54 MrJackdaw-1942
        Dye={
152 MrJackdaw-1942
        "Dye"}
153 100 MrJackdaw-1942
        Dye.Name="Dye"
154 MrJackdaw-1942
 
155 54 MrJackdaw-1942
        Fishing={
156 MrJackdaw-1942
        "Fish",
157 MrJackdaw-1942
        "FishingBait",
158 MrJackdaw-1942
        "FishingOther",
159 MrJackdaw-1942
        "FishingPole"}
160 100 MrJackdaw-1942
        Fishing.Name="Fishing"
161 MrJackdaw-1942
 
162 54 MrJackdaw-1942
        Class={
163 MrJackdaw-1942
        "Runekeeper",
164 MrJackdaw-1942
        "Burglar",
165 MrJackdaw-1942
        "Captain",
166 MrJackdaw-1942
        "Guardian",
167 MrJackdaw-1942
        "Champion",
168 70 MrJackdaw-1942
         "ChampionHorns",                                                       --CUSTOM! Remove when Turbine fix the ItemCategory Enumeration
169 54 MrJackdaw-1942
        "Loremaster",
170 MrJackdaw-1942
        "Hunter",
171 MrJackdaw-1942
        "Warden"}
172 100 MrJackdaw-1942
        Class.Name="Class"
173 MrJackdaw-1942
 
174 54 MrJackdaw-1942
        Food={
175 MrJackdaw-1942
        "Food",
176 MrJackdaw-1942
        "LoremasterFood"}
177 100 MrJackdaw-1942
        Food.Name="Food"
178 MrJackdaw-1942
 
179 54 MrJackdaw-1942
        Decoration={
180 MrJackdaw-1942
        "CeilingDecoration",
181 MrJackdaw-1942
        "Decoration",
182 MrJackdaw-1942
        "FloorDecoration",
183 MrJackdaw-1942
        "FurnitureDecoration",
184 MrJackdaw-1942
        "MusicDecoration",
185 MrJackdaw-1942
        "SpecialDecoration",
186 MrJackdaw-1942
        "Trophy",
187 MrJackdaw-1942
        "TrophyDecoration",
188 MrJackdaw-1942
        "YardDecoration",
189 MrJackdaw-1942
        "WallDecoration",
190 MrJackdaw-1942
        "SurfacePaintDecoration"}
191 100 MrJackdaw-1942
        Decoration.Name="Decoration"
192 MrJackdaw-1942
 
193 54 MrJackdaw-1942
        Legend={
194 MrJackdaw-1942
        "LegendaryWeaponExperience",
195 MrJackdaw-1942
        "LegendaryWeaponIncreaseMaxLevel",
196 MrJackdaw-1942
        "LegendaryWeaponReplaceLegacy",
197 MrJackdaw-1942
        "LegendaryWeaponReset",
198 MrJackdaw-1942
        "LegendaryWeaponUpgradeLegacy"}
199 100 MrJackdaw-1942
        Legend.Name="Legend"
200 MrJackdaw-1942
 
201 54 MrJackdaw-1942
        Potion={
202 MrJackdaw-1942
        "Potion"}
203 100 MrJackdaw-1942
        Potion.Name="Potion"
204 MrJackdaw-1942
 
205 54 MrJackdaw-1942
        Device={
206 MrJackdaw-1942
        "Device"}
207 100 MrJackdaw-1942
        Device.Name="Device"
208 MrJackdaw-1942
 
209 54 MrJackdaw-1942
        Craft={
210 MrJackdaw-1942
        "Component",
211 MrJackdaw-1942
        "Crafting",
212 MrJackdaw-1942
        "Ingredient",
213 MrJackdaw-1942
        "CraftOptionalIngredient"                               --CUSTOM! Remove when Turbine fix the ItemCategory Enumeration
214 MrJackdaw-1942
        }
215 100 MrJackdaw-1942
        Craft.Name="Craft"
216 MrJackdaw-1942
 
217 54 MrJackdaw-1942
        BuffItem={
218 MrJackdaw-1942
        "Scroll",
219 MrJackdaw-1942
        "Trap",
220 MrJackdaw-1942
        "ShieldSpikes",                                                         --CUSTOM! Remove when Turbine fix the ItemCategory Enumeration
221 MrJackdaw-1942
        "Oil"}
222 100 MrJackdaw-1942
        BuffItem.Name="BuffItem"
223 MrJackdaw-1942
 
224 54 MrJackdaw-1942
        Misc={
225 40 Hazado-481
 
226 54 MrJackdaw-1942
        "CraftingTrophy",
227 MrJackdaw-1942
        "Deconstructable",
228 MrJackdaw-1942
        "Effect",
229 MrJackdaw-1942
        "Healing",
230 MrJackdaw-1942
        "Implement",
231 40 Hazado-481
 
232 54 MrJackdaw-1942
        "Key",
233 MrJackdaw-1942
        "KinshipCharter",
234 3 MrJackdaw-1942
 
235 54 MrJackdaw-1942
        "Mounts",
236 MrJackdaw-1942
        "NonInventory",
237 8 Hazado-481
 
238 54 MrJackdaw-1942
        "Orb",
239 MrJackdaw-1942
        "Pennant",
240 MrJackdaw-1942
        "Quest",
241 MrJackdaw-1942
        "Relic",
242 MrJackdaw-1942
        "Resource",
243 3 MrJackdaw-1942
 
244 54 MrJackdaw-1942
        "SpecialTrophy",
245 3 MrJackdaw-1942
 
246 5 MrJackdaw-1942
 
247 54 MrJackdaw-1942
        "Treasure",
248 MrJackdaw-1942
        "Undefined",
249 3 MrJackdaw-1942
 
250 54 MrJackdaw-1942
        "BarterReputation",                                             --CUSTOM! Remove when Turbine fix the ItemCategory Enumeration
251 MrJackdaw-1942
         "Special",                                                                             --CUSTOM! Remove when Turbine fix the ItemCategory Enumeration
252 MrJackdaw-1942
        "BarterSkirmish",                                                       --CUSTOM! Remove when Turbine fix the ItemCategory Enumeration
253 MrJackdaw-1942
         "Barter",                                                                                      --CUSTOM! Remove when Turbine fix the ItemCategory Enumeration
254 MrJackdaw-1942
        "SkillScrolls",                                                                 --CUSTOM! Remove when Turbine fix the ItemCategory Enumeration
255 MrJackdaw-1942
 
256 MrJackdaw-1942
         "Perks",                                                                                       --CUSTOM! Remove when Turbine fix the ItemCategory Enumeration
257 MrJackdaw-1942
         "TravelAndMaps",                                                       --CUSTOM! Remove when Turbine fix the ItemCategory Enumeration
258 MrJackdaw-1942
         "Misc"
259 MrJackdaw-1942
        }
260 100 MrJackdaw-1942
        Misc.Name="Misc"
261 MrJackdaw-1942
 
262 MrJackdaw-1942
        Groups={Tool,Device,Potion,BuffItem,Food,Legend,Weapons,Armor,Class,Craft,Dye,Fishing,Decoration,CraftScroll,Misc}
263 MrJackdaw-1942
 
264 MrJackdaw-1942
end
265 5 MrJackdaw-1942
 
266 110 MrJackdaw-1942
if Groups[0]==nil then Groups[0]={} end
267 MrJackdaw-1942
Groups[0].Name="Empty Slots"
268 MrJackdaw-1942
 
269 100 MrJackdaw-1942
function BuildList()
270 MrJackdaw-1942
        --Builds the list from the groups
271 MrJackdaw-1942
 
272 MrJackdaw-1942
        --Reset First
273 MrJackdaw-1942
        list=nil
274 MrJackdaw-1942
        list={}
275 54 MrJackdaw-1942
 
276 100 MrJackdaw-1942
        --Merge from current groups
277 MrJackdaw-1942
        mergetable(list,Groups)
278 MrJackdaw-1942
 
279 MrJackdaw-1942
        listtonum()
280 105 MrJackdaw-1942
 
281 MrJackdaw-1942
        --Create a new list - this matches itemcategory to group so, ItemGroup["ForestersAxe"]="Tool"
282 MrJackdaw-1942
        ItemGroup={}
283 MrJackdaw-1942
        for i=1,#Groups do
284 MrJackdaw-1942
                for j=1,#Groups[i] do
285 MrJackdaw-1942
                        ItemGroup[Groups[i][j]]=i
286 MrJackdaw-1942
                end
287 MrJackdaw-1942
        end
288 54 MrJackdaw-1942
end
289 MrJackdaw-1942
 
290 53 MrJackdaw-1942
--Now, change the way the table works.
291 MrJackdaw-1942
--This changes the text list to a numbered list. so, for example, value["Tool"] would equal 150 or whatever.
292 54 MrJackdaw-1942
function listtonum()
293 MrJackdaw-1942
        value={}
294 MrJackdaw-1942
        for i,v in pairs(list) do
295 55 MrJackdaw-1942
                value[v]=i                                      --This converts say, list[1]="Geoff" to value[Geoff]=1 Nice huh?
296 54 MrJackdaw-1942
        end
297 MrJackdaw-1942
end
298 8 Hazado-481
 
299 100 MrJackdaw-1942
--Get the list; Pass 1
300 MrJackdaw-1942
        BuildList()
301 70 MrJackdaw-1942
 
302 MrJackdaw-1942
--Repair function if any new item categories have been added
303 100 MrJackdaw-1942
local changed=false
304 70 MrJackdaw-1942
for i,v in pairs(ItemCategory) do
305 MrJackdaw-1942
        if value[ItemCategory[i]]==nil then
306 100 MrJackdaw-1942
                if Unknown==nil then Unknown={} Unknown.Name="Unknown" end
307 MrJackdaw-1942
                changed=true
308 MrJackdaw-1942
                table.insert(Unknown,ItemCategory[i])
309 70 MrJackdaw-1942
                listtonum()
310 MrJackdaw-1942
        end
311 MrJackdaw-1942
end
312 100 MrJackdaw-1942
if changed then Turbine.Shell.WriteLine("Adding missing Categories to the 'Unknown' group ") table.insert(Groups,Unknown) end
313 MrJackdaw-1942
 
314 MrJackdaw-1942
 
315 MrJackdaw-1942
--Get the list; Pass 2 Rebuild the list after now adding the items in the "Unknown" category
316 MrJackdaw-1942
        BuildList()
317 MrJackdaw-1942
 

All times are GMT -5. The time now is 05:48 PM.


Our Network
EQInterface | EQ2Interface | Minion | WoWInterface | ESOUI | LoTROInterface | MMOUI | Swtorui