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!

How to change LogLevel in XML profile?

CoreFun

Member
Joined
Jul 14, 2012
Messages
83
File .\Quest Behaviors\UserSettings.cs does not contains such parameter.
How can I set LogLevel in my XML profiles? Or how can I set LogLevel=None by default?
Maybe is possible with own custom plugin?
 
You could set it via the GlobalSettings class.
eg:
PHP:
GlobalSettings.Instance.LogLevel = LogLevel.None;
GlobalSettings.Instance.LogLevel = LogLevel.Quiet;
GlobalSettings.Instance.LogLevel = LogLevel.Normal;
GlobalSettings.Instance.LogLevel = LogLevel.Verbose;
GlobalSettings.Instance.LogLevel = LogLevel.Diagnostic;


With the questing botbase, put it into a RunCode.
eg:
PHP:
<CustomBehavior File="RunCode" Code="GlobalSettings.Instance.LogLevel = LogLevel.None;"/>



GlobalSettings
http://docs.honorbuddy.com/html/1bc0be30-d663-9b83-8222-cdd430455af5.htm


CharacterSettings
http://docs.honorbuddy.com/html/861a96a9-d15e-43ee-6f09-9f37d63f5f59.htm
 
Thanks a lot! I did it wrong - was looking for LogLevel in Styx.Common...
Now trying add to profile:
Code:
<CustomBehavior File="RunCode" Code="GlobalSettings.Instance.LogLevel = LogLevel.None;"/>
log says:
[01:37:55.971 D] [UserSettings-v2005(debug)] Applied changes...
LootMobs = True (previous: True; original: True)
PullDistance = 25 (previous: 100; original: 100)
UseFlightPaths = False (previous: True; original: True)
UseRandomMount = True (previous: False; original: False)
Difference from user's original settings...
LogLevel = None (originally: Normal)
PullDistance = 25 (originally: 100)
UseFlightPaths = False (originally: True)
UseRandomMount = True (originally: False)
Log Level still 'Normal'.

Wrote plugin:
Code:
using System;
using Styx.Common;
using Styx.Plugins;
using Styx.Helpers;

namespace Styx
{
	public partial class SetLogLevel : HBPlugin
	{
		public override string Name { get { return "SetLogLevel"; } }
		public override string Author { get { return "CoreFun"; } }
		public override Version Version { get { return new Version(1, 0, 0); } }
		public override bool WantButton { get { return false; } }
		public override string ButtonText { get { return "SetLogLevel"; } }

		public static bool isFirstTime;
		
		public SetLogLevel()
		{
			isFirstTime = false;
		}
		public override void Pulse()
		{
			if (!isFirstTime) {
				GlobalSettings.Instance.LogLevel = LogLevel.None;
				isFirstTime = true;
			}
		}
	}
}
(sorry, I'm noob)

Activating it in profile:
Code:
<QuestOrder>
<CustomBehavior File="EnablePlugin" Names="SetLogLevel" />
<CustomBehavior File="EnablePlugin" Names="HBRelogHelper" />
<CustomBehavior File="EnablePlugin" Names="Refreshment Detection" />
log says:
[01:48:07.240 N] Installed plugins
[01:48:07.240 N] Anti Drown - Disabled
[01:48:07.240 N] BuddyControlPanel - Disabled
[01:48:07.240 N] DrinkPotions - Disabled
[01:48:07.240 N] HBRelogHelper - Enabled
[01:48:07.240 N] Questhelper - ItemForAura - Disabled
[01:48:07.240 N] Refreshment Detection - Enabled
[01:48:07.240 N] SetLogLevel - Disabled
I don't get it :(
 
Last edited:
Profile code isn't read instantaneously.
The bot will still log the information when it first starts because the RunCode hasn't been been reached in the execution order yet.

Once you hit start the bot will initialize all of its hooks, after that it will then read <QuestOrder> in which you should have the RunCode directly underneath.
From that point on, there will be no logging.


Also it says your plugin you made is disabled.
You would have to enable it for your code to actually run. :P
 
Edited:
Everything is fine. Plugin works.

EchoTiger, thank you :)
 
Last edited:
Back
Top