I have a little question :
In references of demonbuddy i can see OnItemDropped and OnItemStashed event but i have some trouble with theses functions.
In my plugin i use OnGameJoined, OnEnabled, OnDisabled,OnItemDropped without any problems, but OnItemLooted and OnItemStashed are simply not fired :/, i'm not sure but i think trinity overwrite the drop & stash function of the botbase of demonbuddy so theses events are not fired, do u have inforrmations about that and how catch stashed / Dropped Item managed by trinity ?
Here is my code if u don't understand what i mean ^^
Thanks in advance for any help
In references of demonbuddy i can see OnItemDropped and OnItemStashed event but i have some trouble with theses functions.
In my plugin i use OnGameJoined, OnEnabled, OnDisabled,OnItemDropped without any problems, but OnItemLooted and OnItemStashed are simply not fired :/, i'm not sure but i think trinity overwrite the drop & stash function of the botbase of demonbuddy so theses events are not fired, do u have inforrmations about that and how catch stashed / Dropped Item managed by trinity ?
Here is my code if u don't understand what i mean ^^
Thanks in advance for any help
using System;
using System.ComponentModel;
using System.Reflection;
using System.Windows;
using System.Windows.Controls;
using System.Linq;
using System.Text;
using System.IO;
using System.Globalization;
using System.Threading;
using System.Diagnostics;
using System.Configuration;
using System.Windows.Markup;
using System.Windows.Media;
using System.Windows.Documents;
using Zeta.Common;
using Zeta.Common.Plugins;
using Zeta.Common.Xml;
using Zeta.Bot;
using Zeta.Bot.Profile;
using Zeta.Bot.Profile.Composites;
using Zeta.Game;
using Zeta.Game.Internals.Actors;
using Zeta.Bot.Navigation;
using Zeta.TreeSharp;
using Zeta.XmlEngine;
namespace LootAnnouncer
{
public static class Logger
{
private static readonly log4net.ILog Logging = Zeta.Common.Logger.GetLoggerInstanceForType();
public static void Log(string message, params object[] args)
{
StackFrame frame = new StackFrame(1);
var method = frame.GetMethod();
var type = method.DeclaringType;
Logging.ErrorFormat("[Loot Announcer] " + string.Format(message, args), type.Name);
//Logging.InfoFormat("[Loot Announcer] " + string.Format(message, args), type.Name);
}
public static void Log(string message)
{
Log(message, string.Empty);
}
}
public class LootAnnouncer : IPlugin
{
static readonly string NAME = "Loot Announcer";
static readonly string AUTHOR = "Deadbull";
static readonly Version VERSION = new Version(1, 0, 0);
static readonly string DESCRIPTION = "description";
// Plugin Auth Info
public string Author
{
get
{
return AUTHOR;
}
}
public string Description
{
get
{
return DESCRIPTION;
}
}
public string Name
{
get
{
return NAME;
}
}
public Version Version
{
get
{
return VERSION;
}
}
public Window DisplayWindow { get { return null; } }
///////////////
// DB EVENTS //
public void OnDisabled()
{
GameEvents.OnGameJoined -= GameEvents_OnGameJoined;
GameEvents.OnItemStashed -= GameEvents_OnItemStashed;
GameEvents.OnItemDropped -= GameEvents_OnItemDropped;
GameEvents.OnItemLooted -= GameEvents_OnItemLooted;
}
public void OnEnabled()
{
GameEvents.OnGameJoined += GameEvents_OnGameJoined;
GameEvents.OnItemStashed += GameEvents_OnItemStashed;
GameEvents.OnItemDropped += GameEvents_OnItemDropped;
GameEvents.OnItemLooted += GameEvents_OnItemLooted;
Logger.Log("Enabled");
}
void GameEvents_OnItemDropped(object sender, ItemEventArgs e){
Logger.Log("Item dropped catch"); // Work
}
void GameEvents_OnItemLooted(object sender, ItemLootedEventArgs e){
Logger.Log("Item looted catch"); // Don't work
}
void GameEvents_OnGameJoined(object sender, EventArgs e)
{
Logger.Log("Item drop analysis Start"); // Work
}
void GameEvents_OnItemStashed(object sender, ItemEventArgs e)
{
Logger.Log("Item Stash"); // Don't work
}
public void OnInitialize()
{
}
public void OnShutdown()
{
GameEvents.OnGameJoined -= GameEvents_OnGameJoined;
GameEvents.OnItemStashed -= GameEvents_OnItemStashed;
GameEvents.OnItemDropped -= GameEvents_OnItemDropped;
GameEvents.OnItemLooted -= GameEvents_OnItemLooted;
}
public void OnPulse()
{
}
public bool Equals(IPlugin other)
{
return Name.Equals(other.Name) && Author.Equals(other.Author) && Version.Equals(other.Version);
}
}
}
Last edited: