_ChArMz
2006-12-20 12:48:45
//New Smaller Bitmap Masks For SRL's Mining Section
OreMask := BitmapFromString(9, 8, 'z78DA333040076E6080C9C60' +
'F064A17F17A71E9C2AFD70D03E09725DE4CF2DC0F00DCD05C59');
PickHeadMask := BitmapFromString(18, 12, 'z78DA3330400037' +
'3030C001F0CB1203DC3000EDEC22D555F4B48B9E3652622FE5AE2' +
'5DE04EA86097E7B89497B948418252AA99B472889714CBDF42C1F' +
'7099498BBC836C26005E85072C');
DeattachedPickHeadMask := BitmapFromString(22, 15, 'z78DA3330A0377003' +
'03830102C8B60F944B46DD80CB46FAB864E4D8EE8603D0276F926' +
'A1AED42809EB6931AE6D40A37F2ECA224ADD2C24662DC406A9C52' +
'0E28319F7621030087038F28');
BrokenPickHeadMask := BitmapFromString(21, 12, 'z78DA3330C00EDC7000031' +
'A03FCB650D70DA4FA913E21306A3BADDD4049AAA6AE1B28773FED' +
'7219F139023FA03C7753E25F645DF8CDA7A4C4A0A4B4A44FCE020' +
'0C2F033CC');
PickHandleMask := BitmapFromString(14, 26, 'z78DA3330A014B8' +
'2101032A99865F8412D3069B99F8750D0633E9E9C2C11F86A32E1' +
'C6C2E1CFC7979D48523A116A0BC061C2A66D2A2DE07009D42B460' +
'');
Function CharmFindPickHeadColors: Boolean; //Example of a new procedure
Var
Px, Py: Integer;
Begin
GameTab(4);
If(FindBitmapMaskTolerance(PickHeadMask, Px, Py, MIX1, MIY1, MIX2, MIY2, 20, 25))then
Begin
EquipPick:= False;
Result:= True;
End else
Begin
GameTab(5);
Wait(200+Random(100));
If(FindBitmapMaskTolerance(PickHeadMask, Px, Py, MIX1, MIY1, MIX2, MIY2, 20, 25))then
Begin
EquipPick:= True;
Result:= True;
End
End
If(Result= False)then
Begin
CharmDebug('No->Pick!');
Players[CurrentPlayer].Loc:= 'No->Pick';
Logout;
Result:= False;
End else
Begin
PickHeadColor1:= GetColor(Px + 1, Py + 3);
PickHeadColor2:= GetColor(Px + 11, Py + 7);
PickHeadColor3:= GetColor(Px + 8, Py + 5);
PickHeadColor4:= GetColor(Px + 11, Py + 6);
PickHeadColor5:= GetColor(Px + 6, Py + 3);
WriteLn('PickHead Colors: '+IntToStr(PickHeadColor1)+', '+IntToStr(PickHeadColor2)+', '+IntToStr(PickHeadColor3)+', '+IntToStr(PickHeadColor4)+', and '+IntToStr(PickHeadColor5));
End
End;
Function CharmFindObjOre(var Cx, Cy: Integer; Color, Tolerance, MinCount: Integer): Boolean;
Var
x, y, A, C, I, X1, Y1, X2, Y2: Integer;
Begin
If(FindColorSpiralTolerance(x, y, Color, MSX1, MSY1, MSX2, MSY2, Tolerance))then
Begin
X1:= 245;
Y1:= 165;
X2:= 277;
Y2:= 185;
Repeat
If(not(Loggedin))Then break;
A:= A + 1;
If(A= 1)then
C:= C + 1;
If(A= 3)then
C:= C + 1;
For I:= 1 to C do
Begin
If(A= 1)then
Begin
X1:= X1 + 30;
X2:= X2 + 30;
End
If(A= 2)then
Begin
Y1:= Y1 - 20;
Y2:= Y2 - 20;
End
If(A= 3)then
Begin
X1:= X1 - 30;
X2:= X2 - 30;
End
If(A= 4)then
Begin
Y1:= Y1 + 20;
Y2:= Y2 + 20;
End
If(X1= 485) and (X2= 517)then
X2:= X2 - 2;
If(Y1= 325) and (Y2= 345)then
Y2:= Y2 - 7;
If(X2 > 515)Then Break;
If(FindColorTolerance(x, y, Color, X1, Y1, X2, Y2, Tolerance))then
Begin
If(OreColorCount(x, y, Color, 15, MinCount))then
Begin
MMouse(x, y, 5, 5);
GetMousePos(x, y);
Cx:= x;
Cy:= y;
If(IsUpTextMulti('ine', 'Mine', 'ocks'))then //Edited for IsUpTextMulti
Begin
Result := True;
Break;
End
End
End
End
If(A= 4)then A:= 0;
Until(X2 > 515) or (Result= True);
End
End;Just small changes, made all the bitmaps masks(old ones are way to big), and small changes to the procedures.
Tell Me What you think.
I have also edited my own findpickhead functions, so tell me if you like these ideas first.
~ChArMz