What's new
  • Visit Rebornbuddy
  • Visit Panda Profiles
  • Visit LLamamMagic
  • Visit Resources
  • Visit Downloads
  • Visit Portal
RebornBuddy Forums

Register a free account today to become a member! Once signed in, you'll be able to participate on this site by adding your own topics and posts, as well as connect with other members through your own private inbox!

Plugin creation questions

tmask

New Member
Joined
Jun 18, 2011
Messages
22
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:
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);
}
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

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);
			}
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!
 
Log is for RebornConsole. To write to the RB log use Logging.Write.

Spell.Cast is a helper function of Magitek. To cast spells in RB check ff14bot.Managers.Actionmanager. That namespace has everything you need. You're also not setting the IsStealthed variable to true or false after casting the spell as far as I can see.
 
Couldn't agree more. I would love to try my hand at making some profiles, but I'm just so confused at where to start lol
 
Couldn't agree more. I would love to try my hand at making some profiles, but I'm just so confused at where to start lol
Having access to the object structure wont really help you there.

https://www.thebuddyforum.com/rebor...m/183675-using-visual-studio-rebornbuddy.html

Setting up the documentation was turning out to be a huge pain in the ass so its not going to happen for a while. (It's not something only I could do either...someone who wants it so badly could take the time todo it, you have the exe and xml that contains everything it uses)
 
Thanks for all the information! I didnt realize you could get all that information through visual studio, thats very handy. Is there a specific function to pause RB activity? Im trying to make a plugin that will stop whatever it is doing if it detects a player in range. Ive tried using Thread.Sleep(); and setting it to wait for say a minute which kind of works, but causes lots of other problems. Im wanting to use it with the Gather and Grinding routines. Is there a way to specifically tell those routines to stop until a condition is met?
 
Thanks for all the information! I didnt realize you could get all that information through visual studio, thats very handy. Is there a specific function to pause RB activity? Im trying to make a plugin that will stop whatever it is doing if it detects a player in range. Ive tried using Thread.Sleep(); and setting it to wait for say a minute which kind of works, but causes lots of other problems. Im wanting to use it with the Gather and Grinding routines. Is there a way to specifically tell those routines to stop until a condition is met?

I haven't messed with plugins in a long time but maybe you could use a composite and return true/runstatus.success?
 
Back
Top