SRL Archive - OSR Help

TPA Help


Wu-Tang Clan

2013-03-24 19:07:29

So I've been working on getting into TPAs because apparently they're only the coolest thing ever and I want to be an SRL member. So I whipped up a TPA test script to find a color, then left click on it and choose an option. Can anybody tell me what's wrong with my TPA?

program TPAtest;
{$Define SMART}
{$I SRL/SRL.Simba}

procedure DeclarePlayers;
begin
HowManyPlayers := 1;
NumberOfPlayers(HowManyPlayers);
CurrentPlayer := 0;
Players[0].Name :='';
Players[0].Pass :='';
Players[0].Pin :=''
Players[0].Active:=True;
end;

procedure FindThing;
var
X, Y, i: Integer;
TPA: TPointArray;
ATPA: T2DPointArray;

begin
begin
ColorToleranceSpeed(2);
SetColorSpeed2Modifiers(0.97, 3.83);
if FindColorsSpiralTolerance(MSCX, MSCY, TPA, 4211012, MSX1, MSY1, MSX2, MSY2, 6) then
begin
SplitTPAExWrap(TPA, 4, 4, ATPA);
if Length(ATPA) > 0 then
begin
SortATPASize(ATPA, True);
MiddleTPAEx(ATPA[0], X, Y);
MMouse(X, Y, RandomRange(-2, 2), RandomRange(-2, 10));
if WaitUpTextMulti(['anker', 'nker', 'ker'], 500) then
begin
case Random(7) of
0..4: ClickMouse2(1);
5..6: begin
ClickMouse2(0);
WaitOptionMulti(['ank', 'nk'], 500);
end;
end;
end;
end;
end;
end;
end;

begin
SMART_FIXSPEED := True;
SRL_SixHourFix:= True;
SetupSRL;
DeclarePlayers;
LoginPlayer;
repeat
FindThing;
until (False);
end.

It only seems to hover over grey minimized action bar.

StickToTheScript

2013-03-24 19:23:53

Try reading this: http://villavu.com/forum/showthread.php?t=49089

And get a complete understanding of TPA's (Just incase you don't). Then you should be able to learn to figure out your own errors.

They are under the Advanced Section.

Good luck!

x[Warrior]x3500

2013-03-24 19:25:49

well lets go through it step by step.

1. your standards are off and honestly are annoying to me XD.

2.

ColorToleranceSpeed(2);
SetColorSpeed2Modifiers(0.97, 3.83);

good your using cts 2, but u need to revert back to the previous cts once your done finding your colors. (you never do this)

3.

SplitTPAExWrap(TPA, 4, 4, ATPA);
if Length(ATPA) > 0 then
begin
good, u now have a working atpa, but you do something not needed: you check the length of your ATPA. If the original colors finding function does not return any points, then you wont enter the if statement. if you dont enter the if statement, u cant get to this point. the only way that ATPA<=0 is if the colors are not found. hope that made sense.

4.

SortATPASize(ATPA, True);
MiddleTPAEx(ATPA[0], X, Y);
MMouse(X, Y, RandomRange(-2, 2), RandomRange(-2, 10));
ok you are sorting from biggest to smallest, but only looking at 1 of your tpas. so essentially, w/e is your biggest tpa found in your ATPA is the ONLY one that you will mmouse to.

5. now you are being incredibly unclear on what your issue is. i figured out that you wish to find a banker (using the uptext line) and i will assume that since the banker should be bigger than the little skill square, it should go to the banker. the only thing that i can think of that would cause this issue with your code is an inaccurate color/tol. make sure u r using aca to find the best mods/color/tol for your color.