Sorry for the noob questions, but im hoping to get some help with two questions, as im totally new to this.
First im trying to get a log printout of the closest enemies but the code i found gives me errors:
this gives me:
[23:42:02.574 N] Compiler Error: c:\Users\owner\Downloads\rebornbuddy\Plugins\GStealth\GStealth.cs(108,1) : error CS0122: 'System.Diagnostics.Log' is inaccessible due to its protection level
Currious how I can get this to work
Next im trying to detect enemies close by and if there are any, to cast stealth
this compiles but doesnt actually do anything. Which is why im trying to get a log readout via the first code. And lastly, dumb question, is there any to force rebornbuddy to recompile the plugins without having to close and reopen RB?
Thanks!
First im trying to get a log printout of the closest enemies but the code i found gives me errors:
Code:
ClearLog();
foreach(var x in GameObjectManager.GameObjects.OrderBy(r=>r.Distance()))
{
Log("Name:{0} Visible:{1} Type:{2} Distance:{3} ObjectType:{4} ObjectID:{5}",x,x.IsVisible,x.Type,x.Distance(),x.GetType(),x.ObjectId);
}
[23:42:02.574 N] Compiler Error: c:\Users\owner\Downloads\rebornbuddy\Plugins\GStealth\GStealth.cs(108,1) : error CS0122: 'System.Diagnostics.Log' is inaccessible due to its protection level
Currious how I can get this to work
Next im trying to detect enemies close by and if there are any, to cast stealth
Code:
target =(from unit in GameObjectManager.GetObjectsOfType<BattleCharacter>()
where unit.Type == GameObjectType.BattleNpc
where unit.Location.Distance(Core.Player.Location) < 30
where unit.CanAttack
where unit.IsVisible
orderby unit.Distance(Core.Player.Location) ascending
select unit).FirstOrDefault();
if (target != null)
{
Spell.Cast("Stealth", r =>!IsStealthed);
}
if (target == null)
{
Spell.Cast("Stealth", r =>IsStealthed);
}
Thanks!