BPAlpha
New Member
- Joined
- Jan 15, 2010
- Messages
- 594
- Reaction score
- 41
Alphawolf wrote me some code for my guildwithdraw plugin but im not sure how to populate the uint lists
some help would be great guys as im completely lost lol (New to c# coding
Heres the code...
i basic want it to drag from a xml i created if true to construct uint list of all items with that class and withdraw them items!!
here are all the files
some help would be great guys as im completely lost lol (New to c# coding

Heres the code...
Code:
public class GuildWithdrawSpike
{
Dictionary<String, List<uint>> map = new Dictionary<string, List<uint>>();
public GuildWithdrawSpike()
{
map.Add("Herbs", new List<uint>());
map.Add("Ores", new List<uint>());
map.Add("Gems", new List<uint>());
map.Add("Inks", new List<uint>());
map.Add("Eternals", new List<uint>());
map.Add("Leather", new List<uint>());
map.Add("Lockboxes", new List<uint>());
}
public List<uint> GetItemsToWithdraw()
{
var doc = XDocument.Load(@"..\..\GuildWithdraw.xml");
List<string> q = doc.Elements("Option")
.Where(x => (bool) x.Attribute("Set"))
.Select(x => (string) x.Attribute("Value"))
.ToList();
List<uint> q2 = map.Where(x => q.Contains(x.Key))
.SelectMany(x => x.Value)
.ToList();
return q2;
}
}
i basic want it to drag from a xml i created if true to construct uint list of all items with that class and withdraw them items!!
here are all the files
Attachments
Last edited: