Runaway
2009-09-13 04:24:04
4 Year(s) +
Are you affilated in anyway with Jagex LTD?
No
What is your general programming knowledge?
Pascal and Intermediate C# and C++
Are you a member of any other communities?
No
Tell us about yourself…
From: Runaway Cop
Hello again! I'm back and applying with a new script! I'm still the same dude, laid back and friendly :) I still enjoy the same things I did a few weeks ago. Except for my new hobby, driving! I got my license last week and I've been driving everywhere! It's pretty awesome. Anyways, I hope this script will help my odds of acceptance this time round. Cheers!
I believe this script is better than my previous one, and shows that I have a better understanding of scripting with pascal. Thanks to a few guides on DDTM's and such, this script is equipped with decent walking abilities also :)
Please show us one (or multiple) of your scripts.
Much thanks to Main_Ftw, who helped with standards and fixed a few things :)
program RunawayPlanker;
{.include srl/srl/misc/smart.scar}
{.include srl/srl.scar}
const
RunScriptFor = 120; //Minutes to run script
SmartServer = 134;
var
Stime, OakDTM, NormalDTM, LoadsToDo: Integer;
Procedure DeclarePlayers;
begin
HowManyPlayers:= 1;
NumberOfPlayers(HowManyPlayers);
CurrentPlayer:= 0;
Players[0].Name := '';
Players[0].Pass := '';
Players[0].Nick := '';
Players[0].Pin := '';
Players[0].Integers[0] := 50; //Loads to be done
Players[0].Strings[1] := ''; //Type of log
Players[0].Active := True;
{Players[1].Name := '';
Players[1].Pass := '';
Players[1].Nick := '';
Players[1].Pin := '';
Players[1].Integers[0]:= 50; //Loads to be done
Players[1].Strings[1] := ''; //Type of log
Players[1].Active := True;}
{Players[2].Name := '';
Players[2].Pass := '';
Players[2].Nick := '';
Players[2].Pin := '';
Players[2].Integers[0]:= 50; //Loads to be done
Players[2].Strings[1] := ''; //Type of log
Players[2].Active := True;}
{Players[3].Name := '';
Players[3].Pass := '';
Players[3].Nick := '';
Players[3].Pin := '';
Players[3].Integers[0]:= 50; //Loads to be done
Players[3].Strings[1] := ''; //Type of log
Players[3].Active := True;}
end;
procedure LoadLogDTMs;
begin
OakDTM := DTMFromString('78DA637CC2C4C07086910119CC2AF7606006D' +
'220D1FF40C0F80EA8E628AA1A882C8C04D29F816A2E12507317A8' +
'E616013557816A2E1150730BA8E6387E3500DB530FA2');
NormalDTM := DTMFromString('78DA63E4636660B060624006D5F196609A11C' +
'A679400AA314255039385AB9105AAB123A0861DA8C68D809AFF4C' +
'C49943C03D00037B03F0');
end;
procedure AntiRandoms;
begin
if not (LoggedIn) then Exit;
If (not(Getcolor(499, 455)= 4807525)) then FindNormalRandoms;
end;
function Antiban: boolean;
var
x, y: Integer;
begin
if not (LoggedIn) then Exit;
result := true;
AntiRandoms;
case random(220) of
0,1: BoredHuman;
2,3: RandomRClick;
4,5: PickUpMouse;
6,7: HoverSkill('random', false);
8,9: MouseSpeed := 15+random(5)-random(5);
10,11:
begin
MakeCompass(randomrange(1, 55));
Wait(50+random(100));
MakeCompass(randomrange(120, 250));
Wait(50+random(100));
MakeCompass('n');
end;
12,13:
begin
GetMousePos(x, y);
MMouse(x, y, 15, 15);
Wait(50+random(100))
MMouse(x, y, 5, 5);
end;
14:
begin
SetAngle(true);
Wait(100+random(250));
SetAngle(false);
end;
15,16: RandomMovement;
17,18:
begin
GameTab(RandomRange(1, 13));
Wait(500+random(1000));
Gametab(tab_Inv);
end;
19,20: SleepAndMoveMouse(500+random(1000));
21: wait(500+random(1000));
end;
end;
procedure SetupScript;
begin
SetupSRL;
ClearDebug;
DeclarePlayers;
ActivateClient;
LoginPlayer;
SetAngle(true);
MakeCompass('n');
Antiban;
end;
function UseBank(LogType: string): boolean;
var
x, y, CoinsNeeded: Integer;
begin
if not (LoggedIn) then Exit;
Result := OpenBankQuiet('veb');
if (not Result) then
begin
Logout;
NextPlayer(true);
Exit;
end;
if PinScreen then
InPin(Players[CurrentPlayer].Pin)
else
begin
FixBank;
DepositAll;
case Lowercase(LogType) of
'normal': CoinsNeeded:= (27*150);
'oak': CoinsNeeded:= (27*270);
end;
SearchBank('coins');
Withdraw(1, 1, CoinsNeeded);
LoadLogDTMs;
SearchBank('log');
case Lowercase(LogType) of
'normal':
begin
if FindDTM(NormalDTM, x, y, MSX1, MSY1, MSX2, MSY2) then
begin
Mouse(x, y, 2, 2, false);
Wait(100+random(100));
ChooseOption('all');
end else
begin
Logout;
NextPlayer(true);
Exit;
end;
end;
'oak':
begin
if FindDTM(OakDTM, x, y, MSX1, MSY1, MSX2, MSY2) then
begin
Mouse(x, y, 2, 2, false);
Wait(100+random(100));
ChooseOption('all');
end else
begin
Logout;
NextPlayer(true);
Exit;
end;
end;
end;
end;
FreeDTM(NormalDTM);
FreeDTM(OakDTM);
CloseBank;
Antiban;
Inc(LoadsToDo);
If (LoadsToDo = Players[CurrentPlayer].Integers[0]) then
begin
Logout;
NextPlayer(true);
Exit;
end;
end;
function DDTMWalking(WalkNumber: Integer): Integer;
var
dtmMainPoint: TDTMPointDef;
dtmSubPoints: array[0..3] of TDTMPointDef;
TempTDTM: TDTM;
RoadColour: Integer;
begin
case WalkNumber of
0: begin
RoadColour := FindVarrockRoadColor;
dtmMainPoint.x := 1104;
dtmMainPoint.y := 292;
dtmMainPoint.AreaSize := 0;
dtmMainPoint.AreaShape := 0;
dtmMainPoint.Color := RoadColour;
dtmMainPoint.Tolerance := 0;
dtmSubPoints[0].x := 1104;
dtmSubPoints[0].y := 292;
dtmSubPoints[0].AreaSize := 0;
dtmSubPoints[0].AreaShape := 0;
dtmSubPoints[0].Color := RoadColour;
dtmSubPoints[0].Tolerance := 0;
dtmSubPoints[1].x := 1083;
dtmSubPoints[1].y := 320;
dtmSubPoints[1].AreaSize := 0;
dtmSubPoints[1].AreaShape := 0;
dtmSubPoints[1].Color := RoadColour;
dtmSubPoints[1].Tolerance := 0;
dtmSubPoints[2].x := 1072;
dtmSubPoints[2].y := 302;
dtmSubPoints[2].AreaSize := 0;
dtmSubPoints[2].AreaShape := 0;
dtmSubPoints[2].Color := RoadColour;
dtmSubPoints[2].Tolerance := 0;
dtmSubPoints[3].x := 1072;
dtmSubPoints[3].y := 291;
dtmSubPoints[3].AreaSize := 0;
dtmSubPoints[3].AreaShape := 0;
dtmSubPoints[3].Color := RoadColour;
dtmSubPoints[3].Tolerance := 0;
TempTDTM.MainPoint := dtmMainPoint;
TempTDTM.SubPoints := dtmSubPoints;
Result := AddDTM(TempTDTM);
end;
1: begin
RoadColour := FindVarrockRoadColor;
dtmMainPoint.x := 1123;
dtmMainPoint.y := 328;
dtmMainPoint.AreaSize := 0;
dtmMainPoint.AreaShape := 0;
dtmMainPoint.Color := RoadColour;
dtmMainPoint.Tolerance := 0;
dtmSubPoints[0].x := 1123;
dtmSubPoints[0].y := 328;
dtmSubPoints[0].AreaSize := 0;
dtmSubPoints[0].AreaShape := 0;
dtmSubPoints[0].Color := RoadColour;
dtmSubPoints[0].Tolerance := 0;
dtmSubPoints[1].x := 1110;
dtmSubPoints[1].y := 316;
dtmSubPoints[1].AreaSize := 0;
dtmSubPoints[1].AreaShape := 0;
dtmSubPoints[1].Color := RoadColour;
dtmSubPoints[1].Tolerance := 0;
dtmSubPoints[2].x := 1111;
dtmSubPoints[2].y := 345;
dtmSubPoints[2].AreaSize := 0;
dtmSubPoints[2].AreaShape := 0;
dtmSubPoints[2].Color := RoadColour;
dtmSubPoints[2].Tolerance := 0;
dtmSubPoints[3].x := 1098;
dtmSubPoints[3].y := 344;
dtmSubPoints[3].AreaSize := 0;
dtmSubPoints[3].AreaShape := 0;
dtmSubPoints[3].Color := RoadColour;
dtmSubPoints[3].Tolerance := 0;
TempTDTM.MainPoint := dtmMainPoint;
TempTDTM.SubPoints := dtmSubPoints;
Result := AddDTM(TempTDTM);
end;
2: begin
RoadColour := FindVarrockRoadColor;
dtmMainPoint.x := 1114;
dtmMainPoint.y := 328;
dtmMainPoint.AreaSize := 0;
dtmMainPoint.AreaShape := 0;
dtmMainPoint.Color := RoadColour;
dtmMainPoint.Tolerance := 5;
dtmSubPoints[0].x := 1114;
dtmSubPoints[0].y := 328;
dtmSubPoints[0].AreaSize := 0;
dtmSubPoints[0].AreaShape := 0;
dtmSubPoints[0].Color := RoadColour;
dtmSubPoints[0].Tolerance := 5;
dtmSubPoints[1].x := 1123;
dtmSubPoints[1].y := 293;
dtmSubPoints[1].AreaSize := 0;
dtmSubPoints[1].AreaShape := 0;
dtmSubPoints[1].Color := RoadColour;
dtmSubPoints[1].Tolerance := 5;
dtmSubPoints[2].x := 1134;
dtmSubPoints[2].y := 360;
dtmSubPoints[2].AreaSize := 0;
dtmSubPoints[2].AreaShape := 0;
dtmSubPoints[2].Color := RoadColour;
dtmSubPoints[2].Tolerance := 5;
dtmSubPoints[3].x := 1082;
dtmSubPoints[3].y := 330;
dtmSubPoints[3].AreaSize := 0;
dtmSubPoints[3].AreaShape := 0;
dtmSubPoints[3].Color := RoadColour;
dtmSubPoints[3].Tolerance := 5;
TempTDTM.MainPoint := dtmMainPoint;
TempTDTM.SubPoints := dtmSubPoints;
Result := AddDTM(TempTDTM);
end;
3: begin
RoadColour := FindVarrockRoadColor;
dtmMainPoint.x := 982;
dtmMainPoint.y := 174;
dtmMainPoint.AreaSize := 8;
dtmMainPoint.AreaShape := 0;
dtmMainPoint.Color := RoadColour;
dtmMainPoint.Tolerance := 5;
dtmSubPoints[0].x := 982;
dtmSubPoints[0].y := 174;
dtmSubPoints[0].AreaSize := 8;
dtmSubPoints[0].AreaShape := 0;
dtmSubPoints[0].Color := RoadColour;
dtmSubPoints[0].Tolerance := 5;
dtmSubPoints[1].x := 928;
dtmSubPoints[1].y := 187;
dtmSubPoints[1].AreaSize := 8;
dtmSubPoints[1].AreaShape := 0;
dtmSubPoints[1].Color := RoadColour;
dtmSubPoints[1].Tolerance := 5;
dtmSubPoints[2].x := 926;
dtmSubPoints[2].y := 201;
dtmSubPoints[2].AreaSize := 8;
dtmSubPoints[2].AreaShape := 0;
dtmSubPoints[2].Color := RoadColour;
dtmSubPoints[2].Tolerance := 5;
dtmSubPoints[3].x := 951;
dtmSubPoints[3].y := 220;
dtmSubPoints[3].AreaSize := 8;
dtmSubPoints[3].AreaShape := 0;
dtmSubPoints[3].Color := RoadColour;
dtmSubPoints[3].Tolerance := 5;
TempTDTM.MainPoint := dtmMainPoint;
TempTDTM.SubPoints := dtmSubPoints;
Result := AddDTM(TempTDTM);
end;
4: begin
RoadColour := FindVarrockRoadColor;
dtmMainPoint.x := 1076;
dtmMainPoint.y := 283;
dtmMainPoint.AreaSize := 0;
dtmMainPoint.AreaShape := 0;
dtmMainPoint.Color := RoadColour;
dtmMainPoint.Tolerance := 0;
dtmSubPoints[0].x := 1076;
dtmSubPoints[0].y := 283;
dtmSubPoints[0].AreaSize := 0;
dtmSubPoints[0].AreaShape := 0;
dtmSubPoints[0].Color := RoadColour;
dtmSubPoints[0].Tolerance := 0;
dtmSubPoints[1].x := 1061;
dtmSubPoints[1].y := 314;
dtmSubPoints[1].AreaSize := 0;
dtmSubPoints[1].AreaShape := 0;
dtmSubPoints[1].Color := RoadColour;
dtmSubPoints[1].Tolerance := 0;
dtmSubPoints[2].x := 1056;
dtmSubPoints[2].y := 319;
dtmSubPoints[2].AreaSize := 0;
dtmSubPoints[2].AreaShape := 0;
dtmSubPoints[2].Color := RoadColour;
dtmSubPoints[2].Tolerance := 0;
dtmSubPoints[3].x := 1070;
dtmSubPoints[3].y := 310;
dtmSubPoints[3].AreaSize := 0;
dtmSubPoints[3].AreaShape := 0;
dtmSubPoints[3].Color := RoadColour;
dtmSubPoints[3].Tolerance := 0;
TempTDTM.MainPoint := dtmMainPoint;
TempTDTM.SubPoints := dtmSubPoints;
Result := AddDTM(TempTDTM);
end;
end;
end;
Function WalkTo(Num: Integer): Boolean;
var
Colours, StartRadials,
EndRadials, Radius: TIntegerArray;
begin
if not (LoggedIn) then Exit;
Colours := [FindVarrockRoadColor, 2189373, FindVarrockRoadColor, FindVarrockRoadColor, RoadColor, RoadColor];
StartRadials := [58, 18, 33, 18, 10, 13];
EndRadials := [68, 28, 45, 25, 20, 20];
Radius := [75, 75, 75, 75, 75, 75];
result := RadialRoadWalk(Colours[Num], StartRadials[Num], EndRadials[Num], Radius[Num], 0, 1);
fflag(2);
end;
Procedure WalkToSawMill;
var
i : Integer;
GotThere: Boolean;
begin
for i := 0 to 5 do
begin
GotThere := WalkTo(i);
if not GotThere then break;
end;
end;
function AtSawMill: boolean;
var
TPA: TPointArray;
i, x, y: Integer;
begin
if not (LoggedIn) then Exit;
SymbolAccuracy := 0.5;
result := FindSymbol(x, y, 'Saw Mill');
SymbolAccuracy := 0.8;
if (not result) then
begin
for i := 1 to 25 do
FindColorsSpiralTolerance(x, y, TPA, 2078944, MMX1, MMY1, MMX2, MMY2, i);
if (GetArrayLength(TPA) >= 50) then
begin
Mouse(TPA[i].x, TPA[i].y, 5, 5, true);
FFlag(2);
Exit;
end;
if (GetArrayLength(TPA) = 0) then
begin
Logout;
NextPlayer(true);
Exit;
end;
end;
Mouse(x, y, 2, 2, true);
Antiban;
FFlag(2);
end;
function MakeLogs(LogType: string): boolean;
var
TPA: TPointArray;
i, x, y: Integer;
begin
if not (LoggedIn) then Exit;
for i := 1 to 10 do
Antiban;
if FindColorSpiralTolerance(x, y, 763277, MSX1, MSY1, MSX2, MSY2, i) then
repeat
FindColorsSpiralTolerance(x, y, TPA, 7633277, MSX1, MSY1, MSX2, MSY2, 10);
until((GetArrayLength(TPA) >= 15));
begin
MMouse(TPA[i].x, TPA[i].y, 3, 3);
wait(100+random(100));
Result := IsUpText('operator');
if not result then Exit
else
begin
GetMousePos(x,y);
Mouse(x, y, 0, 0, false);
ChooseOption('plank');
wait(200+random(500));
end;
case Lowercase(LogType) of
'normal':
begin
MouseBox(342, 120, 333, 100, 1);
GetMousePos(x, y);
ClickMouse(x, y, false);
Wait(100+random(100));
ChooseOption('all');
end;
'oak':
begin
MouseBox(185, 98, 195, 118, 1);
GetMousePos(x, y);
ClickMouse(x, y, false);
Wait(100+random(100));
ChooseOption('all');
end;
end;
end;
end;
Function WalkBack(Num: Integer): Boolean;
var
Colours, StartRadials,
EndRadials, Radius: TIntegerArray;
begin
if not (LoggedIn) then Exit;
Colours := [RoadColor, RoadColor, FindVarrockRoadColor, 2189373, FindVarrockRoadColor];
StartRadials := [58, 18, 33, 18, 10, 13];
EndRadials := [68, 28, 45, 25, 20, 20];
Radius := [75, 75, 75, 75, 75, 75];
result := RadialRoadWalk(Colours[Num], StartRadials[Num], EndRadials[Num], Radius[Num], 0, 1);
fflag(2);
end;
Procedure WalkBackBank;
var
i : Integer;
GotThere: Boolean;
begin
MakeCompass('s');
for i := 0 to 5 do
begin
GotThere := WalkTo(i);
if not GotThere then break;
end;
end;
function AtBank: boolean;
var
TPA: TPointArray;
i, x, y: Integer;
begin
if not (LoggedIn) then Exit;
SymbolAccuracy := 0.5;
result := FindSymbol(x, y, 'Bank');
SymbolAccuracy := 0.8;
if (not result) then
begin
for i := 1 to 15 do
FindColorsSpiralTolerance(x, y, TPA, 1356913, MMX1, MMY1, MMX2, MMY2, i);
if (GetArrayLength(TPA) >= 20) then
begin
Mouse(TPA[i].x, TPA[i].y, 3, 3, true);
FFlag(2);
Exit;
end;
if (GetArrayLength(TPA) = 0) then
begin
Logout;
NextPlayer(true);
Exit;
end;
end;
Mouse(x, y, 2, 2, true);
Antiban;
FFlag(2);
end;
procedure ProgressReport;
begin
WriteLn('/--------------------------------------------------------\');
WriteLn('| Runaway Planker |');
WriteLn('|--------------------------------------------------------|');
WriteLn('| The Script Has Run For '+IntToStr(TimeFromMark(stime))+'! |');
WriteLn('| |');
WriteLn('| We Have Made '+IntToStr((LoadsToDo)*27)+' Planks! |');
WriteLn('\--------------------------------------------------------/');
end;
begin
MouseSpeed := 15+random(5)-random(5);
SetupScript;
MarkTime(stime);
repeat
UseBank(Players[0].Strings[1]);
WalkToSawMill;
AtSawMill;
MakeLogs(Players[0].Strings[1]);
WalkBackBank;
AtBank;
ProgressReport;
until((TimeFromMark((stime)/1000/60)>RunScriptFor));
end.