mistahmikey
New Member
- Joined
- Jun 29, 2015
- Messages
- 161
I decided to make an Orderbot profile to grind mobs and spiritbond some gear. In the profile, I included the following tag:
<Grind grindRef="Plasmoids" while="InventoryManager.FilledArmorySlots.Where(bs=>bs.SpiritBond!=100&&bs.Item.Convertible!=0).Count()!=0" />
The idea was to grind until all the spiritbondable armor in my armory was 100% spiritbonded (was using agil to manage the gear swapping automatically).
However, when I run the script, the condition was rejected as having a syntax error at the '>' character; I made sure the syntax was in fact correct by running it in the rebornbuddy console.
So I then decided I would finesse the problem by creating a class to act as a wrapper for the condition. I put the .cs file and the orderbot profile in RebornBuddy\Profiles\mistahmikey. However, it appears that ordinary c# files are not loaded when rebornbuddy starts. So, I changed the .cs file to include a bogus Tag definition, thus:
and the orderbot profile to:
This worked fine when I ran the profile.
So, my questions are:
1) Is the inability to use the anonymous lamba syntax a bug in the ConditionParser? Or must I use a different syntax?
2) Is there a way to inform reborn buddy that I would like it to load a regular c# file (i.e, one that does not contain any botbases, plugins, tags, etc.) so it gets parsed and its contents added to the namespace?
<Grind grindRef="Plasmoids" while="InventoryManager.FilledArmorySlots.Where(bs=>bs.SpiritBond!=100&&bs.Item.Convertible!=0).Count()!=0" />
The idea was to grind until all the spiritbondable armor in my armory was 100% spiritbonded (was using agil to manage the gear swapping automatically).
However, when I run the script, the condition was rejected as having a syntax error at the '>' character; I made sure the syntax was in fact correct by running it in the rebornbuddy console.
So I then decided I would finesse the problem by creating a class to act as a wrapper for the condition. I put the .cs file and the orderbot profile in RebornBuddy\Profiles\mistahmikey. However, it appears that ordinary c# files are not loaded when rebornbuddy starts. So, I changed the .cs file to include a bogus Tag definition, thus:
Code:
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Linq;
using System.Runtime.InteropServices;
using System.Text;
using System.Threading;
using System.Threading.Tasks;
using System.Windows.Forms;
using Clio.Utilities;
using Clio.XmlEngine;
using ff14bot.Behavior;
using ff14bot.Helpers;
using ff14bot.Managers;
using ff14bot.Navigation;
using ff14bot.NeoProfiles;
using ff14bot.RemoteWindows;
using TreeSharp;
using Action = TreeSharp.Action;
namespace ff14bot.NeoProfiles.Tags
{
[XmlElement("DummyTag")]
class DummyTag : TalkToTag
{
protected override Composite CreateBehavior()
{
return null;
}
}
public static class SpiritBond
{
public static bool IsSpiritBondPossible()
{
return InventoryManager.FilledArmorySlots.Where(bs=>bs.SpiritBond!=100&&bs.Item.Convertible!=0).Count()!=0;
}
}
}
and the orderbot profile to:
Code:
<?xml version="1.0" encoding="utf-8"?>
<Profile>
<Name>[O] B Grind</Name>
<KillRadius>100</KillRadius>
<Order>
<If Condition="not IsOnMap(155) and not IsOnMap(395)">
<TeleportTo Name="Camp Dragonhead" AetheryteId="23" />
</If>
<Grind grindRef="Plasmoids" while="ff14bot.NeoProfiles.Tags.SpiritBond.IsSpiritBondPossible()" />
</Order>
<GrindAreas>
<GrindArea name="Plasmoids">
<Hotspots>
<Hotspot Radius="250" XYZ="-703.2631, 253.8442, 515.9333" name="Plasmoids" />
</Hotspots>
<TargetMobs>
<TargetMob Id="46" />
</TargetMobs>
</GrindArea>
</GrindAreas>
</Profile>
This worked fine when I ran the profile.
So, my questions are:
1) Is the inability to use the anonymous lamba syntax a bug in the ConditionParser? Or must I use a different syntax?
2) Is there a way to inform reborn buddy that I would like it to load a regular c# file (i.e, one that does not contain any botbases, plugins, tags, etc.) so it gets parsed and its contents added to the namespace?