Wiki Link: [discussion:58041]
Export upgrade list to use ingame  


Coordinator
Jun 1 at 4:03 AM

I got tired of alt-tabbing after each boss to see if the items dropped are an upgrade so I wrote a short program that opens the upgrade xml file and converts it into a lua saved variable file for LootPlan addon. It's not release quality as it is hardcoded for my case, but I've decided to share the source in case anyone finds it useful. All you need to do is add a reference to Rawr.Base.

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Rawr;
using Rawr.Optimizer;
using System.IO;
using System.Xml.Serialization;

namespace LootPlanImport
{
    [Serializable]
    public class SerializationData
    {
        public string[] CustomSubpoints;
        public List<string> Keys;
        public List<ComparisonCalculationUpgrades[]> ItemCalculations;
    }

    class Program
    {
        static void Main(string[] args)
        {
            string file = @"insert path to your upgrade xml";
            if (args.Length > 0) file = args[0];
            SerializationData data = new SerializationData();
            using (StreamReader reader = new StreamReader(file, Encoding.UTF8))
            {
                XmlSerializer serializer = new XmlSerializer(typeof(SerializationData));
                data = (SerializationData)serializer.Deserialize(reader);
                reader.Close();
            }

            StreamWriter sw = new StreamWriter(@"insert path to LootPlan.lua");

            sw.WriteLine(@"LootPlanDB = {
 [""char""] = {
  [""Kavan - Kilrogg""] = {
   [""lootpercat""] = {
    [5] = {");
            foreach (var list in data.ItemCalculations)
            {
                foreach (var item in list)
                {
                    sw.WriteLine(item.ItemInstance.Id + ",");
                }
            }
            sw.WriteLine(@"    },
   },
   [""itemnotes""] = {");
            foreach (var list in data.ItemCalculations)
            {
                foreach (var item in list)
                {
                    sw.WriteLine(@"[""5:{0}""] = ""{1} Dps"",", item.ItemInstance.Id, item.OverallPoints);
                }
            }
            sw.WriteLine(@"   },
  },
 },
 [""profileKeys""] = {
  [""Kavan - Kilrogg""] = ""Kavan - Kilrogg"",
 },
 [""profiles""] = {
  [""Kavan - Kilrogg""] = {
   [""noteintooltip""] = true,
  },
 },
}");
            sw.Close();
        }
    }
}


Jun 1 at 9:29 PM

Hi Kavan,

This was something i metnioned as a "wishlist" in some other post i wrote a while ago. Unfortunately I simply lack the aptitude to do anything with the code above other that stare and perhaps drool a little. While I completley understand you have your hands full, is there any chance you could create an addon for this or perhaps someone else maybe?

This would be a a HUGE timesaver.


Jun 3 at 4:08 PM

I'm experimenting with this utility and find it very interesting.  First of all because I didn't know there was an addon like LootPlan.

As you note, the character name & realm are hardcoded, if the authors of the Optimizer module could add the characters name and realm to the output of the Build Upgrade List functionality then this could be a real fine utility.

How about it Optimizer authors, can we get the name and realm added to the output file?  

Thanks to all involved.


Coordinator
Jun 3 at 9:35 PM

Well I am the author of the optimizer :) Adding in name and realm is not really a problem, you can just make a form for the user to enter it and select the xml file. The real problem with making it useful for general public is having it work for people that use more than one character. It would have to load existing lua file and just change the part for the character that is being updated. Definitely doable, but I'm not sure that I have time to do it right now.


Jun 4 at 10:13 PM

<<fingers crossed>> I sure hope someone does have the time, i've even looked at how to write addons and to be honest after staring blankly at the guides i've read for 20 minutes i'd still had no clue.


Jun 7 at 11:25 AM

Hi.

In version 0.4.0 of LootPlan I have added functionality to import a list of items formatted like this:

itemID1:note;
itemID2:note;
itemID3:note;

In the in-game interface you can paste such a list and choose which category to add the items to.

So, instead of overwriting the LootPlan savedvariables file, you could try this form of input. This also 'solves' the multiple-character problem.

Arthic


Coordinator
Jun 7 at 8:56 PM

Sounds great, I'll add an export option for upgrade lists that exports in this format.


Coordinator
Jun 7 at 9:34 PM

I've added the export option to the export dropdown in upgrade list. It copies the list to clipboard in the above format. It seem to work ok except for items that haven't been seen yet. When I was setting them in saved variables directly they showed up in the interface fine with icon and information, but with the import it skips them and says item does not exist.


Jun 22 at 8:00 PM
Edited Jun 22 at 8:02 PM

I like the added LootPlan option, but could you make it to add the notes such as "Drops from Razorscale in Heroic Ulduar" instead of the "Upgrade Score" which would provide more useful information. Example:

45150:(235.06) Drops from Razorscale in Heroic Ulduar;
or
45150:[235.06] Drops from Razorscale in Heroic Ulduar;
or
45150:235.06 - Drops from Razorscale in Heroic Ulduar;

Also trunicate the Rawr Upgrade Score to the nearest 100ths would be nice... I am not sure of acceptable characters for LootPlan, but to have the Rawr Upgrade Score incased in parentheses or brackets or even fallowed by a hyphen would just make it look nice...


Jul 4 at 3:56 PM

Has there been any further work on this? or is it compelteld or shelved or what?

 

 


Jul 4 at 7:55 PM

For now I have created a Access Database that I import the Rawr Upgrade List into then export a text file with my above information, and it works very well in helping me to both find and track my desired upgrades...

I would still like to see it as a defualt format, due to the fact that for now, I am the only one that I know that has it in this format, and I consider it an advantage over everyone else and would just like to level the playing fields...

Not to mention, not everyone owns Microsoft Office, or has access to it...


Coordinator
Jul 4 at 9:29 PM

Why exactly do you need information about where it drops to be exported from Rawr? That information is already shown in LootPlan if you have LibPeriodicTable.


Jul 4 at 11:41 PM

could the export to lootplan option be added elsewhere to?

 

for example to the post-optimisation screens? (is it posible to export gem/enchant optimiseation with it?)


Jul 5 at 6:07 AM

Hello all,

I must be missing something.

I have been using rawr for a while now and am familiar with the program, am currently running 2.2.9.

Loaded my toon from a character profile, ran an optimization, made an upgrade list  and tried to export it to lootplan (got it installed and working in wow).

Doesn't seem to do anything.

 

Any thoughts?

 


Coordinator
Jul 5 at 7:15 AM

When you click on export to LootPlan it will copy the data to the clipboard. You should paste that data in the LootPlan import dialog.


Jul 5 at 7:54 AM

Ah thanks I will try that.


Jul 5 at 4:53 PM

I will add the LibPeriodicTable and give that a try too. I actually know where the items are, but just thought it would be more useful to have it in the information section that Rawr exports already...

 


Updating...
© 2006-2009 Microsoft | About CodePlex | Privacy Statement | Terms of Use | Code of Conduct | Advertise With Us | Version 2009.10.27.15987