Wanted
2010-01-05 17:34:09
Pinball fixes:
in Exit pinball: changed exit colors/tol/sat/mod/text
in SolvePinball :
New Pinball.scar
Abyss.SCAR
Needs a longer wait after selecting a lever:
New Abyss.SCAR
Leo.SCAR
Missing 1 line:
New Leo.SCAR
Antirandoms.SCAR
userewardsbox
new DTM
LoadSolveTeleRandoms
Change these
Enable PrisonPete -> SolveRandom := @SolvePrisonPete; //
Disable Morduat -> SolveRandom := nil;
Disable Mime -> SolveRandom := nil;
Autocolor .SCAR
FindRockColor
1250837 -> 1382166
in Exit pinball: changed exit colors/tol/sat/mod/text
SetColorSpeed2Modifiers(0.57, 0.67);
if (FindColorsTolerance(TPA, 8359275, MSX1, MSY1, MSX2, MSY2, 8)) then
begin
ATPA := SplitTPA(TPA, 30);
SortATPASize(ATPA, True);
for II := 0 to High(ATPA) do
begin
MiddleTPAEx(ATPA[II], X, Y);
Mouse(X, Y, 0, 0, False);
Wait(200 + Random(100));
if (ChooseOptionMulti(['xit C', 'it C', 't Ca'])) thenin SolvePinball :
Wait(3000 + random(500));
Result := ExitPinball;
MakeCompass('N');
SetAngle(True);New Pinball.scar
//-----------------------------------------------------------------//
//-- Scar Standard Resource Library --//
//-- »» Pinball Routines --//
//-----------------------------------------------------------------//
// * function Pinball_InRandom: Boolean; // * by TRiLeZ
// * function p_ScanPillar(var x, y: Integer): Boolean; // * by SKy Scripter
// * function p_GetScore: string; // * by ZephyrsFury
// * function ExitPinball: string; // * by ZephyrsFury, SKy Scripter & Wizzup?
// * function SolvePinball: Boolean; // * by SKy Scripter fixed by Wizzup?
{*******************************************************************************
function Pinball_InRandom: Boolean;
by: TRiLeZ
Description: Checks if you are in the pinball random.
Date: December 30, 2009
*******************************************************************************}
function Pinball_InRandom: Boolean;
begin
if InBlack then
if (not (GetColor(504, 348) = 657930)) then //Arrow in chat box
Result := (CountColor(0, 204, 17, 280, 43) > 80);
end;
{*******************************************************************************
function p_ScanPillar(var x, y: Integer): Boolean;
by: SKy Scripter
Description: Scans for the pinball pillar
*******************************************************************************}
function p_ScanPillar(var x, y: Integer): Boolean;
var
Points: TPointArray;
Colors: array of Integer;
P2D: T2DPointArray;
I, Hi, Bitmap,
J, ma, ind: Integer;
H, S, L: Extended;
Canvas: TCanvas;
Temp : HDC;
begin
try
Temp := GetColorToleranceSpeed;
ColorToleranceSpeed(2);
SetColorSpeed2Modifiers(0.14, 3.06);
FindColorsTolerance(Points, 8440943, MSX1, MMY1, MSX2, MSY2, 10);
HI := High(Points);
Result := False;
ColorToleranceSpeed(Temp);
if (Hi < 20) then
Exit;
Colors := GetColors(Points);
Bitmap := BitmapFromString(MSX2, MSY2, '');
Canvas := GetBitmapCanvas(Bitmap);
Canvas.Brush.Color := 10;
Canvas.Brush.Style := bsSolid;
Canvas.Rectangle(0, 0, MSX2, MSY2);
J := 0;
Canvas.Brush.Color := 255;
Canvas.Pen.Color := 255;
for I := 0 to HI do
begin
ColortoHSL(Colors[I], H, S, L);
if (L > 50.0) then
begin
Canvas.Rectangle(Points[I].x - 1, Points[I].y - 1,
Points[I].x + 1, Points[I].y + 1);
J := J + 1;
end;
end;
if (J > 20) then
begin
Canvas.Brush.Color := 0;
Canvas.FloodFill(2, 2, 10, 0);
Canvas.FloodFill(MSX2 - 5, MSY2 - 5, 10, 0);
Temp := GetClientCanvas.Handle;
SetTargetBitmap(Bitmap);
FindColorsTolerance(Points, 10, 0, 0, MSX2-5, MSY2-5, 0);
SetTargetDc(temp);
if (Length(Points) > 10) then
begin
P2D := TPAtoATPA(Points, 60);
Hi := High(P2D);
ma := 0;
for I := 0 to Hi do
begin
J := Length(P2D[I]);
if (ma < j) then
begin
ma := j;
ind := I;
end;
end;
result := (ma > 40);
end;
end;
if (result) then
begin
MiddleTPAEx(P2D[ind], x, y);
MMouse(x, y, 0, 0);
result := isuptext('ag');
end;
DisplayDebugImgWindow(MSX2, MSY2);
SafeCopyCanvas(canvas, GetDebugCanvas, 0, 0, MSX2, MSY2, 0, 0, MSX2, MSY2);
finally
FreeBitmap(bitmap);
end;
end;
{*******************************************************************************
function p_GetScore: string;
by: ZephyrsFury
Description: Gets the pinball score.
*******************************************************************************}
function P_GetScore: Integer;
begin
Result := -1;
case (CountColor(0, 278, 17, 316, 48)) of
32, 34: case (CountColor(65535, 278, 17, 316, 48)) of
0: Result := 0;
56: Result := 4;
69: Result := 5;
78: Result := 8;
62: Result := 9;
end;
26: Result := 1;
38: Result := 2;
36: Result := 3;
33: Result := 6;
31: Result := 7;
58: Result := 10;
else
WriteLn('Count: ' + IntToStr(CountColor(0, 278, 17, 316, 48)) + ' Bug in P_GetScore!');
end;
end;
{*******************************************************************************
function ExitPinball: Boolean;
by: ZephyrsFury, SKy Scripter & Wizzup?
Description: Exits the pinball random.
*******************************************************************************}
function ExitPinball: Boolean;
var
CTS, II, X, Y, T: Integer;
TPA: TPointArray;
ATPA: T2DPointArray;
begin
CTS := GetColorToleranceSpeed;
ColorToleranceSpeed(2);
SetColorSpeed2Modifiers(0.57, 0.67);
if (FindColorsTolerance(TPA, 8359275, MSX1, MSY1, MSX2, MSY2, 8)) then
begin
ATPA := SplitTPA(TPA, 30);
SortATPASize(ATPA, True);
for II := 0 to High(ATPA) do
begin
MiddleTPAEx(ATPA[II], X, Y);
Mouse(X, Y, 0, 0, False);
Wait(200 + Random(100));
if (ChooseOptionMulti(['xit C', 'it C', 't Ca'])) then
begin
WriteLn('Exit Found');
T := GetSystemTime;
while (GetSystemTime - T < 30000) and (PercentBlackMM = 100) do
Wait(1000 + Random(2000));
Result := (PercentBlackMM < 100);
if (Result) then Break;
end;
Wait(500 + Random(1000));
end;
end;
ColorToleranceSpeed(CTS);
SetColorSpeed2Modifiers(0.2, 0.2);
end;
{*******************************************************************************
function SolvePinball: Boolean;
by: SKy Scripter fixed by Wizzup?
Description: Attempts to solve the Pinball random.
*******************************************************************************}
function SolvePinball: Boolean;
var
x, y, i, score, time, time2: Integer;
begin
Result := false;
Try
for i := 1 to 3 do
begin
ClickContinue(True, True);
Wait(1000);
end;
Wait(1000);
Writeln('Starting the pinball solver.');
Time := GetSystemTime;
while (p_GetScore <> 10) and (GetSystemTime - Time < 240000) do
begin
if p_ScanPillar(x, y) then
begin
Mouse(x, y, 0, 0, True);
score := p_GetScore;
time2 := getsystemtime;
while (score = p_GetScore) and (getsystemtime - time2 < 10000) do
Wait(1000);
Wait(1000 + Random(1000));
end;
Wait(200);
end;
if (GetSystemTime - Time >= 240000) or (p_GetScore <> 10) Then
exit;
MakeCompass('S');
SetAngle(False);
Wait(3000 + random(500));
Result := ExitPinball;
MakeCompass('N');
SetAngle(True);
finally
if Result Then
Writeln('Pinball Solved.')
end;
end;Abyss.SCAR
Needs a longer wait after selecting a lever:
Wait(RandomRange(8000, 9000)); //wait for response
Inc(Trys); //Trys +1New Abyss.SCAR
//-----------------------------------------------------------------//
//-- Scar Standard Resource Library --//
//-- »» Abyss Solver Routines --//
//-----------------------------------------------------------------//
// * function InAbyss: Boolean; // * by Nava2
// * procedure Abyss_WalkToCenter; // * by IceFire908
// * function Abyss_OddManOut(var P: TPoint): string; // * by IceFire908
// * procedure Abyss_ClickLever; // * by IceFire908
// * function SolveAbyss: Boolean; // * by IceFire908 & Nava2
{*******************************************************************************
function InAbyss: Boolean;
By: Nava2
Description: Searches the Minimap for a black count. If in range, we are in the
abyss.
*******************************************************************************}
function InAbyss: Boolean;
var
Pts: TPointArray;
cts: Integer;
begin
cts := GetColorToleranceSpeed;
ColorToleranceSpeed(1);
FindColorsTolerance(Pts, 0, MMX1, MMY1, MMX2, MMY2, 20);
FilterPointsPie(Pts, 0, 360, 50, 76, MMCX, MMCY);
Result := InRange(Length(Pts), 10480, 10520);
ColorToleranceSpeed(cts);
//Writeln('InAbyss returned ' + IntToStr(Length(Pts)) + '.');
end;
{*******************************************************************************
procedure Abyss_WalkToCenter;
By: IceFire908
Description: Walks to center and aligns everything high angle and compass 45deg
*******************************************************************************}
procedure Abyss_WalkToCenter;
var
TPA: TPointArray;
WTC: TPoint;
begin
MakeCompass(45);//Align Northeast to North
SetAngle(True); //High angle
FindColorsTolerance(TPA, clWhite, MMX1, MMY1, MMX2, MMY2, 421); //All but black
FilterPointsPie(TPA, 0, 360, 0, 75, MMCX, MMCY); //On Minimap
WTC := MiddleTPA(TPA);
if (Distance(MMCX, MMCY, WTC.X + 2, WTC.Y - 3) > 4) then //Not standing in
begin
Mouse(WTC.X + 2, WTC.Y - 3, 0, 0, True); //Walk to
Flag;
end;
Wait(1000 + Random(500)); //Wait a second
end;
{*******************************************************************************
function Abyss_OddManOut(var P: TPoint): string;
By: IceFire908
Description: Sorts through colors of each lever, finds the odd one.
*******************************************************************************}
function Abyss_OddManOut(var P: TPoint): string; //Results North south east west or ''
var // each direction each color except none "arm"
TPA: array [0..3] of array [0..2] of TPointArray;
LvCounts: array [0..3] of Integer; //Eye0 Gray1 Pink2 Arm3 amounts
LeverType: array [0..3] of string; //Levertypes for N[0]-E[1]-S[2]-W[3] North south e...we.. ect.
LPos: array [0..3] of TPoint; //The position of each lever for NSEW
Levers: TVariantArray; //Name, Hue, Sat, Col, LumTol, speed2
Locs: TStringArray; //Gives each direction an index
Sec: TPointArray; //Estimated center point of each direction, take or give max 45pixels each way
I, II: Byte; //Used for small loops/indexs
TC: LongInt; //Used for InStrArrEx which doesn't accept bytes
B: TBox; //Box to search in for each direction, reset each loop by Loccenter + or -45
begin //NW (N) NE (E) SE (S) SW (W)
Sec := [Point(149, 73), Point(354, 66), Point(375, 268), Point(137, 279)];
Levers := ['Eye', 0.01, 0.71, 5423374, 17, 'Gray', 0.04, 0.48, 8819879, 19, 'Pink', 0.10, 0.08, 5394279, 10, 'Arm'];
Locs := ['North', 'East', 'South', 'West'];
ColorToleranceSpeed(2);
for I := 0 to 3 do
begin
B := IntToBox(Sec[I].X - 45, Sec[I].Y - 45, Sec[I].X + 45, Sec[I].Y + 45);
for II := 0 to 2 do
begin
SetColorSpeed2Modifiers(Levers[1 + (II * 5)], Levers[2 + (II * 5)])
FindColorsTolerance(TPA[I][II], Levers[3 + (II * 5)], B.X1, B.Y1, B.X2, B.Y2, Levers[4 + (II * 5)]);
if (Length(TPA[I][II]) > 0) then
begin
LPos[I] := MiddleTPA(TPA[I][II]); //Center of colors matched
LeverType[I] := Levers[II * 5]; //Get name and set to direction index
Wait(100); //avoid loop lag
Break; //found color, no need to search for other parts
end;
Wait(100); //avoid loop lag
end;
end;
SetColorSpeed2Modifiers(0.2, 0.2);
ColorToleranceSpeed(1);
for I := 0 to 3 do
begin
if (LeverType[I] = '') then //Arm had no color, so by process of elimination its plain arm
LeverType[I] := 'Arm';
WriteLn(LeverType[I] + ' found in ' + Locs[I] + '.'); //i.e. Eyeball found in north does all 4 locs
end;
for I := 0 to 3 do
for II := 0 to 3 do
begin
if (II < 3) then //Since arm doesn't have a TPA which is index 3
if (Length(TPA[I][II]) > 0) then //checks TPA length and increases the index for lvr counts
Inc(LvCounts[II]); //+1
if (II = 3) then //Arm
if (LeverType[I] = 'Arm') then
Inc(LvCounts[3]); //Add to arm count
end;
if (LvCounts[3] = 2) then //Pink isn't always visible so if two arms indx(3) then set 3 pinks
begin
LvCounts[3] := 0; //no normal arms
LvCounts[2] := 3; //3 pink ones
end;
for I := 0 to 3 do
WriteLn(Levers[I * 5] + ' count: ' + IntToStr(LvCounts[I])); //writeln all lver counts i.e. Eyeball : 3
for I := 0 to 3 do
if (LvCounts[I] = 1) then //if there is just 1 count of one then do the following
begin
InStrArrEx(Levers[I * 5], LeverType, TC); //Match Index with lever name
WriteLn('Found unique! ' + Levers[I * 5] + ' in ' + Locs[TC] + '.'); //Output unique with location
if (not (PointInBox(LPos[TC], IntToBox(MSX1, MSY1, MSX2, MSY2)))) then //check if NOT on MS
LPos[TC] := Sec[TC] //Out put estimated fixed middle of that loc
else
P := LPos[TC]; //Out put middle of TPA from big loop with findcolors for that loc
Result := Locs[TC]; //result = location
Exit; //leave function
end;
WriteLn('No uniques found!'); //all were the same result = ''
end;
{*******************************************************************************
procedure Abyss_ClickLever;
By: IceFire908
Description: Clicks lever, if it didn't find a unique it guesses.
*******************************************************************************}
procedure Abyss_ClickLever;
var
Locs: TStringArray;
Sec: TPointArray;
LLoc: string;
I: LongInt;
P: TPoint;
B: TBox;
begin
Locs := ['North', 'East', 'South', 'West']; //Loc index
Sec := [Point(149, 73), Point(354, 66), Point(375, 268), Point(137, 279)]; // Loc middle index
LLoc := Abyss_OddManOut(P); //LLoc = unique lever location
if (LLoc <> '') then //if oddmanout found a unique then..
begin
MMouse(P.X, P.Y, 0, 0); //hover mouse
Wait(200 + Random(250)); //uptime
if (CountColorTolerance(14342657, 7, 7, 100, 25, 70) > 50) then //check blue text
Mouse(P.X, P.Y, 0, 0, True) //select
else
begin
InStrArrEx(LLoc, Locs, I); //Match up indexes
B := IntToBox(Sec[I].X - 45, Sec[I].Y - 45, Sec[I].X + 45, Sec[I].Y + 45); //set box
if (SpiralMouse(P.X, P.Y, B.X1, B.Y1, B.X2, B.Y2, 'ppend', 30, 8)) then //hover mouse around til text
Mouse(P.X, P.Y, 0, 0, True); //selected in the section
end;
Exit;
end;
I := Random(4); //random location
B := IntToBox(Sec[I].X - 45, Sec[I].Y - 45, Sec[I].X + 45, Sec[I].Y + 45); //random box
WriteLn('Guessing...');
if (SpiralMouse(P.X, P.Y, B.X1, B.Y1, B.X2, B.Y2, 'ppend', 30, 8)) then
Mouse(P.X, P.Y, 0, 0, True); //select random
end;
{*******************************************************************************
function SolveAbyss: Boolean;
By: IceFire908 & Nava2
Description: Solves the Abyss Random.
*******************************************************************************}
function SolveAbyss: Boolean;
var
T, Trys: LongInt;
begin
T := GetSystemTime; //total function time
if (not (InAbyss)) then
Exit;
while ((InAbyss) and (LoggedIn) and (Trys < 6)) do //stops after 5 trys, logged out, or out of random
begin
if (Trys > 0) then //guessed
srl_Warn('SolveAbyss', 'Failed finding right answer. Retrying, attempt #' + IntToStr(Trys) + '.', warn_AllVersions);
Abyss_WalkToCenter; //align/realign
Abyss_ClickLever; //select lever, if not found then guess
FFlag(0); //wait till at lever
Wait(RandomRange(8000, 9000)); //wait for response
Inc(Trys); //Trys +1
end;
Result := ((not (InAbyss)) and (LoggedIn)); //Logged in and not in random
if (not (Result)) then //Still in random or logged out
begin
LogOut; //GTFO!
Exit;
end;
srl_Warn('SolveAbyss', 'Took ' + IntToStr(GetTimeRunning - T) + ' ms.', warn_Debug); //Debug total time
end;Leo.SCAR
Missing 1 line:
if (not (KeepGoin)) then
Break;
KeepGoin := False;//thisNew Leo.SCAR
//-----------------------------------------------------------------//
//-- Scar Standard Resource Library --//
//-- » Leo The Grave Digger Routines --//
//-----------------------------------------------------------------//
// * procedure Leo_LoadDTMs; // * by ZephyrsFury
// * function InLeoGraveyard: Boolean; // * by ZephyrsFury
// * procedure Leo_WaitForScreen(What: string); // * by Iroki
// * procedure Leo_ToCenter; // * by IceFire908
// * function Leo_WalkTo: Boolean; // * by IceFire908
// * function Leo_DepositMausoleum: Boolean; // * by IceFire908
// * function Leo_TalkTo: Boolean; // * by IceFire908
// * function Leo_ClickNearestGrave(cx, cy: Integer): Boolean; // * by Nielsie95 and SKy Scripter
// * function Leo_AnalyzeCoffin2(GetClientCanvas.Handle): string;// * by Iroki
// * function Leo_AnalyzeGraveStone2(GetClientCanvas.Handle): string; // * by Iroki
// * function Leo_BuryCoffins: Boolean; // * by IceFire908 & Iroki
// * function SolveLeo: Boolean; // * by IceFire908, Iroki, Nielsie95, & SKy Scripter
var
LeoDTM_Coffin: Integer;
const
Leo_CoffinColour = 3105664;
Leo_CoffinTol = 8;
Leo_CoffinHue = 0.06;
Leo_CoffinSat = 1.30;
{*******************************************************************************
procedure Leo_LoadDTMs;
By: ZephyrsFury
Description: Loads Leo Solver DTMs and Bitmaps, etc.
*******************************************************************************}
procedure Leo_LoadDTMs;
begin
LeoDTM_Coffin := DTMFromString('78DA63CC636660E864644006B1DE9A0C72401' +
'A24FA1F081893806A1A51D530303081499828584D270135154035' +
'5309A82906AA994E404D35504D3F01358540354D04D46401D54CC' +
'4AD860D8801E1940D04');
end;
{*******************************************************************************
function InLeoGraveyard: Boolean;
By: ZephyrsFury
Description: Checks if we're in the Leo random.
*******************************************************************************}
function InLeoGraveyard: Boolean;
var
Pts: TPointArray;
ATPA: T2DPointArray;
X, Y, II, GraveCount, cts: Integer;
B: TBox;
begin
if (InBlack) then
if (FindColor(X, Y, 60909, MMX1, MMY1, MMX2, MMY2)) then
if (CountColor(60909, MMX1, MMY1, MMX2, MMY2) = 1) then
if (InRange(PercentBlackMM, 75, 80)) then
begin
FindColorsPie(Pts, clWhite, 50, 0.0, 360.0, 0.0, 76.0, MMX1, MMY1, MMX2, MMY2, MMCX, MMCY);
B := GetTPABounds(Pts);
cts := GetColorToleranceSpeed;
ColorToleranceSpeed(2);
SetColorSpeed2Modifiers(100.0, 100.0);
FindColorsTolerance(Pts, 0, B.X1, B.Y1, B.X2, B.Y2, 2);
SetColorSpeed2Modifiers(0.2, 0.2);
ColorToleranceSpeed(cts);
ATPA := SplitTPAEx(Pts, 1, 1);
for II := 0 to High(ATPA) do
if (Length(ATPA[II]) < 50) then
Inc(GraveCount);
Result := (GraveCount > 5);
end;
end;
{*******************************************************************************
procedure Leo_WaitForScreen(What: string);
By: Iroki
Description: Waits for a gravestone/coffin screen.
*******************************************************************************}
procedure Leo_WaitForScreen(What: string);
var
t, C: Integer;
begin
if (What = 'coffin') then
C := 0
else
C := 465160;
t := GetSystemTime;
while (GetColor(20, 20) <> C) and ((GetSystemTime - t) <= (5 * 1000)) do Wait(1);
end;
{*******************************************************************************
procedure Leo_ToCenter;
By: IceFire908
Description: Walks to the center of the graveyard
*******************************************************************************}
procedure Leo_ToCenter;
var
TPA: TPointArray;
LTC: TPoint;
begin
FindColorsTolerance(TPA, clWhite, MMX1, MMY1, MMX2, MMY2, 421);
FilterPointsPie(TPA, 0, 360, 0, 75, MMCX, MMCY);
LTC := MiddleTPA(TPA);
if (Distance(MMCX, MMCY, LTC.X + 3, LTC.Y + 6) > 4) then
begin
Mouse(LTC.X + 3, LTC.Y + 6, 0, 0, True);
Wait(RandomRange(700, 1400));
Flag;
end;
Wait(2500 + Random(500));
end;
{*******************************************************************************
function Leo_WalkTo: Boolean;
by: IceFire908
Description: Finds Leo's NPC yellow dot on the MM and walks to it.
*******************************************************************************}
function Leo_WalkTo: Boolean;
var
TPA: TPointArray;
LWT: TPoint;
begin
Result := FindColors(TPA, 195836, MMX1, MMY1, MMX2, MMY2);
if (not (Result)) then
Exit;
FilterPointsPie(TPA, 0, 360, 0, 75, MMCX, MMCY);
LWT := MiddleTPA(TPA);
if (Distance(MMCX, MMCY, LWT.X, LWT.Y) < 5) then
Exit;
Mouse(LWT.X, LWT.Y, 2, 2, True);
Wait(RandomRange(300, 500));
FFlag(0);
Wait(RandomRange(1500, 2000));
end;
{*******************************************************************************
function Leo_DepositMausoleum: Boolean;
by: IceFire908
Description: Deposits your last 5 items if needed into your bank.
*******************************************************************************}
function Leo_DepositMausoleum: Boolean;
var
TPAA: T2DPointArray;
TPA: TPointArray;
DM, P: TPoint;
I: LongInt;
II: Byte;
B: TBox;
begin
ColorToleranceSpeed(2);
SetColorSpeed2Modifiers(0.42, 0.08);
FindColorsSpiralTolerance(MSCX, MSCY, TPA, 5066321, MSX1, MSY1, MSX2, MSCY, 10);
SetColorSpeed2Modifiers(0.2, 0.2);
ColorToleranceSpeed(1);
TPAA := TPAToATPAEx(TPA, 50, 50);
SortATPASize(TPAA, True);
for I := 0 to High(TPAA) do
begin
DM := MiddleTPA(TPAA[I]);
MMouse(DM.X, DM.Y, 3, 3);
Wait(200 + Random(50));
if (CountColorTolerance(14342657, 7, 7, 100, 25, 70) > 100) then
begin
Result := True;
GetMousePos(DM.X, DM.Y);
Mouse(DM.X, DM.Y, 0, 0, True);
Wait(RandomRange(2000, 3000));
ClickContinue(True, True);
Wait(RandomRange(2000, 3000));
for II := 0 to 4 do
begin
B := IntToBox(383 - (II * 48), 218, 431 - (II * 48), 256);
if (FindColor(P.X, P.Y, srl_OutLine_Black, B.X1, B.Y1, B.X2, B.Y2)) then
begin
Mouse((B.X1 + B.X2) div 2, (B.Y1 + B.Y2) div 2, 2, 2, False);
Wait(RandomRange(400, 600));
ChooseOption('Deposit-All');
Wait(RandomRange(600, 800));
end;
end;
Mouse(434, 40, 0, 0, True);
Wait(RandomRange(1200, 1400));
Exit;
end;
end;
end;
{*******************************************************************************
function Leo_TalkTo: Boolean;
By: IceFire908
Description: Finds Leo and talks to him.
*******************************************************************************}
function Leo_TalkTo: Boolean;
var
TPAA: T2DPointArray;
TPA: TPointArray;
LTT: TPoint;
I: LongInt;
begin
MMouse(MSCX, MSCY, 0, 0);
Wait(200 + Random(50));
if (CountColorTolerance(648165, 7, 7, 100, 25, 50) > 40) then
begin
Result := True;
GetMousePos(LTT.X, LTT.Y);
Mouse(LTT.X, LTT.Y, 0, 0, True);
Wait(RandomRange(1000, 2000));
Exit;
end;
ColorToleranceSpeed(2);
SetColorSpeed2Modifiers(0.15, 0.21);
FindColorsSpiralTolerance(MSCX, MSCY, TPA, 3624531, MSX1, MSY1, MSX2, MSY2, 4);
SetColorSpeed2Modifiers(0.2, 0.2);
ColorToleranceSpeed(1);
TPAA := TPAToATPAEx(TPA, 15, 15);
SortATPASize(TPAA, True);
for I := 0 to High(TPAA) do
begin
LTT := MiddleTPA(TPAA[I]);
MMouse(LTT.X, LTT.Y, 3, 3);
Wait(200 + Random(50));
if (CountColorTolerance(648165, 7, 7, 100, 25, 50) > 40) then
begin
Result := True;
GetMousePos(LTT.X, LTT.Y);
Mouse(LTT.X, LTT.Y, 0, 0, True);
Wait(RandomRange(1000, 2000));
Exit;
end;
end;
end;
{*******************************************************************************
procedure Leo_GrabCoffins;
By: Nielsie95 and SKy Scripter
Description: Grabs all coffins from the screen.
*******************************************************************************}
procedure Leo_GrabCoffins;
var
i, x, y, c, Time, f: Integer;
p: TPointArray;
t: T2DPointArray;
begin
Time := GetSystemTime;
while (CountItems('dtm', LeoDTM_Coffin, []) < 5) and ((GetSystemTime - Time) <= (60 * 1000)) and (f < 5) do
begin
ColorToleranceSpeed(2);
SetColorSpeed2Modifiers(Leo_CoffinHue, Leo_CoffinSat);
FindColorsTolerance(p, leo_CoffinColour, MSX1, MSY1, MSX2, MSY2, Leo_CoffinTol);
if (Length(p) < 30) then Continue;
t := SplitTPAEx(p, 7, 7);
SortATPAFromFirstPoint(t, Point(MSCX, MSCY));
for i := 0 to High(t) do
begin
MiddleTPAEx(t[i], x, y);
MMouse(x, y, 5, 15);
Wait(200 + Random(50));
if (InRange(CountColorTolerance(14342657, 7, 7, 100, 25, 70), 10, 70)) then
begin
GetMousePos(x, y);
c := InvCount;
Mouse(x, y, 0, 0, True);
Wait(500);
FFlag(0);
Wait(1500);
y := 0;
while (c = InvCount) and (y < 20) do
begin
Inc(y);
Wait(500);
end;
if (c < InvCount) then
Break;
end;
end;
if (i > High(t)) then
begin
Inc(f);
Leo_ToCenter;
end;
ColorToleranceSpeed(1);
end;
end;
{*******************************************************************************
function Leo_ClickNearestGrave(cx, cy: Integer): Boolean;
By: Nielsie95 and SKy Scripter
Description: Puts the coffin inside the grave.
*******************************************************************************}
function Leo_ClickNearestGrave(cx, cy: Integer): Boolean;
var
i, c, x, y: Integer;
p: TPointArray;
t: T2DPointArray;
b: TBox;
begin
Result := False;
ColorToleranceSpeed(2);
SetColorSpeed2Modifiers(0.03, 0.33);
FindColorsTolerance(p, 4609120, MSX1, MSY1, MSX2, MSY2, 13);
SetColorSpeed2Modifiers(0.1, 0.2);
t := SplitTPAEx(p, 3, 3);
SortATPAFrom(t, Point(cx, cy));
SortATPAFromFirstPoint(t, Point(cx, cy));
for i := 0 to High(t) do
if (Length(t[i]) > 150) then
begin
b := GetTPABounds(t[i]);
if (CountColorTolerance(3563122, b.x1 + 10, b.y1 + 10, b.x2 -10, b.y2 -10, 13) > 5) then Continue;
MiddleTPAEx(t[i], x, y);
MMouse(x -4, y -4, 10, 10);
Wait(200 + Random(150));
if (not (InRange(CountColorTolerance(14342657, 7, 7, 100, 25, 70), 10, 70))) then Continue;
GetMousePos(x, y);
c := InvCount;
Mouse(x, y, 0, 0, True);
Result := True;
Wait(500);
FFLag(0);
y := 0;
while (c = InvCount) and (y < 20) do
begin
Inc(y);
Wait(500);
end;
if (c > InvCount) then
Break
else
Leo_ClickNearestGrave(cx, cy);
end;
end;
{*******************************************************************************
function Leo_AnalyzeCoffin2(GetClientCanvas.Handle): string;
By: Iroki
Description: Indentifys the coffin, should work first try, if not fail safe :-)
*******************************************************************************}
{*******************************************************************************
function Leo_AnalyzeGraveStone2(GetClientCanvas.Handle): string;
By: Iroki
Description: Indentifys the grave stone, 3 trys and you're good.
*******************************************************************************}
{*******************************************************************************
function Leo_BurryCoffins: Boolean;
By: IceFire908 & Iroki
Description: Finds and identifies coffins and graves.
*******************************************************************************}
function Leo_BuryCoffins: Boolean;
var
GraveTypeCount: array [0..4] of array [0..4] of Integer;
GraveNames: array [0..4] of array [0..2] of string;
CofNames, GraveName: array [0..4] of string;
InvLoc: array [0..4] of Integer;
I, Coffin, II, III, T: Integer;
C, Center, RGS, UWG: TPoint;
GraveSkills: TStringArray;
StoneLoc: array of TBox;
TPAA: T2DPointArray;
TPA: TPointArray;
BadName: Boolean;
B: TBox;
begin
Leo_GrabCoffins;
if (CountItems('dtm', LeoDTM_Coffin, []) < 5) then
begin
WriteLn('Could not find all coffins!');
LogOut;
Exit;
end;
for I := 1 to 28 do
begin
if (not (ExistsItem(I))) then
Continue;
B := InvBox(I);
if (FindDTM(LeoDTM_Coffin, C.X, C.Y, B.X1, B.Y1, B.X2, B.Y2)) then
begin
InvLoc[Coffin] := I;
for II := 0 to 4 do
begin
BadName := False;
Mouse(C.X, C.Y, 2, 2, True);
Leo_WaitForScreen('coffin');
CofNames[Coffin] := Leo_AnalyzeCoffin2(GetClientCanvas.Handle);
Wait(RandomRange(1000, 2000));
Mouse(490, 26, 2, 2, True);
for III := 0 to 4 do
if ((CofNames[III] = CofNames[Coffin]) and (III <> Coffin)) then
BadName := True;
if ((CofNames[Coffin] <> 'error') and (CofNames[Coffin] <> '') and (not (BadName))) then
begin
WriteLn('Coffin ' + IntToStr(Coffin + 1) + ' ' + CofNames[Coffin] + ' identified!');
Inc(Coffin);
Break;
end;
if (II = 4) then
begin
WriteLn('Unable to identify coffin!');
LogOut;
Exit;
end;
end;
end;
end; //NW[0], NE[1], SW[2], SM[3], SE[4] for the loc indexes
GraveSkills := ['cooking', 'crafting', 'farming', 'mining', 'woodcutting'];
StoneLoc := [IntToBox(123, 45, 264, 161), IntToBox(274, 48, 402, 169), IntToBox(14, 162, 178, 317),
IntToBox(232, 149, 333, 331), IntToBox(367, 158, 509, 331)];
for I := 0 to 4 do
begin
Center := Point((StoneLoc[I].X1 + StoneLoc[I].X2) div 2, (StoneLoc[I].Y1 + StoneLoc[I].Y2) div 2);
Leo_ToCenter;
for II := 0 to 2 do
begin
ColorToleranceSpeed(2);
SetColorSpeed2Modifiers(0.42, 0.08);
if (II = 0) then
FindColorsSpiralTolerance(Center.X, Center.Y, TPA, 6908269, StoneLoc[I].X1, StoneLoc[I].Y1, StoneLoc[I].X2, StoneLoc[I].Y2, 17)
else
FindColorsSpiralTolerance(MSCX, MSCY, TPA, 6908269, MSCX - 50, MSCY - 50, MSCX + 50, MSCY + 50, 14);
SetColorSpeed2Modifiers(0.2, 0.2);
ColorToleranceSpeed(1);
TPAA := TPAToATPAEx(TPA, 10, 10);
if (II = 0) then
SortATPAFromFirstPoint(TPAA, Center)
else
SortATPAFromFirstPoint(TPAA, Point(MSCX, MSCY));
for III := 0 to High(TPAA) do
begin
RGS := MiddleTPA(TPAA[III]);
MMouse(RGS.X, RGS.Y, 2, 2);
Wait(250 + Random(50));
if (CountColorTolerance(14342657, 7, 7, 100, 25, 70) > 100) then
begin
GetMousePos(RGS.X, RGS.Y);
Mouse(RGS.X, RGS.Y, 0, 0, True);
Leo_WaitForScreen('');
GraveNames[I][II] := Leo_AnalyzeGraveStone2(GetClientCanvas.Handle);
if (GraveNames[I][II] = '') then
GraveNames[I][II] := 'error';
WriteLn('Grave ' + IntToStr(I + 1) + ' ' + IntToStr(II + 1) + ' ' + GraveNames[I][II] + ' identified!');
Wait(RandomRange(2000, 3000));
Mouse(490, 26, 2, 2, True);
Break;
end;
if (III = High(TPAA)) then
begin
WriteLn('Could not find grave stone!');
LogOut;
Exit;
end;
end;
end;
end;
for I := 0 to 4 do //Count em up
for II := 0 to 2 do
if (InStrArrEx(GraveNames[I][II], GraveSkills, III)) then
Inc(GraveTypeCount[I][III]);
for I := 0 to 4 do //Found a 3 of one
for II := 0 to 4 do
if (GraveTypeCount[I][II] > 2) then
if (not (StrInArr(GraveSkills[II], GraveName))) then
GraveName[I] := GraveSkills[II];
for I := 0 to 4 do //Found a 2 of one
for II := 0 to 4 do
if (GraveTypeCount[I][II] > 1) then
if (not (StrInArr(GraveSkills[II], GraveName))) then
GraveName[I] := GraveSkills[II];
for I := 0 to 4 do //Maybe one of them
begin
if (GraveName[I] <> '') then
Continue;
for II := 0 to 2 do
if (not (StrInArr(GraveNames[I][II], GraveName))) then
if (StrInArr(GraveNames[I][II], GraveSkills)) then
GraveName[I] := GraveNames[I][II];
end;
for I := 0 to 4 do //randomize the rest and pray
begin
if (GraveName[I] <> '') then
Continue;
for II := 0 to 4 do
if (not (StrInArr(GraveSkills[II], GraveName))) then
begin
GraveName[I] := GraveSkills[II];
Break;
end;
end;
for I := 0 to 4 do
WriteLn(IntToStr(I + 1) + ' = ' + GraveName[I]);
for I := 0 to 4 do //bury coffins
begin
Leo_ToCenter;
InStrArrEx(GraveName[I], CofNames, II);
MouseItem(InvLoc[II], False);
Wait(250 + Random(50));
ChooseOption('se');
Wait(RandomRange(500, 800));
Center := Point((StoneLoc[I].X1 + StoneLoc[I].X2) div 2, (StoneLoc[I].Y1 + StoneLoc[I].Y2) div 2);
ColorToleranceSpeed(2);
SetColorSpeed2Modifiers(0.11, 0.19);
FindColorsSpiralTolerance(Center.X, Center.Y, TPA, 3490382, StoneLoc[I].X1, StoneLoc[I].Y1, StoneLoc[I].X2, StoneLoc[I].Y2, 7);
SetColorSpeed2Modifiers(0.2, 0.2);
ColorToleranceSpeed(1);
TPAA := TPAToATPAEx(TPA, 30, 30);
SortATPAFromFirstPoint(TPAA, Center)
for II := 0 to High(TPAA) do
begin
UWG := MiddleTPA(TPAA[II]);
MMouse(UWG.X, UWG.Y, 2, 2);
Wait(250 + Random(50));
if (InRange(CountColorTolerance(14342657, 7, 7, 250, 25, 70), 100, 200)) then
begin
III := InvCount;
GetMousePos(UWG.X, UWG.Y);
Mouse(UWG.X, UWG.Y, 0, 0, True);
T := GetSystemTime;
while (((GetSystemTime - T) < 15000) and (InvCount = III)) do
Wait(RandomRange(500, 1500));
Wait(RandomRange(2000, 3000));
Break;
end;
if (II = High(TPAA)) then
begin
WriteLn('Could not find grave!');
LogOut; //Deselect coffin
Wait(RandomRange(500, 1000));
LogOut;
Exit;
end;
end;
end;
Result := True;
end;
{*******************************************************************************
function SolveLeo: Boolean;
By: IceFire908, Iroki, Nielsie95, & SKy Scripter
Description: Solves the Leo random.
*******************************************************************************}
function SolveLeo: Boolean;
var
X, Y, Leo_Trys: Integer;
KeepGoin: Boolean;
begin
Leo_LoadDTMs;
for Leo_Trys := 1 to 10 do
begin
WriteLn('Leo try # ' + IntToStr(Leo_Trys));
SetAngle(True);
MakeCompass('N');
GameTab(tab_Inv);
Wait(2000);
if (Leo_Trys = 1) then
begin
while (InConvo) do
ClickContinue(True, True);
Wait(1000);
if (FindColor(X, Y, 65535, MSX1, MSY1, MSX2, MSY2)) then
Mouse(455, 45, 5, 5, True);
Wait(RandomRange(1000, 1500));
if (InvCount > 23) then
Leo_DepositMausoleum;
end;
if Leo_BuryCoffins then
if Leo_WalkTo then
if Leo_TalkTo then
begin
while (InConvo) do
begin
ClickContinue(True, True);
if (FindNPCChatText('want', ClickLeft)) then
KeepGoin := True;
Wait(RandomRange(1500, 2500));
end;
end;
if (not (KeepGoin)) then
Break;
KeepGoin := False;
if (Leo_Trys = 10) then
begin
WriteLn('Failed to solve Leo!');
LogOut;
end;
end;
FreeDTM(LeoDTM_Coffin);
Result := (LoggedIn);
if (Result) then
WriteLn('Solved Leo!')
else
begin
WriteLn('Failed to solve Leo!');
LogOut;
end;
end;Antirandoms.SCAR
userewardsbox
new DTM
bDTM := DTMFromString('78DA63CC61626078C68002DA452219FE03694' +
'620FE0F048C9940355719D00013986484F2187388509300E4DF23' +
'A0A69C083520F77C20C2AED704D45400F96FF1AB0100750B108B');LoadSolveTeleRandoms
Change these
Enable PrisonPete -> SolveRandom := @SolvePrisonPete; //
Disable Morduat -> SolveRandom := nil;
Disable Mime -> SolveRandom := nil;
Autocolor .SCAR
FindRockColor
1250837 -> 1382166
{*******************************************************************************
function FindRockColor: Integer;
By: Tarajunky, fixed by Shuttleu, IceFire908
Description: Autodetecs Rock (Gray) Color on Minimap
*******************************************************************************}
function FindRockColor: Integer;
var
A, L, TestColor: Integer;
P: TPointArray;
begin
Flag;
if FindMMColorsSpiralTolerance(P, 5591394, 80) then
begin
L := High(P);
for A := 0 to L do
begin
TestColor := GetColor(P[a].x,P[a].y);
if (TestColor - GetColor(P[A].X + 1,P[A].Y) = 1382166) then
begin
Result := TestColor;
srl_Warn('FindRockColor', 'RockColor = ' + IntToStr(TestColor), warn_Debug);
Exit;
end;
end;
end;
srl_Warn('FindRockColor', 'Could''t find RockColor', warn_Debug);
Result := 0;
end;