What's new
  • Visit Rebornbuddy
  • Visit Resources
  • Visit API Documentation
  • Visit Downloads
  • Visit Portal
  • Visit Panda Profiles
  • Visit LLamamMagic

Position / Float / number comparison

swolbyn

New Member
Joined
Apr 24, 2010
Messages
796
Reaction score
7
How would one accomplish something like this?

Code:
<If condition="Zeta.ZetaDia.Me.Position.Y < 700.00">

or

Code:
<If condition="Zeta.ZetaDia.Me.Position.Y <= 700.00">

i tried both and they result in this (or similar)
Code:
[01:20:12.082 N] Failed to load profile: '<', hexadecimal value 0x3C, is an invalid attribute character. Line 7, position 47.
[01:20:12.523 D] System.Xml.XmlException: '<', hexadecimal value 0x3C, is an invalid attribute character. Line 7, position 47.
   at System.Xml.XmlTextReaderImpl.Throw(Exception e)
   at System.Xml.XmlTextReaderImpl.Throw(String res, String[] args)
   at System.Xml.XmlTextReaderImpl.ParseAttributeValueSlow(Int32 curPos, Char quoteChar, NodeData attr)
   at System.Xml.XmlTextReaderImpl.ParseAttributes()
   at System.Xml.XmlTextReaderImpl.ParseElement()
   at System.Xml.XmlTextReaderImpl.ParseElementContent()
   at System.Xml.XmlTextReaderImpl.Read()
   at System.Xml.Linq.XContainer.ReadContentFrom(XmlReader r, LoadOptions o)
   at System.Xml.Linq.XElement.ReadElementFrom(XmlReader r, LoadOptions o)
   at System.Xml.Linq.XElement.Load(XmlReader reader, LoadOptions options)
   at System.Xml.Linq.XElement.Load(String uri, LoadOptions options)
   at Zeta.CommonBot.Profile.Profile.Load(String path)
   at Zeta.CommonBot.ProfileManager.Load(String profilePath)

does DB have an escape character for the < and > and if so what is it?

or perhaps some sort of comparison helper method?

thanks
 
Last edited:
Did you try html codes instead of the char itself ?
Here is a list HTML Character table

Yeah. tried &lt; and &gt; it doesn't give an exception but it doesnt work either it seems to bug up the profile completely =\ very strange.

i would expect the following code to either 1. town portal 2. leavegame or 3. move a bit away from my current location.
Code:
<Profile> 
    <Name>Test Profile</Name> 
    <GameParams quest="-1" step="1" act="A1" difficulty="Normal" resumeFromSave="False" isPrivate="True" numGames="-1"  /> 
    <KillMonsters>True</KillMonsters> 
    <PickupLoot>True</PickupLoot> 
    <Order>
          <If condition="Zeta.ZetaDia.Me.Position.Y &lt; 700.00">
            <UseTownPortal questId="1" />
            <WaitTimer questId="1" waitTime="5000" />
        </If>
        <If condition="Zeta.ZetaDia.Me.Position.Y &gt; 750.00">
            <LeaveGame reason="Well done! Next run!" />
        </If>
        <MoveTo questId="1" x="299.3334" y="545.4965" z="20.1" pathPrecision="1" />
        <WaitTimer questId="1" waitTime="15000" />
    </Order> 
</Profile>

info tab has my location as
x="315.6539" y="660.9652" z="15.85319"

so if all were well it would town portal.

instead nothing happens. absolutely nothing. it doesnt fall through to the moveto and doesnt enter any of the if's =\
 
Last edited:
use < in .cs
use &lt; &gt; in .xml

.xml always has to be 'escaped'

as far as your issue - i dunno. i haven't had the need to ever use that yet (as I just use Me.IsInTown or not Me.IsInTown if i'm in town or not)
 
use < in .cs
use &lt; &gt; in .xml

.xml always has to be 'escaped'

as far as your issue - i dunno. i haven't had the need to ever use that yet (as I just use Me.IsInTown or not Me.IsInTown if i'm in town or not)

yeah .. unfortunately my latest project is pretty complex and involves knowing where abouts you are in the map. (i also have a further set of tweaks using this for the queen profile that i've been dying to make) i was excited to start on it, going to be fun. If i could do these comparisons it would make my life a TON easier and the code cleaner. I hate the bot doing unessecary walking around just because it's flying blind =\
 
Last edited:
still no response from any devs as to why this appears to be broken in DB?
 
Back
Top