SRL Archive - Jr. Member General Help and Discussion

How to loot (cowhides)?


Torol

2014-11-28 19:27:17

Actually I find it pretty hard, because the colors usually matches with the bones. I think if the script could remember the position of where the cow were killed, it would be easier, but that would need some nasty coding skills to do (which I don't have). I'm looking for advice for this one! Help me im stuped :D

Lucidity

2014-11-28 19:31:55

Have it look for the color, and if mouse over text isn't pickup cowhides, then rightclick and chooseoption.

Kyle

2014-11-28 19:33:31

From: Torol
Actually I find it pretty hard, because the colors usually matches with the bones. I think if the script could remember the position of where the cow were killed, it would be easier, but that would need some nasty coding skills to do (which I don't have). I'm looking for advice for this one! Help me im stuped :D


Well I'm not sure if you are talking about RS3 or OSR, but for either or what you would try, depending on what shows up on top, bones or cow hide. Just use a CountColor() or make a TPA of the loot on the ground and get the length of it. Then, you should be able to tell by the length, if it is just bones, or bones plus cowhide. From there just mouse over to it and check either by right clicking or by uptext.

Hopefully that helped some, if not, or if you have more questions, just post back!

Hoodz

2014-11-28 19:37:19

Make a tpa for the colors of the cowhides > split them into an atpa of size 60*60 (tile size???)(TPAToATPAEx) (sortfrompoint ?). After that loop through your atpa array and check for the length of atpa[index of loop]. A cow hide should have a higher length than bones. If you want help with this you can add me on skype so we can discuss about this tomorrow

Lipcot

2014-11-28 22:05:19

i started to make a cow killer script once… got bored though! i had everything done, handle door and stuff.. check out if this works:

function lootavailable: boolean;
var
x, y, i : integer;
TPA: TPointArray;
ATPA : T2DPointArray;
begin
if findColorsSpiralTolerance(x, y, TPA, RawMeatColor, mainScreen.getBounds(), RawMeatTol, colorSetting(2, RawMeatHue, RawMeatSat)) then
begin
writeln('there is meat to loot');
result := true;
end else
begin
writeln('No meat to loot');
result := false;
end;
end;

Procedure Loot();
var
x, y, x2, y2, i, x3, y3: integer;
TPA, TPA2, TPA3, TPA4, TPA5: TPointArray;
ATPA, ATPA2, ATPA3, ATPA4: T2DPointArray;
CombatTimer: TTimeMarker;
begin
if not isLoggedIn() then
exit;

//CurrentStatus := ('Status: Looting');
mouseSpeed := 30 + random(10);
CombatTimer.start();
mainScreen.setAngle(MS_ANGLE_HIGH);
//progressreport;
//paintonsmart;
{-----Failsafe-----}
{------------------}

repeat

if notmoving and lootavailable then
begin
findColorsSpiralTolerance(x, y, TPA, RawMeatColor, mainScreen.getBounds(), RawMeatTol, colorSetting(2, RawMeatHue, RawMeatSat));

{ if (Length(TPA) < 1) then
begin
print('No Cows Here, Going To Center');
//sps.blindWalk(point(335, 244));
end; }


ATPA := tpa.toATPA(5, 10);
ATPA.sortFromMidPoint(mainscreen.playerPoint);


if DrawOnSmart then
smartImage.debugATPA(ATPA);

{-------------------AntiBan-----------------}
if random(100) = 4 then
begin
smallRandomMouse(500 + random(100));
end;
if random(100) = 5 then
begin
sleepAndMoveMouse(randomRange(750, 1000));
end;
{-------------------------------------------}

for i := 0 to HIGH(ATPA) do
begin
mouse(middleTPA(ATPA[i]), MOUSE_MOVE);
if isMouseOverText(['eat', 'Raw', 'Meat', 'aw'], 200) then
begin

{-------------------AntiBan-----------------}
if gaussRangeInt(0,25) = 4 then
begin
wait(randomRange(100, 200));
fastClick(MOUSE_RIGHT);
chooseOption.select(['eat', 'Raw', 'Meat', 'aw']);
inc(toadspicked);
if DrawOnSmart then
smartImage.clear();
break;
end;
{-------------------------------------------}

fastClick(MOUSE_LEFT);

{-------------------AntiBan-----------------}
if random(10) = 4 then
smallRandomMouse(100 + random(150));
if random(200) = 4 then
antiban;
if random(200) = 4 then
fastClick(MOUSE_LEFT);
if random(10) = 5 then
sleepAndMoveMouse(randomRange(600, 900));
{-------------------------------------------}

if DrawOnSmart then
smartImage.clear;
break;
end;
end;
end;

wait(randomrange(1000, 2000));

if not notmoving then {this is my own procedure to check if im moving.. you can use minimap.waitplayermoving}
repeat
wait(500)
until notmoving;

until not lootavailable() or not isLoggedIn() or (CombatTimer.getTime() > 180000);

end;

Torol

2014-11-29 06:35:01

From: elfyyy
Well I'm not sure if you are talking about RS3 or OSR


Sorry, it's RS3! :)

From: hoodz
A cow hide should have a higher length than bones.


That's a good idea, I will certainly try that!

From: undorak7
i started to make a cow killer script once… got bored though! i had everything done, handle door and stuff.. check out if this works


That's funny, because I was looking for the raw meat color too in my script.. :D it's quite unique

Torol

2014-11-29 07:47:29

However it's sometimes become buggy like this:

[ATTACH=CONFIG]24515[/ATTACH]

Flight

2014-11-29 08:39:47

Ground items are tricky to accurately distinguish if there are many areas of the screen with the same or similar colors. But in a situation like this you just have to look at it from the human point of view. If you as the player look at a cowhide and a pile of bones, what makes you distinguish between the two? Probably much more than just "the white color". You're probably looking for a combination of the amount of white, the size of the white, and possibly the shape.

You already have the basic white color finding down, now you can go with something like what elfyyy suggested and count the color (length of your white color's TPA). After that narrow it down by the size: for each TPA (that contains X amount of white pixels) get the bounds of the TPA and check if those bounds are the correct length and width of a normal cow hide. Or, if you'd like, you could create a unique DTM of the cowhide on the ground and make sure, in the DTM maker tool, that only the DTM you made only detects cowhides. Then just search the screen for that DTM, get the nearest from your player (middle screen) and go from there.

Torol

2014-11-29 10:49:54

What do you think guys? Will it be efficient?

procedure hideLoot();
var
x, y, i, b : Integer;
p : TPoint;
TPA : TPointArray;
ATPA : T2DPointArray;
cowhideBox : TBox;
TBArray1, TBArray2 : TBoxArray;
begin
findColorsSpiralTolerance(x, y, TPA, BEEF_COLOR, mainScreen.getBounds(), BEEF_TOL, colorSetting(2, BEEF_HUE, BEEF_SAT));
ATPA := TPA.toATPA(7,7);
FilterTPAsBetween(ATPA, 1, 3);
ATPA.sortFromMidPoint(mainscreen.playerPoint);
TBArray1 := ATPA.getEachBounds();

SetLength(TBArray2, 50);

b := 0;
for i := 0 to high(ATPA) do
begin
p := middleTPA(ATPA[i]);
cowhideBox := intToBox(p.x-6,p.y-6,p.x+6,p.y+6);
if(countColorTolerance(HIDE_COLOR, cowhideBox, HIDE_TOL, colorSetting(2, HIDE_HUE, HIDE_SAT)) > 60) and
((countColorTolerance(BCKGR1_COLOR, cowhideBox, BCKGR1_TOL, colorSetting(2, BCKGR1_HUE, BCKGR1_SAT)) < 30) or
(countColorTolerance(BCKGR2_COLOR, cowhideBox, BCKGR2_TOL, colorSetting(2, BCKGR2_HUE, BCKGR2_SAT)) < 30)) then
begin
TBArray2[b] := cowhideBox;
b := b + 1;
end;
end;

SetLength(TBArray2, b);


{$IFDEF SMART}
//smartImage.debugATPA(ATPA);
//smartImage.drawBox(cowhideBox, False, ClBlue);
smartImage.drawBoxes(TBArray2, False, ClBlue);
{$ENDIF}

end;


Ross

2014-11-29 16:46:33

From: Torol
What do you think guys? Will it be efficient?

procedure hideLoot();
var
x, y, i, b : Integer;
p : TPoint;
TPA : TPointArray;
ATPA : T2DPointArray;
cowhideBox : TBox;
TBArray1, TBArray2 : TBoxArray;
begin
findColorsSpiralTolerance(x, y, TPA, BEEF_COLOR, mainScreen.getBounds(), BEEF_TOL, colorSetting(2, BEEF_HUE, BEEF_SAT));
ATPA := TPA.toATPA(7,7);
FilterTPAsBetween(ATPA, 1, 3);
ATPA.sortFromMidPoint(mainscreen.playerPoint);
TBArray1 := ATPA.getEachBounds();

SetLength(TBArray2, 50);

b := 0;
for i := 0 to high(ATPA) do
begin
p := middleTPA(ATPA[i]);
cowhideBox := intToBox(p.x-6,p.y-6,p.x+6,p.y+6);
if(countColorTolerance(HIDE_COLOR, cowhideBox, HIDE_TOL, colorSetting(2, HIDE_HUE, HIDE_SAT)) > 60) and
((countColorTolerance(BCKGR1_COLOR, cowhideBox, BCKGR1_TOL, colorSetting(2, BCKGR1_HUE, BCKGR1_SAT)) < 30) or
(countColorTolerance(BCKGR2_COLOR, cowhideBox, BCKGR2_TOL, colorSetting(2, BCKGR2_HUE, BCKGR2_SAT)) < 30)) then
begin
TBArray2[b] := cowhideBox;
b := b + 1;
end;
end;

SetLength(TBArray2, b);


{$IFDEF SMART}
//smartImage.debugATPA(ATPA);
//smartImage.drawBox(cowhideBox, False, ClBlue);
smartImage.drawBoxes(TBArray2, False, ClBlue);
{$ENDIF}

end;



Not sure if you're posting that just for validation, but it looks great to me!

Torol

2014-11-29 17:43:16

From: Ross
Not sure if you're posting that just for validation, but it looks great to me!


Well if I started a thread, it's the least to share what was my solution, plus if someone can give suggestions to the code then feel free to do it!

The Mayor

2014-11-30 01:26:17

From: Torol
Well if I started a thread, it's the least to share what was my solution, plus if someone can give suggestions to the code then feel free to do it!


Look at Wooty's script in the competition results thread.

Torol

2014-11-30 04:40:36

From: The Mayor
Look at Wooty's script in the competition results thread.


Thanks! I checked it out. I didn't even know there was a tabBackpack.waitForShift() function, and I already wrote a custom for that lol

Torol

2014-11-30 15:17:00

I think I will give up on this script, since I encountered an other problem. I can't filter out the non-attackable cows. I tried filtering with the yellow bell's color on their neck, but it's usually can't be seen because of the camera angle. :( Therefore the mouse keep mousing over it like crazy..

Hoodz

2014-11-30 15:43:47

From: Torol
I think I will give up on this script, since I encountered an other problem. I can't filter out the non-attackable cows. I tried filtering with the yellow bell's color on their neck, but it's usually can't be seen because of the camera angle. :( Therefore the mouse keep mousing over it like crazy..


mmh what about taverly location..

and if there is also a diary cow there, i will help you to find a fix!

Lipcot

2014-11-30 15:57:02

From: Torol
I think I will give up on this script, since I encountered an other problem. I can't filter out the non-attackable cows. I tried filtering with the yellow bell's color on their neck, but it's usually can't be seen because of the camera angle. :( Therefore the mouse keep mousing over it like crazy..


if you are in lumbridge, you can make the script to stay on the upper part, and not even see the dairy cows (there are like 5-6 cows on the top part of the pen, more than enough)

Torol

2014-11-30 19:14:40

From: hoodz
mmh what about taverly location..

and if there is also a diary cow there, i will help you to find a fix!


From: undorak7
if you are in lumbridge, you can make the script to stay on the upper part, and not even see the dairy cows (there are like 5-6 cows on the top part of the pen, more than enough)


Thanks for the support guys! I wanted this to work next to the crafting guild, because nearly noone uses that… even in the "crowded" worlds it's empty. I think at an other location I would be able to get it to work, if I get there I'll let you know :)