Getdropped
2012-07-30 01:53:50
What it will do: C1 rusher (more into the future)
So far I have the frozen floors scripted down I am looking for fairly decent quality pics of keys and bosses etc for colors ;) all the help would be geat post your pics here.
It is well named since unlike reflection with a single scripter we are open to the public and everyone contributes.
I know alot of you are most likely thinking stop your wasting your time. Well IDRC (i dont really care) People say it CANNOT be done well all I have to say is :f: .
Anyone that would like to help create functions please post them.
What is still needed (images):
Key images
Key door images
Abandonded floor doors and key doors
occ floor doors and key doors
Bosses
Custom sps map image:
Please all try to contribute how ever you can ;)
Inspiration: Simba (as a whole), the challenge, showing that simba is the one and only true "bot" out there.
Done so far:
//By Getdropped
program WeDungeon;
{$DEFINE SMART}
{$I SRL/SRL.Simba}
{$IFDEF SIMBAMAJOR980}
{$I SRL/SRL/Misc/PaintSmart.Simba}
{$ELSE}
{$I SRL/SRL/Misc/SmartGraphics.Simba}
{$ENDIF}
{.include SRL/SRL/Skill/Fighting.simba}
{$i sps/sps.simba}
var
x, y, NoFood, FoundStairs, WallNum, FoundDoor, FoundLoot, NoMonster,
FailSafe, DoorTries, BackGroundColor, TimesBackTracked :Integer;
Key, Debug, OpenedRoom : Variant;
procedure DeclarePlayers;
begin
HowManyPlayers := 1;
NumberOfPlayers(HowManyPlayers);
CurrentPlayer := 0;
with Players[0] do
begin
Name := ''; //Character Name
Pass := ''; //Character Pass
Pin := ''; //Pin for bank
Active := true;
end;
end;
function CustSPS_GetMyPos(): TPoint;
var
Minimap: TMufasaBitmap;
SmallMap: T3DIntegerArray;
t, FoundMatches: integer;
P: TPoint;
Searches: extended;
begin
Result := Point(-1, -1);
if (not LoggedIn) then
Exit;
if (SPS_Tolerance < 1.0) then
SPS_Tolerance := 600.0;
if (SPS_MatchesPercent = 0.0) then
SPS_MatchesPercent := 0.35;
{if (inRange(round(rs_GetCompassAngleDegrees), 10, 350)) then
MakeCompass('N');}
t := getSystemTime();
Minimap := SPS_GatherMinimap;
SPS_FilterMinimap(Minimap);
//DrawBitmapDebugImg(Minimap.Index);
//DisplayDebugImgWindow(150, 150);
{$IFDEF SIMBAMAJOR990}
SetLength(SmallMap, 0); // Using this instead of SmallMap := [];
SPS_BitmapToMap(Minimap, SPS_Accuracy, SmallMap);
{$ELSE}
SmallMap := [];
SmallMap := SPS_BitmapToMap(Minimap, SPS_Accuracy);
{$ENDIF}
FoundMatches := SPS_FindMapInMap(P.x, P.y, SPS_AreaMaps, SmallMap, SPS_Tolerance);
Searches := ((Minimap.Width / SPS_Accuracy) * (Minimap.Height / SPS_Accuracy));
{
writeln('fx: '+toStr(p.x)+' ~ on area: '+toStr(P.X * SPS_Accuracy + (Minimap.Width / 2)));
writeln('fy: '+toStr(p.y)+' ~ on area: '+toStr(P.Y * SPS_Accuracy + (Minimap.Width / 2)));
writeln('matches: '+toStr(foundMatches));
writeln('searches: '+toStr(searches));
writeln('percent: '+toStr(FoundMatches / Searches));
}
if ((FoundMatches / Searches) > SPS_MatchesPercent) then
Result := SPS_LocalToGlobal(SPS_GetTopLeftCoords(SPS_Areas), // the top left of the total area
P.x * SPS_Accuracy + (Minimap.Width / 2),
P.y * SPS_Accuracy + (Minimap.Width / 2));
Minimap.Free;
t := (GetSystemTime - t);
if (SPS_Debug) then
Writeln('SPS_GetMyPos: Finished in '+ToStr(t)+' ms. Result = '+ToStr(Result));
end;
function MMMS(MM: TPoint): TPoint;
Var
X, Y :Extended;
begin
X := (((MM.X - 626.5) * 9.81119354838709677419354838709677) + 258.531);
Y := (((MM.Y - 84.5) * 8.84193548387096774193548387096777) + 175.341);
Result := Point(Round(X), Round(Y));
end;
function HasKey : Boolean;
var
x, y, NoneDTM: Integer;
Found : Extended;
begin
NoneDTM := DTMFromString('mKgEAAHic42NgYOAAYlkkLMWAAKxAzALEwkDMD8ViQMwDlWOE' +
'yrMDMTMQsyHpZUMSZ4eqB4n9//+fLMwF1EsOZiQTowIAstArkA==');
if FindDTMRotated(NoneDTM, x, y, 9, 63, 91, 86, -Pi/4, Pi/4,
Pi/60, Found) then
begin
Writeln('You do not have a key =[ ');
end
else
begin
Writeln('You have a key!');
Result := true;
end;
Freedtm(NoneDTM);
end;
function HasCorrectKey : Boolean;
var
x, y, NotCorrectDTM: Integer;
Found : Extended;
begin
NotCorrectDTM := DTMFromString('m5wEAAHicE2dgYNgKxNuBeCMQrwPiVVC8F4oPQvERID4OxCeA' +
'eAEUzwXiOUA8DYjPA/FZIJ4CxH1A3APEzkwMDA5AbAXErlDsAKVtoLQjFKOLg7ATVNwBSQxm' +
'xlAFjDTEOAAAmSAWDw==');
if FindDTMRotated(NotCorrectDTM, x, y, 8, 440, 290, 458, -Pi/4, Pi/4, Pi/60,
Found) then
begin
Writeln('You do not have the right key =[ ');
end
else
begin
Writeln('You have the right key!');
Result := true;
end;
Freedtm(NotCorrectDTM);
end;
function GoodDoor : Boolean;
var
x, y, i : Integer;
begin
Getmousepos(x,y);
for i := 0 to 50 do
if (GetColor((x + i), y) = 0) or (GetColor((x - i), y) = 0) then
begin
Writeln('That wasnt a good door.');
Result := false;
Exit
end;
Writeln('That is a good door!');
Result := true;
Mouse(x, y, RandomRange(-2, 2), RandomRange(-2, 2), true);
Exit;
end;
{
MMouse((x + 25), y, RandomRange(-2, 2), RandomRange(-2, 2));
Wait(RandomRange(350, 450));
if (IsUpText('nter')) or (IsUpText('oor')) and not(GetColor((x + 25), y) = 0)
and not(GetColor((x - 25), y) = 0) then
begin
Writeln('That is a good door!');
Result := true;
Mouse(x, y, RandomRange(-2, 2), RandomRange(-2, 2), true);
Exit;
end;
MMouse((x - 25), y, RandomRange(-2, 2), RandomRange(-2, 2));
Wait(RandomRange(350, 450));
if (IsUpText('nter')) or (IsUpText('oor')) and not(GetColor((x - 25), y) = 0)
and not(GetColor((x + 25), y) = 0) then
begin
Writeln('That is a good door!');
Result := true;
Mouse(x, y, RandomRange(-2, 2), RandomRange(-2, 2), true);
Exit;
end;
Writeln('That wasnt a good door.');
end;}
function FindStairs: Boolean;
var
arP, arAP: TPointArray;
arC, arUC: TIntegerArray;
ararP: T2DPointArray;
tmpCTS, i, j, arL, arL2: Integer;
P: TPoint;
X, Y, Z: Extended;
begin
tmpCTS := GetColorToleranceSpeed;
ColorToleranceSpeed(2);
SetColorSpeed2Modifiers(0.14, 0.16);
if not(FindColorsTolerance(arP, 7696502, MSX1, MSY1, MSX2, MSY2, 4)) then
begin
Writeln('Failed to find the color, no object found.');
ColorToleranceSpeed(tmpCTS);
SetColorSpeed2Modifiers(0.2, 0.2);
Exit;
end;
arC := GetColors(arP);
arUC := arC;
ClearSameIntegers(arUC);
arL := High(arUC);
arL2 := High(arC);
for i := 0 to arL do
begin
ColorToXYZ(arC[i], X, Y, Z);
if (X >= 13.67) and (X <= 19.50) and (Y >= 13.93) and (Y <= 19.96) and (Z >= 15.86) and (Z <= 22.58) then
begin
for j := 0 to arL2 do
begin
if (arUC[i] = arC[j]) then
begin
SetLength(arAP, Length(arAP) + 1);
arAP[High(arAP)] := arP[j];
end;
end;
end;
end;
SortTPAFrom(arAP, Point(MSCX, MSCY));
ararP := SplitTPAEx(arAP, 10, 10);
arL := High(ararP);
for i := 0 to arL do
begin
if (Length(ararP[i]) < 10) then Continue;
P := MiddleTPA(ararP[i]);
MMouse(P.x, P.y, 5, 5);
Wait(100 + Random(100));
if (IsUpText('Climb-down')) then
begin
Getmousepos(p.x, p.y);
MMouse(p.x, p.y, 2, 2);
Mouse(p.x, p.y, 0, 0, true);
IncEx(FoundStairs, 1);
Result := True;
Break;
end;
end;
ColorToleranceSpeed(tmpCTS);
SetColorSpeed2Modifiers(0.2, 0.2);
if (i = arL + 1) then
begin
Exit;
end;
end;
procedure HpCheck;
var
t, i, x, y: Integer;
begin
if (HPPercent < RandomRange(55, 65)) and LoggedIn then
begin
if not InvEmpty then
for i := 1 to 28 do
if ExistsItem(i) then
begin
MMouseItem(i);
GetMousePos(x, y);
if WaitUptext('Eat', 400) then
begin
Mouse(x, y, 0, 0, false);
if WaitOption('Eat', 400) then
begin
t := GetSystemTime;
while ExistsItem(i) and ((GetSystemTime - t) < 2000) do
wait(20);
end;
Exit;
end;
end;
end;
end;
procedure FindMonster;
var
NPCTPA:TPointArray;
begin
NPCTPA := GetMinimapDotsIn('npc', MMX1, MMY1, MMX2, (MMY2 - 50));
if not(length(NPCTPA) = 0) then //removes the previous room
begin
SortTPAFrom(NPCTPA, Point(MMCX, (MMCY - 20)));
Mouse(NPCTPA[0].x, NPCTPA[0].y, 2, 2, true);
end
else
begin
writeln('No NPC dot found.');
NoMonster := 1;
end;
Wait(RandomRange(600, 700));
while IsMoving do
Wait(RandomRange(250, 350));
Wait(RandomRange(1500, 2500));
while (InFight) do
HPCheck;
end;
procedure KeySearch;
var
KeyTPA : TPointArray;
i : integer;
begin
KeyTPA := GetMinimapDotsIn('red', 594, 24, 657, 80);
if (length(KeyTPA) > 0) then
begin
Writeln('There is a key in the next room');
Key := False;
end;
end;
procedure FindDoor;
var
X, Y, i: Integer;
ColorTPA, DoorTPA: TPointArray;
ColorATPA: T2DPointArray;
begin
case WallNum of
0: Mouse(546, 24, 5, 5, true);
1: MakeCompass('E');
2: MakeCompass('S');
3: MakeCompass('W');
4..100: begin
//FindMonster;
WallNum := 0;
Writeln('Reseting wall searcher');
Exit;
end;
end;
Inc(DoorTries);
ColorToleranceSpeed(2);
SetColorSpeed2Modifiers(0.19, 0.10);
if FindColorsTolerance(DoorTPA, 8679000, MSX1, MSY1, MSX2, (MSY2 - 150), 2) then
begin
ColorTPA := DoorTPA;
ColorToleranceSpeed(2);
SetColorSpeed2Modifiers(0.21, 0.39);
FindColorsTolerance(DoorTPA, 3879464, MSX1, MSY1, MSX2, (MSY2 - 150), 4);
ColorTPA := ColorTPA + DoorTPA;
SplitTPAExWrap(ColorTPA, 10, 10, ColorATPA);
if (Debug = true) then
begin
SMART_ClearCanvas;
WriteLn(''+IntToStr(CountColorTolerance(4274738, MSX1, MSY1, MSX2, MSY2, 5))+'');
SMART_DrawDotsEx(False, ColorTPA, clYellow);
//SMART_DrawBoxes(False, False, [GetTPABounds(ColorTPA)], clRed);
//DebugATPABounds(ColorATPA);
end;
//SortATPASize(ColorATPA, );
for i:=0 to High(ColorATPA) do
begin
MiddleTPAEx(ColorATPA[i], X, Y);
MMouse(X, Y, RandomRange(-3, 3), RandomRange(-3, 3));
Wait(200 + Random(100));
if (IsUpText('pen')) or (IsUpText('oor')) or (IsUpText('nter')) then
begin
if (IsUpText('lock')) or (IsUpText('reen')) or (IsUpText('lue')) or
(IsUpText('ilver')) or (IsUpText('rimson')) or (IsUpText('old')) or
(IsUpText('ed')) or (IsUpText('edge')) or (IsUpText('urple')) then
begin
Writeln('Found key door!');
if (HasKey) then
begin
ClickMouse2(false);
if OptionsExist(['nlock'], false) then
begin
WaitOptionMulti(['nlock'], 200);
Wait(RandomRange(550, 650));
while IsMoving do
Wait(RandomRange(250, 350));
Wait(RandomRange(650, 750));
If HasCorrectKey then
begin
Mouse(255, 130, 3, 3, false);
end
else
begin
Inc(WallNum);
Exit;
end;
end;
if OptionsExist(['pen'], false) then
begin
if (DoorTries > 4) and (GetColor(625, 30) = BackGroundColor) then
OpenedRoom := true;
if (DoorTries < 4) and (GetColor(625, 30) = BackGroundColor) then
begin
Inc(WallNum);
Exit;
end;
WaitOptionMulti(['pen'], 200);
case WallNum of
0: WallNum := 3;
1: WallNum := 0;
2: WallNum := 1;
3: WallNum := 2;
4: WallNum := 0;
end;
Wait(RandomRange(600, 700));
FoundDoor := 1;
while IsMoving do
Wait(RandomRange(250, 350));
Wait(RandomRange(450, 650));
if not(OpenedRoom) then
begin
KeySearch;
Mouse(255, 130, 3, 3, true);
end;
if OpenedRoom then
begin
Inc(TimesBackTracked);
Writeln('Back tracking rooms');
end;
OpenedRoom := false;
Wait(RandomRange(650, 850));
Mouse(625, 56, 3, 3, true);
end;
Wait(RandomRange(600, 700));
while IsMoving do
Wait(RandomRange(250, 350));
Exit;
end
else
begin
Inc(WallNum);
Exit;
end;
end
else
begin
if (DoorTries > 4) and not(GetColor(625, 30) = BackGroundColor) then
OpenedRoom := true;
if (DoorTries < 4) and not(GetColor(625, 30) = BackGroundColor) then
begin
Writeln('We already opened that door!');
Inc(WallNum);
Exit;
end;
if GoodDoor then
begin
case WallNum of
0: WallNum := 3;
1: WallNum := 0;
2: WallNum := 1;
3: WallNum := 2;
4: WallNum := 0;
end;
Wait(RandomRange(600, 700));
FoundDoor := 1;
while IsMoving do
Wait(RandomRange(250, 350));
Wait(RandomRange(450, 650));
if not(OpenedRoom) then
begin
KeySearch;
Mouse(255, 130, 3, 3, true);
end;
if OpenedRoom then
begin
Inc(TimesBackTracked);
Writeln('Back tracking rooms');
end;
OpenedRoom := false;
Wait(RandomRange(650, 850));
Mouse(625, 56, 3, 3, true);
Exit;
end;
end;
Writeln('Thats it!');
end;
end;
end;
Inc(WallNum);//inc's after scans the tpa
end;
procedure TakeAllLootold;
var
LootTPA : TPointArray;
i : integer;
begin
LootTPA := GetMiniMapDots('red');
for i := 0 To High(LootTPA) Do
begin
MMMS(LootTPA[i]);
MMouse(MMMS(LootTPA[i]).x, MMMS(LootTPA[i]).y, 2, 2);
Wait(500);
if ((IsUpText('ake')) and not(InvFull)) or (IsUpText('ey')) then
begin
if (IsUpText('ey')) and not(IsUpText('eye')) then
Key := true;
ClickMouse2(Mouse_Left);
Wait(RandomRange(600, 700));
while IsMoving do
Wait(RandomRange(250, 350));
Exit;
end;
end;
end;
procedure TakeAllLoot;
var
i : integer;
LootTPA, CommonTPA, BlackTPA, ColTPA: TPointArray;
LootATPA: T2DPointArray;
begin
Writeln('creating tpas');
LootTPA := TPAFromBox(IntToBox((MSX1 + 100), (MSY1 + 50), (MSX2 - 100), (MSY2 - 50))); //Create a TPA of the full main screen ("MainScreen TPA")
ColorToleranceSpeed(2);
SetColorSpeed2Modifiers(0.25, 0.97);
FindColorsSpiralTolerance(MSCX, MSCY, CommonTPA, 12293450, (MSX1 + 100), (MSY1 + 50), (MSX2 - 100), (MSY2 - 50), 46); //Make a TPA of all the common colors
FindColorsSpiralTolerance(MSCX, MSCY, BlackTPA, 0, (MSX1 + 100), (MSY1 + 50), (MSX2 - 100), (MSY2 - 50), 1);
Writeln('Searching for colors');
//ClearTPAFromTPA(MSTPA, BlackTPA);
LootTPA := ClearTPAFromTPA(LootTPA, CommonTPA);
Writeln('Removed common colors.');
LootTPA := ClearTPAFromTPA(LootTPA, BlackTPA);
Writeln('Removed blacks');
//SortTPAFrom(LootTPA, Point(MSCX, MSCY ));
SplitTPAExWrap(LootTPA, 3, 3, LootATPA);
Writeln('Split tpa');
if Debug then
begin
Writeln('Doing paint');
SMART_ClearCanvas;
//WriteLn(''+IntToStr(CountColorTolerance(12293450, MSX1, MSY1, MSX2, MSY2, 5))+'');
//SMART_DrawDotsEx(False, blackTPA, clYellow);
//SMART_DrawDotsEx(False, CommonTPA, clGreen);
ColTPA := LootTPA;
for i := 0 to High(ColTPA) do
ColTPA[i].Y := (ColTPA[i].Y + 50);
SMART_DrawDotsEx(False, ColTPA, clBlue);
//SMART_DrawBoxes(False, False, [GetTPABounds(LootTPA)], clRed);
//DebugATPABounds(ColorATPA);
end;
//SMART_ClearCanvas;
for i := 0 To High(LootATPA) Do
begin
MiddleTPAEx(LootATPA[i], X, Y);
MMouse(x, y, 2, 2);
Wait(500);
if ((IsUpText('ake')) and not(InvFull)) or (IsUpText('ey')) then
begin
if (IsUpText('ey')) and not(IsUpText('eye')) then
Key := true;
ClickMouse2(Mouse_Left);
Wait(RandomRange(600, 700));
while IsMoving do
Wait(RandomRange(250, 350));
Exit;
end;
end;
end;
procedure WalkToLoot;
var
LootTPA : TPointArray;
begin
LootTPA := GetMiniMapDots('red');
if not(length(LootTPA) = 0) then
begin
SortTPAFrom(LootTPA, Point(MMCX, MMCY));
Mouse(LootTPA[0].x, LootTPA[0].y, 2, 2, true);
end
else
begin
writeln('No Loot dot found.');
FoundLoot := 1;
end;
Wait(RandomRange(600, 700));
while IsMoving do
Wait(RandomRange(250, 350));
Wait(RandomRange(1500, 2500));
while (InFight) do
Wait(RandomRange(250, 350));
end;
procedure RapidLoot;
begin
MMouse(260, 170, 5, 5);
Repeat
Wait(200 + Random(100));
if ((IsUpText('ake')) and not(InvFull)) or (IsUpText('ey')) then
begin
if (IsUpText('ey')) and not(IsUpText('eye')) then
Key := true;
ClickMouse2(Mouse_Left);
Wait(RandomRange(600, 700));
while IsMoving do
Wait(RandomRange(250, 350));
end;
until(not(IsUpText('ake')) or InvFull);
end;
procedure EatFood;
var
GiantFlatFish, ShortEel, RedEye, HeimCrab, DuskEel : Integer;
begin
GiantFlatFish := DTMFromString('mFQEAAHic42VgYHjGxMDwBYg/APFzIL4PxJ+h+BU' +
'Q3wTiG1AM4j8E4guMDAyXgfgGEN+D4lNAfBSKzwDxdSC+BZU7DMT1eXlA25hIwlwMpANGM'+
'jAKAADGOxgc');
ShortEel := DTMFromString('mVAEAAHicE2BgYLBmZmBwAmJ3IHZhhvCNgdgAiG2B2BGIHYD' +
'YEIh1oeo8oOLmQPyWkYHhBRB/BOL/QMzExMDACMT/gOy/QPwDKvcaiN8D8U8g/grEv6HyzZH' +
'hQFcwkY25GCgDjBRidAAAlP0S8w==');
RedEye := DTMFromString('mFQEAAHic42VgYDBnZmCwA2JHIHaHYicgtgdiGyA2BWJ9KLYEY' +
'mMgvsLIwHAcis8B8QkgvgrE14H4NhDfgeKzUDmQuuqIIKBtTCRhLgbSASMZGAUAACUVDyk=');
HeimCrab :=DTMFromString('mfgEAAHicrc7dCkRQFMXxdY4LolGoQfEAc+X9n0iSUqSJfPz' +
'LuZvLsevXXhdr104lpZ6UIUGEAG8UKJGjcrn27v4LPkLXjzEZqUeLzuXB5Rkjvtix4YS10sF' +
'ezH2/omk+fGX/FuqZMQ/5nQv4wRKF');
DuskEel := DTMFromString('mfgEAAHicrc5BCkBgEIbh+VkohRKlhFNyBecSCyVZCQlX8ZbZ' +
'WTL1NPNNs5hQREJbJEWGHIXOCSL4cOAi0F2s2YKnuTcinXn6gAkzdhy4cGLDikVvRr1v0aCu' +
'Sr6yPnPlnzI/edcNVh8SCw==');
end;
procedure Equipt;
var
x, y, PlateSkirt, PlateBody, FullHelm : Integer;
Found : Extended;
begin
Plateskirt := DTMFromString('mfgEAAHicrclBCoNAEETRGscsIkpwJN5BN95UFIkoJJ7T4' +
'CYf7FVcasGDruogafTS+8/s9/2FAZ1p8TETeiy2R5F0R4aAJ0o8UNidI4WDsDlpxRcx/Yamr' +
'vbnSYmuibvIMT8FRg9k');
PlateBody := DTMFromString('m6wAAAHic42ZgYNjNxMCwD4gPA/FxJgh/B1TsEBBvBOItU' +
'JzCyMAQBcTRQBwHxLloGCQWC8QZQOxgYQ40nYkoLMJAPGAkASMBAAyvDWw=');
if FindDTMRotated(PlateSkirt, x, y, MIX1, MIY1, MIX2, MIY2, -Pi/4, Pi/4,
Pi/60, Found) then
begin
Mouse(x, y, 3, 3, true);
Wait(RandomRange(600, 700));
end;
if FindDTMRotated(PlateBody, x, y, MIX1, MIY1, MIX2, MIY2, -Pi/4, Pi/4,
Pi/60, Found) then
begin
Mouse(x, y, 3, 3, true);
end;
Freedtm(PlateSkirt);
Freedtm(PlateBody);
end;
procedure HomeTele;
begin
if not(GameTab(tab_magic)) then
GameTab(tab_magic);
while IsMoving do
Wait(RandomRange(250, 350));
while InFight do
Wait(RandomRange(250, 350));
MMouse(574, 228, 2, 2);
ClickMouse2(Mouse_Left);
Wait(RandomRange(10000, 15000));
if not(GameTab(tab_inv)) then
GameTab(tab_inv);
end;
function FoundSmuggler : Boolean;
var
X, Y, i: Integer;
ColorTPA, SecondColorTPA, ThirdColorTPA: TPointArray;
ColorATPA: T2DPointArray;
begin
ColorToleranceSpeed(2);
SetColorSpeed2Modifiers(0.05, 0.07);
FindColorsTolerance(ColorTPA, 3756647, MSX1, MSY1, MSX2, MSY2, 8);
{if FindColorsTolerance(ColorTPA, 3756647, MSX1, MSY1, MSX2, MSY2, 8) or
FindColorsTolerance(SecondColorTPA, 3229530, MSX1, MSY1, MSX2, MSY2, 13) or
FindColorsTolerance(ThirdColorTPA, 4284530, MSX1, MSY1, MSX2, MSY2, 7) then
begin }
SetColorSpeed2Modifiers(0.15, 0.12);
FindColorsTolerance(SecondColorTPA, 3229530, MSX1, MSY1, MSX2, MSY2, 13);
SetColorSpeed2Modifiers(0.05, 0.14);
FindColorsTolerance(ThirdColorTPA, 4284530, MSX1, MSY1, MSX2, MSY2, 7);
ColorTPA := ColorTPA + SecondColorTPA + ThirdColorTPA;
SplitTPAExWrap(ColorTPA, 10, 10, ColorATPA);
if (Debug = true) then
begin
SMART_ClearCanvas;
WriteLn(''+IntToStr(CountColorTolerance(3756647, MSX1, MSY1, MSX2, MSY2, 8))+'');
SMART_DrawDotsEx(False, ColorTPA, clGreen);
//SMART_DrawBoxes(False, False, [GetTPABounds(ColorTPA)], clRed);
//DebugATPABounds(ColorATPA);
end;
//SortATPASize(ColorATPA, );
for i:=0 to High(ColorATPA) do
begin
MiddleTPAEx(ColorATPA[i], X, Y);
MMouse(X, Y, RandomRange(-3, 3), RandomRange(-3, 3));
Wait(200 + Random(100));
if (IsUpText('alk-to')) or (IsUpText('uggler')) then
begin
Result := true;
Break;
end;
end;
end;
//end;
procedure EndDung;
var
X, Y, i, Tries: Integer;
ColorTPA: TPointArray;
ColorATPA: T2DPointArray;
begin
Tries := 0;
repeat
case Tries of
0: Mouse(546, 24, 5, 5, true);
1: MakeCompass('E');
2: MakeCompass('S');
3: MakeCompass('W');
4: Mouse(546, 24, 5, 5, true);
5: MakeCompass('E');
6: MakeCompass('S');
7: MakeCompass('W');
8..100: Mouse(546, 24, 5, 5, true);
end;
while InFight do
Wait(RandomRange(450, 550));
ColorToleranceSpeed(2);
SetColorSpeed2Modifiers(0.07, 0.38);
if FindColorsTolerance(ColorTPA, 7958870, MSX1, MSY1, MSX2, MSY2, 10) then
begin
SplitTPAExWrap(ColorTPA, 10, 10, ColorATPA);
if (Debug = true) then
begin
SMART_ClearCanvas;
WriteLn(''+IntToStr(CountColorTolerance(7958870, MSX1, MSY1, MSX2, MSY2, 7))+'');
SMART_DrawDotsEx(False, ColorTPA, clGreen);
//SMART_DrawBoxes(False, False, [GetTPABounds(ColorTPA)], clRed);
//DebugATPABounds(ColorATPA);
end;
//SortATPASize(ColorATPA, );
for i:=0 to High(ColorATPA) do
begin
MiddleTPAEx(ColorATPA[i], X, Y);
MMouse(X, Y, RandomRange(-3, 3), RandomRange(-3, 3));
Wait(200 + Random(100));
if (IsUpText('nd')) or (IsUpText('ungeon')) then
begin
ClickMouse2(Mouse_Left);
while IsMoving do
Wait(RandomRange(250, 350));
Wait(RandomRange(3000, 3500));
Mouse(477, 34, RandomRange(-3, 3), RandomRange(-3, 3), true);
Wait(RandomRange(1000, 1500));
Mouse(432, 35, RandomRange(-2, 2), RandomRange(-2, 2), true);
Tries := 9;
Break;
end;
end;
end;
Inc(Tries);
until(not(loggedin) or (Tries > 8));
end;
function FindBoss : Boolean;
var
x, y, BossRoomDTM, BossRoomDTM2, ReceivedDTM : Integer;
Found : Extended;
begin
if not(CustSPS_GetMyPos() = Point(-1, -1)) then
begin
Writeln('Found boss! ~via location');
Result := true;
Exit;
end;
{BossRoomDTM := DTMFromString('mPwEAAHicpc7LCkBgEEDh4QW8gRe0sVFuyUZY8MeGrJCSt3RckmTF1FczZzWGiOS6yAgbiX7cDfxbrxEjQIjybIUm4pxCTKigMGNBjwEtMkTIkXbdLlLq2u8sz33tG5O/v9J+eMwK56Ur6Q==');
if FindDTMRotated(BossRoomDTM, x, y, MMX1, MMY1, MMX2, MMY2, -Pi/4, Pi/4,
Pi/60, Found) then
begin
Writeln('Found boss! ~ via room dtm one');
MMouse(x, y, 0,0);
FreeDTM(BossRoomDTM);
Result := true;
Exit;
end; }
{ BossRoomDTM2 := DTMFromString('mKgEAAHic42NgYEhkZGCoAmIPIC6Dsr2BOB6IE4A4EI' +
'jTgDgKiGuBuA6Ii4F4IhCvAeKVUPHJULoRiBcA8QwgXgTEK4C4A6pvPhC3T57NkJxVyMDGwM' +
'pQUtvKUNcxASwGwtWtPQz5FfVgNogGqQFhEFsO6FZyMCOZGBUAANMTIJE=');
if FindDTMRotated(BossRoomDTM2, x, y, MMX1, MMY1, MMX2, MMY2, -Pi/4, Pi/4,
Pi/60, Found) then
begin
Writeln('Found boss! ~ via room dtm two');
Result := true;
//FreeDTM(BossRoomDTM);
FreeDTM(BossRoomDTM2);
Exit;
end; }
ReceivedDTM := DTMFromString('mEQIAAHic3cvBCkBAEMbx4S0US/u2UoqTC6WclIOSHMh' +
'Fnsv/MFt7cXUw9Wtmmm8iERkwYlKzWrBiw4kDO3p0aNGoCjVKFMhx4VZpKGKQwKrY2/2eeRm' +
'jrHd3GfcT6fyXCj7wWg/SrRPy');
if FindDTMRotated(ReceivedDTM, x, y, 8, 440, 290, 458, -Pi/4, Pi/4, Pi/60,
Found) then
begin
Writeln('Found boss! ~ via ReceivedDTM');
Result := true;
Typesend(':)');
//FreeDTM(BossRoomDTM);
//FreeDTM(BossRoomDTM2);
FreeDTM(ReceivedDTM);
Exit;
end;
Writeln('Not in a boss');
FreeDTM(ReceivedDTM);
// FreeDTM(BossRoomDTM2);
//FreeDTM(BossRoomDTM);
end;
procedure CenterStartRoom;
var
x, y, StartRoomDTM : Integer;
Found : Extended;
begin
Mouse(546, 24, 5, 5, true);
StartRoomDTM := DTMFromString('mPwEAAHicpc7LCkBgEEDh4QW8gRe0sVFuyUZY8MeGrJ' +
'CSt3RckmTF1FczZzWGiOS6yAgbiX7cDfxbrxEjQIjybIUm4pxCTKigMGNBjwEtMkTIkXbdL' +
'lLq2u8sz33tG5O/v9J+eMwK56Ur6Q==');
if FindDTM(StartRoomDTM, x, y, MMX1, MMY1, MMX2, MMY2) then
begin
Writeln('Found center of start room!');
Mouse(x, y, RandomRange(-2, 2), RandomRange(-2, 2), true);
FreeDTM(StartRoomDTM);
Exit;
end;
FreeDTM(StartRoomDTM);
Writeln('Did not find start room center');
end;
procedure CenterOfRoom;
var
x, y, CenterRoomDTM, CenterRoomDTM2 : Integer;
Found : Extended;
begin
Mouse(546, 24, 5, 5, true);
CenterRoomDTM := DTMFromString('mkwEAAHicE2ZgYDgBxM+g+AEQXwbiw0C8HYiXQ/EyK' +
'AaxNwDxbiA+DsQXgPgmEN8D4vVA/ASIzwDxJyBmYYRgZiBmBeI/QLG3ULVXoOqO4MAgPZmVV' +
'QwMTIxUwW5AM0WohBmpiLEAABmAHYo=');
if FindDTM(CenterRoomDTM, x, y, MMX1, MMY1, MMX2, MMY2) then
begin
Writeln('Found center of your room DTM 1!');
Mouse(x, y, RandomRange(-2, 2), RandomRange(-2, 2), true);
FreeDTM(CenterRoomDTM);
Exit;
end;
FreeDTM(CenterRoomDTM);
CenterRoomDTM2 := DTMFromString('mVAEAAHicE2BgYFAEYkcodoZicyDWBGJBIJZgw' +
'AScQKwKxBZArATEBkAsC8RCUDlGKGaA0nxQdRpAbIxkjxMQt0ybw8DIyEI2dgOaIUIBZqQQ' +
'owMArF0Hmw==');
if FindDTM(CenterRoomDTM2, x, y, MMX1, MMY1, MMX2, MMY2) then
begin
Writeln('Found center of your room DTM 2!');
Mouse(x, y, RandomRange(-2, 2), RandomRange(-2, 2), true);
FreeDTM(CenterRoomDTM2);
Exit;
end;
FreeDTM(CenterRoomDTM2);
Writeln('Did not find the center of your room!');
end;
begin
Cleardebug;
{$IFDEF SMART}
{$IFDEF SIMBAMAJOR980}
Smart_Server := 72;
Smart_Members := True;
Smart_Signed := True;
Smart_SuperDetail := False;
{$ELSE}
SRL_SixHourFix := True;
Smart_FixSpeed := True;
{$ENDIF}
{$ENDIF}
SetupSRL;
DeclarePlayers;
LoginPlayer;
Writeln('Welcome to WeDungeon!');
Wait(800);
SetAngle(SRL_ANGLE_HIGH);
SPS_Setup(RUNESCAPE_OTHER, ['WeDungeon']);
Key := true;
Debug := true;
repeat
{repeat
FindStairs;
until(FoundStairs > 0) }
Mouse(300, 205, 2, 2, true);
FoundStairs :=0;
Wait(randomrange(2500, 3000));
Mouse(54, 105, 3, 0, true);//chooses floor one
wait(randomrange(800, 900));
Mouse(211, 281, 2, 2, true);// click confirm
wait(randomrange(800, 900));
Mouse(43, 51, 1, 1, true); //click one
wait(randomrange(800, 900));
Mouse(211, 281, 2, 2, true);// click confirm
wait(randomrange(6000, 7000));
BackGroundColor := GetColor(630, 20);
Writeln(IntToStr(BackGroundColor));
repeat
TakeAllLoot;
WalkToLoot;
until(FoundLoot = 1);
Equipt;
FindMonster;
NoMonster := 0;
//CenterStartRoom;
FoundLoot := 0;
while IsMoving do
begin
Wait(250);
end;
repeat
Mouse(546, 24, 5, 5, true);
repeat
OpenedRoom := false;
FindDoor;
inc(FailSafe);
until((FoundDoor = 1) or (FailSafe > 8) or (TimesBackTracked > 5));
DoorTries := 0;
if (FailSafe > 8) or (TimesBackTracked > 5) then
HomeTele;
TimesBackTracked := 0;
FailSafe := 0;
FoundDoor := 0;
SetAngle(SRL_ANGLE_HIGH);
FindBoss;
repeat
FindMonster;
Inc(FailSafe);
until((NoMonster = 1) or FoundSmuggler or (FailSafe > 5));
FailSafe := 0;
NoMonster := 0;
repeat
WalkToLoot;
TakeAllLoot;
RapidLoot;
Inc(FailSafe);
until((FoundLoot = 1) or (Key = true) or (FailSafe > 10));
if (FailSafe > 10) then
HomeTele;
Key := true;
CenterOfRoom;
if FindBoss then
EndDung;
FailSafe := 0;
FoundLoot := 0;
//WallNum := 0;
//Makecompass('E');
until(not(loggedin));
until(false);
end.