SRL Archive - OSR Script Requests

[Request] A nest finding/looting procedure that could be inserted into any script.


hakishakataki

2014-06-04 09:06:50

Ive got screen shots right here of every possible scenario.
http://imgur.com/a/GhtRQ

-in inventory
-directly below
-nearby
-nearby mouse hover
-nearby mouse right click.

if there is any other information needed just let me know.

EXTRA Info: I plan on inserting this procedure into skinnyn3rd's pro draynor script.

Turpinator

2014-06-04 09:08:55

Does it not have chat text saying that a nest fell from the tree?

IDs would be good too. would be a hell of a lot easier with that than just color.

hakishakataki

2014-06-04 09:40:24

From: Turpinator
Does it not have chat text saying that a nest fell from the tree?

IDs would be good too. would be a hell of a lot easier with that than just color.


I believe it does, however I did not get a screenshot of it when it happened.
For the text locator, the script could just wait for the game to say anything about 'bird's nests' to know when to look for it.

where can i find the ID's?

EDIT: I just found out that when a birds nest falls, it says
"a bird's nest falls out of the tree"
got a screenshot of it http://imgur.com/WZNzko3

As for the nest ID's, I did a little snoopin and found this http://itemdb.biz/index.php?search=nest
Althought I'm not sure which one is the right one or of all of them would work.

Wetish

2014-06-04 11:35:45

It does display a message in the chat box when it drops.
As for the ids, don't they change on every update? It would be far easier to just find the object based on its name.

Brotein

2014-06-04 11:45:16

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;

Awkwardsaw

2014-06-04 12:58:02

Here's a quick searcher I made with the help of ACA:

function NestColorRecord : TAutoColorInfo;
begin
with result do
begin
MinCount := 10;
Color := 613972;
HueMod := 0.05;
SatMod := 0.77;
LumTol := 3;
end;

end;

function LootNest : boolean;
var
i, cts : integer;
atpa : T2DPointArray;
tpa : TPointArray;
tp : Tpoint;
begin
result := true;
if not FindBlackChatMessage('A bird''s nest falls out of the tree.') then
exit;
cts := GetColorToleranceSpeed;
SetColorToleranceSpeed(2);

with NestColorRecord do
begin

SetColorspeed2Modifiers(HueMod, SatMod);
if not FindColorsSpiralTolerance(mscx, mscy, tpa, Color, mscx, mscy, mscx, mscy, LumTol) then //change search box to make sure it covers what ever area you need
begin
result := false;
SetColorToleranceSpeed(cts);
exit; //do some failsafes to make sure you can find it
end;
SetColorToleranceSpeed(cts);
result := length(tpa) < Mincount;

if result then
begin
atpa := TPAtoATPAEx(TPA, 55, 55);

for i := 0 to high(atpa) do
begin
tp := MiddleTPA(atpa[i]);
mmouse(tp.x, tp.y, 3, 3);

if WaitUptext('ird nest', 5000) then
begin
ClickMouse2(true);
exit;
end;
end;

result := false;
end;
end;
end;

hakishakataki

2014-06-05 14:00:14

From: Brotein
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;



From: Awkwardsaw
Here's a quick searcher I made with the help of ACA:

function NestColorRecord : TAutoColorInfo;
begin
with result do
begin
MinCount := 10;
Color := 613972;
HueMod := 0.05;
SatMod := 0.77;
LumTol := 3;
end;

end;

function LootNest : boolean;
var
i, cts : integer;
atpa : T2DPointArray;
tpa : TPointArray;
tp : Tpoint;
begin
result := true;
if not FindBlackChatMessage('A bird''s nest falls out of the tree.') then
exit;
cts := GetColorToleranceSpeed;
SetColorToleranceSpeed(2);

with NestColorRecord do
begin

SetColorspeed2Modifiers(HueMod, SatMod);
if not FindColorsSpiralTolerance(mscx, mscy, tpa, Color, mscx, mscy, mscx, mscy, LumTol) then //change search box to make sure it covers what ever area you need
begin
result := false;
SetColorToleranceSpeed(cts);
exit; //do some failsafes to make sure you can find it
end;
SetColorToleranceSpeed(cts);
result := length(tpa) < Mincount;

if result then
begin
atpa := TPAtoATPAEx(TPA, 55, 55);

for i := 0 to high(atpa) do
begin
tp := MiddleTPA(atpa[i]);
mmouse(tp.x, tp.y, 3, 3);

if WaitUptext('ird nest', 5000) then
begin
ClickMouse2(true);
exit;
end;
end;

result := false;
end;
end;
end;



Thank you both, I will attempt to incorporate it and bring back news of how it went :)