SRL Archive - OSR Help

TPA Help


Element17

2012-08-01 16:16:02

Function Harvest(var x, y: Integer): Boolean;   //
Var
CTS, I: Integer;
TPA: TPointArray;
ATPA: Array of TPointArray;
Begin
If(Not(LoggedIn))Then Exit;
CTS := GetColorToleranceSpeed;
ColorToleranceSpeed(2);
SetColorSpeed2Modifiers(0.48, 1.97);
FindColorsSpiralTolerance(MSCX, MSCY, TPA, 2676409, MSX1, MSY1, MSX2, MSY2, 15);
ATPA := TPAToATPAEx(TPA, 15, 15);


For I := 0 To High(ATPA) Do
Begin
MiddleTPAEx(ATPA[i], x, y);
MMouse(x, y, 2, 2);
If(IsUpTextMultiCustom(['arve','swee'])) Then
Begin
Writeln('Found harvest');
GetMousePos(x, y);
Result := True;
Break;
End;
End;
End;

That searches and find the sweetcorn every time, but I am also wanting to search for anything planted in the herb patch, but I don't want to make a new function…I think I will have to though….agree?

NKN

2012-08-01 16:24:17

http://villavu.com/forum/showthread.php?t=73768

Look how he does it, he uses a Type, and records.

Element17

2012-08-01 16:33:54

I think that will be perfect and funny thing I was just looking at that for something else haha. Thanks mate!