SCAR Code:
program CheesTM;
{.include srl/srl.scar}
var carMP : TDTMPointDef;
carSP : array[0..3] of TDTMPointDef;
carDTM : Integer;
carDDTM: TDTM;
x, y : Integer;
procedure LoadDTM;
begin
carMP.x := 187
carMP.y := 316
carMP.areasize := 1;
carMP.areashape := 0;
carMP.Color := 12750
carMP.tolerance := 255;
carSP[0].x := 177;
carSP[0].y := 316;
carSP[0].areasize := 2;
carSP[0].areashape := 0;
carSP[0].Color := 12750;
carSP[0].tolerance := 10;
carSP[1].x := 197;
carSP[1].y := 316;
carSP[1].areasize := 2;
carSP[1].areashape := 0;
carSP[1].Color := 12750;
carSP[1].tolerance := 10;
carSP[2].x := 187;
carSP[2].y := 306;
carSP[2].areasize := 2;
carSP[2].areashape := 0;
carSP[2].Color := 2039583;
carSP[2].tolerance := 10;
carSP[3].x := 177;
carSP[3].y := 326;
carSP[3].areasize := 2;
carSP[3].areashape := 0;
carSP[3].Color := 8684676;
carSP[3].tolerance := 10;
carDDTM.MainPoint := carMP;
carDDTM.SubPoints := carSP;
carDTM := AddDTM(carDDTM);
end;
procedure FindScar;
begin
if(FindDTM(carDTM, x, y, 0, 0, 1024, 768))then
begin
Writeln('Scar Found!!');
mmouse(x, y, 3, 3);
GetMousePos(x, y);
WriteLn('Your Points are: ' + IntToStr(x)+ ', ' + IntToStr(y) + '.');
end;
end;
begin
SetupSRL;
LoadDTM;
FindScar;
end.
Thats my little test script, of a DDTM i made of the Scar icon on your desktop.
My problem is that it will only find scar if its in a certain slot, for me its 3 right and 4 down, its where the x, and y values are set at.
So if any of you guys want to give me a hand on how to improve my DDTM or just help my fix it, any help will be appreciated