SRL Archive - RS3 Script Requests

Dungeoneering Leeching Bot


Jim

2012-05-08 21:43:21

All the bot would have to do is click around the screen every 3-4 mins.

If laws are binded, it could gatestone tele when the designated keyer says "gte" and end the dungeon on its own.

Additional features could include: being able to do emote room when needed/sounding alarm when the dungeon is done or the keyer needs help on skill door/emote room.

Joe

2012-05-08 21:52:58

stayloggedin by r4nd0m
this one doesn't do anything but stay logged in, but you could mod it

Brandon

2012-05-09 01:32:10

Trying to find a way to figure out how to tell when a user has teleported.. It works but lets just say it's TOOOOO Accurate.. Down to the very last pixel -__- Anyway Read the whole script, Add your own antiban movements to keep you logged in.. And see if u want mod it..


{$DEFINE SMART}
{$I SRL/SRL.Simba}
{$I SRL/SRL/Misc/Debug.Simba}

var
Path: string;
KeyWords: TStringArray;


Procedure DeclarePlayers;
begin
Path:= 'C:\Users\Brandon\Downloads\MSN_Sound.wav';
KeyWords:= ['gte'];
end;

Procedure AntiBan;
begin
end;


Var
StartingBitmap: Integer;

Procedure FreeBitmaps;
begin
FreeBitmap(StartingBitmap);
end;

Function WaitGameTab(Tab: Integer; TabTo: Boolean; TimeToWait: Integer): Boolean;
Var
T: Integer;
begin
Result := False;
T := GetSystemTime + TimeToWait;
while (GetSystemTime < T) do
begin
if TabTo then
GameTab(Tab);
if (GetCurrentTab = Tab) then
begin
Result := True;
Exit;
end;
Wait(20 + Random(10));
end;
end;

Procedure GetMinimap(var Map: Integer);
var
TPA, Draw: TPointArray;
TIA: TIntegerArray;
I, BMP: Integer;
begin
BMP:= CreateBitmap(MMX2 - MMX1 + 1, MMY2 - MMY1 + 1);
TPA:= TPAFromBox(MMBox);
FilterPointsPie(TPA, 0.0, 360.0, 0.0, 75.0, MMCX, MMCY);
TIA:= GetColors(TPA);

TPA:= TPAFromBox(IntToBox(0, 0, MMX2 - MMX1, MMY2 - MMY1));
DrawTPABitmap(BMP, TPA, 0);
FilterPointsPie(TPA, 0.0, 360.0, 0.0, 75.0, (MMX2 - MMX1)/2, (MMY2 - MMY1)/2);

SetLength(DRAW, 1);
For I:= 0 To High(TPA) do
begin
Draw[0]:= TPA[I];
DrawTPABitmap(BMP, Draw, TIA[I]);
end;

For I:= 0 To High(TPA) do
begin
if (SimilarColors(TIA[I], 67075, 20)) then
FastSetPixel(BMP, TPA[I].X, TPA[I].Y, clBlack);
end;
DebugBitmap(BMP);
Map:= CopyBitmap(Bmp);
FreeBitmap(BMP);
end;

Function FindBitmapInBitmap(XBMP, YBMP, Tol: Integer): Boolean;
var
Similar, NotSimilar, I, J, X: Integer;
BMPC1, BMPC2: T2DIntegerArray;
begin
try
BMPC1:= GetBitmapAreaColors(XBMP, 0, 0, 150, 150);
BMPC2:= GetBitmapAreaColors(YBMP, 0, 0, 150, 150);

X:= High(BMPC1);
For I:= 0 To 150 do
begin
For J:= 0 To 150 do
begin
if ((SimilarColors(BMPC1[J][I], 0, 20)) or (SimilarColors(BMPC2[J][I], 0, 20))) then
Continue;
if (SimilarColors(BMPC1[J][I], BMPC2[J][I], Tol)) then
Inc(Similar)
else
Inc(NotSimilar);
end;
end;
Result:= Similar > NotSimilar;
except
Result:= False;
end;
end;

Function SitNearSmuggler: Boolean;
var
I, L: Integer;
Shop: TPoint;
ShopBox: TBox;
NPCs: TPointArray;
begin
if (Not IsResting) then
begin
NPCs:= GetMiniMapDots('NPC');
L:= High(NPCs);
For I:= 0 To High(NPCs) do
begin
MMouse(NPCs[I].X, NPCs[I].Y, 0, 0);
FFlag(0);
Shop:= MMToMS(NPCs[I]); ShopBox:= IntToBox(Shop.X - 20, Shop.Y - 20, Shop.X + 20, Shop.Y + 20);
MouseTBox(ShopBox, 3);
if (WaitUptextMulti(['ugg', 'ggler', 'Smuggler', 'alk-t', 'alk-to', 'Talk-to', 'uggl', 'uggl'], 600)) then
break;
end;
end;
Result:= SetRest;
end;

function GetChatBoxTextCustom(Line, TextCol: Integer): string;
var
P: TPoint;
cArr: TPointArray;
B: TBox;
begin
Result := '';
P := TextCoords(Line);
if (FindColorsTolerance(cArr, TextCol, MCX1, P.y, MCX2, P.y + 13, 0)) then
begin
B := GetTPABounds(cArr);
result := Trim(GetTextAtExWrap(b.x1-1,p.y,B.x2+1,p.y+13,0,5,2,TextCol,0,SmallChars));
end;
end;

function TextBetween(Text: string; TextCol, StartLine, EndLine: Integer): Boolean; //Non-CaseSensitive..
var
II: Integer;
CText: String;
begin
Result := True;
for II := Max(StartLine, EndLine) downto Min(StartLine, EndLine) do
begin
CText:= LowerCase(GetChatBoxText(II, TextCol));
if ((Pos(Text, CText) > 0)) then
Exit;
end;
Result := False;
end;

Function Teleported(TimeToWait: Integer): Boolean;
var
T, {X, Y,} BMP: Integer;
//Acc: Extended;
begin
MakeCompass('N');
T := GetSystemTime + TimeToWait;
While (GetSystemTime < T) do
begin
GetMinimap(BMP);
//if (Not FindDeformedBitmapToleranceIn(StartingBitmap, X, Y, MMX1, MMY1, MMX2, MMY2, 10, 0, false, Acc)) then
if (Not FindBitmapInBitmap(StartingBitmap, BMP, 10)) then
begin
Result:= True;
FreeBitmap(BMP);
Exit;
end;
FreeBitmap(BMP);
Wait(20 + Random(10));
end;
end;

//DoConversation..
Function TeleportGateStone(ChatText: TStringArray): Boolean;
var
Spell, I, L, X, Y: Integer;
begin
L:= High(ChatText);
Spell := DTMFromString('m6wAAAHic42ZgYGhlYmBoAeImIG4D4gYgbgbidiDuBOIaqHwvEOsyMjBoAbE+EBsAsTYQm0DFdKFYBYj1gPjSw6cMf//+ZVi59ylDz7STDOF2RQz5068zJPl0MPho1jPEmB0F80FYEugOYjEjCRgJAAAXUxzL');
For I:= 0 To L do
if (TextBetween(LowerCase(ChatText[I]), clChat, 1, 8)) then
begin
GetMiniMap(StartingBitmap);
if WaitGameTab(TAB_MAGIC, True, 3000) then
if WaitFindDTMEx(Spell, X, Y, 544, 202, 760, 467, 50, 3000) then
begin
MMouse(X, Y, 0, 0);
if (WaitUptextMulti(['roup', 'ate', 'ele', 'one teleport', 'op Gatestone teleport'], 600)) then
begin
ClickMouse2(MOUSE_LEFT);
Result:= Teleported(5000);
break;
end;
end;
end;
FreeDTM(Spell);
end;

Procedure MainLoop;
begin
SitNearSmuggler;
while (Not TeleportGateStone(KeyWords)) do
begin
AntiBan;
end;

if (Teleported(5000)) then
begin
//Some Function To Find the ladder at the end of the dungeon and exit..
//OR make a huge noise when your dungeon is finished..
PlaySound(Path);
TerminateScript;
end;
end;

begin
Smart_Server := 72;
Smart_Members := True;
Smart_Signed := True;
Smart_SuperDetail := False;
SetupSRL;
SmartSetRefresh(100);
DeclarePlayers;
AddOnTerminate('FreeBitmaps');
Repeat
MakeCompass('N');
while (SmartEnabled = false) do
wait(1);
MainLoop;
Until(False);
end.

Jim

2012-05-09 02:38:12

From: Brandon
Trying to find a way to figure out how to tell when a user has teleported.. It works but lets just say it's TOOOOO Accurate.. Down to the very last pixel -__- Anyway Read the whole script, Add your own antiban movements to keep you logged in.. And see if u want mod it..


{$DEFINE SMART}
{$I SRL/SRL.Simba}
{$I SRL/SRL/Misc/Debug.Simba}

var
Path: string;
KeyWords: TStringArray;


Procedure DeclarePlayers;
begin
Path:= 'C:\Users\Brandon\Downloads\MSN_Sound.wav';
KeyWords:= ['gte'];
end;

Procedure AntiBan;
begin
end;


Var
StartingBitmap: Integer;

Procedure FreeBitmaps;
begin
FreeBitmap(StartingBitmap);
end;

Function WaitGameTab(Tab: Integer; TabTo: Boolean; TimeToWait: Integer): Boolean;
Var
T: Integer;
begin
Result := False;
T := GetSystemTime + TimeToWait;
while (GetSystemTime < T) do
begin
if TabTo then
GameTab(Tab);
if (GetCurrentTab = Tab) then
begin
Result := True;
Exit;
end;
Wait(20 + Random(10));
end;
end;

Procedure GetMinimap(var Map: Integer);
var
TPA, Draw: TPointArray;
TIA: TIntegerArray;
I, BMP: Integer;
begin
BMP:= CreateBitmap(MMX2 - MMX1 + 1, MMY2 - MMY1 + 1);
TPA:= TPAFromBox(MMBox);
FilterPointsPie(TPA, 0.0, 360.0, 0.0, 75.0, MMCX, MMCY);
TIA:= GetColors(TPA);

TPA:= TPAFromBox(IntToBox(0, 0, MMX2 - MMX1, MMY2 - MMY1));
DrawTPABitmap(BMP, TPA, 0);
FilterPointsPie(TPA, 0.0, 360.0, 0.0, 75.0, (MMX2 - MMX1)/2, (MMY2 - MMY1)/2);

SetLength(DRAW, 1);
For I:= 0 To High(TPA) do
begin
Draw[0]:= TPA[I];
DrawTPABitmap(BMP, Draw, TIA[I]);
end;

For I:= 0 To High(TPA) do
begin
if (SimilarColors(TIA[I], 67075, 20)) then
FastSetPixel(BMP, TPA[I].X, TPA[I].Y, clBlack);
end;
DebugBitmap(BMP);
Map:= CopyBitmap(Bmp);
FreeBitmap(BMP);
end;

Function FindBitmapInBitmap(XBMP, YBMP, Tol: Integer): Boolean;
var
Similar, NotSimilar, I, J, X: Integer;
BMPC1, BMPC2: T2DIntegerArray;
begin
try
BMPC1:= GetBitmapAreaColors(XBMP, 0, 0, 150, 150);
BMPC2:= GetBitmapAreaColors(YBMP, 0, 0, 150, 150);

X:= High(BMPC1);
For I:= 0 To 150 do
begin
For J:= 0 To 150 do
begin
if ((SimilarColors(BMPC1[J][I], 0, 20)) or (SimilarColors(BMPC2[J][I], 0, 20))) then
Continue;
if (SimilarColors(BMPC1[J][I], BMPC2[J][I], Tol)) then
Inc(Similar)
else
Inc(NotSimilar);
end;
end;
Result:= Similar > NotSimilar;
except
Result:= False;
end;
end;

Function SitNearSmuggler: Boolean;
var
I, L: Integer;
Shop: TPoint;
ShopBox: TBox;
NPCs: TPointArray;
begin
if (Not IsResting) then
begin
NPCs:= GetMiniMapDots('NPC');
L:= High(NPCs);
For I:= 0 To High(NPCs) do
begin
MMouse(NPCs[I].X, NPCs[I].Y, 0, 0);
FFlag(0);
Shop:= MMToMS(NPCs[I]); ShopBox:= IntToBox(Shop.X - 20, Shop.Y - 20, Shop.X + 20, Shop.Y + 20);
MouseTBox(ShopBox, 3);
if (WaitUptextMulti(['ugg', 'ggler', 'Smuggler', 'alk-t', 'alk-to', 'Talk-to', 'uggl', 'uggl'], 600)) then
break;
end;
end;
Result:= SetRest;
end;

function GetChatBoxTextCustom(Line, TextCol: Integer): string;
var
P: TPoint;
cArr: TPointArray;
B: TBox;
begin
Result := '';
P := TextCoords(Line);
if (FindColorsTolerance(cArr, TextCol, MCX1, P.y, MCX2, P.y + 13, 0)) then
begin
B := GetTPABounds(cArr);
result := Trim(GetTextAtExWrap(b.x1-1,p.y,B.x2+1,p.y+13,0,5,2,TextCol,0,SmallChars));
end;
end;

function TextBetween(Text: string; TextCol, StartLine, EndLine: Integer): Boolean; //Non-CaseSensitive..
var
II: Integer;
CText: String;
begin
Result := True;
for II := Max(StartLine, EndLine) downto Min(StartLine, EndLine) do
begin
CText:= LowerCase(GetChatBoxText(II, TextCol));
if ((Pos(Text, CText) > 0)) then
Exit;
end;
Result := False;
end;

Function Teleported(TimeToWait: Integer): Boolean;
var
T, {X, Y,} BMP: Integer;
//Acc: Extended;
begin
MakeCompass('N');
T := GetSystemTime + TimeToWait;
While (GetSystemTime < T) do
begin
GetMinimap(BMP);
//if (Not FindDeformedBitmapToleranceIn(StartingBitmap, X, Y, MMX1, MMY1, MMX2, MMY2, 10, 0, false, Acc)) then
if (Not FindBitmapInBitmap(StartingBitmap, BMP, 10)) then
begin
Result:= True;
FreeBitmap(BMP);
Exit;
end;
FreeBitmap(BMP);
Wait(20 + Random(10));
end;
end;

//DoConversation..
Function TeleportGateStone(ChatText: TStringArray): Boolean;
var
Spell, I, L, X, Y: Integer;
begin
L:= High(ChatText);
Spell := DTMFromString('m6wAAAHic42ZgYGhlYmBoAeImIG4D4gYgbgbidiDuBOIaqHwvEOsyMjBoAbE+EBsAsTYQm0DFdKFYBYj1gPjSw6cMf//+ZVi59ylDz7STDOF2RQz5068zJPl0MPho1jPEmB0F80FYEugOYjEjCRgJAAAXUxzL');
For I:= 0 To L do
if (TextBetween(LowerCase(ChatText[I]), clChat, 1, 8)) then
begin
GetMiniMap(StartingBitmap);
if WaitGameTab(TAB_MAGIC, True, 3000) then
if WaitFindDTMEx(Spell, X, Y, 544, 202, 760, 467, 50, 3000) then
begin
MMouse(X, Y, 0, 0);
if (WaitUptextMulti(['roup', 'ate', 'ele', 'one teleport', 'op Gatestone teleport'], 600)) then
begin
ClickMouse2(MOUSE_LEFT);
Result:= Teleported(5000);
break;
end;
end;
end;
FreeDTM(Spell);
end;

Procedure MainLoop;
begin
SitNearSmuggler;
while (Not TeleportGateStone(KeyWords)) do
begin
AntiBan;
end;

if (Teleported(5000)) then
begin
//Some Function To Find the ladder at the end of the dungeon and exit..
//OR make a huge noise when your dungeon is finished..
PlaySound(Path);
TerminateScript;
end;
end;

begin
Smart_Server := 72;
Smart_Members := True;
Smart_Signed := True;
Smart_SuperDetail := False;
SetupSRL;
SmartSetRefresh(100);
DeclarePlayers;
AddOnTerminate('FreeBitmaps');
Repeat
MakeCompass('N');
while (SmartEnabled = false) do
wait(1);
MainLoop;
Until(False);
end.


Thanks Brandon, I will try this out next time I leech a dungeon.