Hiya, I have some autocoloring procedures that I need help with. They are for my banana autoquester and when I get these done and tested, it'll be a finished script!! Yay!
Here they are:
SCAR Code:
Function GetFeildColor:Integer;
Var q:TPoint;
i:Integer;
Begin
LoginCheck;
MakeCompass('n');
Result:=2596502;
ddtmarea:=1;
ddtmtol:=20;
LoadDTMs;
For i:=0 to 5 do
Begin
IF (FindDTM(BFeild,q.x,q.y,MMX1,MMY1,MMX2,MMY2)) Then
Begin
MMouse(q.x+30,q.y+30,2,2);
Result:=GetColor(q.x,q.y);
FreeDTMs;
Exit;
End;
Inc(ddtmarea);
ddtmtol:=ddtmtol+5;
End;
Writeln('Trouble autocoloring the feild...');
FreeDTMs;
End;
Function GetLuthasMMColor:Integer;
Var q:TPoint;
i:Integer;
Begin
LoginCheck;
MakeCompass('n');
Result:=195836;
ddtmarea:=1;
ddtmtol:=20;
LoadDTMs;
For i:=0 to 5 do
Begin
IF (FindDTM(LuthasMM,q.x,q.y,MMX1,MMY1,MMX2,MMY2)) Then
Begin
MMouse(q.x+30,q.y+30,2,2);
Result:=GetColor(q.x,q.y);
FreeDTMs;
Exit;
End;
Inc(ddtmarea);
ddtmtol:=ddtmtol+5;
End;
Writeln('Trouble autocoloring luthas on the minimap...');
FreeDTMs;
End;
Function GetOutsideHouseColor:Integer;
Var q:TPoint;
i:Integer;
Begin
LoginCheck;
MakeCompass('n');
Result:=FindRoadColor;
ddtmarea:=1;
ddtmtol:=20;
LoadDTMs;
For i:=0 to 5 do
Begin
IF (FindDTM(OutHouse,q.x,q.y,MMX1,MMY1,MMX2,MMY2)) Then
Begin
MMouse(q.x+30,q.y+30,2,2);
Result:=GetColor(q.x,q.y);
FreeDTMs;
Exit;
End;
Inc(ddtmarea);
ddtmtol:=ddtmtol+5;
End;
Writeln('Trouble autocoloring the outside of the house...');
FreeDTMs;
End;
Here are the DDTM's used in those proc's:
SCAR Code:
Procedure LoadDTMs;
Begin
BFMP.x:=622;//Bananafeild
BFMP.y:=433;
BFMP.areasize:=1;
BFMP.areashape:=0;
BFMP.color:= 346978;
BFMP.tolerance:= ddtmtol;
BFSP[0].x:= 632;
BFSP[0].y:= 433;
BFSP[0].areasize:=ddtmarea;
BFSP[0].areashape:=0;
BFSP[0].color:= 933217;
BFSP[0].tolerance:= ddtmtol;
BFSP[1].x:= 617;
BFSP[1].y:= 449;
BFSP[1].areasize:=ddtmarea;
BFSP[1].areashape:=0;
BFSP[1].color:= 3630145;
BFSP[1].tolerance:= ddtmtol;
BFSP[2].x:= 634;
BFSP[2].y:= 431;
BFSP[2].areasize:=ddtmarea;
BFSP[2].areashape:=0;
BFSP[2].color:= 15462116;
BFSP[2].tolerance:= ddtmtol;
BFSP[3].x:= 634;
BFSP[3].y:= 439;
BFSP[3].areasize:=ddtmarea;
BFSP[3].areashape:=0;
BFSP[3].color:= 15462116;
BFSP[3].tolerance:= ddtmtol;
BFSkel.MainPoint:=BFMP;
BFSkel.SubPoints:=BFSP;
//end defining bananafeild
LMMP.x:=537;//LuthasMM
LMMP.y:=365;
LMMP.areasize:=1;
LMMP.areashape:=0;
LMMP.color:= 60909;
LMMP.tolerance:= ddtmtol;
LMSP[0].x:= 535;
LMSP[0].y:= 365;
LMSP[0].areasize:=ddtmarea;
LMSP[0].areashape:=0;
LMSP[0].color:= 195836;
LMSP[0].tolerance:= ddtmtol;
LMSP[1].x:= 617;
LMSP[1].y:= 449;
LMSP[1].areasize:=ddtmarea;
LMSP[1].areashape:=0;
LMSP[1].color:= 3630145;
LMSP[1].tolerance:= ddtmtol;
LMSkel.MainPoint:=LMMP;
LMSkel.SubPoints:=LMSP;
//end defining LuthasMM
OHMP.x:=529;//OutHouse
OHMP.y:=382;
OHMP.areasize:=ddtmarea;
OHMP.areashape:=0;
OHMP.color:= 344686;
OHMP.tolerance:= ddtmtol;
OHSP[0].x:= 522;
OHSP[0].y:= 380;
OHSP[0].areasize:=ddtmarea;
OHSP[0].areashape:=0;
OHSP[0].color:= 15462116;
OHSP[0].tolerance:= ddtmtol;
OHSP[1].x:= 536;
OHSP[1].y:= 380;
OHSP[1].areasize:=ddtmarea;
OHSP[1].areashape:=0;
OHSP[1].color:= 15462116;
OHSP[1].tolerance:= ddtmtol;
OHSP[2].x:= 548;
OHSP[2].y:= 379;
OHSP[2].areasize:=ddtmarea;
OHSP[2].areashape:=0;
OHSP[2].color:= 15462116;
OHSP[2].tolerance:= ddtmtol;
OHSP[3].x:= 510;
OHSP[3].y:= 380;
OHSP[3].areasize:=ddtmarea;
OHSP[3].areashape:=0;
OHSP[3].color:= 15462116;
OHSP[3].tolerance:= ddtmtol;
OHSkel.MainPoint:=OHMP;
OHSkel.SubPoints:=OHSP;
//end defining OutHouse
BFeild:=AddDTM(BFSkel);
LuthasMM:= AddDTM(LMSkel);
OutHouse:= AddDTM(OHSkel);
End;
The rest of my script seemed to be working ok, but when I tested these procedures, they gave me their error messages XP Please help.