Now although I have an essence miner I am still happy to help :)
Here is a compiling version:
program new;
{$DEFINE SMART}
{$i srl\srl.scar}
{$i reflection\reflection.simba}
//*******************************\\
// Trav's Essence Miner \\
//*******************************\\
// Setup \\
// Fill in lines 36-44 \\
// Start in bank \\
// Hit The Start Button \\
//*******************************\\
// To-Do List \\
// 1.Anything you want to see? \\
//*******************************\\
type
EssOptions = record
EssTotal,TimeTotal,LoadsTotal,Loads,Break:Integer;
Exp:Extended;
Debug:Boolean;
end;
var
Options:array of EssOptions;
Time,TimeMark,BreakTime:Integer;
procedure DeclarePlayers;
begin
HowManyPlayers := 1;
NumberOfPlayers(HowManyPlayers);
SetLength(Options,HowManyPlayers);
CurrentPlayer := 0;
Players[0].Name := ''; //your username, duh
Players[0].Pass := ''; //your password
Players[0].Nick := ''; //3-4 letters of ur username, not including first letter
Players[0].Active := True; //Is he going to Mine?
Players[0].Pin := ''; //Your Pin if you have one
Options[0].Loads := 0; //how many loads to do, 0 for unlimited
Options[0].Debug := True; //Enable Debuging?
Options[0].Break := 0; //Take a break every X hours? 0 = disabled
end;
procedure Debug(s:String);
begin
if(Options[CurrentPlayer].Debug = True) then
writeln(s);
end;
procedure MineEss; forward;
procedure Antiban;
var
EssPlayers:Array of TPlayer;
I,RanPlayer:Integer;
TP:TPoint;
begin
R_FindRandoms;
if LevelUp then
MineEss;
Case Random(40) of
1: RandomRClick;
2:
begin
EssPlayers := GetAllPlayers;
if(Length(EssPlayers)>0)then
begin
RanPlayer := RandomRange(0,High(EssPlayers));
if(TileOnMS(Tile(EssPlayers[RanPlayer].Tile.X,EssPlayers[RanPlayer].Tile.Y),5)) then
begin
TP:=TileToMS(Tile(EssPlayers[RanPlayer].Tile.X,EssPlayers[RanPlayer].Tile.Y),5);
Mouse(TP.X,TP.Y,5,5,false);
wait(200+random(300));
MMouse(RandomRange(MIX1,MIX2),RandomRange(MIY1,MIY2),0,0);
end;
end;
end;
3:
begin
MMouse(-100+random(50),-50-random(50),5,5);
wait(3000+random(5000));
end;
4:
begin
PickUpMouse;
wait(1000+random(500));
end;
5:
begin
GameTab(21+Random(10));
wait(100+random(2000));
GameTab(25);
end;
end;
end;
//originally R_DepositAllByIDEX by Zyt3x, but updated for my needs.
procedure EM_DepositAllButIDEx(IDs : TIntegerArray);
var
I, T : Integer;
Item : TInvItem;
begin
if not LoggedIn then
Exit;
for I := 1 to 28 do
begin
Item := GetInvItemAt(I);
if(InIntArray(IDs, Item.ID))then Continue;
R_ClickItem(I, False, 'Deposit-All');
T := GetSystemTime;
while(R_ItemExists(I)) and (GetSystemTime-T<6000) do
wait(100);
end;
end;
procedure Bank;
var
Items:TInvItemArray;
begin
if not LoggedIn Then
Exit;
R_FindRandoms;
Debug('Opening Bank and Depositing all but Pickaxes');
wait(500+random(500));
if(R_ItemIdExistsEx([7936,1436],Items)) then
begin
if R_OpenBankBooth('veb') then
begin
if(R_ItemIDExistsEx([1269,1271,1265,15259,1267,1273,1275],Items)) then
begin
EM_DepositAllButIDEx([1269,1271,1265,15259,1267,1273,1275]);
wait(300+random(500));
end
else
begin
DepositAll;
end;
end
else if(OpenBank('veb',True,True)) then
begin
Debug('Opening Bank With Color');
if(R_ItemIDExistsEx([1269,1271,1265,15259,1267,1273,1275],Items)) then
begin
EM_DepositAllButIDEx([1269,1271,1265,15259,1267,1273,1275]);
wait(300+random(500));
end
else
begin
DepositAll;
end;
end
else
begin
Debug('Error Finding Bank, Making Sure We are in the bank and trying again.');
wait(1000+random(200));
if(DistanceFrom(Tile(3253,3421))<3) then
begin
Debug('We are in the Bank');
end
else
begin
WalkToTile(Tile(3253,3421),1,0);
Debug('Found we were not in bank and now we are in the bank');
end;
if R_OpenBankBooth('veb') then
begin
if(R_ItemIDExistsEx([1269,1271,1265,15259,1267,1273,1275],Items)) then
begin
EM_DepositAllButIDEx([1269,1271,1265,15259,1267,1273,1275]);
wait(300+random(500));
end
else
begin
DepositAll;
end;
end
else if(OpenBank('veb',True,True)) then
begin
Debug('Opening Bank With Color');
if(R_ItemIDExistsEx([1269,1271,1265,15259,1267,1273,1275],Items)) then
begin
EM_DepositAllButIDEx([1269,1271,1265,15259,1267,1273,1275]);
wait(300+random(500));
end
else
begin
DepositAll;
end;
end
else
begin
Debug('Not At bank, quiting');
Logout;
Players[CurrentPlayer].Active := False;
Exit;
end;
end;
end;
end;
procedure WalkToAubury;
var
Path:TTileArray;
begin
if not LoggedIn then
Exit;
Debug('Walking To Aubury');
Path := [Tile(3259, 3411),Tile(3253, 3400)];
WalkPath(Path);
wait(500+random(500));
end;
procedure FindAubury;
var
Aubury, AllNPCs:TNPCArray;
PT:TPoint;
x,I,y:Integer;
begin
if not LoggedIn then
Exit;
Debug('Finding Aubury');
repeat
AllNPCs := GetAllNPCs(False);
Aubury := SortNPCs(AllNPCs);
for I:=0 to High(Aubury) do
begin
if(ToStr(Aubury[I].Name) = 'Aubury') then
begin
if(TileOnMS(Tile(Aubury[i].Tile.X, Aubury[i].Tile.Y),5)) then
begin
PT := TileToMs(Tile(Aubury[i].Tile.X, Aubury[i].Tile.Y),5);
Mouse(PT.x,PT.y,0,0,false);
if(R_ChooseOption('eleport')) then
begin
Debug('Found Aubury');
x:=1;
break;
end;
end;
end;
end;
until(x=1);
repeat
until(FindColorTolerance(x,y,14604757,MMX1,MMY1,MMX2,MMY2,10));
wait(1000+random(500));
end;
procedure FindClosestEss;
var
Ess:TRSObjectArray;
I:Integer;
begin
if Not LoggedIn then
Exit;
R_FindRandoms;
Debug('Finding Location In Mine');
Ess:=GetObjectsByIDEx([2491],OBJECT_TYPE_INTERACTABLE,50);
for i:=0 to High(Ess) do
begin
if (High(Ess)>40) then
Break;
if TileOnMS(Ess[I].Tile,5) then
Exit;
end;
if(TileonMM(Tile(2925, 4818))) then //southeast
begin
Debug('SouthEast');
WalkToTile(Tile(2925,4818),1,2);
end
else if(TileonMM(Tile(2898, 4818))) then //southwest
begin
Debug('southwest');
WalkToTile(Tile(2898, 4818),1,2);
end
else if(TileOnMM(Tile(2896, 4845))) then //Northwest
begin
Debug('Northwest');
WalkToTile(Tile(2896, 4845),1,2);
end
else if(TileOnMM(Tile(2923, 4846))) then //northeast
begin
Debug('Northeast');
WalkToTile(Tile(2923, 4846),1,2);
end
else if(TileOnMM(Tile(2921, 4844))) then //Northeast from middle
begin
Debug('In Middle, Walking to Northeast');
WalkToTile(Tile(2921, 4844),1,2);
end
else if(TileOnMM(Tile(2899, 4820))) then //Southwest from middle
begin
Debug('In Middle, Walking to SouthWest');
WalkToTile(Tile(2899, 4820),1,2);
end
else
begin
Debug('Error Finding Essence, Quiting');
Logout;
Players[CurrentPlayer].Active := False;
Exit;
end;
wait(1000+random(500));
end;
procedure MineEss;
var
Ess:TRSObjectArray;
TP:TPoint;
I,T,X:Integer;
begin
if not LoggedIn then
Exit;
Debug('Mining Essence');
repeat
Ess:=GetObjectsByIDEx([2491],OBJECT_TYPE_INTERACTABLE,50);
if(High(Ess)>40) then
FindClosestEss;
for I:=5 to High(Ess) do
begin
TP := TileToMS(Ess[I].Tile ,5);
MMouse(TP.X,TP.Y,3,3);
wait(100+random(50));
If(R_IsUpTextMulti(['ine','ssence'])) then
begin
ClickMouse2(true);
x:=1;
Break;
end;
end;
until(x=1);
T:=GetSystemTime;
repeat
Antiban;
wait(1000+random(2000));
until(R_InvFull) or (GetSystemTime-T>240000);
end;
procedure FindPortal;
var
x,y,t:Integer;
Portal:TRSObject;
PT:TPoint;
begin
If Not LoggedIn then
Exit;
Debug('Done Mining Essence, time to find the portal');
if(TileOnMM(Tile(2890,4813))) then //northwest
begin
WalkToTile(Tile(2890,4813),1,1);
end
else if(TileOnMM(Tile(2933,4817))) then //northeast
begin
WalkToTile(Tile(2933,4817),1,1);
end
else if(TileOnMM(Tile(2886, 4849))) then //southwest
begin
WalkToTile(Tile(2886, 4849),1,1);
end
else if(TileOnMM(Tile(2932, 4854))) then //southeast
begin
WalkToTile(Tile(2931, 4853),1,1);
end;
MarkTime(t);
while(Not IsIdle) or (TimeFromMark(t)<2000) do
wait(100);
wait(500+random(300));
repeat
Portal:=GetObjectByID(2492,OBJECT_TYPE_INTERACTABLE,50);
PT:=TileToMS(Portal.Tile,5);
MMouse(PT.X,PT.Y,5,5);
if(R_IsUpText('ortal')) then
begin
wait(100+random(100));
if(R_IsUpText('ortal')) then
begin
Debug('Found Portal');
ClickMouse2(True);
x:=1
end;
end;
wait(500+random(500));
until(x=1);
repeat
until(FindColorTolerance(x,y,4025968,MMX1,MMY1,MMX2,MMY2,10));
end;
procedure WalkToBank;
var
Path:TTileArray;
begin
if not LoggedIn then
Exit;
Debug('Walking To Bank');
Path:= [Tile(3258,3412),Tile(3253,3421)];
WalkPath(Path);
end;
procedure DoChecks;
var
run:Integer;
begin
if not LoggedIn then
Exit;
R_FindRandoms;
if(Options[CurrentPlayer].Loads>=Options[CurrentPlayer].LoadsTotal) and (Options[CurrentPlayer].Loads<>0) then
begin
Debug('Player is done. Going to next Player');
Logout;
Players[CurrentPlayer].Active:=False;
Exit;
end;
if(TimeMark=0) then
begin
MarkTime(TimeMark);
end
else
begin
Options[CurrentPlayer].TimeTotal := Options[CurrentPlayer].TimeTotal+TimeFromMark(TimeMark);
MarkTime(TimeMark);
end;
R_MakeCompass('n');
SetAngle(True);
run:=R_GetMMLevels('run');
if(run>80+random(20)) and (not R_IsRunning) then
begin
SetRun(true)
end;
if(run<15+random(15)) then
begin
R_Rest(80+random(20));
SetRun(True);
end;
end;
procedure SetUpScript;
var
I:Integer;
begin
for I:=0 to (HowManyPlayers-1) do
begin
TimeMark := 0;
Options[I].EssTotal:=0;
Options[I].Exp:=0;
Options[I].Loads:=0;
Options[I].LoadsTotal:=0;
Options[I].TimeTotal:=1;
MarkTime(BreakTime);
if(Options[I].Break<>0) then
Options[I].Break:=Options[I].Break*3600000;
end;
end;
procedure IsBreakTime;
var
T:Integer;
begin
if not LoggedIn then
Exit;
if(Options[CurrentPlayer].Break=0) then
Exit;
if(GetSystemTime-BreakTime>=Options[CurrentPlayer].Break) then
begin
Debug('Time for a break.');
T:=GetSystemTime+RandomRange(1200000,2400000);
case Random(3) of
1:
begin
ExitToLobby;
repeat
Debug('Time Left in Break:'+MsToTime((T-GetSystemTime),Time_Short));
if(T-GetSystemTime>60000) then
begin
wait(RandomRange(180000,300000));
end
else
begin
wait(RandomRange(40000,60000));
end;
until(T<GetSystemTime);
Debug('Break Over');
if (LobbyScreen) then
begin
MouseBox(72, 445, 570, 477, 1);
end
else
begin
LoginPlayer;
end;
end;
2:
begin
repeat
Debug('Time Left in Break:'+MsToTime((T-GetSystemTime),Time_Short));
if(T-GetSystemTime>60000) then
begin
wait(RandomRange(180000,300000));
end
else
begin
wait(RandomRange(40000,60000));
end;
until(T<GetSystemTime);
Debug('Break Over');
if (LobbyScreen) then
begin
MouseBox(72, 445, 570, 477, 1);
end
else
begin
LoginPlayer;
end;
end;
3:
begin
Logout;
repeat
Debug('Time Left in Break:'+MsToTime((T-GetSystemTime),Time_Short));
if(T-GetSystemTime>60000) then
begin
wait(RandomRange(180000,300000));
end
else
begin
wait(RandomRange(40000,60000));
end;
until(T<GetSystemTime);
Debug('Break Over');
LoginPlayer;
end;
end;
end;
repeat
BreakTime:=GetSystemTime;
wait(1000+random(1000));
until(Loggedin);
end;
procedure ProgressReport;
var
I:Integer;
EssPerHour,Exp64:Int64;
begin
if(TimeMark=1) then
begin
MarkTime(TimeMark);
end
else
begin
Options[CurrentPlayer].TimeTotal := Options[CurrentPlayer].TimeTotal+TimeFromMark(TimeMark);
MarkTime(TimeMark);
end;
Options[CurrentPlayer].EssTotal := Options[CurrentPlayer].EssTotal+ R_CountItemIDEx([7936,1436]);
Options[CurrentPlayer].Exp:= Options[CurrentPlayer].Exp+(5*R_CountItemIDEx([7936,1436]));
Inc(Options[CurrentPlayer].LoadsTotal);
Writeln('***********************************************');
Writeln('**********Traveler''s Essence Miner************')
Writeln('***********************************************');
Writeln('*Total Time Runing: '+Padr(MsToTime(GetTimeRunning, Time_Short),26)+'*');
WriteLn('***********************************************');
for I := 0 to HowManyPlayers-1 do
begin
Writeln('*Progress Report For: '+Padr(Players[I].Name,24)+'*');
Writeln('*---------------------------------------------*');
Writeln('*Time Runing: '+Padr(MsToTime(Options[I].TimeTotal,Time_Short),32)+'*');
Writeln('*Essence Made: '+Padr(IntToStr(Options[I].EssTotal),31)+'*');
EssPerHour := Round((Options[I].EssTotal*60)/(Options[I].TimeTotal/60000.0));
//test := Round((Options[I].BarsTotal*3600000)/Options[I].Time);
Writeln('*Essence Per Hour: '+Padr(IntToStr(EssPerHour),27)+'*');
Writeln('*Loads: '+Padr(IntToStr(Options[I].LoadsTotal),38)+'*');
Writeln('*Exp Gained: '+Padr(IntToStr(Round(Options[I].Exp)),33)+'*');
Exp64 := Round((Options[I].Exp*3600000)/Options[I].TimeTotal);
Writeln('*Exp Per Hour: '+Padr(IntToStr(exp64),31)+'*');
Writeln('*---------------------------------------------*');
end;
end;
begin
Smart_Server := 141;
Smart_Members := False;
Smart_Signed := True;
Smart_SuperDetail := False;
SetupSRL;
SetupReflectionEX(true);
DeclarePlayers;
SetUpScript;
BreakTime:=GetSystemTime;
repeat
repeat
if not LoggedIn then
begin
LoginPlayer;
BreakTime:=GetSystemTime;
end;
DoChecks;
Bank;
WalkToAubury;
FindAubury;
FindClosestEss;
MineEss;
FindPortal;
WalkToBank;
ProgressReport;
IsBreakTime;
until(Not LoggedIn);
NextPlayer(Players[CurrentPlayer].Active);
until(AllPlayersInactive);
end.