SRL Archive - Research & Development Lounge

Project WeDungeon


Getdropped

2012-07-30 01:53:50

WeDungeon




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.

Chris

2012-07-30 02:03:11

Nice project, could we see the source of what you already have?

kevin33

2012-07-30 02:05:29

I will post pictures when I can. All I can say is good luck to everyone who participates.

Le Jingle

2012-07-30 02:09:55

Cool project, also, why are occult floor info's needed for c1s? Unless you c1 up to 47… which would nerf your xp gains. Cool project though, will be interesting to see what comes of it!

Getdropped

2012-07-30 02:16:24

From: Chris
Nice project, could we see the source of what you already have?


so far it is still really rough I just started really getting into this this week (I have been running idungeon and honestly I KNOW it can be done in color I will post the code sometime tomarrow functions mostly done:

NPC location (not clicking to attack just mmlocation)
findfood(on the tables) not really needed for c1
click door with rotation for loaction of doors n, e, s, w still not working well it seems that the frozen doors can be either a dark shade of blue or a almost white shade
Entering dungeon (does not enter party but does choose floor 1, c1)

Thats pretty much all I have done but I have plenty of ideas to come ;) hope we get loads of pictures to help out :p

Edit: Im not really sure about occ honestly I cant even access them my dungeon level is only 58 so… :p but it is just a general list

litoris

2012-07-30 08:19:33

I think rs wiki has most if not all the things you asked for.

putonajonny

2012-07-30 08:27:53

Get this on GitHub and a lot of people will be able to help you very easily :)

Joe

2012-07-30 08:31:29

Tell Zmon to give you his source and then just expand on that.

Getdropped

2012-07-30 14:47:57

Just posted what I have so far.


From: Joe
Tell Zmon to give you his source and then just expand on that.


Oh i didnt know anyone else had started this do you know if he would be willing to share what he has so far?

Hazzah

2012-07-30 16:50:35

From: getdropped69
Just posted what I have so far.




Oh i didnt know anyone else had started this do you know if he would be willing to share what he has so far?


I think Zmon has a massive list of DTM's and colors for almost every item in dungeoneering, something like 2k+ lines of DTM's + colors, iirc.

E: wasnt Zmon I was thinking of, Le Jingle is the person

http://villavu.com/forum/showthread.php?t=84315&highlight=Dungeoneering+items

NKN

2012-07-30 17:23:21

The Dung dev team in the SRL Memebers have a bit done.
We'll see how it goes. :)

Getdropped

2012-07-30 23:59:55

From: NKN
The Dung dev team in the SRL Memebers have a bit done.
We'll see how it goes. :)


Im not quite sure if it would be wrong of me to ask but what are you doing for a sort of walk, custom sps maps or dtms using the out side of each room(those are the ones i can think of)…. right now i have about 10 custom sps rooms maped out. Just woundering if there was a better way. Also I have generated a few of the fish dtms for food. Also for armor I was thinking of using a dtm with a high tolerance on the middle point so it would detect it for all others of the same armor part. Also I saw that they are using 3d mapping for finding doors. My way of just rotating the screen angle and searching for the door can sometimes open doors that is isnt facing causing it to back track…. One thing that I was thinking about doing to find the door easier is using a tpa to find the redish color that would signal a door. Any other thoughts and ideas would be great ;)

Le Jingle

2012-07-31 00:14:38

Don't think dtm / sps is used in the srl members dev team's dung project.

There's a little glimpse of the idea for walking afaik on the dungeoneering dtm's thread link I replied to you with.

illester

2012-07-31 04:32:28

Good luck, hope something good comes out.

Chris

2012-07-31 05:31:52

Didn't read through everything but this:

procedure TakeAllLoot;
begin

MMouse(312, 177, 5, 5);
Wait(200 + Random(100));
if (IsUpText('Take')) then
begin
ClickMouse2(Mouse_Left);
Wait(RandomRange(600, 700));
while IsMoving do
Wait(RandomRange(250, 350));
Exit
end;

MMouse(316, 229, 5, 5);
Wait(200 + Random(100));
if (IsUpText('Take')) then
begin
ClickMouse2(Mouse_Left);
Wait(RandomRange(600, 700));
while IsMoving do
Wait(RandomRange(250, 350));
Exit
end;

MMouse(259, 227, 5, 5);
Wait(200 + Random(100));
if (IsUpText('Take')) then
begin
ClickMouse2(Mouse_Left);
Wait(RandomRange(600, 700));
while IsMoving do
Wait(RandomRange(250, 350));
Exit
end;

MMouse(207, 230, 5, 5);
Wait(200 + Random(100));
if (IsUpText('Take')) then
begin
ClickMouse2(Mouse_Left);
Wait(RandomRange(600, 700));
while IsMoving do
Wait(RandomRange(250, 350));
Exit
end;

MMouse(201, 175, 5, 5);
Wait(200 + Random(100));
if (IsUpText('Take')) then
begin
ClickMouse2(Mouse_Left);
Wait(RandomRange(600, 700));
while IsMoving do
Wait(RandomRange(250, 350));
Exit
end;

MMouse(208, 136, 5, 5);
Wait(200 + Random(100));
if (IsUpText('Take')) then
begin
ClickMouse2(Mouse_Left);
Wait(RandomRange(600, 700));
while IsMoving do
Wait(RandomRange(250, 350));
Exit
end;

MMouse(257, 138, 5, 5);
Wait(200 + Random(100));
if (IsUpText('Take')) then
begin
ClickMouse2(Mouse_Left);
Wait(RandomRange(600, 700));
while IsMoving do
Wait(RandomRange(250, 350));
Exit
end;

MMouse(295, 138, 5, 5);
Wait(200 + Random(100));
if (IsUpText('Take')) then
begin
ClickMouse2(Mouse_Left);
Wait(RandomRange(600, 700));
while IsMoving do
Wait(RandomRange(250, 350));
Exit
end;

MMouse(253, 173, 5, 5);
Wait(200 + Random(100));
if (IsUpText('Take')) then
begin
ClickMouse2(Mouse_Left);
Wait(RandomRange(600, 700));
while IsMoving do
Wait(RandomRange(250, 350));
Exit
end;

end;


procedure TakeAllLootBegin;
begin

MMouse(312, 167, 5, 5);
Wait(200 + Random(100));
if (IsUpText('Take')) then
begin
ClickMouse2(Mouse_Left);
Wait(RandomRange(600, 700));
while IsMoving do
Wait(RandomRange(250, 350));
Exit
end;

MMouse(316, 219, 5, 5);
Wait(200 + Random(100));
if (IsUpText('Take')) then
begin
ClickMouse2(Mouse_Left);
Wait(RandomRange(600, 700));
while IsMoving do
Wait(RandomRange(250, 350));
Exit
end;

MMouse(259, 217, 5, 5);
Wait(200 + Random(100));
if (IsUpText('Take')) then
begin
ClickMouse2(Mouse_Left);
Wait(RandomRange(600, 700));
while IsMoving do
Wait(RandomRange(250, 350));
Exit
end;

MMouse(207, 220, 5, 5);
Wait(200 + Random(100));
if (IsUpText('Take')) then
begin
ClickMouse2(Mouse_Left);
Wait(RandomRange(600, 700));
while IsMoving do
Wait(RandomRange(250, 350));
Exit
end;

MMouse(201, 165, 5, 5);
Wait(200 + Random(100));
if (IsUpText('Take')) then
begin
ClickMouse2(Mouse_Left);
Wait(RandomRange(600, 700));
while IsMoving do
Wait(RandomRange(250, 350));
Exit
end;

MMouse(208, 116, 5, 5);
Wait(200 + Random(100));
if (IsUpText('Take')) then
begin
ClickMouse2(Mouse_Left);
Wait(RandomRange(600, 700));
while IsMoving do
Wait(RandomRange(250, 350));
Exit
end;

MMouse(257, 118, 5, 5);
Wait(200 + Random(100));
if (IsUpText('Take')) then
begin
ClickMouse2(Mouse_Left);
Wait(RandomRange(600, 700));
while IsMoving do
Wait(RandomRange(250, 350));
Exit
end;

MMouse(295, 118, 5, 5);
Wait(200 + Random(100));
if (IsUpText('Take')) then
begin
ClickMouse2(Mouse_Left);
Wait(RandomRange(600, 700));
while IsMoving do
Wait(RandomRange(250, 350));
Exit
end;

MMouse(253, 163, 5, 5);
Wait(200 + Random(100));
if (IsUpText('Take')) then
begin
ClickMouse2(Mouse_Left);
Wait(RandomRange(600, 700));
while IsMoving do
Wait(RandomRange(250, 350));
Exit
end;

end;

Could be:

procedure Loot(AtBegin: Boolean);
var
TPA: TPointArray;
I: Integer;
begin
TPA := [[312, 177], [316, 229], [259, 227], [207, 230], [201, 175], [208,136], [257, 138], [295, 138], [253, 173]];
for i := 0 to high(TPA) do
begin
if not(AtBegin) then
MMouse(TPA[i].x, TPA[i].y, 5, 5)
else
MMouse(TPA[i].x, TPA[i].y - 10, 5, 5);
Wait(200 + Random(100));
if (IsUpText('Take')) then
begin
ClickMouse2(Mouse_Left);
Wait(RandomRange(600, 700));
while IsMoving do
Wait(RandomRange(250, 350));
Exit
end;
end;
end;

procedure TakeAllLoot;
begin
Loot(False);
end;


procedure TakeAllLootBegin;
begin
Loot(True);
end;
;)

LemonHaze

2012-07-31 05:37:02

Awesome project!
I'll try to get some pics.

exilednoob

2012-07-31 06:14:15

really like what your doing, its so much appreciated. too bad few people would be able to use it because it would log most common computers too bad to even run.

J J

2012-07-31 06:21:40

Please don't use auto generated TPA functions :\ Instead, make a general object finder that you can call.

You can use this one, be sure to include SmartGraphics & Debug

{$i SRL/SRL/misc/debug.simba} 
{$i SRL/SRL/misc/SmartGraphics.simba}

function ObjFinder(Hue, Sat: Extended; Color, Tolerance, X1, Y1, X2, Y2: Integer; Width, Height:Integer; Sort: Boolean; Uptext: Array of String; xOffset, yOffset, UptextWaitTime: Integer): Boolean;
var
X, Y, i: Integer;
ColorTPA: TPointArray;
ColorATPA: T2DPointArray;

begin
ColorToleranceSpeed(2);
SetColorSpeed2Modifiers(Hue, Sat);
if FindColorsTolerance(ColorTPA, Color, X1, Y1, X2, Y2, Tolerance) then
begin
SplitTPAExWrap(ColorTPA, Width, Height, ColorATPA);
if Debug then
begin
SMART_ClearCanvas;
WriteLn(''+IntToStr(CountColorTolerance(Color, X1, Y1, X2, Y2, Tolerance))+'');
SMART_DrawDotsEx(False, ColorTPA, clYellow);
SMART_DrawBoxes(False, False, [GetTPABounds(ColorTPA)], clRed);
DebugATPABounds(ColorATPA);
end;

SortATPASize(ColorATPA, Sort);
for i:=0 to High(ColorATPA) do
begin
MiddleTPAEx(ColorATPA[i], X, Y);
MMouse(X, Y, xOffset, yOffset);
if WaitUpTextMulti(Uptext, UptextWaitTime) then
begin
Result := True;
Break;
end;
end;
end;
end;

It colors the found points yellow.
The points will be split into boxes with a red outline.
All the points will also be given as a debug image.

Example
function KillJelly: Boolean;
begin
if ObjFinderInside(0.95, 1.06, 8172918, 20, MSX1, MSY1, MSX2, MSY2, 3, 3, True, ['elly', 'Jelly'], RandomRange(-2, 2), RandomRange(-2, 2), 500) then
begin
case Random(7) of
0..4: ClickMouse2(1);
5..6: begin
ClickMouse2(0);
WaitOptionMulti(['tack', 'Attack'], 500);
end;
end;
// Checking if fighting etc.
end;
end;

You can even expand that version and automatically let it random click left or right and if it clicks right then select an option you input.

Then you can just use it for all object finding. Keeps the code a lot shorter and with the debugging you can find out what Simba is finding.

Getdropped

2012-07-31 20:32:03

From: J J
Please don't use auto generated TPA functions :\ Instead, make a general object finder that you can call.

You can use this one, be sure to include SmartGraphics & Debug

{$i SRL/SRL/misc/debug.simba} 
{$i SRL/SRL/misc/SmartGraphics.simba}

function ObjFinder(Hue, Sat: Extended; Color, Tolerance, X1, Y1, X2, Y2: Integer; Width, Height:Integer; Sort: Boolean; Uptext: Array of String; xOffset, yOffset, UptextWaitTime: Integer): Boolean;
var
X, Y, i: Integer;
ColorTPA: TPointArray;
ColorATPA: T2DPointArray;

begin
ColorToleranceSpeed(2);
SetColorSpeed2Modifiers(Hue, Sat);
if FindColorsTolerance(ColorTPA, Color, X1, Y1, X2, Y2, Tolerance) then
begin
SplitTPAExWrap(ColorTPA, Width, Height, ColorATPA);
if Debug then
begin
SMART_ClearCanvas;
WriteLn(''+IntToStr(CountColorTolerance(Color, X1, Y1, X2, Y2, Tolerance))+'');
SMART_DrawDotsEx(False, ColorTPA, clYellow);
SMART_DrawBoxes(False, False, [GetTPABounds(ColorTPA)], clRed);
DebugATPABounds(ColorATPA);
end;

SortATPASize(ColorATPA, Sort);
for i:=0 to High(ColorATPA) do
begin
MiddleTPAEx(ColorATPA[i], X, Y);
MMouse(X, Y, xOffset, yOffset);
if WaitUpTextMulti(Uptext, UptextWaitTime) then
begin
Result := True;
Break;
end;
end;
end;
end;

It colors the found points yellow.
The points will be split into boxes with a red outline.
All the points will also be given as a debug image.

Example
function KillJelly: Boolean;
begin
if ObjFinderInside(0.95, 1.06, 8172918, 20, MSX1, MSY1, MSX2, MSY2, 3, 3, True, ['elly', 'Jelly'], RandomRange(-2, 2), RandomRange(-2, 2), 500) then
begin
case Random(7) of
0..4: ClickMouse2(1);
5..6: begin
ClickMouse2(0);
WaitOptionMulti(['tack', 'Attack'], 500);
end;
end;
// Checking if fighting etc.
end;
end;

You can even expand that version and automatically let it random click left or right and if it clicks right then select an option you input.

Then you can just use it for all object finding. Keeps the code a lot shorter and with the debugging you can find out what Simba is finding.


Just updated with alot of the things suggested and a few of my own ideas ;) just curious was the killjelly function used in SRL members one or just a snippet you had? :p

Joe

2012-07-31 21:24:01

The Dung Dev team in SRL members dont have a working script… If I'm allowed to say it: It only walks through doors that have been opened. I don't even think it has an end dungeon function. I remember seeing it, and I never even bothered to compile it.
JJ has a great amount of scripting skill so I'm excited to see how this turns out.
I would join the endevour but I don't think I'd be of much use.

Good luck!

~Joe

Vinyl Scratch

2012-07-31 21:41:49

Joe, we/they (if I'm allowed.. Some people don't like me very much.) need all of the help we can get. You're in SRL Members. You can help. I'm thinking up a function right now, once I get home tomorrow, I'll work on it.

OT: I'm going to work on a function for detecting the boss, and what boss it is. Trying to figure out how I'm going to do it. Also, could we also talk in the SRL Skype, or make our own for this, it would make getting help alot easier. Just letting you guys know. ;P

John

2012-08-01 00:52:04

From: xXTrollXx
Joe, we/they (if I'm allowed.. Some people don't like me very much.) need all of the help we can get. You're in SRL Members. You can help. I'm thinking up a function right now, once I get home tomorrow, I'll work on it.

OT: I'm going to work on a function for detecting the boss, and what boss it is. Trying to figure out how I'm going to do it. Also, could we also talk in the SRL Skype, or make our own for this, it would make getting help alot easier. Just letting you guys know. ;P


If you can see the boss, Maybe Mouse over it get the uptext?

Getdropped

2012-08-01 00:57:44

From: John
If you can see the boss, Maybe Mouse over it get the uptext?


Right now I have it so it will click on the npc dot until it is in combat so you should be able to see the boss.

Edit: but honestly for c1 you dont really need to know the boss because all the frozen floors except the beast that eats from the carcases are just auto attackable.

John

2012-08-01 00:59:22

You should try to detect what it is before you go into combat, try to get to the boss door then Have a look from there.

Getdropped

2012-08-01 03:39:15

From: John
You should try to detect what it is before you go into combat, try to get to the boss door then Have a look from there.


I'm using an sps map to detect one of the bosses I made a map of the boss room and set it to return true if it finds you are on a point on the map

I updated the script at the top to include all of my new changes that I have made hope to see more ideas in the morning off to bed right now 3:40am :p


Silentcore

2012-08-01 03:55:42

cool project, lookd promising for the future..

Joe

2012-08-01 07:49:45

Make it say in the debug: "Shit, its Har'lack the Riftsplitter. Say goodbye to your tokens!"

OT: The tricky thing about bosses is that they have specials you can dodge- like Nightgazer, Shadowforger, Bulwark…
Especially for the Bulwark beast you need to walk to the point and attack rather than full on destroy him.
You also have to take into mind that some bosses have weaknesses- like Rammernaut can pretty much only be killed using mage.
I wouldn't go for a function like Zmon was talking about, where it drops the gatestone, makes food and skills, and then teles back to the gatestone.
That would be incredibly hard to calibrate and perfect and would just take away from xp/hr and tokens/hr.

Getdropped

2012-08-01 12:31:33

From: Joe
Make it say in the debug: "Shit, its Har'lack the Riftsplitter. Say goodbye to your tokens!"

OT: The tricky thing about bosses is that they have specials you can dodge- like Nightgazer, Shadowforger, Bulwark…
Especially for the Bulwark beast you need to walk to the point and attack rather than full on destroy him.
You also have to take into mind that some bosses have weaknesses- like Rammernaut can pretty much only be killed using mage.
I wouldn't go for a function like Zmon was talking about, where it drops the gatestone, makes food and skills, and then teles back to the gatestone.
That would be incredibly hard to calibrate and perfect and would just take away from xp/hr and tokens/hr.


You have to remember this is just a C1 rusher honestly I dont use enough food to need to home tele plus in c1 rush you dont get a gatestone so lower level accounts couldnt do that…..

J J

2012-08-02 09:25:30

What are you trying to achieve with the SPS function? All rooms are different so you can't use it to check your location. Unless you are checking for the background color because it might be different in some rooms. I'm personally toying around with some dungeoneering functions (not for Simba) and I hope to make a full dungeoneering script one day :P

I'm currently working on getting the clickable points of the current room. Once you have those you can search for other stuff in a much smaller area. Such as doors, npc dots, item dots, etc.

What I've done so far:
Get all the black points of the minimap, that is RGB Color(0, 0, 0) with 10 tol.
Once you have those you can make a circle and calculate all points in it.
Once you have done that you can loop through both of the arrays and check for matching points, if the points aren't matching you add them to a new array. Once the loop has been completed you will have an array of points that aren't black. Then you can use that to do other stuff, currently figuring out some stuff what you can use it for.

Example:
www.youtube.com/watch?v=Cijo3IoknbU

I'm not sure if that is worth making in Simba as it will probably take ages to loop through everything. But with Lape it might have a good speed. With Java it takes around 400 ms but I've just started with java programming 2 weeks ago so I'm probably not even using the fastest methods.

Abu

2012-08-02 10:01:01

EDIT: Forget this.

Good luck.

Getdropped

2012-08-02 14:33:11

From: J J
What are you trying to achieve with the SPS function? All rooms are different so you can't use it to check your location. Unless you are checking for the background color because it might be different in some rooms. I'm personally toying around with some dungeoneering functions (not for Simba) and I hope to make a full dungeoneering script one day :P

I'm currently working on getting the clickable points of the current room. Once you have those you can search for other stuff in a much smaller area. Such as doors, npc dots, item dots, etc.

What I've done so far:
Get all the black points of the minimap, that is RGB Color(0, 0, 0) with 10 tol.
Once you have those you can make a circle and calculate all points in it.
Once you have done that you can loop through both of the arrays and check for matching points, if the points aren't matching you add them to a new array. Once the loop has been completed you will have an array of points that aren't black. Then you can use that to do other stuff, currently figuring out some stuff what you can use it for.

Example:
www.youtube.com/watch?v=Cijo3IoknbU

I'm not sure if that is worth making in Simba as it will probably take ages to loop through everything. But with Lape it might have a good speed. With Java it takes around 400 ms but I've just started with java programming 2 weeks ago so I'm probably not even using the fastest methods.


I have found that sps isnt realyl going to work because the rotation of the room can be anything based on where you came from rendering it useless…. However I was thinking about ways to locate boss rooms and…. What im thinking now is maybe make dtms of the room and finddtmrotated Im not really sure right now I may make a hover function for each boss and if it locates the correct uptext to run differently….. bosses and telling if you have the right key are basically all i need to do right now ;) its comming along great and I dont think I will update the script on here until I have a good working version for you all to see ;) but I will tell you this has been a long week of coding for me and hopefully this is pay off in the long run :p
Cause honestly I learned more/ done more this week then I have most likely in the majority of time I have spent here. :cool:
~Getdropped

wister1

2012-08-02 16:23:27

god dam! gl on the project of a color based dungeneering script which would be boss because of longevity of color scripts compared to injection/reflection, although idungeon is rocking asses right now :p

Getdropped

2012-08-02 17:15:15

From: wister1
god dam! gl on the project of a color based dungeneering script which would be boss because of longevity of color scripts compared to injection/reflection, although idungeon is rocking asses right now :p


lol i agree Im actually rocking idungeon while i design this so :p but wedungeon is comming along quite well it is almost able to complete a dungeon all by itself, although I have been coding it for basically the past 4 days straight lol still I can't wait for once I add the abort feature and a few others that I have left and it should be able to earn me and everyone else here some easy dungeoneering exp ;)
% done = 85ish%

waiting until I work out the rest of the bugs to show it off ;)

Vinyl Scratch

2012-08-03 11:20:19

Getdropped, What else do you need done? I'm back home, and can start coding again.

Joe

2012-08-03 11:58:19

From: getdropped69
lol i agree Im actually rocking idungeon while i design this so :p but wedungeon is comming along quite well it is almost able to complete a dungeon all by itself, although I have been coding it for basically the past 4 days straight lol still I can't wait for once I add the abort feature and a few others that I have left and it should be able to earn me and everyone else here some easy dungeoneering exp ;)
% done = 85ish%

waiting until I work out the rest of the bugs to show it off ;)


Wow. This is some quick scripting. I highly recommend ironing it out and applying.

Jos3ph

2012-08-03 15:21:54

ill pm you a bunch of images I have

KeepBotting

2012-08-03 20:40:16

This needs to be revived. Here's a list of colors I have so far:

4670029 astea frostweb

7364974 behemoth
6054051 carcass blood (the part you have to stand on)

4413848 orange diamond key
3619937 orange diamond door

6633784 purple pentagon key
13128797 purple pent door

8357511 silver corner key
6447977 silver corner door

8348470 blue shield key
6506020 blue shield door

9462574 blue rectangle key
6703141 blue rectangle door

2263984 gold wedge key
4613234 gold wedge door

5402431 green shield key
4413739 green shield door

8160138 silver diamond key
9408650 silver diamond door


6709320 end-dungeon ladder

Silentcore

2012-08-03 20:54:32

From: KeepBotting
This needs to be revived. Here's a list of colors I have so far:

4670029 astea frostweb

7364974 behemoth
6054051 carcass blood (the part you have to stand on)

4413848 orange diamond key
3619937 orange diamond door

6633784 purple pentagon key
13128797 purple pent door

8357511 silver corner key
6447977 silver corner door

8348470 blue shield key
6506020 blue shield door

9462574 blue rectangle key
6703141 blue rectangle door

2263984 gold wedge key
4613234 gold wedge door

5402431 green shield key
4413739 green shield door

8160138 silver diamond key
9408650 silver diamond door


6709320 end-dungeon ladder

Nice work..keepbotting and keep getting those colors..

KeepBotting

2012-08-03 20:55:21

From: Ucantseemebot
Nice work..keepbotting and keep getting those colors..
I will and I will. Thanks.

J J

2012-08-03 21:01:43

From: KeepBotting
This needs to be revived. Here's a list of colors I have so far:

4670029 astea frostweb

7364974 behemoth
6054051 carcass blood (the part you have to stand on)

4413848 orange diamond key
3619937 orange diamond door

6633784 purple pentagon key
13128797 purple pent door

8357511 silver corner key
6447977 silver corner door

8348470 blue shield key
6506020 blue shield door

9462574 blue rectangle key
6703141 blue rectangle door

2263984 gold wedge key
4613234 gold wedge door

5402431 green shield key
4413739 green shield door

8160138 silver diamond key
9408650 silver diamond door


6709320 end-dungeon ladder

You definately need CTS 2 modifers & tolerances with those otherwise you will never be able to detect an object properly.

KeepBotting

2012-08-03 21:04:31

From: J J
You definately need CTS 2 modifers & tolerances with those otherwise you will never be able to detect an object properly.

I need a what? And my tolerances are almost always 10.

Vinyl Scratch

2012-08-03 21:11:32

He's talking about
TPAs. You need hue, sat, CTS 2 mods, and tolerances (I use 7) for TPAs.

KeepBotting

2012-08-03 21:12:25

From: xXTrollXx
He's talking about
TPAs. You need hue, sat, CTS 2 mods, and tolerances (I use 7) for TPAs.
I dunno how to do those lmao. I've always used FindObj and it seems to work for me.

Getdropped

2012-08-03 21:28:06

From: KeepBotting
I dunno how to do those lmao. I've always used FindObj and it seems to work for me.


If you are using aca to get the colors click create function and copy these two lines:

  SetColorSpeed2Modifiers(5.56, 0.22);

if not(FindColorsTolerance(arP, 10263964, MSX1, MSY1, MSX2, MSY2, 6))

But all I really need are the blue key colors because all the rest can get picked up with my "special function" I have made ;) and I already have the ladder colors it is really comming along not to bad…. but it is really slow…. well compared to idungeon ofc ;) but we will see I will most likely show it off sometime next week ;)

Rezozo

2012-08-03 21:51:14

Well good luck guys, this is an immense project!

KeepBotting

2012-08-03 21:53:15

From: JoeyGupta
Well good luck guys, this is an immense project!
Indeed. But together we will prevail.

Getdropped

2012-08-03 22:31:08

From: KeepBotting
Indeed. But together we will prevail.


Together "WEDUNGEON" it finally did it:

It completed the dungeon took a while but it did it just need to tweek the exit dungeon function and who knows WeCanDungeon ;)

KeepBotting

2012-08-03 22:39:50

From: getdropped69
Together "WEDUNGEON" it finally did it:

It completed the dungeon took a while but it did it just need to tweek the exit dungeon function and who knows WeCanDungeon ;)
Pretty damn nice! :P

Getdropped

2012-08-03 23:24:15

From: KeepBotting
Pretty damn nice! :P


Ya it is just reallllllllllyyyyyyyyyyy…… SLOW! right now…. but what do you expect it is color ;)

The funny part is that idungeon can do a c6 med faster than this can do a class one small lol I may release it tomarrow or the next day based on how its going…..
lets put it this way the only way this will get good use is if there is another "bot nuke" soon ;)

Jos3ph

2012-08-04 09:55:56

I supoort fully what you have going on here man, good job! Keep up the good work.

Vinyl Scratch

2012-08-07 01:37:51

I wouldn't mind helping in the area of speed. My Runespan is pretty fast, not the fastest, but it's got quite some speed.

Getdropped

2012-08-11 01:09:06

From: Vinyl Scratch
I wouldn't mind helping in the area of speed. My Runespan is pretty fast, not the fastest, but it's got quite some speed.


Speed isnt really the issue…. It is just a very complex script finding open doors and if you have the correct keys are very tricky. I have posted the rest of my code because I wont be doing much coding while idungeon is running sooooooooo well XD so if anyone gets ambition they can see what I have done to solve most of the problems in creating this script. Please if anyone is to use this be sure to give credit where credit is due ;) I put almost 4 days straight into coding this :p maybe a little less. I will most likely pick this back up once there is another bot nuke. I still prefer simba (just not for dungeoneering) cause it is just to complex. <3 simba most of my scripts I have I like to run for more than 6 hours and simba is the best way to do it :p I will be doing more to this in the future hope you all like what I have done. Please continue to post ideas here to help me and others in this future endevor against the "unbottable" skill ;)

Joe

2012-08-19 21:08:01

Any progress updates? I've been following this for a while and I'm sad now.

NKN

2012-08-19 21:30:52

From: Joe
Any progress updates? I've been following this for a while and I'm sad now.


He said no progress until IDung stops working. :(

Getdropped

2012-08-26 01:54:45

From: NKN
He said no progress until IDung stops working. :(


I might pick this back up since idungeon is now going to be paid…. im not sure though…. I will see how much time i have left once school starts back up. :p

thomas1116

2012-08-26 02:30:50

From: Getdropped
I might pick this back up since idungeon is now going to be paid…. im not sure though…. I will see how much time i have left once school starts back up. :p


well it cost around 19.99 dollars i think ? :S