SRL Archive - Help and Support

Help with TPA's! Wont right click!!


Naike

2008-06-27 14:25:29

function ObliTrade: Boolean;
var
TPA : Tpointarray;
h, i, x, y, cts, OldMS: Integer;
ATPA: T2DPointArray;
begin
if (not LoggedIn) then exit;
If(ShopScreen) then Exit;
Result := False;
Cts := GetColorToleranceSpeed;
OldMS := MouseSpeed;
MouseSpeed := 30;
ColorToleranceSpeed(2);
FindColorsTolerance(TPA, 15789808, MSX1, MSY1, MSX2, MSY2, 25);
ATPA := TPAtoATPAEx(TPA, 5, 5);
SortATPASize(ATPA, True);
h := High(TPA);
for i := 0 to h do
begin
MiddleTPAEx(ATPA[i], x, y);
MMouse(x, y, 8, 8);
if IsUpText('alk') then
Continue;
GetMousePos(x, y);
Mouse(x, y, 0, 0, False);
if ChooseOption('rade') then
begin
FFlag(0);
Wait(RandomRange(800, 1500));
If(Not(ShopScreen))Then
begin
FindNormalRandoms;
ObliTrade;
end;
result := true;
MouseSpeed := OldMS;
exit;
end;
end;
end;


Whats wrong? I cant see it can you?
Figure it out and i got some cookies for you!

skilld u

2008-06-27 15:51:18

if IsUpText('alk') then
Continue;
what is continue?

PvH

2008-06-27 15:53:09


if IsUpText('alk') then
Continue;
GetMousePos(x, y);
Mouse(x, y, 0, 0, False);
if ChooseOption('rade') then
begin
FFlag(0);
Wait(RandomRange(800, 1500));
If(Not(ShopScreen))Then
begin
FindNormalRandoms;
ObliTrade;
end;
result := true;
MouseSpeed := OldMS;
exit;
end;
end;
end;
1. just remove continue;)
2. where is the end else? shouldn't there be a failsafe^^?
Or make result false.

PvH


EDIT:

I found the problem:p
You need a begin!
Else you would only do continue;)
And of course you need an end for the begin^^


EDIT2:
here is the fix for you:p

if IsUpText('alk') then
begin
Continue;
GetMousePos(x, y);
Mouse(x, y, 0, 0, False);
if ChooseOption('rade') then
begin
FFlag(0);
Wait(RandomRange(800, 1500));
If(Not(ShopScreen))Then
begin
FindNormalRandoms;
ObliTrade;
end;
result := true;
MouseSpeed := OldMS;
exit;
end;
end;
end;
result := false;
end;

Now gimme the cookie:D

HyperSecret

2008-06-27 16:07:07

From: skilld u
if IsUpText('alk') then
Continue;
what is continue?


continue; - when your inside of a loop it looks for the condition, in this case isuptext, if that uptext is found at the point in the for to do loop, then i will go back to the beginning of the loop and will go to the next point and run the check and if isuptext no found (in this case) it will go on with the rest of the loop

@pvh - h := High(TPA); needed to be h := High(ATPA); since he is doing middleTPA of the ATPA and not the TPA, that was the problem. but he also had some other issues that are now fixed…

PvH

2008-06-27 16:11:53

Ohh yes HyperSecret, you are right;)
But he still needs the begin/end , result:=false; and things, right?
So now, he needs to give 2 cookies^^

mixster

2008-06-28 07:35:01

You don't as the IfUpText is a check so if that returns true, the point is wrong so he continue's and doesn't need a begin end. Also, he sets Result := False; at the beginning and sets it to true then exit's so no need to set it to false again :)
All your cookies are belong to Hyper

Markus

2008-07-07 10:23:05


if (not(IsUptext('Talk'))) then
continue;

Timer

2008-07-07 10:29:57

Timer calls cookie!!!

function ObliTrade: Boolean;
var
TPA : Tpointarray;
h, i, x, y, cts, OldMS: Integer;
ATPA: T2DPointArray;
begin
if (not (LoggedIn)) then exit;
If (ShopScreen) then Exit;
Result := False;
Cts := GetColorToleranceSpeed;
OldMS := MouseSpeed;
MouseSpeed := 30;
ColorToleranceSpeed(2);
FindColorsTolerance(TPA, 15789808, MSX1, MSY1, MSX2, MSY2, 25);
ATPA := TPAtoATPAEx(TPA, 5, 5);
SortATPASize(ATPA, True);
h := High(ATPA);
for i := 0 to h do
begin
MiddleTPAEx(ATPA[i], x, y);
MMouse(x, y, 8, 8);
Wait(50 + random(50));
if (not (IsUpText('alk'))) then
Continue;
GetMousePos(x, y);
Mouse(x, y, 0, 0, False);
Wait(50 + random(50));
if ChooseOption('rade') then
begin
FFlag(0);
Wait(1500 + random(500));
If(Not (ShopScreen)) Then
begin
FindNormalRandoms;
result := ObliTrade;
MouseSpeed := OldMS;
exit;
end;
result := true;
MouseSpeed := OldMS;
exit;
end else
Continue;
end;
end;