Naum
2009-05-12 23:45:37
Made these ones for the new prayer menu, good for combat or antiban:
Function InQuickPrayerMenu : Boolean;
Var TPA : TPointArray;
Begin
FindColorsSpiralTolerance(619, 457, TPA, 7710941, MIX1, MIY1, MIX2, MIY2, 1);
Result := (Length(TPA) > 10)
End;
Function OpenQuickPrayerMenu : Boolean;
Begin
Mouse(711, 54, 40, 15, False);
Wait(200 + Random(200));
Result := ChooseOption('elect')
If Result Then
Wait(800 + Random(400));
End;
Procedure TurnQuickPrayer;
Var xx, yy : Integer;
Begin
If Not FindText(xx, yy, '0', NPCChars, 742, 64, 750, 72) Then
If Not GetColor(726, 76) = 13822676) Then
Mouse(711, 54, 40, 15, True);
End;
Function SetQuickPrayers(Box : TIntegerArray) : Boolean;
Var X1, Y1, X2, Y2, I : Integer;
Tmp, Row : Integer;
Begin
{
Tmp := Length(Box); }
ClearSameIntegers(Box);
{If Tmp > Length(Box) Then
srl_Warn('SetQuickPrayers', 'Duplicate number[s] entered ', warn_AllVersions); }
If Length(Box) > 13 Then
srl_Warn('SetQuickPrayers', IntToStr(Length(Box))+' prayers cannot be selcted at once', warn_AllVersions);
For I := 0 To High(Box) Do
If Box[I] >= 28 Then
srl_Warn('SetQuickPrayers', 'Prayers in array are above the required length use numbers 1 - 27 only', warn_AllVersions);
If Not InQuickPrayerMenu Then
If OpenQuickPrayerMenu Then
Wait(1);
For I := 0 To High(Box) Do
Begin
Row := Trunc(Box[i]/5); {Rasta :D}
Begin
X1 := ((555 - 37) + (37 * Box[I]));
Y1 := ((236 - 35) + (35 * Row));
X2 := ((564 - 37) + (37 * Box[I]));
Y2 := ((242 - 35) + (35 * Row));
If (Box[I] > 5) Then
Begin
X1 := (X1 - ((37*5) * (Row-1)));
X2 := (X2 - ((37*5) * (Row-1)));
End;
If Not FindColor(Tmp, Row, 192, X1, Y1, X2, Y2) Then {<-Used origonal}
MouseBox(X1 + 6, Y1 + 6, X2 - 6, Y2 - 6, 1); { vars becuase
they would be
reset anyway}
Wait(1001 + Random(400));
End;
End;
If Random(2) = 1 Then
Begin
Mouse(711, 54, 40, 15, False);
Wait(200 + Random(200));
Result := ChooseOption('inish');
Exit;
End;
Begin
Result := FindText(X1, Y1, 'onfirm', TradeChars, 605, 443, 700, 460);
Mouse(X1 + 15, Y1 + 7, 5, 1, True);
End;
End;
Procedure TurnOffAllQuickPrayers;
Var xx, yy, I : Integer;
ATPA : T2DPointArray;
TPA : TPointArray;
Begin
If Not InQuickPrayerMenu Then
If OpenQuickPrayerMenu Then
Wait(1);
FindColorsTolerance(TPA, 192, MIX1, MIY1, MIX2, MIY2, 0);
ATPA := TPAToATPA(TPA, 30);
For I := 0 to High(ATPA) Do
If MiddleTPAEx(ATPA[I], xx, yy) Then
Begin
Mouse(xx - 3, yy, 0, 0, True);
Wait(400 + Random(200));
End;
If FindText(xx, yy, 'onfirm', TradeChars, 605, 443, 700, 460) Then
Mouse(xx + 15, yy + 7, 5, 1, True);
End;