[C#] Any good souls want to help troubleshoot? menu

Shout-Out

User Tag List

Results 1 to 3 of 3
  1. #1
    PunkGamer1021's Avatar Member
    Reputation
    -6
    Join Date
    Jan 2008
    Posts
    41
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    [C#] Any good souls want to help troubleshoot?

    Okay, I'm using BlackRain to, well right now to get a list of the surrounding nodes and give their names, locations, and entry #'s.

    Everything works so far, except for the node's name...
    It is supposed to retrieve the name of the node from an XML file.(below) It searches the XML file for an element (Mineral) who's Entry attribute matches the node's entry #.
    Troublesome code:
    Code:
    privatevoid button1_Click(object sender, System.EventArgs e)
    {
    XPathDocument xPathDocument = newXPathDocument("ResourceList.xml");
    XPathNavigator xPathNavigator = xPathDocument.CreateNavigator();
    //Take out exisiting entries
    Objects_lst.Items.Clear();
    foreach (WowObject gather inObjectManager.Objects)
    {
    if (gather.X != 0 && gather.Y != 0 && gather.Z != 0 && gather.Type == 5)
    {
    //string nodeName = (string)xPathNavigator.Evaluate("string(//ResourceList/Mineral[@Entry="+gather.Entry+"]/Name/text())");
    //Hard-coded the value for copper instead...
    //Gets the Name of the mineral/herb from an XML file based on the Entry#
    string nodeName = (string)xPathNavigator.Evaluate("string(//ResourceList/Mineral[@Entry=1731]/Name/text())");
    if (nodeName == null)
    {
    nodeName = "Unknown";//If nothing is there, catch the null value, and stop it from breaking something.
    }
    //Finally, add the Item to the list With the format:( X: -100.9 | Y: 351.379 | Z: 12.48 | Entry: 1731 | Name: Copper Vein )
    Objects_lst.Items.Add(string.Format("X: {0} | Y: {3} | Z: {4} | Entry: {1} | Name: {2}", gather.X,
    gather.Entry, nodeName, gather.Y, gather.Z));
    }
    }
    }
    
    Code:
    <?xmlversion="1.0"encoding="utf-8"?>
    <ResourceListxmlns="http://tempuri.org/XMLSchema.xsd">
    <MineralEntry="1731">
    <Name>Copper Vein</Name>
    <Entry>1731</Entry>
    <MinSkill>1</MinSkill>
    </Mineral>
    <MineralEntry="1732">
    <Name>Tin Vein</Name>
    <Entry>1732</Entry>
    <MinSkill>65</MinSkill>
    </Mineral>
    <MineralEntry="1733">
    <Name>Silver Vein</Name>
    <Entry>1733</Entry>
    <MinSkill>1</MinSkill>
    </Mineral>
    <MineralEntry="1735">
    <Name>Iron Deposit</Name>
    <Entry>1735</Entry>
    <MinSkill>125</MinSkill>
    </Mineral>
    <MineralEntry="1734">
    <Name>Gold Vein</Name>
    <Entry>1734</Entry>
    <MinSkill>175</MinSkill>
    </Mineral>
    <MineralEntry="2040">
    <Name>Mithril Deposit</Name>
    <Entry>2040</Entry>
    <MinSkill>175</MinSkill>
    </Mineral>
    <MineralEntry="2047">
    <Name>Truesilver Deposit</Name>
    <Entry>2047</Entry>
    <MinSkill>205</MinSkill>
    </Mineral>
    <MineralEntry="165658">
    <Name>Dark Iron Deposit</Name>
    <Entry>165658</Entry>
    <MinSkill>230</MinSkill>
    </Mineral>
    <MineralEntry="324">
    <Name>Small Thorium Vein</Name>
    <Entry>324</Entry>
    <MinSkill>320</MinSkill>
    </Mineral>
    
    If nothing else, does anyone have a better way than XML to retrieve the mineral's name? The XPath expression works fine on BIT-101 XPath Query Tool... So I am at a loss as to why it won't work at run-time...

    Any help would be greatly appreciated.
    Last edited by PunkGamer1021; 06-13-2010 at 04:31 PM.

    [C#] Any good souls want to help troubleshoot?
  2. #2
    Rieg's Avatar Member
    Reputation
    1
    Join Date
    Jun 2010
    Posts
    4
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Just a short question... Is the XML-file you posted corrupt??? It seems there are many spaces missing in the xml-snipplet. i will try to code a small program to get the names out of the xml file

  3. #3
    PunkGamer1021's Avatar Member
    Reputation
    -6
    Join Date
    Jan 2008
    Posts
    41
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Wow there are a ton of spaces missing there... not on the actual file though...

    Thank you for post, this has been gnawing at me for the past few days, but I can't see the error...

Similar Threads

  1. Any good suggestions for a newbie priest? pls help~!
    By AmieeLouire in forum Hearthstone: Heroes of Warcraft
    Replies: 1
    Last Post: 11-08-2013, 07:26 AM
  2. [Bot] Lazy Bot Help! - If your ANY good with Lazybot enter.
    By Chloroform in forum World of Warcraft Bots and Programs
    Replies: 1
    Last Post: 07-18-2012, 11:22 PM
  3. [Help] DK Spec any good?
    By jesusisgod in forum World of Warcraft General
    Replies: 1
    Last Post: 01-31-2009, 01:45 PM
  4. Cant find any good Private server guides... HELP!
    By Kasilopana in forum World of Warcraft Emulator Servers
    Replies: 8
    Last Post: 01-09-2008, 08:15 PM
  5. Any know any good Webisght Builder Programs
    By karokekid in forum Community Chat
    Replies: 9
    Last Post: 06-11-2006, 06:15 PM
All times are GMT -5. The time now is 07:01 PM. Powered by vBulletin® Version 4.2.3
Copyright © 2025 vBulletin Solutions, Inc. All rights reserved. User Alert System provided by Advanced User Tagging (Pro) - vBulletin Mods & Addons Copyright © 2025 DragonByte Technologies Ltd.
Google Authenticator verification provided by Two-Factor Authentication (Free) - vBulletin Mods & Addons Copyright © 2025 DragonByte Technologies Ltd.
Digital Point modules: Sphinx-based search