Sir R. M8gic1an
2010-08-02 08:09:35
program Kings_Varrock_Air_Runecrafter;
{.include SRL/SRL.scar}
//===============================*****===============================//
// _ _ _ King's Varrock Air Runecrafter //
// | | / / (_) Version 1.0 //
// | | / / _ _ __ _____ //
// | |/ / | | | |/_ \ / ___ \ Simba //
// | | | | | / \ \ | | | | SRL Dev Revision //
// | |\ \ | | | | | | | |___| | //
// |_| \_\ |_| |_| |_| \____ | What It does: //
// _ | | Walks from the Varrock //
// SCRIPTS | |___/ | Bank to the air alter and //
// \_____/ crafts air runes. //
//===================================================================//
// Instructions! //
// 1. Setup players in Varrock West Bank, southwestern bankbooth. //
// 2. Have either talisman in your inventory or wearing your tiara. //
// 3. Set up sections in the script needed to run. //
// 4. Push play and then post progress reports when its done! //
//===================================================================//
// Credits //
// SRL - Great community, thanks everyone! //
//===================================================================//
// ///|||\\\ Version History ///|||\\\ //
//===================================================================//
// Version 1.0: First stable release of the script. //
//===============================*****===============================//
const
LoadsToDo = 7;// Number of loads to do before switching players.
Debug = True;// True to debug all information, please choose this one!
// False to debug only important information.
procedure DeclarePlayers;
begin
HowManyPlayers :=2;
NumberOfPlayers(HowManyPlayers);
CurrentPlayer :=0;
Players[0].Name := '';//Username
Players[0].Pass := '';//Password
Players[0].Nick := '';// Nick
Players[0].Booleans[0] := True;//True for tiara, false for talisman
Players[0].Active := True;//Active?
Players[1].Name := '';//Username
Players[1].Pass := '';//Password
Players[1].Nick := '';// Nick
Players[1].Booleans[0] := True;//True for tiara, false for talisman
Players[1].Active := True;//Active?
end;
var
x, y, RuneEssence, AirRune, AirTalisman, AirTiara, Start, Todo, Loads: Integer;
Bankers5p1, Bankers5, Bankers4p1, Bankers4, Bankers3p1, Bankers3: Integer;
startxp, endxp, startlvl, endlvl, XPgained, lvlgained: integer;
procedure Load;
begin
RuneEssence := BitmapFromString(21, 15, 'beNqd0tkKglAUheGXsKtowL' +
'CJJBFEEEHEkpOZ2CgRXvT+L9GKBYeDmkrw366P7SDELgwP8R4dhWC' +
'nJGF5mrJLlqHbOUeP6xU97/dXUbzLEvM4ihgdSXU6EMIgQED+cFDg' +
'+0hF6k7luSSCG3zPo/ALabmEc6YKfR6Hc891kSp0IvIGvD3XcSj0R' +
'FSBc9aOVAQ5d2wbtSMVQZ3blkWhjjQK8n6+utVyAYGpSKOgHsCfZ6' +
'brm/V6a5r9Bc757UbD4dwwMO8jqHM+/kDTppMxhM4bKp/yK3wAVEH' +
'vmQ==');
AirRune := BitmapFromString(23, 14, 'beNplk09LAlEUxb9JtZZWgg' +
'QitBBaiIllJiIiIiKTaWam2SCmTZN/0swIWyW4aFEt+yS17cN04MD' +
'h4cBd3Jl3+XHOue85TqlQOCufnFdOL6rVy1rt7/eH1blqqb/tdO66' +
'XX2ynsbjxWz2vlx+f30CYhWL5VKpYlmkaazdaKjv2TZQJuTBdaeD+' +
'9f5/GO1Kubz5OC/l9Oq1yWse90GSkeDfn/kOKi3xaKQy5GjU6LYy6' +
'DdbJKjMRh0ezfQA1P5bBYFlE5hTT2CkiS4A8oMChA4ep5Msul0LpM' +
'BR6e0xjIlkWOmBDGz4RAJZ1IpcaCH7kxrbBAUOWtRgwAl6WQSZaI4' +
'sxYUJMkaC/kIEo9GjxMJoTjgTUm+zIsECOy8PE73wmFwjg7iRIFDV' +
'RqGHjNqE4JMGGwoGCTnMBYTShDoMU2ZIWNTgGDFcBTw+70cRWSaMs' +
'PhpmAHlw1itn0+cHZDIXD2IxFw5Mu7eobDTQGCBfG+bW1ugLMTCIi' +
'zJoYh63XoaUAMFgRHo38xSh9+');
AirTalisman := BitmapFromString(9, 12, 'beNp9j80KglAUhF8pgg' +
'hEEKHCfrHMQkRERKQsM7Mfi+hR2rWpZcta9l59cKBlMAz3nrlzZu6' +
'xXC8Xvus6tj0aDG7Xa7vVhFVFqddqoe9zBuOhCXcNA9Y1rVqpIOFy' +
'p1N50O904Iaua6oahyGq5zhiNHs9eYORLNTA81BJlDmJGM+HfRLHU' +
'RCIypw+rMV1OZZlUYgqoRPLQiXrtNtts4y1syj6VcJF/32eb9J0lc' +
'wxSiXKkIXEUCBlxMI2/sX1Pz7vF3g+7gK6Xb76a4NG');
AirTiara := BitmapFromString(5, 9, 'beNrr7FyxcMHiObPnTZ8+Y9' +
'Kkyb29yNyJ3d1YufevXQVygeSqRYuAJFAWSAJlgSSaLLJeNO7U/j4' +
'gY87UqdMnTJgAALpQVZQ=');
Bankers5p1 := DTMFromString('78DA63CC63666060636440064D051E0CFF813' +
'448F43F10302601D5F041D43041D5FCF9C3C4C0055503026035AC' +
'44A8F9CB4058CD57026A92816ADE62AA614056D30F542384DF3D0' +
'04D191869');
Bankers5 := DTMFromString('78DA63CC63666060636440068D79DE0CFF813' +
'448F43F10302601D5F041D43041D5FCF9C3C4C00555030260356C' +
'44A8F9CB4058CD5722D4BCC1AF0600098615C5');
Bankers4p1 := DTMFromString('78DA63CC63666060636440064D051E0CFF813' +
'448F43F10302601D5F041D43041D5FCF9C3C4C0055503026035AC' +
'44A8F9CB4058CD57026AFA816A84F0DB0500F4CF1518');
Bankers4 := DTMFromString('78DA63CC63666060636440064D051E0CFF813' +
'448F43F10302601D5F041D43041D5FCF9C3C4C0055503026035AC' +
'44A8F9CB4058CD57FC6A0027F2126B');
Bankers3p1 := DTMFromString('78DA638C656660F8C780029A0A3C18FE03694' +
'620FE0F048C414035AC8C603926A89A3F7F9818B8A06A4000ACE6' +
'2F037E35C140355F09A8A907AAE1C26F1700F527133B');
Bankers3 := DTMFromString('78DA63CC63666060636440068D79DE0CFF813' +
'448F43F10302601D5F041D43041D5FCF9C3C4C00555030260356C' +
'44A8F9CB80570D00BFD50F0A');
end;
procedure W(Info: string);
begin
if (not(Debug)) then
Exit;
Writeln('' + Info + '');
end;
function AntiBan: Boolean;
begin
Result := False;
if (not LoggedIn) then
Exit;
case Random(15) of
0,1,12: begin
HoverSkill('Runecrafting', False);
Wait(2000 + Random(2000));
GameTab(Tab_Inv);
Result := True;
end;
2,3: begin
HoverSkill('Mining', False);
Wait(2000 + Random(2000));
GameTab(Tab_Inv);
Result := True;
end;
4..6: begin
SleepAndMoveMouse(2000 + random(1000));
Result := True;
end;
7: begin
GameTab(tab_Stats);
Wait(2000 + Random(2000));
GameTab(tab_Inv);
end;
8..10: FindNormalRandoms
end;
end;
procedure ProgressReport; forward;
procedure Bye(Explain, Loc: string);
begin
Writeln('ERROR: ['+ Players[CurrentPlayer].Nick +'] is now inactive.');
Writeln('' + Explain + '');
Players[CurrentPlayer].Loc := '' + Loc +'';
Players[CurrentPlayer].Active := False;
EndXP := GetXp('Runecrafting');
EndLvl := GetSkillLevel('Runecrafting');
XPGained := EndXP - StartXP;
LvlGained := EndLvl - StartLvl;
ProgressReport;
end;
function AccurateBankonMMFinding: Boolean;
begin
if(not LoggedIn)then
Exit;
Result := True;
if(not(DTMRotated(Bankers5p1, x, y, MMX1, MMY1, MMX2, MMY2))) then
begin
if(not(DTMRotated(Bankers5, x, y, MMX1, MMY1, MMX2, MMY2))) then
begin
if(not(DTMRotated(Bankers4p1, x, y, MMX1, MMY1, MMX2, MMY2))) then
begin
if(not(DTMRotated(Bankers4, x, y, MMX1, MMY1, MMX2, MMY2))) then
begin
if(not(DTMRotated(Bankers3p1, x, y, MMX1, MMY1, MMX2, MMY2))) then
begin
if(not(DTMRotated(Bankers3, x, y, MMX1, MMY1, MMX2, MMY2))) then
begin
Bye('Could not find bankers on MM.', 'Lost');
Result := False;
end else
Exit;
end else
Exit;
end else
Exit;
end else
Exit;
end else
Exit;
end else
Exit;
end;
function DDTMs(PathNum: integer): integer;
var
dtmMainPoint: TDTMPointDef;
dtmSubPoints: Array [0..3] of TDTMPointDef;
TempTDTM: TDTM;
i: integer;
begin
i := AutoColor(srl_VarrockRoadColor);
case PathNum of
1: begin //1-4 To Ruins
dtmMainPoint.x := 832;
dtmMainPoint.y := 297;
dtmMainPoint.Color := i;
dtmMainPoint.Tolerance := 15;
dtmSubPoints[0].x := 832;
dtmSubPoints[0].y := 297;
dtmSubPoints[0].Color := i;
dtmSubPoints[0].Tolerance := 15;
dtmSubPoints[1].x := 833;
dtmSubPoints[1].y := 271;
dtmSubPoints[1].Color := i;
dtmSubPoints[1].Tolerance := 15;
dtmSubPoints[2].x := 850;
dtmSubPoints[2].y := 303;
dtmSubPoints[2].Color := i;
dtmSubPoints[2].Tolerance := 15;
dtmSubPoints[3].x := 879;
dtmSubPoints[3].y := 294;
dtmSubPoints[3].Color := i;
dtmSubPoints[3].Tolerance := 15;
end;
2: begin
dtmMainPoint.x := 827;
dtmMainPoint.y := 294;
dtmMainPoint.Color := i;
dtmMainPoint.Tolerance := 15;
dtmSubPoints[0].x := 827;
dtmSubPoints[0].y := 294;
dtmSubPoints[0].Color := i;
dtmSubPoints[0].Tolerance := 15;
dtmSubPoints[1].x := 842;
dtmSubPoints[1].y := 273;
dtmSubPoints[1].Color := i;
dtmSubPoints[1].Tolerance := 15;
dtmSubPoints[2].x := 861;
dtmSubPoints[2].y := 260;
dtmSubPoints[2].Color := i;
dtmSubPoints[2].Tolerance := 15;
dtmSubPoints[3].x := 867;
dtmSubPoints[3].y := 242;
dtmSubPoints[3].Color := i;
dtmSubPoints[3].Tolerance := 15;
end;
3: begin
dtmMainPoint.x := 818;
dtmMainPoint.y := 270;
dtmMainPoint.Color := i;
dtmMainPoint.Tolerance := 15;
dtmSubPoints[0].x := 818;
dtmSubPoints[0].y := 270;
dtmSubPoints[0].Color := i;
dtmSubPoints[0].Tolerance := 15;
dtmSubPoints[1].x := 850;
dtmSubPoints[1].y := 270;
dtmSubPoints[1].Color := i;
dtmSubPoints[1].Tolerance := 15;
dtmSubPoints[2].x := 867;
dtmSubPoints[2].y := 262;
dtmSubPoints[2].Color := i;
dtmSubPoints[2].Tolerance := 15;
dtmSubPoints[3].x := 893;
dtmSubPoints[3].y := 241;
dtmSubPoints[3].Color := i;
dtmSubPoints[3].Tolerance := 15;
end;
4: begin
dtmMainPoint.x := 823;
dtmMainPoint.y := 264;
dtmMainPoint.Color := i;
dtmMainPoint.Tolerance := 25;
dtmSubPoints[0].x := 823;
dtmSubPoints[0].y := 264;
dtmSubPoints[0].Color := i;
dtmSubPoints[0].Tolerance := 25;
dtmSubPoints[1].x := 870;
dtmSubPoints[1].y := 263;
dtmSubPoints[1].Color := i;
dtmSubPoints[1].Tolerance := 25;
dtmSubPoints[2].x := 902;
dtmSubPoints[2].y := 264;
dtmSubPoints[2].Color := i;
dtmSubPoints[2].Tolerance := 25;
dtmSubPoints[3].x := 917;
dtmSubPoints[3].y := 252;
dtmSubPoints[3].Color := i;
dtmSubPoints[3].Tolerance := 25;
end;
5: begin //5-8 ToBank
dtmMainPoint.x := 926;
dtmMainPoint.y := 225;
dtmMainPoint.Color := i;
dtmMainPoint.Tolerance := 50;
dtmSubPoints[0].x := 926;
dtmSubPoints[0].y := 225;
dtmSubPoints[0].Color := i;
dtmSubPoints[0].Tolerance := 50;
dtmSubPoints[1].x := 893;
dtmSubPoints[1].y := 225;
dtmSubPoints[1].Color := i;
dtmSubPoints[1].Tolerance := 50;
dtmSubPoints[2].x := 869;
dtmSubPoints[2].y := 234;
dtmSubPoints[2].Color := i;
dtmSubPoints[2].Tolerance := 50;
dtmSubPoints[3].x := 841;
dtmSubPoints[3].y := 217;
dtmSubPoints[3].Color := i;
dtmSubPoints[3].Tolerance := 50;
end;
6: begin
dtmMainPoint.x := 937;
dtmMainPoint.y := 262;
dtmMainPoint.Color := i;
dtmMainPoint.Tolerance := 50;
dtmSubPoints[0].x := 937;
dtmSubPoints[0].y := 262;
dtmSubPoints[0].Color := i;
dtmSubPoints[0].Tolerance := 50;
dtmSubPoints[1].x := 896;
dtmSubPoints[1].y := 260;
dtmSubPoints[1].Color := i;
dtmSubPoints[1].Tolerance := 50;
dtmSubPoints[2].x := 848;
dtmSubPoints[2].y := 259;
dtmSubPoints[2].Color := i;
dtmSubPoints[2].Tolerance := 50;
dtmSubPoints[3].x := 835;
dtmSubPoints[3].y := 268;
dtmSubPoints[3].Color := i;
dtmSubPoints[3].Tolerance := 50;
end;
7: begin
dtmMainPoint.x := 924;
dtmMainPoint.y := 224;
dtmMainPoint.Color := i;
dtmMainPoint.Tolerance := 15;
dtmSubPoints[0].x := 924;
dtmSubPoints[0].y := 224;
dtmSubPoints[0].Color := i;
dtmSubPoints[0].Tolerance := 15;
dtmSubPoints[1].x := 908;
dtmSubPoints[1].y := 246;
dtmSubPoints[1].Color := i;
dtmSubPoints[1].Tolerance := 15;
dtmSubPoints[2].x := 890;
dtmSubPoints[2].y := 251;
dtmSubPoints[2].Color := i;
dtmSubPoints[2].Tolerance := 15;
dtmSubPoints[3].x := 859;
dtmSubPoints[3].y := 258;
dtmSubPoints[3].Color := i;
dtmSubPoints[3].Tolerance := 15;
end;
8: begin
dtmMainPoint.x := 924;
dtmMainPoint.y := 253;
dtmMainPoint.Color := i;
dtmMainPoint.Tolerance := 15;
dtmSubPoints[0].x := 924;
dtmSubPoints[0].y := 253;
dtmSubPoints[0].Color := i;
dtmSubPoints[0].Tolerance := 15;
dtmSubPoints[1].x := 896;
dtmSubPoints[1].y := 234;
dtmSubPoints[1].Color := i;
dtmSubPoints[1].Tolerance := 15;
dtmSubPoints[2].x := 897;
dtmSubPoints[2].y := 252;
dtmSubPoints[2].Color := i;
dtmSubPoints[2].Tolerance := 15;
dtmSubPoints[3].x := 871;
dtmSubPoints[3].y := 266;
dtmSubPoints[3].Color := i;
dtmSubPoints[3].Tolerance := 15;
end;
end;
TempTDTM.MainPoint := dtmMainPoint;
TempTDTM.SubPoints := dtmSubPoints;
Result := AddDTM(TempTDTM);
end;
function OpentheBank: Boolean;
begin
if(not LoggedIn)then
Exit;
if (InvFull) then
begin
Result := True;
W('inventory already full');
Exit;
end else
begin
if (Bankscreen) then
begin
Result := True;
Players[CurrentPlayer].Loc := 'Bank';
end else
begin
if (not(OpenBankFast('vwb'))) then
begin
if (not(OpenBank('vwb', False, False))) then
begin
if (not(AccurateBankonMMFinding)) then
begin
Bye('Bank was not found.', 'NoBank');
Result := False;
Exit;
end else
begin
if (not(OpenBank('vwb', False, False))) then
begin
Bye('Bank was not found2.', 'NoBank');
Result := False;
Exit;
end else
begin
Result := True;
Players[CurrentPlayer].Loc := 'Bank';
Exit;
end;
end;
end else
begin
Wait(250 + Random(250));
if (BankScreen) then
begin
Result := True;
Players[CurrentPlayer].Loc := 'Bank';
Exit;
end else
begin
OpenTheBank;
end;
end;
end else
begin
Wait(500 + Random(250));
if (BankScreen) then
begin
Result := True;
Players[CurrentPlayer].Loc := 'Bank';
Exit;
end else
begin
OpenTheBank;
end;
end;
end;
end;
end;
function DepositInventory: Boolean;
var
Tries: Integer;
begin
if(not LoggedIn)then
Exit;
Tries := 0;
repeat
Wait(300 + Random(200));
if (not(FindBitmapToleranceIn(AirRune, x, y, MIx1, MIy1, MIx2, MIy2, 20))) then
begin
Result := True;
Exit;
end else
begin
Mouse(x, y, 9, 9, False);
Wait(300 + Random(300));
ChooseOption('ll');
Wait(500 + Random(300));
if FindBitmapToleranceIn(AirRune, x, y, MIx1, MIy1, MIx2, MIy2, 20) then
begin
Tries := Tries + 1;
end else
begin
Tries := 0;
Result := True;
Exit;
end;
end;
until (Tries > 4) or (not(FindBitmapToleranceIn(AirRune, x, y, MIx1, MIy1, MIx2, MIy2, 20)));
if (Tries > 4) then
begin
Bye('Problem in depositing air runes.','Bank');
Result := False;
Exit;
end;
end;
function WithdrawEss: Boolean;
var
Tries, HowMuchEss: Integer;
begin
if (not LoggedIn) then
Exit;
Wait(250 + Random(150));
Tries := 0;
repeat
if (not(BankScreen)) then
begin
OpenTheBank;
DepositInventory;
end;
if FindBitmapToleranceIn(RuneEssence, x, y, MIx1, MIy1, MIx2, MIy2, 25) then
begin
Result := True;
Closebank;
Wait(300 + Random(200));
HowMuchEss := ItemAmount('inv','bmp', RuneEssence, [25]);
Players[CurrentPlayer].Integers[1] := Players[CurrentPlayer].Integers[1] + HowMuchEss;
FindNormalRandoms;
Exit;
end else
begin
if (not(FindBitmapToleranceIn(RuneEssence, x, y, MSx1, MSy1, MSx2, MSy2, 25))) then
begin
Bye('Out of rune essence!', 'NoMoreEss');
Result := False;
Exit;
end else
begin
Mouse(x, y, 8, 8, False);
Wait(350 + Random(150));
ChooseOption('ll');
Wait(600 + Random(300));
if (not(FindBitmapToleranceIn(RuneEssence, x, y, MIx1, MIy1, MIx2, MIy2, 20))) then
begin
Tries := Tries + 1;
end else
begin
Tries := 0;
Result := True;
HowMuchEss := ItemAmount('inv','bmp', RuneEssence, [25]);
Players[CurrentPlayer].Integers[1] := Players[CurrentPlayer].Integers[1] + HowMuchEss;
CloseBank;
Wait(500 + Random(250));
FindNormalRandoms;
Exit;
end;
end;
end;
until (Tries > 4) or (FindBitmapToleranceIn(RuneEssence, x, y, MIx1, MIy1, MIx2, MIy2, 20));
if (Tries > 4) then
begin
Bye('Problem in depositing air runes.','Bank');
Result := False;
Exit;
end;
CloseBank;
Wait(500 + Random(250));
FindNormalRandoms;
end;
function FindRuins(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.14, 3.16);
if not(FindColorsTolerance(arP, 14395764, MSX1, MSY1, MSX2, MSY2, 12)) then
begin
Writeln('Failed to find the color, no object found.');
Bye('Could not find the ruins.', 'Ruins');
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 >= 22.29) and (X <= 51.70) and (Y >= 24.19) and (Y <= 58.46) and (Z >= 39.06) and (Z <= 101.48) 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, 25, 25);
Wait(150 + Random(100));
if (IsUpText('Mysterious')) then
begin;
Result := True;
Break;
end;
end;
ColorToleranceSpeed(tmpCTS);
SetColorSpeed2Modifiers(0.2, 0.2);
if (i = arL + 1) then
begin
Writeln('FindObject could not find ruins.');
Bye('Could not find the ruins.', 'LOST');
Exit;
end;
GetMousePos(fx, fy);
end;
procedure SmartRun(Energy: integer);
var
I: string;
begin
if(not LoggedIn)then
Exit;
FindNormalRandoms;
if(GetMMLevels('Run', I) > Energy)then
SetRun(True);
end;
function UniversalWalking(Num, MSR, MER, MRad, MRandX, MRandY: Integer): Boolean;
var
Path: Integer;
begin
FindNormalRandoms;
Path := DDTMs(Num);
SmartRun(75);
if(not(DTMRotated(Path, x, y, MMx1, MMy1, MMx2, MMy2))) then
begin
if (not(RadialWalkAutoColor(srl_VarrockRoadColor, MSR, MER, MRad, MRandX, MRandY))) then
begin
Bye('Could not walk using DDTM ' + IntToStr(Num) +' or RRW', 'Walk');
Result := False;
FreeDTM(Path);
Exit;
end else
begin
FindNormalRandoms;
Antiban;
FFlag(3);
W(' RadialWalk' + IntToStr(Num) + '');
end;
end else
begin
Mouse(x, y, 12, 12, True);
FindNormalRandoms;
Antiban;
FFlag(3);
W(' DDTM' + IntToStr(Num) + '');
end;
FindNormalRandoms;
FreeDTM(Path);
Result := True;
end;
function BankToRuins(i: Integer): Boolean;
begin
if (not LoggedIn) then
Exit;
case i of
1: if UniversalWalking(1, 212, 245, 62, 10, 10) then
BankToRuins(2);
2: if UniversalWalking(2, 210, 255, 62, 10, 10) then
BankToRuins(3);
3: if UniversalWalking(3, 240, 280, 55, 10, 10) then
BankToRuins(4);
4: if UniversalWalking(4, 235, 295, 40, 10, 10) then
BankToRuins(5);
5: begin
if (not(RadialWalkAutoColor(srl_RockColor, 200, 250, 35, 5, 5))) then
begin
Result := False;
Bye('Could not finish last step of walking to ruins.','LOST');
Exit;
end else
begin
Flag;
FindNormalRandoms;
Result := True;
Players[CurrentPlayer].Loc := 'Ruins';
Writeln('BankToRuins works!');
end;
end;
end;
end;
function RuinsToBank(i: Integer): Boolean;
begin
if (not LoggedIn) then
Exit; //now with lost function, it can find its way back
W('About to begin RuinsToBank');
case i of
1: if UniversalWalking(5, 20, 75, 66, 10, 10) then
RuinsToBank(2);
2: if UniversalWalking(6, 60, 110, 62, 10, 10) then
RuinsToBank(3);
3: if UniversalWalking(7, 30, 70, 65, 10, 10) then
RuinsToBank(4);
4: if UniversalWalking(8, 55, 100, 45, 10, 10) then
RuinsToBank(5);
5: if AccurateBankonMMFinding then
begin
Mouse(x, y, 7, 7, True);
FFlag(6);
Wait(1500 + Random(1000));
W('Should be at bankbooth.');
Result := True;
end;
end;
end;
function FindAltar(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(0);
if not(FindColorsTolerance(arP, 6447458, MSx1, MSy2, MSx2, MSy1, 6)) then
begin
Writeln('Failed to find the color, no object found.');
Bye('Could not find the altar.','Altar');
ColorToleranceSpeed(tmpCTS);
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 >= 10.30) and (X <= 12.72) and (Y >= 10.62) and (Y <= 13.50) and (Z >= 12.31) and (Z <= 13.76) 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, 25, 25);
Wait(100 + Random(100));
if (IsUpText('Altar')) then
begin;
Result := True;
Break;
end;
end;
ColorToleranceSpeed(tmpCTS);
if (i = arL + 1) then
begin
Writeln('FindObject could not find altar.');
Bye('Could not find the altar.','LOST');
Result := False;
Exit;
end;
GetMousePos(fx, fy);
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.10, 0.74);
if not(FindColorsTolerance(arP, 7975097, MSX1, MSY1, MSX2, MSY2, 14)) then
begin
Writeln('Failed to find the color, no object found.');
Bye('Could not find the portal.', '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 >= 22.75) and (X <= 57.60) and (Y >= 24.56) and (Y <= 63.56) and (Z >= 13.65) and (Z <= 42.04) 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, 8, 8);
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, 7, 7);
Wait(250 + Random(200));
if (IsUpText('nter')) then
begin;
Result := True;
Break;
end;
end;
ColorToleranceSpeed(tmpCTS);
SetColorSpeed2Modifiers(0.2, 0.2);
if (i = arL + 1) then
begin
Writeln('FindObject could not find portal.');
Exit;
end;
GetMousePos(fx, fy);
end;
function Craft: Boolean;
var
Rx, Ry, Ax, Ay, Px, Py, AirAmount: Integer;
begin
if(not LoggedIn) then
Exit;
if (not(Players[CurrentPlayer].Booleans[0])) then
begin
GameTab(tab_Inv);
if(not(FindBitmapToleranceIn(AirTalisman, x, y, MIx1, MIy1, MIx2, MIy2, 20))) then
begin
Result := False;
Bye('Could not find Air Talisman.', 'NoTally');
Exit;
end else
Mouse(x, y, 8, 8, True);
FindNormalRandoms;
end;
if FindRuins(Rx, Ry) then
begin
Mouse(Rx, Ry, 0, 0, True);
Flag;
Wait(3000 + Random(2000));
FindNormalRandoms;
if FindAltar(Ax, Ay) then
begin
Mouse(Ax, Ay, 0, 0, True);
FindNormalRandoms;
Flag;
Wait(6000 + Random(2000));
Players[CurrentPlayer].Loc := 'Altar';
FindNormalRandoms;
AirAmount := ItemAmount('inv', 'bmp', AirRune, [20]);
Players[CurrentPlayer].Integers[2] := Players[CurrentPlayer].Integers[2] + AirAmount;
W(Players[CurrentPlayer].Nick + ' just crafted ' + IntToStr(AirAmount) + ' air runes!');
if FindPortal(Px, Py) then
begin
Mouse(Px, Py, 0, 0, True);
FindNormalRandoms;
Flag;
Wait(4000 + Random(2000));
FindNormalRandoms;
Result := True;
Exit;
end else
begin
Mouse(623, 108, 15, 15, True);
Flag;
Wait(500 + Random(500));
if FindPortal(Px, Py) then
begin
Mouse(Px, Py, 0, 0, True);
FindNormalRandoms;
Flag;
Wait(4000 + Random(2000));
FindNormalRandoms;
Result := True;
Exit;
end else
begin
Bye('Could not find the portal!','LOST');
Result := False;
Exit;
end;
end;
end;
end;
end;
procedure ProgressReport;
var
i, BankTotal, EssTotal, CraftTotal, XPTotal, LvlTotal: Integer;
begin
for i := 0 to HowManyPlayers - 1 do
begin
BankTotal := BankTotal + Players[I].Integers[0];
EssTotal := EssTotal + Players[I].Integers[1];
CraftTotal := CraftTotal + Players[I].Integers[2];
XPTotal := XPTotal + XPGained;
LvlTotal := LvlTotal + LvlGained;
end;
WriteLn('[=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=]');
WriteLn('[ Kings Varrock Air Runecrafter ]');
WriteLn('[ Version 1.0 ]');
WriteLn('[ Progress Report ]');
WriteLn('[=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=]');
WriteLn(PadR('[ Worked for ' + TimeRunning + '!', 72) + ']');
WriteLn(PadR('[ Banked ' + IntToStr(BankTotal) + ' loads!', 72) + ']');
WriteLn(PadR('[ Used ' + IntToStr(EssTotal) + ' essence!', 72) + ']');
WriteLn(PadR('[ Crafted ' + IntToStr(CraftTotal) + ' air runes!', 72) + ']');
if CraftTotal > 0 then
WriteLn(PadR('[ Crafted ' + FloatToStr(Round(CraftTotal div TimeFromMark(Start) * 3600000.0)) + ' air runes per hour!', 72) + ']');
WriteLn(PadR('[ Gained ' + IntToStr(XPTotal) + ' experience!', 72) + ']');
WriteLn(PadR('[ Gained ' + IntToStr(LVLTotal) + ' levels!', 72) + ']');
WriteLn('[=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=]');
WriteLn('[ Individual Reports ]');
WriteLn('[=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=]');
WriteLn('[[#] Nick | Active | Banked | Ess Used | Crafted | XP Gained | Location ]');
for i := 0 to HowManyPlayers - 1 do
begin
Writeln(PadR('[[' + IntToStr(i) +
']['+ PadR(Players[i].Nick, 4) + //nick
']| ' + PadR(BoolToStr(Players[i].Active), 7) + //active
'| ' + PadR(IntToStr(Players[i].Integers[0]), 7) + //banked
'| ' + PadR(IntToStr(Players[i].Integers[1]), 9) + //ess used
'| ' + PadR(IntToStr(Players[i].Integers[2]), 8) + //airs crafted
'| ' + PadR(IntToStr(Players[i].Integers[3]), 10) + //XP Gained
'| ' + Players[i].Loc, 71) + ' ]'); //loc
end;
WriteLn('[=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=]');
end;
begin
SetupSRL;
DeclarePlayers;
ActivateClient;
Load;
MarkTime(Start);
repeat
if(not LoggedIn) then
LoginPlayer;
SetAngle(True);
StartXP := GetXP('Runecrafting');
StartLvl := GetSkillLevel('Runecrafting');
ToDo := LoadsToDo + Random(3);
for Loads:= 1 to ToDo do
begin
if (OpenTheBank) then
begin
if (DepositInventory) then
begin
if (WithdrawEss) then
begin
if (BankToRuins(1)) then
begin
if (Craft) then
begin
if (RuinsToBank(1)) then
begin
LogOut;
end;
end else
LogOut;
end else
LogOut;
end else
LogOut;
end else
LogOut;
end else
LogOut;
end;
NextPlayer(LoggedIn);
until false;
FreeDTM(Bankers5p1);
FreeDTM(Bankers5);
FreeDTM(Bankers4p1);
FreeDTM(Bankers4);
FreeDTM(Bankers3p1);
FreeDTM(Bankers3);
FreeBitmap(RuneEssence);
FreeBitmap(AirRune);
FreeBitmap(AirTiara);
FreeBitmap(AirTalisman);
end.
~RM