Code:
program DeclarePlayers;
{$DEFINE SMART}
{$i srl/srl/misc/smart.simba} // This is how we include SMART; it HAS to be included BEFORE SRL!
{$i srl/srl.simba}
{$I SRL/SRL/misc/paintsmart.simba}
{$I SRL/SRL/misc/debug.simba}
(*
========================================== Script setup ==========================================
*)
const
EssenceTab = 1; // The bank tab your essence is stored on
EssenceSlot = 1; // The bank slot your essence is stored on
RingTab = 1; // The bank tab your rings of duelling are stored on
RingSlot = 2; // The bank slot your rings of duelling are stored on
NumOfPouches = 0; // The number of essence pouches you are using
// -------------------------------- Script constants | Don't touch ---------------------------------
LOC_DUEL_ARENA = 1;
LOC_CASTLE_WARS = 2;
LOC_BANK = 3;
LOC_RUINS = 4;
LOC_INSIDE_ALTAR = 5;
LOC_AT_ALTAR = 6;
LOC_TP_CW = 7;
LOC_TP_DA = 8;
LOC_LOST = 0;
procedure DeclarePlayers;
begin
HowManyPlayers := 1; // This is set to the total amount of players (more on multiplayer later ;)), for now, just keep it set as 1
NumberOfPlayers(HowManyPlayers); // This is a procedure in SRL which sets up player arrays (also, more on that later), this will always be the same
CurrentPlayer := 0; // This is the player to start with; the first player will always be 0 (you'll find out when you learn all about arrays)
stats_UserName := '';
stats_UserPass := '';
Players[0].Name := ''; // Username
Players[0].Pass := ''; // Password
Players[0].Nick := ''; // 3-4 lowercase letters from username; used for random event detection
Players[0].Member := True;
Players[0].Active := True; // Set to true if you want to use Player 0
Players[0].Pin := ''; // Leave bank if the player doesn't have a bank pin
end;
(*
========================================== DONT touch from here on if you just want to run the script ==========================================
*)
var
AltarPath: Array of Integer;
InsideAltarPath: Array of Integer;
CastleBankPath: Array of Integer;
TeleportsLeft: Integer;
Location: Integer;
(*
========================================== DTM related functions ==========================================
*)
(*
Description: Loads all global DTMs for this script
*)
procedure loadDTM;
begin
SetArrayLength(AltarPath, 2);
SetArrayLength(InsideAltarPath, 1);
SetArrayLength(CastleBankPath, 5);
AltarPath[0] := DTMFromString('mlwAAAHicY2dgYDBjY2BIBmIDIHYCYikgFgBiVyDeCZQ/D8RXgPgcED8B4g9A/AOIZ3enMUQ6STKsmVDI0FjgzjClPohhdn8aw9yedAZ+oDwuzIgHQwEAYTURvA==');
AltarPath[1] := DTMFromString('mggAAAHicY2NgYChkY2DIBeJkII4H4hVAXATE+owMDJZArAbEYkBsAMTRQDyhJpGhuTACjBd0ZTP4WIowrO0pZeAHmoUNM+LAEAAA3oIMWw==');
InsideAltarPath[0] := DTMFromString('mrAAAAHic42BgYDjPxsCwF4jPAvFDIL4AxIeA+A4Q3wJiKUYGBkkgZofSakDMCcQcQKwMxJEB9gyRvmYMoZ7GDAGuhgxJIdYMaRF2DAn++gwJQVYM/EA78GFGAhgGAPLgDwI=');
CastleBankPath[0] := DTMFromString('m6wAAAHic42ZgYKhgYmDIY4LQHUA8BYgXAPEiIF4IxPOg/AQgjgSqrwLpgeJSIM4D4jgg9gNiMyBWBOJAIC4uyGFo65mBgRvbJ6Pw07q0GfiB6onFjCRgJAAAJb0cHA==');
CastleBankPath[1] := DTMFromString('mwQAAAHic42RgYKhjYmBYCMSLgXgZEM8G4j4grgbiCCBOAOJQoDp/II4B4mwgLgLiCiCugdLmQJyZlszQ1jMDK541bRJDWpc2Az9QHSHMSASGAwDRnRb7');
CastleBankPath[2] := DTMFromString('mwQAAAHic42RgYKhkYmAoAeJWIJ4AxAuBeAkQLwbiBCCOB+IgoLo6IC4HqQfiQiBOAOIQIA4EYnMgLi7IYWjrmYEVp3VpgzE/UB0hzEgEhgMAig8WQw==');
CastleBankPath[3] := DTMFromString('mwQAAAHic42RgYKhlYmBYA8SrgXgFEK8F4vVQdhoQxwBxOVBdKRDnAXEQELsBsTUQGwJxIBCXAHFBSTZD84TpWHFynxbD9FkTGfiB6ghhRiIwHAAAA1AXOQ==');
CastleBankPath[4] := DTMFromString('mwQAAAHic42RgYGhnYmBYC8UrgXg9lL0CiGOBOAqIi4DqyoA4F4iDgdgFiM2AWBuIvYC4AIjTspIYmidMx4qnz5oIxsQARiIwHAAAAggXIw==');
end;
(*
Description: Walks a path set by an array of DTMs
Returns: True if the path has been succesfully walked, false if something went wrong
*)
function WalkDTMPathEx(DTM: Array of Integer; PathStart: Integer; PathEnd: Integer): boolean;
var
i: Integer;
x, y: Integer;
aFound: Extended;
timer, tries: Integer;
begin
for i := PathStart to PathEnd do
begin
tries := 0;
repeat
Inc(tries);
if FindDTMRotated(DTM[i], x, y, MMX1, MMY1, MMX2, MMY2, -Pi/4, Pi/4, Pi/60, aFound) then
begin
Mouse(x, y, 3, 3, True);
FFlag(6);
if (i <> High(DTM)) then
begin
MarkTime(timer);
repeat
Wait(50 + Random(25));
until FindDTMRotated(DTM[i+1], x, y, MMX1, MMY1, MMX2, MMY2, -Pi/4, Pi/4, Pi/60, aFound) or (TimeFromMark(timer) > 20000);
if(TimeFromMark(timer) > 20000) then
begin
Writeln('DTM ' + IntToStr(i + 1) + ' not found');
Result := False;
Break;
end;
end;
break;
end;
Wait(500 + Random(500));
until(tries > 10);
Result := True;
if(tries > 10) then
begin
Writeln('DTM ' + IntToStr(i) + ' not found');
Result := False;
end;
end;
end;
function WalkDTMPath(DTM: Array of Integer): boolean;
begin
Result := WalkDTMPathEx(DTM, 0, High(DTM));
end;
(*
Description: Frees all DTMs in a given array
*)
procedure FreeDTMArray(DTM: Array of Integer);//DTM Freeing procedure.
var
i: Integer;
begin
for i := 0 to High(DTM) do
begin
FreeDTM(DTM[i])
end;
end;
(*
Description: Frees all DTMs in this script
*)
procedure FreDTMs;
begin
FreeDTMArray(AltarPath);
FreeDTMArray(InsideAltarPath);
FreeDTMArray(CastleBankPath);
end;
(*
Description: Autocolor function for the mysterious ruins
Returns: Mysterious runes orange color
*)
function RuinsColor: Integer;
var
arP: TPointArray;
arC: TIntegerArray;
tmpCTS, i, arL: Integer;
X, Y, Z: Extended;
begin
tmpCTS := GetColorToleranceSpeed;
ColorToleranceSpeed(2);
SetColorSpeed2Modifiers(0.12, 1.88);
FindColorsSpiralTolerance(MSCX, MSCY, arP, 2710230, MSX1, MSY1, MSX2, MSY2, 16);
if (Length(arP) = 0) then
begin
Writeln('Failed to find the color, no result.');
ColorToleranceSpeed(tmpCTS);
SetColorSpeed2Modifiers(0.2, 0.2);
Exit;
end;
arC := GetColors(arP);
ClearSameIntegers(arC);
arL := High(arC);
for i := 0 to arL do
begin
ColorToXYZ(arC[i], X, Y, Z);
if (X >= 11.43) and (X <= 52.22) and (Y >= 9.44) and (Y <= 42.03) and (Z >= 4.82) and (Z <= 12.77) then
begin
Result := arC[i];
Writeln('AutoColor = ' + IntToStr(arC[i]));
Break;
end;
end;
ColorToleranceSpeed(tmpCTS);
SetColorSpeed2Modifiers(0.2, 0.2);
if (i = arL + 1) then
Writeln('AutoColor failed in finding the color.');
end;
(*
Description: Autocolor function for the runecrafting altar
Returns: Color of the flame in the middle of the altar
*)
function AltarColor: Integer;
var
arP: TPointArray;
arC: TIntegerArray;
tmpCTS, i, arL: Integer;
X, Y, Z: Extended;
begin
tmpCTS := GetColorToleranceSpeed;
ColorToleranceSpeed(2);
SetColorSpeed2Modifiers(1.26, 0.31);
FindColorsSpiralTolerance(MSCX, MSCY, arP, 6249053, MSX1, MSY1, MSX2, MSY2, 10);
if (Length(arP) = 0) then
begin
Writeln('Failed to find the color, no result.');
ColorToleranceSpeed(tmpCTS);
SetColorSpeed2Modifiers(0.2, 0.2);
Exit;
end;
arC := GetColors(arP);
ClearSameIntegers(arC);
arL := High(arC);
for i := 0 to arL do
begin
ColorToXYZ(arC[i], X, Y, Z);
if (X >= 9.40) and (X <= 11.16) and (Y >= 9.68) and (Y <= 11.45) and (Z >= 11.25) and (Z <= 13.19) then
begin
Result := arC[i];
Writeln('AutoColor = ' + IntToStr(arC[i]));
Break;
end;
end;
ColorToleranceSpeed(tmpCTS);
SetColorSpeed2Modifiers(0.2, 0.2);
if (i = arL + 1) then
Writeln('AutoColor failed in finding the color.');
end;
(*
Description: Enters the mysterious ruins
Returns: True if the ruins have been entered, false if something went wrong
*)
function EnterRuins: boolean;
var
tpa : TPointArray;
atpa : T2DPointArray;
tries, i, x, y : Integer;
begin
tries := 1;
repeat
writeln('Searching for ruins');
FindColorsTolerance(tpa, RuinsColor, MSX1, MSY1, MSX2, MSY2, 25);
atpa := TPAToATPAEx(tpa, 20, 20);
SortATPASize(atpa, True);
for i := 0 to High(atpa) do
begin
writeln( 'TPA ' + IntToStr(i) + ' = ' + IntToStr(GetArraylength(ATPA[i])) );
MiddleTPAEx(ATPA[i], x, y);
MMouse(x, y, 3, 3);
Wait(800 + Random(300));
if WaitUpTextMulti( ['ysterious', 'uins', 'ruins', 'rious'], 100) then
begin
writeln('Ruins found');
GetMousePos(x, y);
Mouse(x, y, 0, 0, true);
Result := True;
Exit;
end;
end;
Wait(500 + Random(300));
Inc(tries);
until tries > 10;
Result := False;
end;
(*
Description: Loops trough all pouch inventory slots and empties them
Returns: True if the pouches have been emptied, false if something went wrong
*)
function EmptyPouches: boolean;
var
i: Integer;
tries: Integer;
begin
for i := 1 to numOfPouches do
begin
SMART_DrawBoxEx(False,InvBox(i),clRed);
MouseBox(InvBox(i).X1, InvBox(i).Y1, InvBox(i).X2, InvBox(i).Y2, mouse_right);
tries := 1
repeat
Inc(tries);
writeln('Searching for "Empty pouch" text')
wait(200+Random(400));
until (tries > 10) or ChooseOptionMulti(['Empty', 'mpty', 'pty']);
if(tries > 10) then
begin
Result := False;
end else
begin
Result := True;
end;
end;
end;
(*
Description: Loops trough all pouch inventory slots and fills them
Returns: True if the pouches have been filled, false if something went wrong
*)
function FillPouches: boolean;
var
i: Integer;
tries: Integer;
begin
for i := 1 to NumOfPouches do
begin
SMART_DrawBoxEx(False,InvBox(i),clRed);
MouseBox(InvBox(i).X1, InvBox(i).Y1, InvBox(i).X2, InvBox(i).Y2, mouse_right);
tries := 1
repeat
Inc(tries);
writeln('Searching for "Fill pouch" text')
wait(200+Random(400));
until (tries > 10) or ChooseOptionMulti(['Fill', 'ill']);
if(tries > 10) then
begin
Result := False;
end else
begin
Result := True;
end;
end;
end;
(*
Description: Finds and clicks the runecrafting altar
Returns: True if the altar has been clicked, false if it hasn't
*)
function FindAltar: boolean;
var
tpa : TPointArray;
atpa : T2DPointArray;
tries, i, x, y : Integer;
begin
tries := 1;
repeat
writeln('Searching for altar');
FindColorsTolerance(tpa, AltarColor, MSX1, MSY1, MSX2, MSY2, 5);
atpa := TPAToATPAEx(tpa, 20, 20);
SortATPASize(atpa, True);
for i := 0 to High(atpa) do
begin
writeln( 'TPA ' + IntToStr(i) + ' = ' + IntToStr(GetArraylength(ATPA[i])) );
MiddleTPAEx(ATPA[i], x, y);
MMouse(x, y, 3, 3);
Wait(500 + Random(300));
if WaitUpTextMulti( ['raft', 'rune', 'ltar'], 500) then
begin
writeln('Altar found');
GetMousePos(x, y);
Mouse(x, y, 0, 0, true);
Result := True;
Exit;
end;
end;
Wait(500 + Random(300));
Inc(tries);
until tries > 10;
Result := False;
end;
(*
Description: Enters the mysterious ruins
Returns: True if the ruins have been entered, false if something went wrong
*)
function CraftRunes: boolean;
var
i : Integer;
begin
for i := 1 to 2 do
begin
writeln('Crafting load ' + IntToStr(i));
if not FindAltar then
begin
Result := False;
Exit;
end;
if (i = 1) then
begin
if (numOfPouches = 0 ) then
begin
Wait(1000 + Random(500));
Result := True;
Exit;
end;
Wait(1000 + Random(500));
if not EmptyPouches then
begin
writeln('A problem occured emptying the pouches')
Result := False;
Exit;
end;
end;
end;
Wait(1000 + Random(500));
Result := True;
end;
(*
Description: Teleports the player using the ring of duelling
Parameter: True to teleport to dual arena, false to teleport to castle wars
Returns: True if the ring has been found and the player teleported, false if something went wrong
*)
function Teleport(arena: boolean): boolean;
var
tries: Integer;
invSlot: Integer;
begin
tries := 1;
invSlot := NumOfPouches + 1;
MouseBox(InvBox(invSlot).X1, InvBox(invSlot).Y1, InvBox(invSlot).X2, InvBox(invSlot).Y2, mouse_right);
SMART_DrawBoxEx(False,InvBox(invSlot),clRed);
wait(200+Random(200));
Result := False;
repeat
Inc(tries);
writeln('Searching for text')
if ChooseOptionMulti(['Rub', 'Ru', 'ub']) Then
begin
Wait(800 + Random(300));
tries := 12;
dec(TeleportsLeft);
Wait(800 + Random(300));
if(arena) then
begin
KeyDown(49);
Wait(75 + Random(75));
KeyUp(49);
Result := True;
end else
begin
KeyDown(50);
Wait(75 + Random(75));
KeyUp(50);
Result := True;
end;
end;
Wait(1000 + Random(300));
until tries > 10;
end;
(*
Description: Tries a couple of different DTMs to walk to the castle wars bank chest
Returns: True if the chest has been reached, false if it hasn't
*)
function ToCastleWarsChest : Boolean;
var
i: Integer;
begin
Result := False;
for i := 0 to High(CastleBankPath) do
begin
MouseBox(641, 123, 652, 132, 1);
FFlag(0);
Wait(RandomRange(1500, 2000));
begin
Result := True;
Break;
end;
Wait(500 + Random(500));
end;
end;
(*
Description: Temporay fix for the bank tab function in SRL since it wasn't working on tab 2 for some reason
Returns: The current bank tab opened
*)
function CurrentBankTabCustom: Integer;
begin
Result := -1;
if not BankScreen then
Exit;
for Result := 1 to 9 do
if InRange(GetColor(40 + 48 * (Result - 1), 83), 2831418, 2896954) then
Exit;
Result := 0;
end;
(*
Description: Switches to the correct tab and withdraws the rune essence
Returns: True if the essence has been withrawn, false if something went wrong
*)
function WithdrawEssence: boolean;
var
tries: Integer;
begin
if(CurrentBankTabCustom <> EssenceTab) then
BankTab(EssenceTab);
for tries := 1 to 14 do
begin
if Withdraw(0, 0, 28) then
begin
Result := True;
Exit;
end;
wait(500 + Random(500));
end;
Result := False;
end;
(*
Description: Switches to the correct tab and withdraws a ring of duelling
Returns: True if the ring has been withrawn, false if something went wrong
*)
function WithdrawRing: boolean;
var
tries : Integer;
begin
if(CurrentBankTabCustom <> RingTab) then
BankTab(RingTab);
for tries := 1 to 4 do
begin
if WithdrawEx((Ringslot MOD 10) - 1, RingSlot / 10, 1, ['duelling', 'uelling', 'ling', 'duel']) then
begin
Result := True;
Exit;
end;
wait(500 + Random(500));
end;
Result := False;
end;
(*
Description: Sorts an ATPA array by its boundaries' surface area (sort by size sorts by the amount of dots)
*)
procedure SortATPAByBoundaries( atpa : T2DPointArray);
var
i, j, maxIndex : Integer;
box1, box2 : TBox;
temp : TPointArray;
begin
for i := 0 to High(atpa) do
begin
maxIndex := i;
for j := i + 1 to High(atpa) do
begin
box1 := GetTPABounds(atpa[j]);
box2 := GetTPABounds(atpa[maxIndex]);
if( (box1.X2 - box1.X1) * (box1.Y2 - box1.Y1) > (box2.X2 - box2.X1) * (box2.Y2 - box2.Y1) ) then
maxIndex := j;
end;
temp := atpa[i];
atpa[i] := atpa[maxIndex];
atpa[maxIndex] := temp;
end;
end;
(*
Description: Find and opens the castle wars bank chest
Returns: True if the chest has been found and opened, false if something went wrong
*)
function OpenCastleWarsBank: boolean;
var
tpa : TPointArray;
atpa : T2DPointArray;
tries, i, x, y : Integer;
begin
tries := 1;
repeat
writeln('Searching for bank chest');
FindColorsTolerance(tpa, 11053488, MSX1, MSY1, MSX2, MSY2, 6);
atpa := TPAToATPAEx(tpa, 20, 40);
SortATPAByBoundaries(atpa);
for i := 0 to High(atpa) do
begin
writeln( 'TPA ' + IntToStr(i) + ' = ' + IntToStr(GetArraylength(ATPA[i])) );
MiddleTPAEx(ATPA[i], x, y);
MMouse(x, y, 3, 3);
if WaitUpTextMulti(['chest', 'est', 'Bank', 'ank'], 500) then
begin
writeln('Chest found');
Mouse(x, y, 3, 3, true);
Result := True;
Exit;
end;
end;
Wait(200 + Random(200));
Inc(tries);
until tries > 10;
Result := False;
end;
(*
Description: Takes care of all the banking related stuff in the script
*)
function Bank: boolean;
var
timer: Integer;
begin
Result := True;
//Open bank
Wait(1000+Random(500));
if OpenBankChest(SRL_BANK_CW) or BankScreen or PinScreen then
begin
MarkTime(timer);
repeat
Wait(250+Random(250));
until BankScreen or PinScreen or (TimeFromMark(timer) > 7000);
if (TimeFromMark(timer) > 15000) then
begin
writeln('BankScreen wait time exceeded');
Result := False;
Exit;
end;
if PinScreen and not InPin(Players[CurrentPlayer].Pin) then
begin
writeln('Failed to enter pin');
Result := False;
Exit;
end;
end else
begin
writeln('Failed to open bank');
Result := False;
if (Location <> LOC_LOST) and ToCastleWarsChest then
begin
Location := LOC_LOST;
Wait(3000 + Random(1000));
Result := Bank;
end;
Exit;
end;
//Deposit fire runes
Deposit(NumOfPouches+2,NumOfPouches+2, True);
//Check if a new ring of duelling is needed
if(TeleportsLeft <= 1) then
begin
Wait(250+Random(250));
if (TeleportsLeft <> 0) then
begin
Deposit(NumOfPouches+1, NumOfPouches+1, False);
end;
Wait(250+Random(250));
if not WithdrawRing then
begin
writeln('Ran out of rings of duelling');
Result := False;
Exit;
end;
TeleportsLeft := 8;
end;
//Withdraw essence a first time
Wait(250+Random(250));
if not WithdrawEssence then
begin
writeln('Ran out of essence');
Result := False;
Exit;
end;
if (numOfPouches > 0 ) then
begin
//Fill pouches
Wait(250+Random(250));
if not FillPouches then
begin
writeln('Failed to fill pouches');
Result := False;
Exit;
end;
//Withdraw essence a second time
Wait(250+Random(250));
if not WithdrawEssence then
begin
writeln('Ran out of essence');
Result := False;
Exit;
end;
end;
Wait(250+Random(250));
if not CloseBank then
begin
writeln('Failed to close bank');
Result := False;
Exit;
end;
wait(300 + Random(300))
end;
(*
Thanks and credits to YoHoJo for this antiban (copied parts of his antiban in his video tutorial)
(might implement more of my own antiban later)
*)
Procedure Antiban;
Begin
Case Random(150) Of
0:
begin
writeln('Antiban ... Hover runecrafting');
GameTab(tab_Stats) HoverSkill('Runecrafting', False);
Wait(500 + Random(500));
GameTab(tab_Inv);
end;
1:
begin
writeln('Antiban ... Examine inventory');
GameTab(tab_Inv);
ExamineInv;
end;
2:
begin
writeln('Antiban ... Sleep and move mouse');
SleepAndMoveMouse(4000 + Random(500));
end;
3:
begin
writeln('Antiban ... Hover random skill');
HoverSkill('random', False);
Wait(1000 + Random(500));
GameTab(tab_Inv);
end;
4:
begin
writeln('Antiban ... Look at stats');
GameTab(Tab_Stats);
Wait(3000 + Random(1500));
GameTab(tab_Inv);
end;
5:
begin
writeln('Antiban ... Pickup mouse');
PickUpMouse;
end;
6:
begin
writeln('Antiban ... Bored human');
BoredHuman;
end;
End;
End;
(*
Description: Tries to teleport to castle wars and bank if the player got lost
*)
function RecoverFromLost : Boolean;
begin
Result := False;
if Teleport(false) then
begin
wait(2000 + Random(1000));
if ToCastleWarsChest then
begin
wait(2000 + Random(1000));
if Bank then
begin
Result := True;
Location := LOC_TP_DA;
Exit;
end;
end;
end;
end;
(*
Description: Draws the smart overlay with experience and such
*)
procedure DrawSmartProggy;
var
h, m, s : Integer;
xpPerHour : Integer;
essencePerHour : Integer;
begin
SMART_ClearCanvas;
ConvertTime(TimeFromMark(Players[CurrentPlayer].Integers[3]), h, m, s);
xpPerHour := ((60 * 60 * 1000) / TimeFromMark(Players[CurrentPlayer].Integers[3])) * Players[CurrentPlayer].Integers[1];
essencePerHour := ((60 * 60 * 1000) / TimeFromMark(Players[CurrentPlayer].Integers[3])) * Players[CurrentPlayer].Integers[2];
SMART_DrawText(15, 35, 'UpChars', 'Maigel''s Fire RuneCrafter:', clLime);
SMART_DrawText(15, 50, 'UpChars', 'Ran for: '+ PadZ(IntToStr(h), 2)+':'+PadZ(IntToStr(m), 2)+':'+PadZ(IntToStr(s), 2), clWhite);
SMART_DrawText(15, 65, 'UpChars', 'Experience Gained: ' + IntToStr(Players[CurrentPlayer].Integers[1]), clWhite);
SMART_DrawText(15, 80, 'UpChars', 'Experience / Hour: ' + IntToStr(xpPerHour), clWhite);
SMART_DrawText(15, 95, 'UpChars', 'Essence Crafted: '+ IntToStr(Players[CurrentPlayer].Integers[2]), clWhite);
SMART_DrawText(15, 110, 'UpChars', 'Essence / Hour: '+ IntToStr(essencePerHour), clWhite);
end;
(*
Description: Prints out a progress report and commits to SRL Stats
*)
procedure ProgressReport;
var
xpGained : Integer;
h, m, s, player : Integer;
begin
xpGained := GetXPBarTotal - Players[CurrentPlayer].Integers[0];
Players[CurrentPlayer].Integers[0] := GetXPBarTotal;
Players[CurrentPlayer].Integers[1] := Players[CurrentPlayer].Integers[1] + xpGained;
Players[CurrentPlayer].Integers[2] := Players[CurrentPlayer].Integers[2] + (xpGained / 7);
ConvertTime(TimeFromMark(Players[CurrentPlayer].Integers[3]), h, m, s);
Writeln('*********************************************');
Writeln('Maigel''s Fire Runecrafter');
Writeln('*********************************************');
Writeln('Ran for: '+ PadZ(IntToStr(h), 2)+':'+PadZ(IntToStr(m), 2)+':'+PadZ(IntToStr(s), 2));
Writeln('*********************************************');
for player:=0 to High(Players) do
begin
Writeln('Player: '+Players[player].Nick);
Writeln('Experience Gained: '+IntToStr(Players[player].Integers[1]));
Writeln('Essence Crafted: '+IntToStr(Players[player].Integers[2]));
Writeln('*********************************************');
end;
DrawSmartProggy;
stats_IncVariable('Rune Essence (Crafted)', xpGained / 7);
stats_IncVariable('Runecrafting EXP (Gained)', xpGained);
stats_Commit;
end;
begin
//Setup Smart and other variables
Smart_Server := 1;
Smart_Members := True;
Smart_Signed := True;
Smart_SuperDetail := False;
ClearDebug;
SetupSRL;
DeclarePlayers;
LoginPlayer;
ClickNorth(SRL_ANGLE_HIGH);
Players[CurrentPlayer].Integers[0] := GetXPBarTotal;
Players[CurrentPlayer].Integers[1] := 0;
Players[CurrentPlayer].Integers[2] := 0;
MarkTime(Players[CurrentPlayer].Integers[3]);
TeleportsLeft := 0;
loadDTM;
Location := LOC_BANK;
SetupSRLStats(596, stats_Username, stats_Userpass);
stats_InitVariable('Rune Essence (Crafted)', 0);
stats_InitVariable('Runecrafting EXP (Gained)', 0);
if (stats_Username = '') then
begin
stats_Username := 'Anonymous';
stats_Userpass := 'anon1337';
end;
SetupSRLStats(596, stats_Username, Stats_Userpass);
// Main loop
repeat
Antiban;
FindNormalRandoms;
DrawSmartProggy;
Case Location of
LOC_DUEL_ARENA:
if walkDTMPath(AltarPath) then Location := LOC_RUINS else Location := LOC_LOST;
LOC_RUINS:
if EnterRuins then Location := LOC_INSIDE_ALTAR;
LOC_INSIDE_ALTAR:
if WalkDTMPath(InsideAltarPath) then Location := LOC_AT_ALTAR else Location := LOC_LOST;
LOC_AT_ALTAR:
if CraftRunes then Location := LOC_TP_CW else Location := LOC_LOST;
LOC_TP_CW:
if Teleport(False) then
begin
Location := LOC_CASTLE_WARS;
ProgressReport;
end else
begin
Location := LOC_LOST;
end;
LOC_CASTLE_WARS:
if ToCastleWarsChest then Location := LOC_BANK else Location := LOC_LOST;
LOC_BANK:
if Bank then Location := LOC_TP_DA else Location := LOC_LOST;
LOC_TP_DA:
if Teleport(True) then Location := LOC_DUEL_ARENA else Location := LOC_LOST;
LOC_LOST:
begin
writeln('Got lost!!! Atempting to recover.')
if not RecoverFromLost then
begin
end else
begin
writeln('Recoverd from being lost successfully!');
end;
end;
end;
Sleep(RandomRange(500,800));
until (False);
FreDTMs;
end.