HarryJames
2011-04-18 17:02:32
program Untitled;
{$DEFINE SMART}
{$i SRL/SRL.scar}
{$i Reflection/Reflection.simba}
procedure DeclarePlayers;
begin
HowManyPlayers := 1;
NumberOfPlayers(HowManyPlayers);
CurrentPlayer := 0;
with Players[0] do
begin
Name := '+5"gmail.com';
Pass := '';
Nick := 'ake';
Active := True;
end;
end;
function FindColorOnTile(theTile : TTile; theColour : Integer) : TPoint;
var
MSPoint, ReturningValue : TPoint;
rx,ry : integer;
begin
MSPoint := TileToMS(theTile, 0);
if ((MSPoint.x = -1) or (MSPoint.y = -1)) then
begin
Writeln('The tile is not on screen, exiting the FindColorOnTile.');
exit;
end;
FindColorTolerance(rx, ry, theColour, MSPoint.X - 10, MSPoint.Y - 10, MSPoint.X + 10, MSPoint.Y + 10, 20);
ReturningValue.x := rx;
ReturningValue.y := ry;
result := ReturningValue;
end;
Procedure click;
var
a : TPoint;
begin
a := FindColorOnTile(Tile(3223, 3217), 3827548);
Mouse(a.x,a.y,0,0,True);
end;
begin
Smart_Server := 36;
Smart_Members := True;
Smart_Signed := True;
Smart_SuperDetail := False;
SetupSRL;
DeclarePlayers;
loginPlayer;
click;
end.You have your TTile, and a colour. It's helpful for things that don't have solid models :)
I suppose it could also be adapted to be used well with NPCs!
I'm going to improve this when I get a chance.