Naum
2009-10-11 06:05:23
Hello,
1) Due to the new PercentColorMM, the PercentBlackMM in AntiRandoms/Common.Scar could be changed from this:
To:
2) A new FindRange() in cooking.scar:
The current one just fails. :(
3) A DragMouse(); procedure:
If This will be added, then procedures like DragInvItem and Drag_BeePart can be edited as so:
To:
(The one's in ()'s represent the randomness, you should just change it to 16 and 20 for x and y repectively, but it's much more accurate that way).
AND:
To:
May be a bit unreadable :/
4) In Prayer.Scar:
Could be a good fail safe for functions like ClickPrayer, as there's no point on activating a prayer if they're no prayer points left.
Will add more when I think of them :p.
1) Due to the new PercentColorMM, the PercentBlackMM in AntiRandoms/Common.Scar could be changed from this:
function PercentBlackMM: Integer;
var
cts: Integer;
p: TPointArray;
begin
cts := GetColorToleranceSpeed;
ColorToleranceSpeed(1);
FindColorsTolerance(p, 0, MMX1, MMY1, MMX2, MMY2, 1);
Result := Round((Length(p) / 18163.0) * 100.0);
ColorToleranceSpeed(cts);
end;
To:
Function PercentBlackMM : Byte;
Begin
Result := PercentColorMM(ClBlack, 1);
End;2) A new FindRange() in cooking.scar:
Function FindRange(Var X, Y : Integer) : Boolean;
Var TPA : Array [0..1] Of TPointArray;
ATPA : Array Of TPointArray;
I : Integer;
ColTolArray : TIntegerArray;
Begin
ColTolArray := [595884, 12, 1648052, 20];
For I := 0 to 1 Do
FindColorsSpiralTolerance(MSCX, MSCY, TPA[I], ColTolArray[I * 2], MSX1, MSY1, MSX2, MSY2, ColTolArray[(I * 2)+1]);
TPA[0] := MergeATPA(TPA);
ATPA := SplitTPA(TPA[0], 3);
SortATPASize(ATPA, True);
For I := 0 To High(ATPA) Do
If (GetArrayLength(ATPA[I]) >= 3) And MiddleTPAEx(ATPA[i], X, Y) Then
Begin
CircleMouse(X, Y, 3, 3);
Result := WaitUpText('option', 70+Random(30));
If Result Then Break;
End;
End;The current one just fails. :(
3) A DragMouse(); procedure:
From: NaumanAkhlaQ
4) A DragMouse(); procedure:Procedure DragMouse(StartX, StartY, SRandX, SRandY, EndX, EndY, ERandX, ERandY : Integer);
Begin
MMouse(StartX, StartY, SRandX, SRandY);
Wait(150 + Random(20));
GetMousePos(x, y);
HoldMouse(x, y, True);
Wait(50 + Random(20));
MMouse(EndX, EndY, ERandX, ERandY);
Wait(150 + Random(20));
ReleaseMouse(x, y, True);
End;
Would help cut down on the code for few things, for example DragItem, Bee_DragMouse and a few others.
Usage: If I wanted to click on 500, 500 with 6 randomness on the x and 7 on the y co-ord, I would do:DragMouse(500, 500, 6, 7 ....);
If I wanted to drag it to 800, 800 and release it with 3 randomness and 6 for x and y respectively, I would then add:DragMouse(500, 500, 6, 7, 800, 800, 3, 6);
:)
If This will be added, then procedures like DragInvItem and Drag_BeePart can be edited as so:
procedure DragItem(inv1, inv2: Integer);
var
X, Y: Integer;
begin
InvMouse(Inv1, 3);
GetMousePos(X, Y);
HoldMouse(X, Y, True);
Wait(150 + Random(50));
InvMouse(Inv2, 3);
GetMousePos(X, Y);
ReleaseMouse(X, Y, True);
end;
To:
procedure DragItem(inv1, inv2: Integer);
Var InvAr : Array [0..1] Of TBox;
begin
InvAr[0] := InvBox(Inv1);
InvAr[1] := InvBox(Inv2);
DragMouse(InvAr[0].x1, InvAr[0].y1, InvAr[0].x2, InvAr[0].y2,
InvAr[1].x1, InvAr[1].y1, InvAr[1].x2, InvAr[1].y2);
end;
(The one's in ()'s represent the randomness, you should just change it to 16 and 20 for x and y repectively, but it's much more accurate that way).
AND:
procedure Bee_DragMouse(Pt1, Pt2: TPoint);
var
x, y: integer;
begin
MMouse(Pt1.x, Pt1.y, 5, 5);
GetMousePos(x, y);
HoldMouse(x, y, True);
Wait(200+Random(100));
MMouse(Pt2.x, Pt2.y, 10, 10);
GetMousePos(x, y);
Wait(200+Random(100));
ReleaseMouse(x, y, True);
Wait(100+Random(100));
end;
To:
procedure Bee_DragMouse(Pt1, Pt2: TPoint);
begin
DragMouse(Pt1.x, Pt1.y, 5, 5, Pt2.x, Pt2.y, 10, 10);
end;
May be a bit unreadable :/
4) In Prayer.Scar:
Function PrayerPoints : Byte;
Var TmpStr : String;
Begin
Result := GetMMLevels('pray', TmpStr);
End;
Could be a good fail safe for functions like ClickPrayer, as there's no point on activating a prayer if they're no prayer points left.
Will add more when I think of them :p.