SRL Archive - Help and Support

Picking up quicker.


xtrapsp

2013-07-16 11:33:08

Hey guys,

having ridiculous slow pickups :/

function Finditem:Boolean;
var
x, y, CTS, i, T, InvC:Integer;
TPA, RedTPA:TpointArray;
ATPA:T2DPointArray;
begin
LoginSetup;

GameTab(Tab_Inv);

CTS := GetColorToleranceSpeed

SetColorToleranceSpeed(2);
SetColorSpeed2Modifiers(0.78, 3.80);

if FindColorsTolerance(TPA, 2134643, MSX1, MSY1, MSX2, MSY2 - 10, 3) then
begin

SetColorToleranceSpeed(CTS);
SetColorSpeed2Modifiers(0.2, 0.2);

if Length(TPA) < 1 then Exit;

SplitTPAWrap(TPA, 7, ATPA);
SortATPAFromMidPoint(ATPA, Point(MSCX, MSCY));

Smart_DebugATPA(false, ATPA);

MarkTime(T);
InvC := InvCount;

for i := 0 to High(ATPA) do
begin
MiddleTPAEx(ATPA[i], x, y);
MMouse(x, y, 2, 2);
if WaitUptextMulti(['', '', ''], 500) then
begin
ClickMouse2(Mouse_left);
while TimeFromMark(T) < 3000 do
begin
Wait(200);
if InvC = ( InvCount - 1) then
begin
FFlag(1);
Result := True;
Exit;
end;
end;
end else
begin
if WaitUptextMulti([''], 500) then
begin
ClickMouse2(Mouse_Right);
if WaitOptionMulti(['', ''], 500) then
begin
while TimeFromMark(T) < 3000 do
begin
Wait(200);
if InvC = ( InvCount - 1) then
begin
FFlag(1);
Result := True;
Exit;
end;
end;
end;
end else Exit;
end;
end;
end;
end;

removed name etc for obvious reasons (Private script).


edit: got solution i think?

masterBB

2013-07-16 11:46:51

Ah, it seems you need a pick up artist!

/spam

What do you mean slow pick ups?
Many false positives(wasting time hovering wrong objects)
Slow procedure(wasting time sorting colors)
Unlogical collecting order(wasting time walking)

Nebula

2013-07-16 11:49:32

splittpa can take 5+ seconds depending on how big the tpa is… that might be your problem

xtrapsp

2013-07-16 11:59:06

From: masterBB
Ah, it seems you need a pick up artist!

/spam

What do you mean slow pick ups?
Many false positives(wasting time hovering wrong objects)
Slow procedure(wasting time sorting colors)
Unlogical collecting order(wasting time walking)


Essentially making a berry picker-uper and it works, but it takes too long.

The berries look like the grass sometimes and in general it's a slow process.

At this moment in time I'm testing if I can create a Tbox around the feet of my character and hopefully that will improve it. but I have to go out now.

So I'm kind of stuck…


rj

2013-07-16 12:15:18

Try ATPA := TPAToATPAEx(TPA, w, h);

Split tpa is hella slow I have had trouble with it in the past

Rich

2013-07-16 13:14:45

See if you can adapt my picking up function in this to work for you:

procedure FindBones;
var
T, MSY3, I, N, L, L2, Inv, Count : Integer;
Points : TPointArray;
ATPA : T2DPointArray;
C: TPoint;

begin
if ((not LoggedIn) or InvFull) then
Exit;
TakeBreak;
FindNormalRandoms;
Write('FindBones - Procedure started');
Flag;
SetArrayLength(Points, 1);
if ActionBar then
MSY3:= MSY2 - 75
else
MSY3:= MSY2;
FindColorsSpiralTolerance(MSCX, MSCY, Points, 13619157, MSX1, MSY1, MSX2, MSY3, 20);
L:= GetArrayLength(Points);
MarkTime(T);
if (L > 0) then
begin
SetArrayLength(ATPA, 1);
ATPA:= TPAToATPAEx(Points, 30, 30);
L2:= GetArrayLength(ATPA);
Write('FindBones - Searching ' + IntToStr(L2) + ' points');
for I:= 0 to (L2-1) do
begin
if (TimeFromMark(T) > 30000) then
begin
Write('FindBones - Restarting procedure. N = ' + IntToStr(N));
MakeCompass(Random(360));
Inc(N);
if (N = 3) then
begin
Write('FindBones - Been unable to find Bones for a long time. Logging out');
Logout;
Players[CurrentPlayer].Active:= False;
end;
Exit;
end;
if (not(LoggedIn) or (I > 2)) then
Break;
C:= MiddleTPA(ATPA[I]);
if ((InRange(C.x, 250, 280)) and (InRange(C.y, 140, 190))) then
Wait(20)
else
begin
Count:= GetArrayLength(ATPA[I]);
if InRange(Count, 5, 35) then
begin
Write('FindBones - May have found Bones. Checking.');
MMouse(C.x, C.y, 0, 0);
if WaitUpTextMulti(['ake', 'Take'], 600) then
begin
Write('FindBones - Found a pile of items');
Inv:= InvCount;
if IsUpTextMultiCustom(['Bones', 'ones', 'ke Bone']) then
begin
N:= 0;
Write('FindBones - Found some Bones on top of a pile');
ClickMouse2(mouse_Left);
if FlagPresent then
begin
Write('FindBones - Flag present');
AntiBan;
MarkTime(T);
while not Flag do
begin
Wait(500);
if (TimeFromMark(T) > 7500) then
begin
Write('FindBones - Failed to pick up Bones');
Exit;
end;
end;
end;
if (InvCount > Inv) then
begin
Inc(Bones);
Write('FindBones - Successfully picked up Bones');
end;
Exit;
end else
begin
ClickMouse2(mouse_Right);
if WaitOptionMulti(['Bones', 'ones'], 600) then
begin
Write('FindBones - Found some Bones in a pile');
if FlagPresent then
begin
Write('FindBones - Flag present');
AntiBan;
MarkTime(T);
while not Flag do
begin
Wait(500);
if (TimeFromMark(T) > 7500) then
begin
Write('FindBones - Failed to pick up Bones');
Exit;
end;
end;
end;
if (InvCount > Inv) then
begin
Inc(Bones);
Write('FindBones - Successfully picked up Bones');
end;
Exit;
end else
begin
Write('FindBones - Failed to find Bones');
MouseBox(MSX1, MSY1, MSX2, MSY2, mouse_Move);
if Random(2) = 1 then
begin
Write('FindBones - Adjusting camera angle');
MakeCompass(rs_GetCompassAngleDegrees + 50 + RandomRange(-40, 40));
end;
end;
end;
end else
if Random(3) = 1 then
begin
Write('FindBones - Adjusting camera angle');
MakeCompass(rs_GetCompassAngleDegrees + 90 + RandomRange(-40, 40));
end;
end else
Wait(50);
end;
end;
end;
FindNormalRandoms;
Flag;
end;

It's from my Bone picker/burier, and is fairly quick and accurate.

Full script: http://villavu.com/forum/attachment.php?attachmentid=21615&d=1370818258

xtrapsp

2013-07-16 14:20:04

From: Rich
See if you can adapt my picking up function in this to work for you:

procedure FindBones;
var
T, MSY3, I, N, L, L2, Inv, Count : Integer;
Points : TPointArray;
ATPA : T2DPointArray;
C: TPoint;

begin
if ((not LoggedIn) or InvFull) then
Exit;
TakeBreak;
FindNormalRandoms;
Write('FindBones - Procedure started');
Flag;
SetArrayLength(Points, 1);
if ActionBar then
MSY3:= MSY2 - 75
else
MSY3:= MSY2;
FindColorsSpiralTolerance(MSCX, MSCY, Points, 13619157, MSX1, MSY1, MSX2, MSY3, 20);
L:= GetArrayLength(Points);
MarkTime(T);
if (L > 0) then
begin
SetArrayLength(ATPA, 1);
ATPA:= TPAToATPAEx(Points, 30, 30);
L2:= GetArrayLength(ATPA);
Write('FindBones - Searching ' + IntToStr(L2) + ' points');
for I:= 0 to (L2-1) do
begin
if (TimeFromMark(T) > 30000) then
begin
Write('FindBones - Restarting procedure. N = ' + IntToStr(N));
MakeCompass(Random(360));
Inc(N);
if (N = 3) then
begin
Write('FindBones - Been unable to find Bones for a long time. Logging out');
Logout;
Players[CurrentPlayer].Active:= False;
end;
Exit;
end;
if (not(LoggedIn) or (I > 2)) then
Break;
C:= MiddleTPA(ATPA[I]);
if ((InRange(C.x, 250, 280)) and (InRange(C.y, 140, 190))) then
Wait(20)
else
begin
Count:= GetArrayLength(ATPA[I]);
if InRange(Count, 5, 35) then
begin
Write('FindBones - May have found Bones. Checking.');
MMouse(C.x, C.y, 0, 0);
if WaitUpTextMulti(['ake', 'Take'], 600) then
begin
Write('FindBones - Found a pile of items');
Inv:= InvCount;
if IsUpTextMultiCustom(['Bones', 'ones', 'ke Bone']) then
begin
N:= 0;
Write('FindBones - Found some Bones on top of a pile');
ClickMouse2(mouse_Left);
if FlagPresent then
begin
Write('FindBones - Flag present');
AntiBan;
MarkTime(T);
while not Flag do
begin
Wait(500);
if (TimeFromMark(T) > 7500) then
begin
Write('FindBones - Failed to pick up Bones');
Exit;
end;
end;
end;
if (InvCount > Inv) then
begin
Inc(Bones);
Write('FindBones - Successfully picked up Bones');
end;
Exit;
end else
begin
ClickMouse2(mouse_Right);
if WaitOptionMulti(['Bones', 'ones'], 600) then
begin
Write('FindBones - Found some Bones in a pile');
if FlagPresent then
begin
Write('FindBones - Flag present');
AntiBan;
MarkTime(T);
while not Flag do
begin
Wait(500);
if (TimeFromMark(T) > 7500) then
begin
Write('FindBones - Failed to pick up Bones');
Exit;
end;
end;
end;
if (InvCount > Inv) then
begin
Inc(Bones);
Write('FindBones - Successfully picked up Bones');
end;
Exit;
end else
begin
Write('FindBones - Failed to find Bones');
MouseBox(MSX1, MSY1, MSX2, MSY2, mouse_Move);
if Random(2) = 1 then
begin
Write('FindBones - Adjusting camera angle');
MakeCompass(rs_GetCompassAngleDegrees + 50 + RandomRange(-40, 40));
end;
end;
end;
end else
if Random(3) = 1 then
begin
Write('FindBones - Adjusting camera angle');
MakeCompass(rs_GetCompassAngleDegrees + 90 + RandomRange(-40, 40));
end;
end else
Wait(50);
end;
end;
end;
FindNormalRandoms;
Flag;
end;

It's from my Bone picker/burier, and is fairly quick and accurate.

Full script: http://villavu.com/forum/attachment.php?attachmentid=21615&d=1370818258



Hey rich,

Excuse the stupid questions. I haven't scripted in a long time.

I'm getting this:

FindBerries - Searching 2 points
FindBradsberries - Procedure started
FindBerries - Searching 2 points
FindBradsberries - Procedure started
FindBerries - Searching 2 points
FindBradsberries - Procedure started
FindBerries - Searching 2 points
FindBradsberries FindBerries - Searching 2 points


I don't think it's taking into consideration the Inc(N)??


 
SetArrayLength(ATPA, 1);
ATPA:= TPAToATPAEx(Points, 30, 30);
L2:= GetArrayLength(ATPA);
Writeln('FindBerries - Searching ' + IntToStr(L2) + ' points');
for I:= 0 to (L2-1) do
begin
if (TimeFromMark(T) > 30000) then
begin
Writeln('FindBerries - Restarting procedure. N = ' + IntToStr(N));
MakeCompass(Random(360));
Inc(N);
if (N = 3) then
begin
Writeln('FindBerries - Been unable to find berries for a long time. Logging out');
Logout;
Players[CurrentPlayer].Active:= False;
end;
Exit;

It's also showing no signs of working :(


EDIT:

Changed the colors etc and it's back to working. Going to test it for a bit :) Thanks

Edit2:


Added walking so when the object is else where it walks. And now it's slower than ever :(

Rich

2013-07-16 15:40:53

Before you adding walking was it quicker than before?

Wetish

2013-07-16 15:58:23

From: xtrapsp

Added walking so when the object is else where it walks. And now it's slower than ever :(

If it was fast before you added walking, then you need to fix your walking function.

[XoL]

2013-07-16 18:13:27

Not sure how demise does it, but her pickup for her slayer script is really fast. Check that out maybe?

Kasi

2013-07-16 18:23:52

I'd filter by ATPA box size.

Wetish

2013-07-16 20:01:24

From: [XoL]
Not sure how demise does it, but her pickup for her slayer script is really fast. Check that out maybe?


Doesn't that script use OpenGl?

DemiseScythe

2013-07-16 20:27:16

From: Wetish
Doesn't that script use OpenGl?


Indeed it does. Flawless looting can be achieved though.

[XoL]

2013-07-16 20:29:21

From: Wetish
Doesn't that script use OpenGl?


Yes it does

Olly

2013-07-16 20:37:15

I mean with ogl you can see everything behind objects/under other drops.. and near enough instantly so heh I would expect flawless/super fast with ogl :p

DemiseScythe

2013-07-16 20:47:47

From: Olly
I mean with ogl you can see everything behind objects/under other drops.. and near enough instantly so heh I would expect flawless/super fast with ogl :p


Actually only 4-5 items are actually visible to the plugin not including player. S if you drop 10 diff items and stand on them, the plugin can only detect the top 4 items and the 6 less valuable ones are entirely invisible.