SRL Archive - Senior Scripts and Snippets

[beta] Aircrafter 3.0


Markus

2008-05-01 08:16:29

Here is my aircrafter rewrite, it is finished and it works a bit. Still need to iron all bugs out, but it should be able to do at least three loads or so :)
SRL stats etc. not added yet, progress report is a bit buggy just like essence counting, but the base is there :p


{
WWWWBgggggggggggggWWW
EWWHggggWF"""""""""""NMgWNWW
EE2HWWWE""""2ZZ22222222%7""HWWWE22
M A R K U S EEQWWWE222ZZZZZZZ22222222222% , JWWWEQ
P R E S E N T S W@gWWEzzgZEEZZZZZZZZZZZZZZZ222cc%-. qWBp
EggWBnZEEZZZEZZZZZZZZZQ2""2E2ZZ22222%-J"WWW@
A I R O EWWFZBBBEEZEBEZEZ@BBEE` `dZZZZ22S2S2 MWHE
M A L E S C O EQNWEEBEEEZZEZZZZE 3E, `@ZZZZ2222, HWH
@WBgBBBEEHEE""""EEi, ""EL, J"Z22ZZS22JWWWW@
A @WWNBEEBEEEb "ZE ""Eg, ZZZZZZ2Zz,qWBgE
@WWNWBEBEHBBg, `3g, 2EZBp, ZZZZZ2222)dWWWE
F A L A D O R @WWWEEEBEE2`WWW, ?#% ZEZZE- ZZZZZZZZZ)dWWWE
E A S T @WWWWWBEEE2 dP 3#, 3EZZE- ZZZZZZZZZ)dWWWE
A I R C R A F T E R @WBBBBBEE$% dgg,7"^ ZEEZEgp -$EZZZZZZZ)dWWWE
@WWWEEEEBBgggggdF"` ggp,`"ZBE"^ 3@EEZZZZEZ^3WWWE
EEBWWWBBEEBEBWW^ ,qWWC 3WE2` 2EEBBZZdWWEWWE
WWWWWBBNBBB,,,3WWE 3WENWR .,@EEEEZPggNWWEZ
Instructions: WqWWWWBgBBBEEEEE- qgZEE, -gHEEEEEEP"WWBWWW
Start at FEB WFWWWWWWBBBEBBBgggEEE"" qpEEEEEEEEqgWWWBN
Have enough ess in bank EWWWBWWWWWBBBEEBBBBBWmmWmWBBEEEEE22QWWWEE
Fill in the player array EHWWWWWWBEBBEBBEEEEEEEBBEEEEEEQgWWWEWW
Run the script and enjoy :)gWWWWWWWWWWWWBBBWWWWWWWWNgggWWBWWW
WWWWWWWWWWWWWWWWWWBWWWWWWWWW
BBEEEEWWWWWWWWWWWWWWWWWEEE
BBEEEEEEEEEEEEEEEEEEE
}
program AiroMalesco;
{.include srl/srl.scar}

const ManualLadderColor = 0; //Pick if the script fails to do so
CoordFailsafe = false; //False if you are coords paranoid *cough* Harry *cough*, true for longer runtime
LoadsBeforeSwitch = 3; //Number of loads before we switch players/logout+login
DebugLevel = 1; //No need to touch, but useful for scripters

procedure DeclarePlayers;
var i : integer;
begin

HowManyPlayers := 1;
NumberOfPlayers(HowManyPlayers);

Players[0].name := ''; //Your player's Username
Players[0].pass := ''; //His password
Players[0].nick := ''; //The nickname

for i := 0 to HowManyPlayers-1 do
Players[i].active := true; //Set them active
end;

type
TDDTMHandler = record //Record for universal (D)DTM handling
DaDTM : integer; //The (D)DDTM
Modi : TBox; //What to mod to X1, Y1, X2, Y2 etc
end; //I.E. Modi.x1 = 10 will search in mmx1+10, mmy1, mmx2, mmy2 etc.
TWalkStep = record //Record for walking stuff, contains all information in order to click one time
DDTM : TDDTMHandler; //The DDTM, first priority :)
Backuptype : (None, Radialwalking, Coords, Polar); //The backuptype, in case the DDTM fails. None, Radialwalk, Coords or Polar coords
RadiPoint : TPoint; //What are the Start/End radials, or the Coords in cae of Coord failsafe
OtherInfo : TPoint; //The radius and colour, or in case of coords, the randomness.
end;
TWalkRoute = array of TWalkStep; //Looks neater then array of TWalkStep imo ^-^
var
ToAltar, ToBank : TWalkRoute; //The WalkRoutes used in the script
TreeColor, LadderColor, //The colours the script uses
dtmRuneEss, dtmAirRune, //Item DTMs
AirsCrafted, Loads, //Report
EssUsed : integer; //Report

////////////////////////////////////////////////////////////////////////////////
// procedure Debug(s : string; level : integer); //
// Will debug string s at level Level, the higher the level the more important//
////////////////////////////////////////////////////////////////////////////////
procedure Debug(s : string; Level : integer);
begin
if (Level >= DebugLevel) then
writeln(s);
Status(s);
end;

////////////////////////////////////////////////////////////////////////////////
// function InAltar : boolean; //
// Returns true if we are in the Altar. Only useful if doubting between out //
// and inside altar. //
////////////////////////////////////////////////////////////////////////////////
function InAltar : boolean;
var
x, y : integer;
begin
x := mmcx;
y := mmcy;
result := False;
if (not(loggedin)) then
exit;
if FindColorSpiral(x, y, TreeColor, mmx1, mmy1, mmx2, mmy2) then
result := (Distance(mmcx, mmcy, x, y) > 30);
end;

////////////////////////////////////////////////////////////////////////////////
// function HandleColour(clr: integer) : integer; //
// Enter colour clr, will return it or autocolour it. Useful for failsafe //
// handling. //
////////////////////////////////////////////////////////////////////////////////
function HandleColour(clr : integer) : integer;
begin
result := clr;
if (clr < 0) then
case clr of
-1 : Result := FindFallyRoadColor; //Maybe I'll add more later
-2 : Result := FindRoadColor;
end;
end;

////////////////////////////////////////////////////////////////////////////////
// function FastFindLadderColor: Integer; //
// by Nielsie95 :) //
// Finds the colour of the ladder, as SRL's one isn't that good (false pos.) //
////////////////////////////////////////////////////////////////////////////////
function FastFindLadderColor: Integer;
var
i, n, cts:Integer;
p: TPointArray;
ca: TIntegerArray;
pa: array of TPointArray;
W, H: Extended;
b: TBox;
begin
if (not(loggedin)) then
exit;
cts := GetColorToleranceSpeed;
ColorToleranceSpeed(2);
SetColorSpeed2Modifiers(0.225, 6.5);
FindColorsSpiralTolerance(MMCX, MMCY, p, 77925, MMX1, MMY1, MMX2, MMY2, 16);
ColorToleranceSpeed(cts);
pa := SplitTPAEx(p, 2, 2);
SortATPAFromSize(pa, 32, True);
n := High(pa);
for i := 0 to n do
if (Length(pa[i]) > 15) and (Length(pa[i]) < 42) then
begin
ca := GetColors(pa[i]);
ClearSameIntegers(ca);
if (Length(ca) = 1) and (ca[0] > 0) then
begin
b := GetTPABounds(pa[i]);
w := b.x2 - b.x1;
h := b.y2 - b.y1;
if (w > h) then
SwapE(w, h);
if (w = 0) or (h = 0) then Continue;
if (h div w >= 1.12) and (h div w <= 1.8) then
begin
Result := ca[0];
Break;
end;
end;
end;
if (Result > 1) then
WriteLn('LadderColor = '+IntToStr(Result));
end;

////////////////////////////////////////////////////////////////////////////////
// function DoAutoColor : boolean; //
// Will autocolor all the colours (2) necessary to run the script. //
////////////////////////////////////////////////////////////////////////////////
function DoAutoColor : boolean;
var
r, g, b, x, y, oB : integer;
begin
result := false;
if (not(loggedin)) then
exit;
try
if ((ManualLadderColor > 0) and FindColor(x, y, ManualLadderColor, mmx1, mmy1, mmx2, mmy2)) then
LadderColor := ManualLadderColor
else
LadderColor := FindLadderColor;
ColortoRGB(LadderColor, R, G, B);
R := Max(0, R-33);
G := Max(0, G-3);
TreeColor := RGBtoColor(R, G, B);
if (FindColor(x, y, TreeColor, mmx1, mmy1, mmx2, mmy2)) then
exit;
oB := B;
for B := oB to oB+10 do
begin
TreeColor := RGBtoColor(R, G, B);
if (FindColor(x, y, TreeColor, mmx1, mmy1, mmx2, mmy2)) then
exit;
end;
writeln(' - Autocoloring FAILED');
writeln(' - Please manually pick the laddercolor, and try to rerun the script');
writeln(' - If it still displays this message after that, take a screenshot, save it as BMP/PNG and send it to Markus');
writeln('TERMINATING SCRIPT');
logout;
RaiseException(erCustomError, 'Autocolouring failed');
TerminateScript;
finally
Debug('Treecolor - '+inttostr(treecolor), 1);
Debug('Laddercolor - '+inttostr(laddercolor), 1);
result := true;
end;
end;

////////////////////////////////////////////////////////////////////////////////
// function WalkTheRoute(route : TWalkRoute) : boolean; //
// Highlevel walking function. Enter a TWalkRoute, and it'll walk. Has built- //
// in failsafe handling. //
////////////////////////////////////////////////////////////////////////////////
function WalkTheRoute(route : TWalkRoute) : boolean;
var
i : integer;
x, y : integer;
begin
if (not(loggedin)) then
exit;
result := false;
for i := 0 to high(route) do
begin
debug('Walking step '+inttostr(i), 0);
if (not(loggedin)) then
exit;
//WaitWhilstLoading;
if DTMRotated(route[i].DDTM.DaDTM, x, y, //Ok, so first we search for the (D)DTM
mmx1+route[i].DDTM.Modi.X1, mmy1+route[i].DDTM.Modi.Y1,
mmx2-route[i].DDTM.Modi.X2, mmy2-route[i].DDTM.Modi.Y2) then
begin
Debug('FOUND STEP '+inttostr(i), 0);
MFF(x, y, 1, 1); //If we found it click
FFlag(0); //Wait
FindNormalRandoms; //And find Randoms ofcourse :p
Wait(500 + random(500)); //Then wait a little bit longer
end else
begin
debug('Failsafe! step '+inttostr(i), 1);
case route[i].BackupType of //If not found, we got a few backup types:
None :
begin
logout;
exit;
end; //We got none, in that case we'll stop
Radialwalking :
begin
if not RadialWalk(HandleColour(route[i].OtherInfo.y), route[i].RadiPoint.x, route[i].RadiPoint.y, route[i].OtherInfo.x, 1, 1) then
begin
logout;
exit; //We got radialwalk
end;
FFlag(0);
FindNormalRandoms;
Wait(500 + random(500));
end;
Coords: //And we got coords
begin
if (not(CoordFailsafe)) then //For coord-click paranoia people, we got constant they can set :)
begin
logout;
exit;
end;
MFF(route[i].RadiPoint.x, route[i].RadiPoint.y, route[i].OtherInfO.x, route[i].OtherInfo.y);
FFlag(0); //Normal
FindNormalRandoms;
Wait(500 + random(500));
end;
end;
end;
end;
result := true;
debug('Walked the route completely :)', 1);
end;

////////////////////////////////////////////////////////////////////////////////
// function ClickRCAltar : boolean; //
// Enters the RC altar, or, when already inside, it'll craft the runes :) //
////////////////////////////////////////////////////////////////////////////////
function ClickRCAltar : boolean;
var
p : TPointArray;
d : T2DPointArray;
i, x, y, t : integer;
Altr : boolean;
begin
result := false;
if (not(loggedin)) then
exit;
Altr := InAltar; //Check if we are in the altar
Debug('In altar: '+booltostr(altr), 0);
repeat
wait(200 + random(200));
writeln('trying');
inc(t);
if (t > 5) then
exit;
ColorToleranceSpeed(2);
SetColorSpeed2Modifiers(0.82, 0.14); //Set CTS2 mods
while (GetColor(0, 0) = -1) do
Wait(1);
FindColorsSpiralTolerance(mscx, mscy, P, 4410442, MSX1, MSY1, MSX2, MSY2, 20); //Find colours
SetColorspeed2Modifiers(0.2, 0.2);
ColorToleranceSpeed(1);
if (length(p) < 30) then
continue;
d := SplitTPAEx(p, 3, 3); //Split the TPA
SortATPASize(d, true); //Sort by size, biggest one first
for i := 0 to 5 do //Only first give are worth checking lol
begin
MiddleTPAEx(d[i], x, y);
MMouse(x-5, y-5, 10, 10); //yea yea big randomness
wait(200 + random(100)); //Wait til uptext appears
if (Altr) then //If inside altar
begin
if (rs_GetUpText = 'Craft-rune Altar / 2 more options') then //Craft the runes
begin
GetMousePos(x, y);
Mouse(x, y, 0, 0, true);
result := true;
FFlag(0);
wait(200 + random(200)); //We might keep moving a little bit after the flag is gone
exit;
end;
end else
begin
if (rs_GetUptext = 'Enter Mysterious ruins / 2 more options') then //Else go inside
begin
GetMousePos(x, y);
Mouse(x, y, 0, 0, true);
x := GetSystemTime;
repeat
wait(50 + random(50));
if (GetSystemTime-x > 5000) then
exit;
until(InAltar);
result := true;
exit;
end;
end;
end;
until (t > 5);
end;

////////////////////////////////////////////////////////////////////////////////
// function ClickPortal : boolean; //
// by Nielsie95 :) //
// Will click the portal in the RC altar, in order to leave it. //
////////////////////////////////////////////////////////////////////////////////
function ClickPortal : Boolean;
var
t, i, cts, cx, cy: Integer;
tpa: TPointArray;
atpa: T2DPointArray;
begin
Result := False;
if (not(loggedin)) then
exit;
while (GetColor(0, 0) = -1) do
Wait(1);
cts := GetColorToleranceSpeed;
ColorToleranceSpeed(2);
SetColorSpeed2Modifiers(0.8, 1.28);
for t := 0 to 5 do
begin
if (t > 0) then
Wait(300 + Random(100));
FindColorsSpiralTolerance(mscx, mscy, tpa, 8897739, 1, 1, 515, 337, 12 + t);
atpa := SplitTPAEx(tpa, 7, 7);
if (Length(atpa) < 1) then Continue;
SortATPASize(atpa, True);
if (Length(atpa[0]) < 100) then Continue;
MiddleTPAEx(atpa[0], cx, cy);
FindColorsTolerance(tpa, 8897739, cx - 30, cy -30, cx +30, cy +30, 15);
if (Length(tpa) < 200) then Continue;
MMouse(cx, cy, 6, 6);
Wait(50 + Random(100));
if IsUpText('se Port') then
begin
GetMousePos(cx, cy);
Mouse(cx, cy, 0, 0, true);
i := GetSystemTime;
repeat
wait(50 + random(50));
if (GetSystemTime-i > 5000) then
exit;
until(not(InAltar));
Result := (not(InAltar));
Break;
end;
end;
SetColorSpeed2Modifiers(0.2, 0.2);
ColorToleranceSpeed(cts);
end;

////////////////////////////////////////////////////////////////////////////////
// function PadWithZero(no, dig : integer) : string; //
// Will add zero's to a number. //
////////////////////////////////////////////////////////////////////////////////
function PadWithZero(no, dig : integer) : string;
var
i : integer;
begin
result := inttostr(no);
for i := 1 to dig-length(inttostr(no)) do
result := '0'+result;
end;
////////////////////////////////////////////////////////////////////////////////
// procedure Report; //
// Will output a progress report :) //
////////////////////////////////////////////////////////////////////////////////
procedure Report;
var
pA : string;
i : integer;
begin
writeln('<=====================================================>');
writeln(' Airo Malesco 3.0, by Markus');
writeln(' We''ve been crafting airs for ' + TimeRunning);
writeln(' We crafted '+inttostr(AirsCrafted)+' airs, using '+inttostr(EssUsed)+' ess.');
writeln('<=====================================================>');
if (HowManyPlayers <= 1) then
begin
writeln(' Our char is '+inttostr(players[currentplayer].level[7])+' Runecrafting');
writeln(' He''s owning the world with this script, as we received '+inttostr(
players[currentplayer].level[7]-players[currentplayer].integers[0])+' levels during this run :)');
end else
begin
writeln(' # | Nick | T/F | Ess | Airs | Level'{ | Lvls gained'}); //Not yet levels gained
for i := 0 to HowManyPlayers-1 do
begin
case Players[i].active of
true : pa := 'T';
false: pa := 'F';
end;
writeln(
' '+PadWithZero(i, 2)+' '+padL(players[i].nick, 4)+' '+pA+' '+
PadWithZero(players[i].integers[1], 5)+' '+PadWithZero(players[i].integers[2], 5)+' '+
padL(inttostr(players[currentplayer].level[7]), 2));
end;
end;
writeln('<=====================================================>');
SRLRandomsReport;
end;

////////////////////////////////////////////////////////////////////////////////
// function OpenFEBBank : boolean; //
// Basically a wrapper for OpenFEBBank, handles PIN too //
////////////////////////////////////////////////////////////////////////////////
function OpenFEBBank : boolean;
begin
if (not(loggedin)) then
exit;
OpenBankFast('feb');
if (PinScreen) then
InPin(Players[currentplayer].pin);
FixBank;
result := BankScreen;
end;

////////////////////////////////////////////////////////////////////////////////
// function HandleBanking : boolean; //
// Deposists airs, withdraws ess =] //
////////////////////////////////////////////////////////////////////////////////
function HandleBanking : boolean;
var
x, y, A : integer;
begin
result := false;
if (not(loggedin or bankscreen)) then //If we aren't in the bank exit;
exit;
if FindDTM(dtmAirRune, x, y, mix1, miy1, mix2, miy2) then
begin
a := AmountDtm('inv', dtmAirRune); //Count the air runes
IncEx(Players[currentplayer].integers[2], a);
IncEx(AirsCrafted, a);
Mouse(x, y, 5, 5, false); //Deposit them
ChooseOption('ll');
inc(loads);
end;
if FindDTM(dtmRuneEss, x, y, msx1, msy1, msx2, msy2) then
begin
result := true;
Mouse(x, y, 5, 5, false);
ChooseOption('ll');
end else
begin
writeln(players[currentplayer].name+' doesn''t have any rune ess anymore!');
writeln('Logging out now');
CloseBank;
logout;
exit;
end;
wait(200 + random(100));
a := CountItemsDtm('inv', dtmRuneEss);
IncEx(EssUsed, a);
IncEx(players[currentplayer].integers[1], a);
if random(3) = 1 then
CloseBank;
end;

////////////////////////////////////////////////////////////////////////////////
// function GenerateWalkSteps : boolean; //
// Will generate the TWalkRoutes necessary for the script :) //
////////////////////////////////////////////////////////////////////////////////
function GenerateWalkSteps : boolean;
var
ToAltarDDTM: array [0 .. 4] of TDTM;
ToBankDDTM: array [0 .. 6] of TDTM;
i : integer;
begin
debug('Generating walking route....', 1);
SetArrayLength(ToAltar, 5);
SetArrayLength(ToBank, 6);
////////////////////////////////////////////////////////////////////////////////
// To Altar DDTM: 1 //
// From: Falador East Bank, best results if standing at bank booth //
// Destination: Between river and Mining Guild //
////////////////////////////////////////////////////////////////////////////////

ToAltarDDTM[0].Mainpoint.x := 611; //1
ToAltarDDTM[0].Mainpoint.y := 145;
ToAltarDDTM[0].Mainpoint.color := 0;
ToAltarDDTM[0].Mainpoint.tolerance := 423; //Max tol

SetArrayLength(ToAltarDDTM[0].subpoints, 3);
ToAltarDDTM[0].SubPoints[0].x := 581;
ToAltarDDTM[0].SubPoints[0].y := 69;
ToAltarDDTM[0].SubPoints[0].color := TreeColor;
ToAltarDDTM[0].SubPoints[0].areasize := 3;

ToAltarDDTM[0].SubPoints[1].x := 611;
ToAltarDDTM[0].SubPoints[1].y := 39;
ToAltarDDTM[0].SubPoints[1].color := TreeColor;
ToAltarDDTM[0].SubPoints[1].areasize := 3;

ToAltarDDTM[0].SubPoints[2].x := 693;
ToAltarDDTM[0].SubPoints[2].y := 97;
ToAltarDDTM[0].SubPoints[2].color := LadderColor;
ToAltarDDTM[0].SubPoints[2].areasize := 3;

ToAltar[0].BackupType := Radialwalking;
ToAltar[0].RadiPoint := IntToPoint(225, 180);
ToAltar[0].OtherInfo := IntToPoint(65, -1);

////////////////////////////////////////////////////////////////////////////////
// To Altar DDTM: 2 //
// From: Between river and Mining Guild //
// Destination: South Falador, near the exit gate //
////////////////////////////////////////////////////////////////////////////////

ToAltarDDTM[1].Mainpoint.x := 622;//2
ToAltarDDTM[1].Mainpoint.y := 148;
ToAltarDDTM[1].Mainpoint.color := 0;
ToAltarDDTM[1].Mainpoint.tolerance := 422; //Max tol

SetArrayLength(ToAltarDDTM[1].subpoints, 2);
ToAltarDDTM[1].SubPoints[0].x := 576;
ToAltarDDTM[1].SubPoints[0].y := 93;
ToAltarDDTM[1].SubPoints[0].color := laddercolor;
ToAltarDDTM[1].SubPoints[0].areasize := 3;

ToAltarDDTM[1].SubPoints[1].x := 676;
ToAltarDDTM[1].SubPoints[1].y := 72;
ToAltarDDTM[1].SubPoints[1].color := laddercolor;
ToAltarDDTM[1].SubPoints[1].areasize := 3;

ToAltar[1].BackupType := Radialwalking;
ToAltar[1].RadiPoint := IntToPoint(135, 225);
ToAltar[1].OtherInfo := IntToPoint(70, -1);

////////////////////////////////////////////////////////////////////////////////
// To Altar DDTM: 3 //
// From: South Falador, near the exit gate //
// Destination: Outside Falador, near the yew tree //
////////////////////////////////////////////////////////////////////////////////

ToAltarDDTM[2].Mainpoint.x := 620;//3
ToAltarDDTM[2].Mainpoint.y := 145;
ToAltarDDTM[2].Mainpoint.color := 0;
ToAltarDDTM[2].Mainpoint.tolerance := 422; //Max tol

SetArrayLength(ToAltarDDTM[2].subpoints, 2);
ToAltarDDTM[2].SubPoints[0].x := 645;
ToAltarDDTM[2].SubPoints[0].y := 81;
ToAltarDDTM[2].SubPoints[0].color := TreeColor;
ToAltarDDTM[2].SubPoints[0].areasize := 3;

ToAltarDDTM[2].SubPoints[1].x := 658;
ToAltarDDTM[2].SubPoints[1].y := 43;
ToAltarDDTM[2].SubPoints[1].color := laddercolor;
ToAltarDDTM[2].SubPoints[1].areasize := 3;

////////////////////////////////////////////////////////////////////////////////
// To Altar DDTM: 4 //
// From: Outside Falador, near the yew tree //
// Destination: North-East of Air Altar //
////////////////////////////////////////////////////////////////////////////////

ToAltarDDTM[3].Mainpoint.x := 581; //4
ToAltarDDTM[3].Mainpoint.y := 127;
ToAltarDDTM[3].Mainpoint.color := 0;
ToAltarDDTM[3].Mainpoint.tolerance := 422; //Max tol

SetArrayLength(ToAltarDDTM[3].subpoints, 3);
ToAltarDDTM[3].SubPoints[0].x := 620;
ToAltarDDTM[3].SubPoints[0].y := 103;
ToAltarDDTM[3].SubPoints[0].color := TreeColor;
ToAltarDDTM[3].SubPoints[0].areasize := 3;

ToAltarDDTM[3].SubPoints[1].x := 613;
ToAltarDDTM[3].SubPoints[1].y := 95;
ToAltarDDTM[3].SubPoints[1].color := TreeColor;
ToAltarDDTM[3].SubPoints[1].areasize := 3;

ToAltarDDTM[3].SubPoints[2].x := 622;
ToAltarDDTM[3].SubPoints[2].y := 68;
ToAltarDDTM[3].SubPoints[2].color := TreeColor;
ToAltarDDTM[3].SubPoints[2].areasize := 3;

////////////////////////////////////////////////////////////////////////////////
// To Altar DDTM: 5 //
// From: North-East of Air Altar //
// Destination: Next to the Air Altar //
////////////////////////////////////////////////////////////////////////////////

ToAltarDDTM[4].Mainpoint.x := 600; //5 / last
ToAltarDDTM[4].Mainpoint.y := 99;
ToAltarDDTM[4].Mainpoint.color := 0;
ToAltarDDTM[4].Mainpoint.tolerance := 422; //Max tol

SetArrayLength(ToAltarDDTM[4].subpoints, 4);
ToAltarDDTM[4].SubPoints[0].x := 607;
ToAltarDDTM[4].SubPoints[0].y := 92;
ToAltarDDTM[4].SubPoints[0].color := TreeColor;
ToAltarDDTM[4].SubPoints[0].areasize := 3;

ToAltarDDTM[4].SubPoints[1].x := 617;
ToAltarDDTM[4].SubPoints[1].y := 106;
ToAltarDDTM[4].SubPoints[1].color := TreeColor;
ToAltarDDTM[4].SubPoints[1].areasize := 3;

ToAltarDDTM[4].SubPoints[2].x := 620;
ToAltarDDTM[4].SubPoints[2].y := 114;
ToAltarDDTM[4].SubPoints[2].color := TreeColor;
ToAltarDDTM[4].SubPoints[2].areasize := 3;

ToAltarDDTM[4].SubPoints[3].x := 614;
ToAltarDDTM[4].SubPoints[3].y := 125;
ToAltarDDTM[4].SubPoints[3].color := TreeColor;
ToAltarDDTM[4].SubPoints[3].areasize := 3;

ToAltar[4].DDTM.Modi.Y1 := 20; //Necessary, against false positives

////////////////////////////////////////////////////////////////////////////////

for i := 0 to 4 do
ToAltar[i].DDTM.DaDTM := AddDTM(ToAltarDDTM[i]);

////////////////////////////////////////////////////////////////////////////////

////////////////////////////////////////////////////////////////////////////////
// To Bank DDTM: 1 //
// From: The place you'll end up after teleporting out of the altar (SE of it)//
// Destination: A bit to the north of it. //
////////////////////////////////////////////////////////////////////////////////

ToBankDDTM[0].Mainpoint.x := 641; //1
ToBankDDTM[0].Mainpoint.y := 41;
ToBankDDTM[0].Mainpoint.color := 0;
ToBankDDTM[0].Mainpoint.tolerance := 423; //Max tol

SetArrayLength(ToBankDDTM[0].subpoints, 3);
ToBankDDTM[0].SubPoints[0].x := 617;
ToBankDDTM[0].SubPoints[0].y := 68;
ToBankDDTM[0].SubPoints[0].color := TreeColor;
ToBankDDTM[0].SubPoints[0].areasize := 3;

ToBankDDTM[0].SubPoints[1].x := 663;
ToBankDDTM[0].SubPoints[1].y := 76;
ToBankDDTM[0].SubPoints[1].color := TreeColor;
ToBankDDTM[0].SubPoints[1].areasize := 3;

ToBankDDTM[0].SubPoints[2].x := 613;
ToBankDDTM[0].SubPoints[2].y := 107;
ToBankDDTM[0].SubPoints[2].color := TreeColor;
ToBankDDTM[0].SubPoints[2].areasize := 3;

////////////////////////////////////////////////////////////////////////////////
// To Bank DDTM: 2 //
// From: North of the air altar //
// Destination: The Yew Tree //
////////////////////////////////////////////////////////////////////////////////

ToBankDDTM[1].Mainpoint.x := 672; //1
ToBankDDTM[1].Mainpoint.y := 64;
ToBankDDTM[1].Mainpoint.color := 0;
ToBankDDTM[1].Mainpoint.tolerance := 423; //Max tol

SetArrayLength(ToBankDDTM[1].subpoints, 4);

ToBankDDTM[1].SubPoints[0].x := 654;
ToBankDDTM[1].SubPoints[0].y := 66;
ToBankDDTM[1].SubPoints[0].color := TreeColor;
ToBankDDTM[1].SubPoints[0].areasize := 3;

ToBankDDTM[1].SubPoints[1].x := 659;
ToBankDDTM[1].SubPoints[1].y := 99;
ToBankDDTM[1].SubPoints[1].color := TreeColor;
ToBankDDTM[1].SubPoints[1].areasize := 3;

ToBankDDTM[1].SubPoints[2].x := 648;
ToBankDDTM[1].SubPoints[2].y := 126;
ToBankDDTM[1].SubPoints[2].color := TreeColor;
ToBankDDTM[1].SubPoints[2].areasize := 3;

ToBankDDTM[1].SubPoints[3].x := 645;
ToBankDDTM[1].SubPoints[3].y := 117;
ToBankDDTM[1].SubPoints[3].color := TreeColor;
ToBankDDTM[1].SubPoints[3].areasize := 3;


////////////////////////////////////////////////////////////////////////////////
// To Bank DDTM: 3 //
// From: The Yew Tree //
// Destination: The entrance of Falador //
////////////////////////////////////////////////////////////////////////////////

ToBankDDTM[2].Mainpoint.x := 669; //1
ToBankDDTM[2].Mainpoint.y := 49;
ToBankDDTM[2].Mainpoint.color := 0;
ToBankDDTM[2].Mainpoint.tolerance := 423; //Max tol

SetArrayLength(ToBankDDTM[2].subpoints, 3);

ToBankDDTM[2].SubPoints[0].x := 617;
ToBankDDTM[2].SubPoints[0].y := 76;
ToBankDDTM[2].SubPoints[0].color := TreeColor;
ToBankDDTM[2].SubPoints[0].areasize := 3;

ToBankDDTM[2].SubPoints[1].x := 644;
ToBankDDTM[2].SubPoints[1].y := 107;
ToBankDDTM[2].SubPoints[1].color := TreeColor;
ToBankDDTM[2].SubPoints[1].areasize := 3;

ToBankDDTM[2].SubPoints[2].x := 656;
ToBankDDTM[2].SubPoints[2].y := 72;
ToBankDDTM[2].SubPoints[2].color := TreeColor;
ToBankDDTM[2].SubPoints[2].areasize := 3;

////////////////////////////////////////////////////////////////////////////////
// To Bank DDTM: 4 //
// From: The entrance of Falador //
// Destination: Inside Falador, bit north of the entrace next to the tree //
////////////////////////////////////////////////////////////////////////////////

ToBankDDTM[3].Mainpoint.x := 620; //1
ToBankDDTM[3].Mainpoint.y := 37;
ToBankDDTM[3].Mainpoint.color := 0;
ToBankDDTM[3].Mainpoint.tolerance := 423; //Max tol

SetArrayLength(ToBankDDTM[3].subpoints, 3);

ToBankDDTM[3].SubPoints[0].x := 612;
ToBankDDTM[3].SubPoints[0].y := 83;
ToBankDDTM[3].SubPoints[0].color := TreeColor;
ToBankDDTM[3].SubPoints[0].areasize := 3;

ToBankDDTM[3].SubPoints[1].x := 644;
ToBankDDTM[3].SubPoints[1].y := 117;
ToBankDDTM[3].SubPoints[1].color := TreeColor;
ToBankDDTM[3].SubPoints[1].areasize := 3;

ToBankDDTM[3].SubPoints[2].x := 611;
ToBankDDTM[3].SubPoints[2].y := 120;
ToBankDDTM[3].SubPoints[2].color := TreeColor;
ToBankDDTM[3].SubPoints[2].areasize := 3;

////////////////////////////////////////////////////////////////////////////////
// To Bank DDTM: 5 //
// From: Bit north of the Fally south gate //
// Destination: Between the castle tower and mining guild //
////////////////////////////////////////////////////////////////////////////////

ToBankDDTM[4].Mainpoint.x := 630; //1
ToBankDDTM[4].Mainpoint.y := 27;
ToBankDDTM[4].Mainpoint.color := 0;
ToBankDDTM[4].Mainpoint.tolerance := 423; //Max tol

SetArrayLength(ToBankDDTM[4].subpoints, 2);

ToBankDDTM[4].SubPoints[0].x := 651;
ToBankDDTM[4].SubPoints[0].y := 52;
ToBankDDTM[4].SubPoints[0].color := LadderColor;
ToBankDDTM[4].SubPoints[0].areasize := 3;

ToBankDDTM[4].SubPoints[1].x := 585;
ToBankDDTM[4].SubPoints[1].y := 35;
ToBankDDTM[4].SubPoints[1].color := LadderColor;
ToBankDDTM[4].SubPoints[1].areasize := 3;

ToBank[4].BackupType := Radialwalking;
ToBank[4].RadiPoint := IntToPoint(-45, 45);
ToBank[4].OtherInfo := IntToPoint(65, -1);

////////////////////////////////////////////////////////////////////////////////
// To Bank DDTM: 6 //
// From: Between castle tower and mining guild //
// Destination: Falador East Bank :) //
////////////////////////////////////////////////////////////////////////////////

ToBankDDTM[5].Mainpoint.x := 653; //1
ToBankDDTM[5].Mainpoint.y := 37;
ToBankDDTM[5].Mainpoint.color := 0;
ToBankDDTM[5].Mainpoint.tolerance := 423; //Max tol

SetArrayLength(ToBankDDTM[5].subpoints, 3);

ToBankDDTM[5].SubPoints[0].x := 582;
ToBankDDTM[5].SubPoints[0].y := 91;
ToBankDDTM[5].SubPoints[0].color := LadderColor;
ToBankDDTM[5].SubPoints[0].areasize := 3;

ToBankDDTM[5].SubPoints[1].x := 648;
ToBankDDTM[5].SubPoints[1].y := 106;
ToBankDDTM[5].SubPoints[1].color := LadderColor;
ToBankDDTM[5].SubPoints[1].areasize := 3;

ToBankDDTM[5].SubPoints[2].x := 676;
ToBankDDTM[5].SubPoints[2].y := 82;
ToBankDDTM[5].SubPoints[2].color := LadderColor;
ToBankDDTM[5].SubPoints[2].areasize := 3;

ToBank[5].BackupType := Radialwalking;
ToBank[5].RadiPoint := IntToPoint(-45, 45);
ToBank[5].OtherInfo := IntToPoint(65, -1);

////////////////////////////////////////////////////////////////////////////////

for i := 0 to 5 do
ToBank[i].DDTM.DaDTM := AddDTM(ToBankDDTM[i]);

////////////////////////////////////////////////////////////////////////////////

Debug('Walking generated!', 1);
result := true;

end;

////////////////////////////////////////////////////////////////////////////////
// procedure RAMKiller; //
// Will kill your RAM (the part, not the person ;) ) by filling it //
// with useless crap like DTMs, Colours, etc. :) //
////////////////////////////////////////////////////////////////////////////////
procedure RAMKiller; //yea I had to do at least ONE weird name ;)
begin
if (not(loggedin)) then
exit;
dtmRuneEss := DTMFromString('78DA63EC63606098C98002E22323183480342' +
'310FF0702C6D940C62C0634C0884402E9E940620901353D406239' +
'01350D40623E0135F5406206013520F74EC5AF060014D50D78');
dtmAirRune := DTMFromString('78DA635CC6C8C0F09401053C7DF8904103480' +
'36518FE0301E36620EB3E031A60442281F41620EB350135CB81AC' +
'CF04D4CC06B2DE12503313C87A885F0D00883C103B');
DoAutocolor;
GenerateWalkSteps;
end;

////////////////////////////////////////////////////////////////////////////////
// procedure SetupScript; //
// Will setup the whole script for you, and owns :p //
////////////////////////////////////////////////////////////////////////////////
procedure SetupScript;
begin
SetupSRL;
DeclarePlayers;
LoginPlayer;
RAMKiller;
SetAngle(true);
GetAllLevels;
OpenFEBBank;
HandleBanking;
end;

begin
SetupScript;
repeat
MakeCompass('n');
report;
WalkTheRoute(ToAltar);
if (not(ClickRCAltar and ClickRCAltar)) then
LogOut;
if (not(ClickPortal)) then
begin
MakeCompass('s');
if (not(ClickPortal)) then
Logout;
MakeCompass('n');
end;
WalkTheRoute(ToBank);
OpenFEBBank;
HandleBanking;
if ((not(loggedin)) or (loads mod LoadsBeforeSwitch = 0)) then
begin
Report;
NextPlayer(loggedin);
GetAllLevels;
end;
until (false);
end.
Edit: oh fuck, forgot the credits.
Credits to Nielsie95 for his awesome portal finder!

nielsie95

2008-05-01 08:44:33

Nice job :)
I can see you like ddtms ;)

the scar noob

2008-05-01 08:48:07

I like your records and your "WalkTheRoute" function to begin with XD

I see a lot of nice code, pro code!
Nice tpa handling etc!

You also have your own style, just as SB100 said before:)
You even found a link between the mm ladder color and the mm tree colour, amazing!:eek:

Keep up the good work, buddy!

-Tsn.

n3ss3s

2008-05-01 12:44:42

Good job, reflection pl0z? x)

bullzeye95

2008-05-01 16:41:25

Very nice, I'm liking your new walking style :)

Bam Bam

2008-05-01 20:24:38

From: bullzeye95
Very nice, I'm liking your new walking style :)

I like it too. If I scripted still for RS I would probably have to borrow it at some point. xD

Dark_Sniper

2008-05-01 21:34:00

walks there nicely.
makes air great.
walk back… after 5 attempts never worked.

maybe i set something wrong… :p

Bobarkinator

2008-05-01 23:05:27

I love your comments makes the code so much easier to follow. I should probably start doing it. Is their a tutorial for SetColorsSpeed2Modifiers anywhere? Or could somebody explain it. I have always wondered how to use it. I know it deals with HSL.

bullzeye95

2008-05-01 23:12:40

From: Bobarkinator
I love your comments makes the code so much easier to follow. I should probably start doing it. Is their a tutorial for SetColorsSpeed2Modifiers anywhere? Or could somebody explain it. I have always wondered how to use it. I know it deals with HSL.


I'm not too good at explaining things, but I'll attempt to explain it… It doesn't quite work like this, to my knowledge, but it's close enough: The tolerance that you put directly into a FindColor*Tolerance function is the luminance tolerance. The two color modifiers (Hue and Saturation) times the tolerance you put into the FindColor*Tolerance function are what it'll look for for hue and saturation tolerances. So basically…
Luminance tolerance = the tolerance you input
Hue tolerance = the tolerance you input * hue modifier
Saturation tolerance = the tolerance you input * the saturation modifier

Bobarkinator

2008-05-01 23:21:24

Thanks Bullzeye. Looks like I need to do some studying up on HSL