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

Chaos Recipes and Filters

tozededao

Community Developer
Joined
Jan 15, 2010
Messages
1,225
Reaction score
5
Hello, basically my suggestion is to make the ChaosChance plugin to work better by stashing only a certain number of items of each type so we can do those recipes.

The easiest way I can see to do this is to have additional filters, and having the plugin to enable and disable filters based on our needs.

Let's see this case for example.



Lets say we have a filter or filters who save the valuable items based on the stats like a good chest piece with life and resists we call it Good Body Armour Filter #1
Beside those filters we would have these:




  • Save any rare Two-Handed
  • Save any rare Helm
  • Save any rare Chest
  • Save any rare Belt
  • Save any rare Gloves
  • Save any rare Boots

Notes : Lets say that amulets and rings are always saved.

At the beginning of the bot session the plugin would try run through your stashtabs and try to pickup items to do a recipe. It would run through all our item types for example Helm. For each rare Helm found on our stash it checks if they DO NOT MATCH any of Good Helms filters.

It would this to all slots and end up with a count of items for each slot. Whenever that count was less than X for non-rings and less than Y for rings it would enable the corresponding filter to pickup those items. Whenever it stashes an item that would match our Save any Slot and didnt match our Good Slot it would increase the counter on that item slot type. When it had enough to match our X or Y it would disable the filter that makes the bot stash all the rare items of a type.
 
this has been requested for a long time, but no one is working on it yet to my knowledge

an alternative to enabling / disabling pickup filters:
if the desired amount of a certain item is met, have it identify any other items of that item type, and leave them in inventory. then if they should be kept (as good stats) or sold will be up to the itemfilter
 
Basically, you need to use a dynamic runtime item filter, rather than the static item filter. The static item filter isn't setup to handle logic; just simple rules. You can try to add logic to a certain degree, but then the task begins getting overly complex. This can be see like so.

For the looting part of that, I go over one implementation idea with the current system here. The Beta just built will contain the actual fix for knowing the id in OnLootEventArgs to fix the issue mentioned in my posted code.

Here's an updated version that shows doing it more generically for any # of items and counts. You'd have to code in file saving/loading for the data you want to track. It's doable though the JsonSettings I think, but I'd have to check what all is needed to serialize the objects correctly. Anyways, it's just an example. You'd just add all the defaults to SetupLootables, and it should work the same way posted in my other reply.

However, that example was for picking up specific items to roll as opposed to use in a recipe, so you'd have to make some changes (such as the Rarity for one, and then rather than use Name you could use Type, in addition to checking Itemlevel). Since that only does looting, you'd now have to work in new systems to tie it together for stashing and selling, since whether you want to keep the item or not, depends on the dynamic condition of how many you know you have in stash.

Attached is an example of a dynamic item filter plugin. It shows a few specific item filters done for Saving.

You'd need to implement your match rules though code, so you could also check at the same time if something should be saved or not based on other data. So basically, your plugin would start by going to stash, and making a list of all the stuff it currently has available. It then needs to expose this data to the MyItemEvaluator class so it can make use of it. When the Match function is called, rather than just checking the item properties itself to see if it should be picked up, stashed, or sold, you'd also check the other current data and modify it accordingly.

To give a non-code example of that, let's say the plugin starts out and says it has 3 unid rare Helms in stash. You want to always keep at least 5. In the ItemEvaluator.EvaluationType.PickUp logic section, you'd check to see if you had an unid rare help that should be picked up first. If so, you then check to see if the current count of helms in stash (3) is more than the amount you want to keep (5). Since that's false, you do want to pickup the item. It should be noted that you will most likely choose to pickup rares regardless to vendor, but you can apply that logic to other things you might not be vendoring, such as skill gems. If you have 4 cleaves in your stash, and you want to have 5, then you'd pickup the first one, but any other ones you'd not.

The same process is then applied for each filter set. Before you Sell, you check your cached data to know if you should be keeping the item or not. If you don't want to keep it, you'd sell it, but if you did, you'd not sell it.

The last thing to be aware of, is how you want to handle data updates. You shouldn't update data in the Match function itself, because it can be called multiple times for the same item. That'd corrupt your tracking state and things would not work as expected. Instead, you'd only want to keep track of items to loot, and then simply re-update the entire stats code whenever you're in town for the first time, before you started to do anything. That avoids the issue of starting to stash, id, or sell too soon, so your task could would have to come before BasicGrindBot's.
 

Attachments

Thanks for all the info, I'll take a look when I have some free time after finals :)
 
Thanks for all the info, I'll take a look when I have some free time after finals :)

Good luck on the finals!

I still would like to swap out the entire item filter system, but I know it's not going to be possible for some time still. Hopefully, I'll be able to get some of this stuff revamped not too long into next year.
 
Back
Top