woody34 / L2RBot

Lineage 2 Revolution pixel bot
32 stars 21 forks source link

Feature request: quest to sell items using filter settings when inventory is full during grind #12

Closed rodion-dolin closed 6 years ago

rodion-dolin commented 6 years ago

Hi!

Thanks @woody34 for his work. I have idea of feature, it can be useful to get some more adena and farm A grade items. Main cycle of the algorithm should check if screen have inventory full icon then open inventory and start selling process:

  1. Press bulk sale button,
  2. If there are nothing to sell in the selection window then quest done (bot can do nothing),
  3. Otherwise start selling cycle: 3.1 Tap Sell button, 3.2 Tap Sell button in modal window, 3.3 Tap OK button in modal window, 3.4 Check selection window, if it still open then start next cycle of selling process (goto 3.1). 3.5 If selection window closed then close inventory and goto main cycle.

I don't have experience in C# programming at all, so I'm not sure how long it will take for me to figure out how to implement this feature. So my question is maybe someone want implement this feature?

woody34 commented 6 years ago

Hello @rodion-dolin,

I appreciate the feedback, as of today I am ending support for the project. I have retired from L2R and I am moving on to other projects. I would be happy to give you guidance if you would like to fork the project and add the feature yourself.

You could add a new method to the QuestHelper class to check for this condition. QuestHelper.Start() runs on every quest class. Create new pixel objects to reflect the Color in A(RGB) and a Point that represents the pixel location. I use a 1280x720 Nox screen cap to find the Color and Point data. I typically check for multiple pixels and use a Pixel[]. This is just the way I decided to do it. You can use whichever collection you like. I attempted to create self documenting code in a readable OOP style so you may pick it up quickly.

//Properties.
public Pixel BulkSale = new Pixel 
{
     Point = new Point(x,y),//Pull X and Y point from a screen shot, this is the pixel you want to find.

     Color = Color.FromArgb(255, 0, 0, 0)//1st int is alpha value which will always be 255 followed by RGB.
}

//Method to search for Full, add method to Start().
if(BulkSale.IsPresent(Screen, 3)) //the 3 is a variance threshold, accounts for different GPU. Screen points to the screen source to grab the pixel from.
{
//Click bulksale pixel.
Click(BulkSale.Point.X, BulkSale.Point.Y);//inherited from Quest parent class.

//Perform bulk sale logic.

}

All of the different quest types inherit from the Quest class. It is the basic blueprint used on every quest type, including QuestHelper.