SRL Archive - RS3 Outdated / Broken Scripts

King's Dragons


King

2012-07-08 13:55:36

I'm sick of people thinking that a green dragon killer is at all hard to make and that it will be horrible to release. I personally believe that Green dragons are a horrible way to make money for any legits and that killing the bots, flipping ect is way better money than the dragons, so I am here to do something most people will not, I am going to make a PUBLIC, ANTI-FREE GDK. It will use the chaos tunnels and possibly the wilderness depending on which I find better. I also would like some cheaper bones for prayer.


It is a work in progress and I am more than halfway done currently, I will release a public beta in the soon to be days.

I will also apple for membership as well and it will NEVER be moved to members+ as I think that this method is well known and easy to script!

Enjoy the wait(;

Update* Working on TPA functions for finding the dragons, I'm reading some of the amazing tutorials around here!

Update 2* Had to work a long shift last night and will not be releasing the script today, however I will post more of what I have done to prove it is a work in progress(; It should be fighting and killing dragons by tonight, hope for release tomorrow or late tonight!

program KingsDragons;
//{/$DEFINE SMART}
{$i SRL/srl.simba}
{$i SRL/SRL/skill/fighting.simba}
{$i SRL/SRL/skill/magic.simba}
{$i sps/sps.simba}
{$i ObjectDTM\ObjDTMInclude.simba}

const

FoodType ='Monkfish';//Enter the type of food to use here (Must exactly match up-text)
FoodAmount = 10; // The amount of your food you wish to withdraw
SuperSet = True; //Tells it to withdraw super potions and drink them or not

var
x, y, T, DTMHouse, DTMEdgeville: integer;




procedure DeclarePlayers;
Begin
HowManyPlayers := 1;
NumberOfPlayers(HowManyPlayers);
CurrentPlayer := 0;

With Players[0] Do
Begin
Name := ''; //Player username.
Pass := ''; //Player password.
Nick := ''; //Player nickname - 3-4 letters of Player username.
Pin := '';
Active := True;
end;

end;

procedure LoadDTMs;
begin
DTMHouse := DTMFromString('mWAAAAHicY2FgYLBhYmBwAGJnILYA4idAsZdA/AiI3wCxnoYBgwSrPEN32zGGrMgDDPxAMWTMiIZBAADlWQj7');
DTMEdgeville := DTMFromString('mrAAAAHic42BgYFBmhGBNINYGYg0glgNiKSieCVSzHIgXAvF0IJ4AxL1Q/hwgXrX9IMPUOYsZdDQ1GXQSEhlEDcIYHIvyGYLFpcAYH+AHYkYCGAYA98kONA==');
end;

procedure ReleaseDTMS;
begin
FreeDTM(DTMHouse);
FreeDTM(DTMEdgeville);
end;

function FindRift(var fx, fy: Integer): 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.07, 0.09);

if not(FindColorsTolerance(arP, 3558753, MSX1, MSY1, MSX2, MSY2, 6)) then
begin
Writeln('Could not find rift.');
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 >= 5.44) and (X <= 11.84) and (Y >= 5.38) and (Y <= 11.69) and (Z >= 3.12) and (Z <= 6.50) 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('Enter')) then
begin;
Result := True;
Break;
end;
end;

ColorToleranceSpeed(tmpCTS);
SetColorSpeed2Modifiers(0.2, 0.2);

if (i = arL + 1) then
begin
Writeln('Could not find rift, location dungeon symbol');
Exit;
end;

GetMousePos(fx, fy);
end;


Procedure ToBank;
Var
myPath: TPointArray;
begin
SPS_Setup(RUNESCAPE_OTHER,['DragonMap']);
myPath := [Point(302, 192), Point(311, 194), Point(319, 194), Point(328, 197), Point(340, 199), Point(347, 201), Point(356, 203), Point(365, 206), Point(375, 207), Point(383, 206), Point(395, 207), Point(402, 207), Point(409, 208), Point(411, 217), Point(412, 221), Point(415, 229), Point(413, 236)];
SPS_WalkPath(myPath);
end;

Procedure ToDitch;
Var
myPath: TPointArray;
begin
SPS_Setup(RUNESCAPE_OTHER,['DragonMap']);
myPath := [Point(419, 223), Point(424, 220), Point(442, 213), Point(454, 193), Point(472, 184), Point(490, 184), Point(501, 161), Point(510, 146), Point(537, 146), Point(572, 146), Point(593, 137), Point(592, 112)];
SPS_WalkPath(myPath);
wait(1200+random(250));
Mouse(254, 134, 5, 5, True);
wait(3200+random(250));
end;

Procedure TeleportToBank;
begin
wait(500+random(50));
GameTab(26);
wait(250+random(50));
Mouse(641,264,2,3,False);
WaitOption('Edgeville',300);
repeat
wait( Random( 2000));
until(FindSymbol(x,y,Symbol_Bank));
ToBank;
end;



Function FindFood:Boolean;
begin
MMouseItem(5);
if WaitUptext(FoodType, 1000) then
begin
result:= True;
writeln('Found food')
Exit;
end else
begin
result:= False;
writeln('No food was found');
Exit;
end;
end;

function TeleportToEdge:Boolean;
begin
writeln('Could not find bank, teleporting to Edgeville and walking to bank');
wait(500+random(50));
GameTab(tab_Magic);
wait(1000+random(50));
if FindDTM(DTMHouse, x, y, MIX1, MIY1, MIX2, MIY2) then
begin
Mouse(x, y, 0, 0, True);
wait(2000+random(200));
end else
begin
writeln('Could not find spell');
end;
if FindDTM(DTMEdgeville, x, y, MSX1, MSY1, MSX2, MSY2) then
begin
Mouse(x, y, 0, 0, True);
if not FindSymbol(x, y, Symbol_Shop) then
begin
MarkTime(T)
repeat
wait(50);
until(FindSymbol(x, y, Symbol_Shop) or (TimeFromMark(T)>= 120000))
begin
wait(1200+random(250));
ToBank;
end;
end else
begin
writeln('Could not find location');
end;
end;
end;

function AtBank:Boolean;
begin
if FindSymbol(x, y, Symbol_Bank) or FindSymbol(x, y, Symbol_Furnace) then
begin
Result:= True;
writeln('Found the bank');
Exit;
end else
begin
Result:= False;
writeln('We could not find the bank');
Exit;
end;
end;


function GloryIsCharged:Boolean;
begin
if FindBlackChatMessage('ou use your amulets last charge.') then
begin
result:= True;
writeln('We need a new glory');
exit;
end else
begin
result:= False;
writeln('Glory is still charged');
exit;
end;
end;

function FindPortal(var fx, fy: Integer): 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.09, 0.58);

if not(FindColorsTolerance(arP, 7904927, MSX1, MSY1, MSX2, MSY2, 14)) then
begin
Writeln('Cannot find portal.');
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 >= 14.89) and (X <= 47.73) and (Y >= 16.19) and (Y <= 52.57) and (Z >= 13.15) and (Z <= 38.65) 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('Enter')) then
begin;
Result := True;
Break;
end;
end;

ColorToleranceSpeed(tmpCTS);
SetColorSpeed2Modifiers(0.2, 0.2);

if (i = arL + 1) then
begin
Writeln('Cannot find portal.');
Exit;
end;

GetMousePos(fx, fy);
end;




function WalkToBank:Boolean;
begin
wait(250 + random(50));
if TeleportToEdge then
if not AtBank then
begin
MarkTime(T);
repeat
wait(50);
until(AtBank or (TimeFromMark(T)>= 120000));
end else
begin
exit;
end;
end;

Procedure CompassChange;
Begin
MakeCompass(RandomRange(0,360));
end;

Function Fighting: Boolean;
begin
Writeln('Looking to see if we are fighting');
Wait(100);
Writeln('Pixel shift of '+IntToStr(averagePixelShift(IntToBox(235, 101, 290, 184), 120, 360)));
if (averagePixelShift(IntToBox(235, 101, 290, 184), 120, 360) < 150) then CompassChange;
if (averagePixelShift(IntToBox(235, 101, 290, 184), 120, 360) > 400) then
Begin
Result := True;
Exit;
end else
if not InFight then
Result :=False;
Exit;
end;


function WalkToRift:Boolean;
Var
x,y: Integer;
begin
ObjDTM_WalkPath(['105:31:2:1:7:39:59:1:7:27:47', '124:40:2:1:7:101:95:2:7:58:56', '94:21:2:2:7:74:60:2:7:129:76'], 0, 100, 80,False,True);
wait(250+random(50));
If Fighting then
repeat
Wait(50);
until(not(Fighting));
if not Fighting and FindRift(x,y) then
begin
Mouse(x,y,0,0,False);
wait(150+random(50));
ChooseOption('Enter');
exit;
end else
begin
If Fighting then
repeat
Wait(50);
until(not(Fighting));
if(FindSymbol(x, y, Symbol_Dungeon))then
begin
Mouse(x,y,2,2,True);
end;
Repeat
wait(50);
until(not(IsMoving));
if not Fighting and FindRift(x,y) then
begin
Mouse(x,y,0,0,False);
wait(150+random(50));
ChooseOption('Enter');
result:=True;
exit;
end else
begin
result:= False;
exit;
end;
end;
end;


function WalkToDragonLair:Boolean;
begin
wait(3000+random(250));
Mouse(624,143,0,0,True);
wait(4500+random(250));
wait(1000+random(50));
Mouse(623,141,0,0,True);
wait(4500+random(50));
if FindPortal(x,y) then
begin
wait(250+random(50));
Mouse(x,y,0,0,False);
WaitOption('Enter',250);
end;
if not FindPortal(x,y) then
begin
if FindPortal(x,y) then
begin
Mouse(x,y,0,0,False);
WaitOption('Enter',250);
end;
wait(250+random(50));
end;
wait(3500+random(200));
Mouse(631,148,2,2,True);
wait(5500+random(150));
end;


Procedure Banking;
Begin
Begin
If Not ( BankScreen or PinScreen) Then
begin
MarkTime(T);
OpenBankNPC;
repeat
wait(50)
until(BankScreen or PinScreen or (TimeFromMark(T)>=120000))
if (TimeFromMark(T)>=120000) then
begin
WalkToBank;
end;
end;
Begin
If PinScreen Then
InPin(Players[0].Pin);
If BankScreen Then
Begin
DepositAll;
if SuperSet = True then
begin
Withdraw(0, 0, 1);
wait(250+random(50));
Withdraw(1, 0, 1);
wait(250+random(50));
Withdraw(2, 0, 1);
wait(250+random(50));
Withdraw(3, 0, FoodAmount);
end else
begin
Withdraw(3, 0, FoodAmount);
end;
wait(500+random(50));
CloseBank;
end;
end;
end;
end;


procedure MainLoop;
begin
TeleportToBank;
if AtBank then
begin
Banking;
end else
begin
WalkToBank;
Banking;
end;
if FindFood then
begin
ToDitch;
end else
begin
MainLoop;
end;
begin
WalkToRift;
end;
begin
WalkToDragonLair;
end;
end;
procedure SetupChar;

begin
ObjDTM_Setup();
SetupSRL();
SetupMagic();
SetAngle(0);
ClickNorth(0);
LoadDTMs;
end;


procedure Startup;
begin
{ Smart_Server := 10;
Smart_Members:= true;
Smart_Signed := true;
Smart_SuperDetail := false;}
SetupSRL;
DeclarePlayers;
LogInPlayer;
end;

begin
Startup;
SetupChar;
MainLoop;
addonterminate('ReleaseDTMS');
end.

Currently the script will find the bank, withdraw super sets if you specify or just food and walk to the dragons. It will also teleport to edgeville if it cannot find the bank and it will then walk to the bank. If it encounters a problem it will teleport home and then restart the process.

Problems: Finding the entrance rift to the chaos tunnels, works 75% of the time, any ideas on how to find it? I was thinking maybe a Rotated DTM like in Demise's tutorial, feel free to post any suggestions!

Ashaman88

2012-07-08 14:11:59

Oh my, you meant this for research and development?

Good luck!

King

2012-07-08 14:15:51

From: ashaman88
Oh my, you meant this for research and development?

Good luck!


Well I have an almost working script, so I thought maybe here would work but where-ever it is supposed to be! Could a mod move this to the appropriate section? Thankyou(:

badkid

2012-07-08 14:34:50

yes more green drag bots to killlllll 99 pray here i come

King

2012-07-08 14:41:54

From: badkid
yes more green drag bots to killlllll 99 pray here i come


Exactly(;

Runaway

2012-07-08 14:48:18

From: SRLKing
PUBLIC, ANTI-FREE GDK


^ Bit of an oxymoron, eh? ;)

Good luck with this. Most scripts can be made fairly easily, it's reliability that poses the real challenge.

King

2012-07-08 15:09:48

From: Runaway
^ Bit of an oxymoron, eh? ;)

Good luck with this. Most scripts can be made fairly easily, it's reliability that poses the real challenge.


lol type-o XD and yes that is the main problem :P

chiatku03

2012-07-08 17:33:00

bless you haha

chilo27

2012-07-09 23:44:35

i would prefer wildy

Benny

2012-07-10 00:14:32

well good luck with this, will be interesting to see the results

Er1k

2012-07-10 00:18:04

Make it such that it will skull. We will then team up and rack up some kills ;)

King

2012-07-10 03:35:02

From: Er1k
Make it such that it will skull. We will then team up and rack up some kills ;)


Well….If people are not nice when I release it(;

Update: Working out bugs as we speak, expect a release tomorrow or the next day.

illester

2012-07-10 04:24:44

interested to see how this goes. good luck.