• Visit Rebornbuddy
  • [Solved] Events OnItemStashed / OnItemLooted not fired

    Discussion in 'Community Developer Forum' started by deadbull, Aug 2, 2017.

    1. deadbull

      deadbull New Member

      Joined:
      Sep 6, 2014
      Messages:
      17
      Likes Received:
      1
      Trophy Points:
      3
      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
       
      Last edited: Aug 2, 2017
    2. xzjv

      xzjv Community Developer

      Joined:
      Mar 17, 2014
      Messages:
      1,243
      Likes Received:
      46
      Trophy Points:
      48
      Yes trinity does its own thing.

      ItemEvents.OnItemSalvaged += item => LogItem(ItemAction.Salvaged, item);
      ItemEvents.OnItemStashed += item => LogItem(ItemAction.Stashed, item);
      ItemEvents.OnItemSold += item => LogItem(ItemAction.Sold, item);
      ItemEvents.OnItemIdentified += item => LogItem(ItemAction.PickedUp, item);
      ItemEvents.OnItemDropped += item => LogItem(ItemAction.Dropped, item);

      https://pastebin.com/raw/VLCx8dfZ
       
      deadbull likes this.
    3. deadbull

      deadbull New Member

      Joined:
      Sep 6, 2014
      Messages:
      17
      Likes Received:
      1
      Trophy Points:
      3
      Thanks for ur fast answer !

      I have one last question, after I could manage by myself to finish the plugin, how to integrate trinity references to my project? ( for demonbuddy resources i need to link demonbuddy.exe but for trinity i have no idea :/ )

      EDIT :
      When in my code i have "using Trinity;" at the top of my plugin, Demonbuddy cry and tell : "Namespace Trinity cannot be found", so i think i need to put some files in my plugin folder or whatever for include trinity functions & hooks but don't know what file is it and where i can find it :/.

      Thanks
       
      Last edited: Aug 3, 2017
    4. ski

      ski Well-Known Member

      Joined:
      Feb 12, 2010
      Messages:
      3,720
      Likes Received:
      48
      Trophy Points:
      48
      Your best bet is to pull the entire Trinity project off the SVN, load that up into VS, and then build your plugin. That's what I do for routines so that my references all match, e.g.:

      Code:
      using Trinity.Components.Combat;
      using Trinity.Components.Combat.Resources;
      using Trinity.Framework;
      using Trinity.Framework.Avoidance.Structures;
      using Trinity.Framework.Actors.ActorTypes;
      using Trinity.Framework.Helpers;
      using Trinity.Framework.Objects;
      using Trinity.Framework.Reference;
      using Trinity.UI;
      using Trinity.Settings;
      
       
    5. deadbull

      deadbull New Member

      Joined:
      Sep 6, 2014
      Messages:
      17
      Likes Received:
      1
      Trophy Points:
      3
      Thanks, perfect :)
       

    Share This Page