SRL Archive - Reflection Help

Nreed Help with ObjFinding


Claymore

2008-08-29 12:19:00

I need help with Hunting. When the Red Chinchompas fall into the Trap Box, how do i pick it up making sure that the UpText ('Check') is there?

TViYH

2008-08-30 20:12:26


function FindCheck(TileX, TileY: integer):boolean;
var
i, x, y: integer;
TPA1: tpointarray;
begin
TPA1 := GetGroundItems(TileX, TileY);
for i := 0 to High(TPA1) do
begin
MMouse(TPA1[i].X, TPA1[i].Y, 0, 0);
if IsUpText('Check') then
Wait(120+Random(250));
Mouse(x, y, 1, 1, False);
Wait(250+Random(250));
if ChooseOption('Check') then
begin
Result := True;
Exit;
end;
end;
end;

I think that'd work.

Metagen

2008-09-02 09:19:50

That wouldn't work. GetGroundItems returns a tpa but in the tpa are not coordinates, they are the id and stack size.

Method

2008-09-02 09:28:25

From: Metagen
That wouldn't work. GetGroundItems returns a tpa but in the tpa are not coordinates, they are the id and stack size.


That's why we have the nifty FindGroundItems and GetAllGroundItems functions, which do return the tile in the array.

Naike

2008-09-02 09:49:16

Death -> Are you working on a Chin script? :o

n3ss3s

2008-09-02 14:41:28

Deathscytex, the box is propably an object, since it has the 'Check'. Just use the FindObject, and proceed like you normally would, move mouse on, check uptext, right click or left click etc…