SRL Archive - Research & Development Lounge

My FindWaterAlter procedure. Has yet to fail!


itSchRis917

2007-07-21 02:33:41

Tell me what you think!

Function FindWaterAlter:Boolean;
Var
Ax1, Ay1, Ax2, Ay2: integer;
Begin
//Mouse(MMCX-30, MMCY-8, 2, 2, True);
//Flag;
If FindColor(x, y, 3093046, MSX1, MSY1, MSX2, MSY2) then
Writeln('Potentially found the Water Altar at X:'+inttostr(x)+ ',Y:'+inttostr(y));
Ax1 := x - 70;
Ay1 := y - 24;
Ax2 := x + 46;
Ay2 := y + 77;
Writeln('Found '+Inttostr(CountColor(3093046, Ax1, Ay1, Ax2, Ay2))+ ' pixels that match the color ' +inttostr(3093046));
If(CountColor(3093046, Ax1, Ay1, Ax2, Ay2)>= 25)then
Case Random(2) Of
0 : Begin
ClickMouseBox(Ax1, Ay1, Ax2, Ay2, True);
Flag;
If Not InvFull then
Result := True;
End;

1 : Begin
ClickMouseBox(Ax1, Ay1, Ax2, Ay2, False);
ChooseOption(x, y, 'Craft');
Flag;
If Not InvFull then
Result := True;
End;
End;
End;

lordsaturn

2007-07-21 03:33:15

Looks pretty complicated to me…wish I could understand more of it than I already do.

Bobarkinator

2007-07-21 12:13:31

Very nice, clever way to use CountColor but I think I would make the number that it has to be higher than a little bit higher because you can find colors elsewhere, for example maybe someone with close to that colored armor or had something on close to that color would probably mess it up.

bullzeye95

2007-07-21 13:22:40

Hey I use countcolor in my altar finding :p

Needs tolerance though.

itSchRis917

2007-07-21 15:44:48

Thanks for the feedback guys! Ill add tolerance and a greater CountColor result..

ShowerThoughts

2007-07-30 11:35:46

good work chris and dont give it up keep the good work :P