I wrote this for my ivy bot a few months back for RS3. The colors worked for all nests(seeds, eggs, etc). I wrote this with a fixed high camera angle facing the ivy, so take that into mind when looking at the bounds for the box. This is an image of where the nest can fall, I is Ivy, N is a square for a nest, P is player. So change the box to fit around I guess a 3x3 box around the player since you're doing willows.
I I I I I
N P N
N N N
It was called in a loop during the wait for the ivy animation, feel free to edit and adopt it for OSR if you can. Had ran the script for 100 somewhat hours, collected many nests in the process. It might have missed a few but I think it grabbed almost all of them.
// @ Function checkNestChat
// * Searches for red text in chat box on bottom 2 lines, and then check for
// text 'ird' 'est' to see if the bird nest message has appeared, will return
// true if found.
// # Chat color: 255(clRed), Tol: 9, Hue: 0.00, Sat: 5.59, CTS: 2
function checkNestChat : Boolean;
var
x, y : Integer;
RedChatBox : TBox;
begin
printStatus('checkNestChat: Starting...', 1);
RedChatBox := IntToBox(6,547,556,576);
if findColorTolerance(x, y, 255, RedChatBox, 9, colorSetting(2, 0.00, 5.59)) then
Result := chatbox.findTextOnLines(['ird', 'est'], [0..1]);
printStatus('checkNestChat: Returned vale of ' + boolToStr(Result), 3);
end;
// @ Procedure findNest
// * Checks for nest message in chat. If true, checks to see if inventory isn't
// full. If it has room, will search for NestTPA in the adjacent 5 squares
// around player based on NestBox.
// # Nest Color: 2767678, Tol: 15, Hue: 0.36, Sat: 0.77, CTS: 2
procedure findNest;
var
i, x, y : Integer;
NestTPA : TPointArray;
NestATPA : T2DPointArray;
NestBox : TBox;
begin
printStatus('findNest: Starting...', 1);
if checkNestChat then
begin
NestBox := IntToBox(156, 188, 430, 306);
printStatus('Checking to see if inventory has room...', 2);
if tabBackpack.isFull then
begin
printStatus('Inventory full, cant pick up anymore nests!', 2);
exit;
end;
printStatus('Looking for Nest', 2);
if findColorsSpiralTolerance(x, y, NestTPA, 2767678, NestBox, 15, colorSetting(2, 0.36, 0.77)) then
begin
NestATPA := NestTPA.toATPA(30, 30);
NestATPA.sortBySize;
if DEBUGCOLORS then
begin
smartImage.clear;
smartImage.debugTPA(NestTPA, true);
smartImage.debugATPA(NestATPA);
end;
for i := 0 to high(NestATPA) do
begin
mouse(medianTPA(NestATPA[i]), MOUSE_MOVE, MOUSE_HUMAN);
wait(150 + random(25));
if isMouseOverText(['est']) then
begin
wait(150 + random(50));
fastClick(MOUSE_LEFT);
printStatus('Found Nest!', 2);
wait(500 + random(100));
if DEBUGCOLORS then
smartImage.clear();
tabBackpack.waitForShift(5000);
printStatus('Found new nest in inventory!', 2);
exit;
end;
end;
end
else
printStatus('Nothing found. Exiting findNest...', 2);
end;
printStatus('findNest: Finished!', 3);
end;