• Visit Rebornbuddy
  • Custom Itemfilter - goal of plugin to use animate guardian/weapon

    Discussion in 'Archives' started by WhereIsMyMind, Jan 25, 2015.

    1. WhereIsMyMind

      WhereIsMyMind Member

      Joined:
      Oct 12, 2013
      Messages:
      848
      Likes Received:
      5
      Trophy Points:
      18
      Sup,

      For the lols i'm prepared to bash my head against a plugin for the animate guardian gem.
      for this I need to get the plugin hooked at item pickup time.

      Now I do not want to overwrite the current default itemfilter implementation, I'd wanting a simple standalone evaluation of the times being pickedup and then logic it for animation.

      so.. how do I interface 'at pick' and before stashing?

      wimm
       
    2. Nepthys

      Nepthys Community Developer

      Joined:
      Oct 13, 2014
      Messages:
      89
      Likes Received:
      1
      Trophy Points:
      0
      Heyas,

      there are two loot item tasks. one in a fixed radius near the character, and a second without a distance limit
      to be checking after both, I believe you should insert your task before MergeInventoryTask

      this is checking after the items are picked up, so you may need to cache the inventory from the last time you checked it, so it doesn't constantly see the same item as a new one that was picked up ;)
       
      WhereIsMyMind likes this.
    3. WhereIsMyMind

      WhereIsMyMind Member

      Joined:
      Oct 12, 2013
      Messages:
      848
      Likes Received:
      5
      Trophy Points:
      18
      Nepthys,

      excellent. Now I know which wall to butt.

      wimm
       
    4. alcor75

      alcor75 Community Developer

      Joined:
      Nov 22, 2012
      Messages:
      376
      Likes Received:
      24
      Trophy Points:
      18
      Hi, i was searching the forum for some answer to few problems i have coding my new project, when i spotted this thread that answer all at once, but is to much pseudocode for me (i'm a noob developer learning on the way of fun.)

      Pls, can someone clarify " insert your task before MergeInventoryTask" with a code exemple?

      Also i'm reading right now to learn how to Cache Objects, and i see System.Runtime.Caching support for ObjectCache (got a cuple exemple on stackoverflow.com). I'm i on the right path or should i use a different way to Cache Items while writing my plugins?... is it possible to have 2,3 line of code exemple to get me on the way?

      I can write the logic no problem but i'm still learning coding tools as i encounter them...not really efficient, but actualy working..

      Tnx and really hope to get some help, i'm falling in love with this bot..
       
    5. toNyx

      toNyx Well-Known Member

      Joined:
      Oct 29, 2011
      Messages:
      3,770
      Likes Received:
      35
      Trophy Points:
      48
      Addbefore(yourtask, "MergeInventoryTask")
       
    6. alcor75

      alcor75 Community Developer

      Joined:
      Nov 22, 2012
      Messages:
      376
      Likes Received:
      24
      Trophy Points:
      18
      Tnx friend, really appreciated.
      Pls can you confirm ObjectCache is the way to go, also?

      /hat
       
    7. toNyx

      toNyx Well-Known Member

      Joined:
      Oct 29, 2011
      Messages:
      3,770
      Likes Received:
      35
      Trophy Points:
      48
      Just use local varsn you have a good example in the ExampleRoutine (search bestTarget). And you check things using those cached values.
       
    8. alcor75

      alcor75 Community Developer

      Joined:
      Nov 22, 2012
      Messages:
      376
      Likes Received:
      24
      Trophy Points:
      18
      Tnx again, i see what you mean.
       
    9. WhereIsMyMind

      WhereIsMyMind Member

      Joined:
      Oct 12, 2013
      Messages:
      848
      Likes Received:
      5
      Trophy Points:
      18
      >Addbefore(yourtask, "MergeInventoryTask")
      Should be AddBefore(yourtask, "MergeInventoryTask")

      :p

      I am finally working on this.

      wimm
       

    Share This Page