Untitled diff
Program AshamanAltars;
Program AshamanAltars;
{$Define Smart}
// {$Define Smart}
{$I SRL/SRL.Simba}
{$I SRL/SRL.Simba}
{$I SRL/SRL/Misc/Debug.Simba}
{$I SRL/SRL/Misc/Debug.Simba}
{$I SRL/SRL/Misc/SmartGraphics.Simba}
// {$I SRL/SRL/Misc/SmartGraphics.Simba}
Var
Var
PTS: Integer;
PTS: Integer;
{
{
AshamanAltars V1.24
AshamanAltars V1.24
-READ THE OP TOPIC BEFORE ATTEMPTING TO USE
-READ THE OP TOPIC BEFORE ATTEMPTING TO USE
-Start at CW bank (or Tzhaar if using that option)
-Start at CW bank (or Tzhaar if using that option)
-Have Teletohousetabs in your inventory (recommend 1st inventory slot)
-Have Teletohousetabs in your inventory (recommend 1st inventory slot)
-Make sure the bones you want to use are in the TOP RIGHT slot of your bank
-Make sure the bones you want to use are in the TOP RIGHT slot of your bank
-Make sure rings of dueling (if using) and marrentil are visible in bank, try not to have too much green stuff similar to them in same tab.
-Make sure rings of dueling (if using) and marrentil are visible in bank, try not to have too much green stuff similar to them in same tab.
-If using Tzhaar ring, make sure you start with it equipped.
-If using Tzhaar ring, make sure you start with it equipped.
-If using a familiar, have spare pouches and summoning pots visible in bank tab.
-If using a familiar, have spare pouches and summoning pots visible in bank tab.
-If using a familiar, make sure left click option is set to "take bob"
-If using a familiar, make sure left click option is set to "take bob"
-Make sure to fill in the required info below.
-Make sure to fill in the required info below.
}
}
///////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////
// //
// //
// Begin of user setup //
// Begin of user setup //
// Fill in the fields below //
// Fill in the fields below //
// //
// //
///////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////
Const
Const
SRLStats_Username = ''; // ***Leave blank if you don't have a stats account***
SRLStats_Username = ''; // ***Leave blank if you don't have a stats account***
SRLStats_Password = '';
SRLStats_Password = '';
RingType = ''; // ***Which type of ring are you using? (Duel,TzHaar)***
RingType = ''; // ***Which type of ring are you using? (Duel,TzHaar)***
AltarDirection = ''; // ***Cardinal direction from entrance to where your altar room is (N,E,S,W)***
AltarDirection = ''; // ***Cardinal direction from entrance to where your altar room is (N,E,S,W)***
HouseDesign = ''; // ***House style (Zenev,BasicWood,BasicStone,Tropical)*** --HIGHLY RECOMMEND BASIC STONE
HouseDesign = ''; // ***House style (Zenev,BasicWood,BasicStone,Tropical)*** --HIGHLY RECOMMEND BASIC STONE
BurnerType = ''; // ***Which type of burner do you have? (Oak,Mahogany,Marble)***
BurnerType = ''; // ***Which type of burner do you have? (Oak,Mahogany,Marble)***
AltarPlace = ''; // ***From the doorway is your altar at the top of the room or side? (Top, or Side)*** --SEE PICS IN OP
AltarPlace = ''; // ***From the doorway is your altar at the top of the room or side? (Top, or Side)*** --SEE PICS IN OP
BoneOrAshType = ''; // ***What type of bone or ash are you using? (Dragon,BabyDragon,..etc) Only for progress report purposes only***
BoneOrAshType = ''; // ***What type of bone or ash are you using? (Dragon,BabyDragon,..etc) Only for progress report purposes only***
UseAutoChecker = True; // ***Auto checks for most updated version and dowloads it.***
UseAutoChecker = True; // ***Auto checks for most updated version and dowloads it.***
Procedure DeclarePlayers;
Procedure DeclarePlayers;
Begin
Begin
HowManyPlayers := 1;
HowManyPlayers := 1;
NumberOfPlayers(HowManyPlayers);
NumberOfPlayers(HowManyPlayers);
CurrentPlayer := 0;
CurrentPlayer := 0;
With Players[0] Do
With Players[0] Do
Begin
Begin
Name := ''; // ***RS Username***
Name := ''; // ***RS Username***
Pass := ''; // ***RS Pass***
Pass := ''; // ***RS Pass***
Pin := ''; // ***RS Pin***
Pin := ''; // ***RS Pin***
PTS := 2; // ***Pouch to summon, 1 for terrorbird, 2 for wartort, 3 for yak, 0 for nothing***
PTS := 2; // ***Pouch to summon, 1 for terrorbird, 2 for wartort, 3 for yak, 0 for nothing***
BoxRewards := ['Coins', 'oins'];
BoxRewards := ['Coins', 'oins'];
Active := True;
Active := True;
End;
End;
End;
End;
///////////////////////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////////////////////
// //
// //
// End of user setup //
// End of user setup //
// Don't touch below this line unless you know what you're doing!! //
// Don't touch below this line unless you know what you're doing!! //
// //
// //
///////////////////////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////////////////////
Const
Const
ScriptVersion = '1.24' ;
ScriptVersion = '1.24' ;
Debug = False;
Debug = False;
Var
Var
BankTime,Ring,HerbDTM,RingDTM,TabDTM,BoneCount,XP,StartTime,StartingExperience,BonesPH,XPH,DoorX1,DoorY1,DoorX2,DoorY2: Integer;
BankTime,Ring,HerbDTM,RingDTM,TabDTM,BoneCount,XP,StartTime,StartingExperience,BonesPH,XPH,DoorX1,DoorY1,DoorX2,DoorY2: Integer;
DoorHue,DoorSat,BurnerHue,BurnerSat,Afound: Extended;
DoorHue,DoorSat,BurnerHue,BurnerSat,Afound: Extended;
DoorColor,DoorTolerance,SummoningTimer,Summoning,Empty,BurnerColor,BurnerTolerance,TRingDTM,MaxTime: Integer;
DoorColor,DoorTolerance,SummoningTimer,Summoning,Empty,BurnerColor,BurnerTolerance,TRingDTM,MaxTime: Integer;
Pouch,AltarX1,AltarY1,AltarX2,AltarY2, NewPouch,Bones,Lengths,MaxLength,BurnerLength,FailedBurners: Integer;
Pouch,AltarX1,AltarY1,AltarX2,AltarY2, NewPouch,Bones,Lengths,MaxLength,BurnerLength,FailedBurners: Integer;
BounceX,BounceY,TzhaarDTM,AltarDTM,M: Integer;
BounceX,BounceY,TzhaarDTM,AltarDTM,M: Integer;
Direction: String;
Direction: String;
StartSummon,Walk,ClickLefts,FailDTM,NoFamiliar: Boolean;
StartSummon,Walk,ClickLefts,FailDTM,NoFamiliar: Boolean;
Procedure SetDTM;
Procedure SetDTM;
Begin
Begin
TabDTM := DTMFromString('mQwAAAHicY2ZgYMhlYmBIAeIyIH4E5L8D4vdAvGj2bIaosDCG4IAABhEgH4YZkTAQAABZdggg');
TabDTM := DTMFromString('mQwAAAHicY2ZgYMhlYmBIAeIyIH4E5L8D4vdAvGj2bIaosDCG4IAABhEgH4YZkTAQAABZdggg');
HerbDTM := DTMFromString('mWAAAAHicY2FgYJjOCMHzgLgfiI8AxfYC8UEgPgrEPGF8DHzJAhCcLsjADxRDxoxoGAQA1cYHow==');
HerbDTM := DTMFromString('mWAAAAHicY2FgYJjOCMHzgLgfiI8AxfYC8UEgPgrEPGF8DHzJAhCcLsjADxRDxoxoGAQA1cYHow==');
RingDTM := DTMFromString('mWAAAAHicY2FgYGAFYk4GCOACYg4omweKXVwcGESnSzKsmCDBUJ0lyGAEFEPGjGgYBADTGwTc');
RingDTM := DTMFromString('mWAAAAHicY2FgYGAFYk4GCOACYg4omweKXVwcGESnSzKsmCDBUJ0lyGAEFEPGjGgYBADTGwTc');
TRingDTM := DTMFromString('mQwAAAHicY2ZgYNjOxMBwAIi3AnELIwNDNRBXAfGDPbUMF9aXMBxZksvAD1QHw4xIGAgAlsAJww==');
TRingDTM := DTMFromString('mQwAAAHicY2ZgYNjOxMBwAIi3AnELIwNDNRBXAfGDPbUMF9aXMBxZksvAD1QHw4xIGAgAlsAJww==');
Summoning := DTMFromString('mWAAAAHicY2FgYHBigmBXIPYEYn1GBgYrILaE4vz8Ega5a3cZZC/dBKpmYkgBkuxImBENgwAAgewHaA==');
Summoning := DTMFromString('mWAAAAHicY2FgYHBigmBXIPYEYn1GBgYrILaE4vz8Ega5a3cZZC/dBKpmYkgBkuxImBENgwAAgewHaA==');
Empty := DTMFromString('mbQAAAHicY2VgYHBkYmBwBWJ7KHYDYh5GBgYOKBYDYhEgTkxMZbC1c2BIS8tmiE9IYQgKDmPgAupHx4xYMBgAAMSrBxM=');
Empty := DTMFromString('mbQAAAHicY2VgYHBkYmBwBWJ7KHYDYh5GBgYOKBYDYhEgTkxMZbC1c2BIS8tmiE9IYQgKDmPgAupHx4xYMBgAAMSrBxM=');
TzhaarDTM := DTMFromString('mQwAAAHicY2ZAAEYglgJiLSg/PjqawcbSkuHbIxcGGSAfhhmRMBAAAJYPBH8=');
TzhaarDTM := DTMFromString('mQwAAAHicY2ZAAEYglgJiLSg/PjqawcbSkuHbIxcGGSAfhhmRMBAAAJYPBH8=');
AltarDTM := DTMFromString('mggAAAHicY2NgYJgBxJuAuAWKVwHxLCC+CsSngfgsEF8D4htAfAKIFy1exXD/7lWGRw/uMLx8+ZzhwYObDNd2yjPwA+WwYUYcGAIAKncW/g==');
AltarDTM := DTMFromString('mggAAAHicY2NgYJgBxJuAuAWKVwHxLCC+CsSngfgsEF8D4htAfAKIFy1exXD/7lWGRw/uMLx8+ZzhwYObDNd2yjPwA+WwYUYcGAIAKncW/g==');
End;
End;
Procedure F33DTM;
Procedure F33DTM;
Begin
Begin
FreeDTM(TabDTM);
FreeDTM(TabDTM);
FreeDTM(HerbDTM);
FreeDTM(HerbDTM);
FreeDTM(RingDTM);
FreeDTM(RingDTM);
FreeDTM(TRingDTM);
FreeDTM(TRingDTM);
FreeDTM(Summoning);
FreeDTM(Summoning);
FreeDTM(Empty);
FreeDTM(Empty);
FreeDTM(Pouch);
FreeDTM(Pouch);
FreeDTM(TzhaarDTM);
FreeDTM(TzhaarDTM);
FreeDTM(AltarDTM);
FreeDTM(AltarDTM);
End;
End;
Procedure ProgressReport;
Procedure ProgressReport;
Begin
Begin
If Not Debug Then
If Not Debug Then
ClearDebug;
ClearDebug;
BoneCount := BoneCount + Bones;
BoneCount := BoneCount + Bones;
XP := (GetXPBarTotal - StartingExperience);
XP := (GetXPBarTotal - StartingExperience);
XPH := Round(XP * (3600.0 / (GetTimeRunning / 1000.0)));
XPH := Round(XP * (3600.0 / (GetTimeRunning / 1000.0)));
BonesPH := Round((BoneCount * (3600.0 / (GetTimeRunning / 1000.0))));
BonesPH := Round((BoneCount * (3600.0 / (GetTimeRunning / 1000.0))));
Writeln('=========AshamanAltars=========');
Writeln('=========AshamanAltars=========');
Writeln('=========Version: '+ScriptVersion+'=========');
Writeln('=========Version: '+ScriptVersion+'=========');
Writeln('Time Running: ' + TimeRunning);
Writeln('Time Running: ' + TimeRunning);
Writeln('Item Type: ' + BoneorAshType);
Writeln('Item Type: ' + BoneorAshType);
Writeln('Bones&Ashes Used: ' + IntToStr(BoneCount));
Writeln('Bones&Ashes Used: ' + IntToStr(BoneCount));
Writeln('Experience Earned: ' + IntToStr(XP));
Writeln('Experience Earned: ' + IntToStr(XP));
Writeln('Experience/Hour: ' + IntToStr(XPH));
Writeln('Experience/Hour: ' + IntToStr(XPH));
Writeln('Bones&Ashes/H: ' + IntToStr(BonesPH));
Writeln('Bones&Ashes/H: ' + IntToStr(BonesPH));
Writeln('===============================');
Writeln('===============================');
Stats_Commit;
Stats_Commit;
End;
End;
Function WaitLoggedIn(Time:Integer): Boolean;
Function WaitLoggedIn(Time:Integer): Boolean;
Var
Var
T: Integer;
T: Integer;
Begin
Begin
MarkTime(T);
MarkTime(T);
Repeat
Repeat
SRL_ResetNavBar;
SRL_ResetNavBar;
If TimeFromMark(T)>Time Then
If TimeFromMark(T)>Time Then
Begin
Begin
Result:=False;
Result:=False;
Exit;
Exit;
End;
End;
Until (GetColor(472, 490) = 16777215);
Until (GetColor(472, 490) = 16777215);
Result:=True;
Result:=True;
End;
End;
{*******************************************************************************
{*******************************************************************************
By: Shuttleu , edited
By: Shuttleu , edited
*******************************************************************************}
*******************************************************************************}
//Please note that almost all of this code was written by Harry, i just edited it a bit
//Please note that almost all of this code was written by Harry, i just edited it a bit
procedure AutoUpdateMe;
procedure AutoUpdateMe;
var Neifile:integer;
var Neifile:integer;
OnlineVersion, NewScript, NeiFeilNennen:string;
OnlineVersion, NewScript, NeiFeilNennen:string;
begin
begin
if UseAutoChecker then
if UseAutoChecker then
begin
begin
writeln('Checking for script updates...');
writeln('Checking for script updates...');
OnlineVersion := GetPage('http://ashamanaltars.googlecode.com/git/Version.txt');
OnlineVersion := GetPage('http://ashamanaltars.googlecode.com/git/Version.txt');
writeln(OnlineVersion);
writeln(OnlineVersion);
writeln(ScriptVersion)
writeln(ScriptVersion)
if (trim(OnlineVersion) > ScriptVersion) then
if (trim(OnlineVersion) > ScriptVersion) then
begin
begin
writeLn('Newer script version online!');
writeLn('Newer script version online!');
writeLn('Autoupdating to newer version.');
writeLn('Autoupdating to newer version.');
NewScript := GetPage('http://ashamanaltars.googlecode.com/git/AshamanAltars.simba');
NewScript := GetPage('http://ashamanaltars.googlecode.com/git/AshamanAltars.simba');
NeiFeilNennen := ScriptPath+ 'AshamanAltars V'+OnlineVersion+' by Ashaman88.simba';
NeiFeilNennen := ScriptPath+ 'AshamanAltars V'+OnlineVersion+' by Ashaman88.simba';
Neifile := Rewritefile(NeiFeilNennen, true);
Neifile := Rewritefile(NeiFeilNennen, true);
try
try
WriteFileString(Neifile, NewScript);
WriteFileString(Neifile, NewScript);
except
except
begin
begin
writeLn('Fatal error writing to '+NeiFeilNennen+'!!');
writeLn('Fatal error writing to '+NeiFeilNennen+'!!');
terminatescript;
terminatescript;
end;
end;
end;
end;
CloseFile(Neifile);
CloseFile(Neifile);
writeLn('New script downloaded to '+NeiFeilNennen+'!! Please use this one!!');
writeLn('New script downloaded to '+NeiFeilNennen+'!! Please use this one!!');
TerminateScript;
TerminateScript;
end else
end else
writeLn('You have the latest version of the script!');
writeLn('You have the latest version of the script!');
end else
end else
WriteLn('!!!!! Not checking for latest version, you may be outdated!');
WriteLn('!!!!! Not checking for latest version, you may be outdated!');
end;
end;
{*******************************************************************************
{*******************************************************************************
By: GGzz , edited
By: GGzz , edited
*******************************************************************************}
*******************************************************************************}
Function WaitGameTab(Tab, TimeToWait: Integer): Boolean;
Function WaitGameTab(Tab, TimeToWait: Integer): Boolean;
Var
Var
T: Integer;
T: Integer;
begin
begin
Result := False;
Result := False;
GameTab(Tab);
GameTab(Tab);
If Debug Then
If Debug Then
Writeln('Waiting on tab '+ToStr(Tab));
Writeln('Waiting on tab '+ToStr(Tab));
T := GetSystemTime + TimeToWait;
T := GetSystemTime + TimeToWait;
while (GetSystemTime < T) do
while (GetSystemTime < T) do
begin
begin
if (GetCurrentTab = Tab) then
if (GetCurrentTab = Tab) then
begin
begin
Result := True;
Result := True;
Exit;
Exit;
end;
end;
Wait(20 + Random(10));
Wait(20 + Random(10));
end;
end;
end;
end;
{*******************************************************************************
{*******************************************************************************
By: Sin , edited
By: Sin , edited
*******************************************************************************}
*******************************************************************************}
function WaitInvCountInc(Time:Integer):Boolean;
function WaitInvCountInc(Time:Integer):Boolean;
var
var
Inv1,Inv2,t:Integer;
Inv1,Inv2,t:Integer;
begin
begin
MarkTime(t);
MarkTime(t);
Inv1 := InvCount;
Inv1 := InvCount;
repeat
repeat
wait(10);
wait(10);
Inv2 := InvCount;
Inv2 := InvCount;
if TimeFromMark(t) > Time then
if TimeFromMark(t) > Time then
begin
begin
Result := False;
Result := False;
Exit;
Exit;
end;
end;
until(Inv2 > Inv1);
until(Inv2 > Inv1);
Result := True;
Result := True;
end;
end;
{*******************************************************************************
{*******************************************************************************
By: Sin , edited
By: Sin , edited
*******************************************************************************}
*******************************************************************************}
function WaitInvCountDec(Time:Integer):Boolean;
function WaitInvCountDec(Time:Integer):Boolean;
var
var
Inv1,Inv2,t:Integer;
Inv1,Inv2,t:Integer;
begin
begin
MarkTime(t);
MarkTime(t);
Inv1 := InvCount;
Inv1 := InvCount;
repeat
repeat
wait(10);
wait(10);
Inv2 := InvCount;
Inv2 := InvCount;
if TimeFromMark(t) > Time then
if TimeFromMark(t) > Time then
begin
begin
Result := False;
Result := False;
Exit;
Exit;
end;
end;
until(Inv2 < Inv1);
until(Inv2 < Inv1);
Result := True;
Result := True;
end;
end;
{*******************************************************************************
{*******************************************************************************
All of these mouse movements are credited to benland100 and flight
All of these mouse movements are credited to benland100 and flight
*******************************************************************************}
*******************************************************************************}
//By Bandland100, modified to shift mouse speeds after every step
//By Bandland100, modified to shift mouse speeds after every step
Procedure SuperWindMouse(xs, ys, xe, ye, gravity, wind, minWait, maxWait, maxStep, targetArea: extended);
Procedure SuperWindMouse(xs, ys, xe, ye, gravity, wind, minWait, maxWait, maxStep, targetArea: extended);
Var
Var
veloX,veloY,windX,windY,veloMag,dist,randomDist,lastDist,step: extended;
veloX,veloY,windX,windY,veloMag,dist,randomDist,lastDist,step: extended;
lastX,lastY,MSP,W: integer;
lastX,lastY,MSP,W: integer;
sqrt2,sqrt3,sqrt5: extended;
sqrt2,sqrt3,sqrt5: extended;
Begin
Begin
MSP := MouseSpeed;
MSP := MouseSpeed;
sqrt2:= sqrt(2);
sqrt2:= sqrt(2);
sqrt3:= sqrt(3);
sqrt3:= sqrt(3);
sqrt5:= sqrt(5);
sqrt5:= sqrt(5);
While hypot(xs - xe, ys - ye) > 1 Do
While hypot(xs - xe, ys - ye) > 1 Do
Begin
Begin
dist:= hypot(xs - xe, ys - ye);
dist:= hypot(xs - xe, ys - ye);
wind:= minE(wind, dist);
wind:= minE(wind, dist);
If dist >= targetArea Then
If dist >= targetArea Then
Begin
Begin
windX:= windX / sqrt3 + (random(round(wind) * 2 + 1) - wind) / sqrt5;
windX:= windX / sqrt3 + (random(round(wind) * 2 + 1) - wind) / sqrt5;
windY:= windY / sqrt3 + (random(round(wind) * 2 + 1) - wind) / sqrt5;
windY:= windY / sqrt3 + (random(round(wind) * 2 + 1) - wind) / sqrt5;
End Else
End Else
Begin
Begin
windX:= windX / sqrt2;
windX:= windX / sqrt2;
windY:= windY / sqrt2;
windY:= windY / sqrt2;
If (maxStep < 3) Then
If (maxStep < 3) Then
Begin
Begin
maxStep:= random(3) + 3.0;
maxStep:= random(3) + 3.0;
End Else
End Else
Begin
Begin
maxStep:= maxStep / sqrt5;
maxStep:= maxStep / sqrt5;
End;
End;
End;
End;
veloX:= veloX + windX;
veloX:= veloX + windX;
veloY:= veloY + windY;
veloY:= veloY + windY;
veloX:= veloX + gravity * (xe - xs) / dist;
veloX:= veloX + gravity * (xe - xs) / dist;
veloY:= veloY + gravity * (ye - ys) / dist;
veloY:= veloY + gravity * (ye - ys) / dist;
if hypot(veloX, veloY) > maxStep then
if hypot(veloX, veloY) > maxStep then
Begin
Begin
randomDist:= maxStep / 2.0 + random(round(maxStep) div 2);
randomDist:= maxStep / 2.0 + random(round(maxStep) div 2);
veloMag:= sqrt(veloX * veloX + veloY * veloY);
veloMag:= sqrt(veloX * veloX + veloY * veloY);
veloX:= (veloX / veloMag) * randomDist;
veloX:= (veloX / veloMag) * randomDist;
veloY:= (veloY / veloMag) * randomDist;
veloY:= (veloY / veloMag) * randomDist;
End;
End;
lastX:= Round(xs);
lastX:= Round(xs);
lastY:= Round(ys);
lastY:= Round(ys);
xs:= xs + veloX;
xs:= xs + veloX;
ys:= ys + veloY;
ys:= ys + veloY;
Case Random(50) Of
Case Random(50) Of
1..25: W := (MSP + (Random((MSP/4))));
1..25: W := (MSP + (Random((MSP/4))));
26..50: W := (MSP - (RandomRange((MSP/2), MSP-1)));
26..50: W := (MSP - (RandomRange((MSP/2), MSP-1)));
End;
End;
If (W < 1) Then
If (W < 1) Then
W := 1;
W := 1;
If (lastX <> Round(xs)) Or (lastY <> Round(ys)) Then
If (lastX <> Round(xs)) Or (lastY <> Round(ys)) Then
MoveMouse(Round(xs), Round(ys));
MoveMouse(Round(xs), Round(ys));
step:= hypot(xs - lastX, ys - lastY);
step:= hypot(xs - lastX, ys - lastY);
//W := round((maxWait - minWait) * (step / maxStep) + minWait);
//W := round((maxWait - minWait) * (step / maxStep) + minWait);
wait(W);
wait(W);
lastdist:= dist;
lastdist:= dist;
End;
End;
If (Round(xe) <> Round(xs)) or (Round(ye) <> Round(ys)) Then
If (Round(xe) <> Round(xs)) or (Round(ye) <> Round(ys)) Then
MoveMouse(Round(xe), Round(ye));
MoveMouse(Round(xe), Round(ye));
MouseSpeed := MSP;
MouseSpeed := MSP;
End;
End;
Procedure HumanMMouse(eX, eY, ranX, ranY: Integer);
Procedure HumanMMouse(eX, eY, ranX, ranY: Integer);
Var
Var
randSpeed: extended;
randSpeed: extended;
X,Y,X2,Y2,j,Dist,MP: integer;
X,Y,X2,Y2,j,Dist,MP: integer;
Begin
Begin
j := MouseSpeed;
j := MouseSpeed;
GetMousePos(X, Y);
GetMousePos(X, Y);
Dist := Distance(X, Y, eX, eY);
Dist := Distance(X, Y, eX, eY);
MP := Round(Dist/150);
MP := Round(Dist/150);
If MP < 0 Then
If MP < 0 Then
MP := 1;
MP := 1;
randSpeed := (random(MouseSpeed) / 2.0 + MouseSpeed) / 10.0;
randSpeed := (random(MouseSpeed) / 2.0 + MouseSpeed) / 10.0;
X2 := RandomRange(eX-(j*MP), eX+(j*MP));
X2 := RandomRange(eX-(j*MP), eX+(j*MP));
Y2 := RandomRange(eY-(j*MP), eY+(j*MP));
Y2 := RandomRange(eY-(j*MP), eY+(j*MP));
SuperWindMouse(X, Y, X2, Y2, 11, 8, 10.0 / randSpeed, 12.0 / randSpeed, 10.0 * randSpeed, 10.0 * randSpeed);
SuperWindMouse(X, Y, X2, Y2, 11, 8, 10.0 / randSpeed, 12.0 / randSpeed, 10.0 * randSpeed, 10.0 * randSpeed);
GetMousePos(X, Y);
GetMousePos(X, Y);
MMouse(eX, eY, ranX, ranY);
MMouse(eX, eY, ranX, ranY);
MouseSpeed := j;
MouseSpeed := j;
End;
End;
Function UsingFamiliarFS: Boolean;
Function UsingFamiliarFS: Boolean;
Var
Var
CTS: Integer;
CTS: Integer;
TPA: TPointArray;
TPA: TPointArray;
Begin
Begin
CTS:= GetColorToleranceSpeed;
CTS:= GetColorToleranceSpeed;
SetColorToleranceSpeed(2);
SetColorToleranceSpeed(2);
SetColorSpeed2Modifiers(0.18, 0.88);
SetColorSpeed2Modifiers(0.18, 0.88);
Result:= FindColorsTolerance(TPA, 8763221, 692, 130, 721, 160, 21);
Result:= FindColorsTolerance(TPA, 8763221, 692, 130, 721, 160, 21);
SetColorSpeed2Modifiers(0.2, 0.2);
SetColorSpeed2Modifiers(0.2, 0.2);
ColorToleranceSpeed(CTS);
ColorToleranceSpeed(CTS);
End;
End;
Function UsingFamiliar: Boolean; //By Flight. Modified highly!
Function UsingFamiliar: Boolean; //By Flight. Modified highly!
Var
Var
X, Y: Integer;
X, Y: Integer;
Begin
Begin
Result := UsingFamiliarFS Or FindColorTolerance(X, Y, 11192179, 695, 130, 720, 155, 20);
Result := UsingFamiliarFS Or FindColorTolerance(X, Y, 11192179, 695, 130, 720, 155, 20);
If (Not Result) Then
If (Not Result) Then
Begin
Begin
If FindColorTolerance(X, Y, 3426817, 695, 130, 720, 155, 20) Then
If FindColorTolerance(X, Y, 3426817, 695, 130, 720, 155, 20) Then
Begin
Begin
Result:= False;
Result:= False;
If Debug Then
If Debug Then
Writeln('Not using familiar');
Writeln('Not using familiar');
Exit;
Exit;
End;
End;
HumanMMouse(708, 144, 5, 5);
HumanMMouse(708, 144, 5, 5);
Repeat
Repeat
GetMousePos(X, Y);
GetMousePos(X, Y);
Wait(RandomRange(200,300));
Wait(RandomRange(200,300));
Until(PointInBox(Point(X, Y), IntToBox(691, 131, 720, 159)));
Until(PointInBox(Point(X, Y), IntToBox(691, 131, 720, 159)));
Result:= (Not WaitUptextMulti(['Pet', 'et '], RandomRange(200,300)));
Result:= (Not WaitUptextMulti(['Pet', 'et '], RandomRange(200,300)));
End;
End;
End;
End;
Function SummonPoints: Integer;
Function SummonPoints: Integer;
Var
Var
ColourString: String;
ColourString: String;
Begin
Begin
Result:= GetMMLevels('summon', ColourString);
Result:= GetMMLevels('summon', ColourString);
End;
End;
Function CheckStuff: Boolean;
Function CheckStuff: Boolean;
Begin
Begin
Result:=False;
Result:=False;
If Not WaitLoggedIn(1000) Then
If Not WaitLoggedIn(1000) Then
LoginPlayer;
LoginPlayer;
If FindNormalRandoms Then
If FindNormalRandoms Then
Begin
Begin
If Not WaitLoggedIn(1000) Then
If Not WaitLoggedIn(1000) Then
TerminateScript;
TerminateScript;
MakeCompass(Direction);
MakeCompass(Direction);
SetAngle(SRL_ANGLE_HIGH);
SetAngle(SRL_ANGLE_HIGH);
Writeln('Checkstuff is true');
Writeln('Checkstuff is true');
Result:=True;
Result:=True;
End;
End;
End;
End;
Procedure DismissFamiliar;
Procedure DismissFamiliar;
Var
Var
T: Integer;
T: Integer;
Label
Label
FamJump;
FamJump;
Begin
Begin
FamJump:
FamJump:
If Not WaitLoggedIn(1000) Then
If Not WaitLoggedIn(1000) Then
Exit;
Exit;
If Debug Then
If Debug Then
Writeln('Attempting to dismiss familiar');
Writeln('Attempting to dismiss familiar');
MouseBox(697,134,712,151,Mouse_Right);
MouseBox(697,134,712,151,Mouse_Right);
If WaitOption('miss',2000) Then
If WaitOption('miss',2000) Then
Begin
Begin
If Debug Then
If Debug Then
Writeln('Found option to dismiss');
Writeln('Found option to dismiss');
MarkTime(T);
MarkTime(T);
Repeat
Repeat
Wait(Random(100));
Wait(Random(100));
If CheckStuff Then
If CheckStuff Then
Break;
Break;
If TimeFromMark(T)>6000 Then
If TimeFromMark(T)>6000 Then
Begin
Begin
If Debug Then
If Debug Then
Writeln('Didnt find NPC chat, exiting.');
Writeln('Didnt find NPC chat, exiting.');
Break;
Break;
End;
End;
Until FindNPCChatText('Yes',Nothing);
Until FindNPCChatText('Yes',Nothing);
If Not FindNPCChatText('Yes',Nothing) Then
If Not FindNPCChatText('Yes',Nothing) Then
GoTo FamJump;
GoTo FamJump;
TypeSendEx('1',False);
TypeSendEx('1',False);
While UsingFamiliar Do
While UsingFamiliar Do
Wait(100);
Wait(100);
End;
End;
End;
End;
Function SummoningRenew(PouchToSummon: integer): Boolean;
Function SummoningRenew(PouchToSummon: integer): Boolean;
Var
Var
X,Y,Tries: Integer;
X,Y,Tries: Integer;
Begin
Begin
CheckStuff;
CheckStuff;
If Not WaitLoggedIn(1000) Then
If Not WaitLoggedIn(1000) Then
Exit;
Exit;
If PTS=0 Then
If PTS=0 Then
Begin
Begin
If Debug Then
If Debug Then
Writeln('PTS=0');
Writeln('PTS=0');
Bones:=25;
Bones:=25;
Exit;
Exit;
End;
End;
If (GetCurrentTab <> Tab_Inv) Then
If (GetCurrentTab <> Tab_Inv) Then
WaitGameTab(Tab_Inv,5000);
WaitGameTab(Tab_Inv,5000);
If (Not WaitFindDTMEx(Pouch, X, Y, MIX1, MIY1, MIX2, MIY2,100,5000)) Then
If (Not WaitFindDTMEx(Pouch, X, Y, MIX1, MIY1, MIX2, MIY2,100,5000)) Then
Begin
Begin
If Debug Then
If Debug Then
Writeln('Did not find pouch in summoning renew function.');
Writeln('Did not find pouch in summoning renew function.');
Exit;
Exit;
End;
End;
If(FindDTM(Summoning,X,Y,MIX1,MIY1,MIX2,MIY2)) Then
If(FindDTM(Summoning,X,Y,MIX1,MIY1,MIX2,MIY2)) Then
If (SummonPoints < 10) Then
If (SummonPoints < 10) Then
Begin
Begin
If Debug Then
If Debug Then
Writeln('Need to Refill Summoning Points.');
Writeln('Need to Refill Summoning Points.');
If(FindDTM(Summoning, X, Y, MIX1, MIY1, MIX2, MIY2)) Then
If(FindDTM(Summoning, X, Y, MIX1, MIY1, MIX2, MIY2)) Then
Begin
Begin
If Debug Then
If Debug Then
Writeln('Found summoning potion.');
Writeln('Found summoning potion.');
HumanMMouse(X,Y+5,4,2);
HumanMMouse(X,Y+5,4,2);
If WaitUptextMulti(['ummoning', 'potion','Summon','poti','tion','ummon','moning'], 500) Then
If WaitUptextMulti(['ummoning', 'potion','Summon','poti','tion','ummon','moning'], 500) Then
Begin
Begin
If Debug Then
If Debug Then
Writeln('Found Drink Uptext.');
Writeln('Found Drink Uptext.');
ClickMouse2(False);
ClickMouse2(False);
WaitOptionMulti(['rink', 'Drink', 'rink Summoning', 'Drink Summoning'],RandomRange(400,500));
WaitOptionMulti(['rink', 'Drink', 'rink Summoning', 'Drink Summoning'],RandomRange(400,500));
Wait(RandomRange(2000,2200));
Wait(RandomRange(2000,2200));
End;
End;
If FindDTM(Empty, X, Y, MIX1, MIY1, MIX2, MIY2) Then
If FindDTM(Empty, X, Y, MIX1, MIY1, MIX2, MIY2) Then
Begin
Begin
HumanMMouse(X,Y,4,4);
HumanMMouse(X,Y,4,4);
If WaitUptextMulti(['ial', 'Vial'], 500) Then
If WaitUptextMulti(['ial', 'Vial'], 500) Then
Begin
Begin
If Debug Then
If Debug Then
Writeln('Found vial uptext');
Writeln('Found vial uptext');
ClickMouse2(False);
ClickMouse2(False);
WaitOptionMulti(['Drop', 'rop', 'p Vial', 'Drop Vial'],RandomRange(400,500));
WaitOptionMulti(['Drop', 'rop', 'p Vial', 'Drop Vial'],RandomRange(400,500));
Wait(RandomRange(2000,2200));
Wait(RandomRange(2000,2200));
End;
End;
End;
End;
End;
End;
End;
End;
If (SummonPoints < 10) then
If (SummonPoints < 10) then
Begin
Begin
If Debug Then
If Debug Then
Writeln('Summoning points too low for new familiar and no pot found');
Writeln('Summoning points too low for new familiar and no pot found');
Exit;
Exit;
End;
End;
Tries:=0;
Tries:=0;
If(FindDtm(Pouch, X, Y, MIX1, MIY1, MIX2, MIY2)) Then
If(FindDtm(Pouch, X, Y, MIX1, MIY1, MIX2, MIY2)) Then
Repeat
Repeat
If Debug Then
If Debug Then
Writeln('Found pouch, attempting to summon');
Writeln('Found pouch, attempting to summon');
If UsingFamiliar Then
If UsingFamiliar Then
Break;
Break;
CheckStuff;
CheckStuff;
HumanMMouse(X, Y, 5, 5);
HumanMMouse(X, Y, 5, 5);
ClickMouse2(False);
ClickMouse2(False);
WaitOption('Summon',500);
WaitOption('Summon',500);
Wait(RandomRange(1000,2000));
Wait(RandomRange(1000,2000));
If(FindBlackChatMessage('follower')) Then
If(FindBlackChatMessage('follower')) Then
Break;
Break;
Tries:= Tries + 1;
Tries:= Tries + 1;
If (Tries > 5) Then
If (Tries > 5) Then
Begin
Begin
If Debug Then
If Debug Then
Writeln('Failed to summon familiar');
Writeln('Failed to summon familiar');
Exit;
Exit;
End;
End;
Until(UsingFamiliar);
Until(UsingFamiliar);
MarkTime(SummoningTimer);
MarkTime(SummoningTimer);
Result:= UsingFamiliar;
Result:= UsingFamiliar;
End;
End;
Function StoreBOB: Boolean;
Function StoreBOB: Boolean;
Var
Var
T:integer;
T:integer;
Jumper: Boolean;
Jumper: Boolean;
Label
Label
Jump;
Jump;
Label
Label
Restart;
Restart;
Begin
Begin
If Debug Then
If Debug Then
Writeln('ENTERING STOREBOB FUNCTION');
Writeln('ENTERING STOREBOB FUNCTION');
Restart:
Restart:
Result:=False;
Result:=False;
Jumper:=False;
Jumper:=False;
CheckStuff;
CheckStuff;
If Not WaitLoggedIn(1000) Then
If Not WaitLoggedIn(1000) Then
Exit;
Exit;
If Not UsingFamiliar Then
If Not UsingFamiliar Then
Begin
Begin
If Debug Then
If Debug Then
Writeln('No familiar found, exiting function');
Writeln('No familiar found, exiting function');
Exit;
Exit;
End;
End;
If Not IsUpTextMultiCustom(['Take','ake','BoB']) Then
If Not IsUpTextMultiCustom(['Take','ake','BoB']) Then
MouseBox(697,134,712,151,Mouse_Right) Else
MouseBox(697,134,712,151,Mouse_Right) Else
ClickMouse2(False);
ClickMouse2(False);
If WaitOptionMulti(['act','Interact','eract'],1500) Then
If WaitOptionMulti(['act','Interact','eract'],1500) Then
Begin
Begin
If Debug Then
If Debug Then
Writeln('Found option to interact with familiar');
Writeln('Found option to interact with familiar');
MarkTime(T);
MarkTime(T);
Repeat
Repeat
Wait(100);
Wait(100);
If CheckStuff Then
If CheckStuff Then
Break;
Break;
If TimeFromMark(T)>5000 Then
If TimeFromMark(T)>5000 Then
Begin
Begin
If Debug Then
If Debug Then
Writeln('Failed to find NPC option');
Writeln('Failed to find NPC option');
Exit;
Exit;
End;
End;
Until FindNPCChatText('tore',Nothing);
Until FindNPCChatText('tore',Nothing);
If Not FindNPCChatText('tore',Nothing) Then
If Not FindNPCChatText('tore',Nothing) Then
GoTo Restart;
GoTo Restart;
TypeSendEx('2',False);
TypeSendEx('2',False);
End;
End;
MarkTime(T);
MarkTime(T);
Repeat
Repeat
InvMouse(RandomRange(6,10),3);
InvMouse(RandomRange(6,10),3);
If (TimeFromMark(T)>5000) Or (Checkstuff) Then
If (TimeFromMark(T)>5000) Or (Checkstuff) Then
Begin
Begin
If Debug then
If Debug then
Writeln('Failed to find bones in inventory');
Writeln('Failed to find bones in inventory');
Jumper:=True;
Jumper:=True;
Break;
Break;
End;
End;
Until WaitUpTextMulti(['ones','Bones','bones','one','Bon','nes','Bo','bo','ne','Drag','agon','drag','gon','Frost','rost','ost','Ashes','Ash','ash','hes'],RandomRange(200,250));
Until WaitUpTextMulti(['ones','Bones','bones','one','Bon','nes','Bo','bo','ne','Drag','agon','drag','gon','Frost','rost','ost','Ashes','Ash','ash','hes'],RandomRange(200,250));
If Jumper Then
If Jumper Then
GoTo Jump;
GoTo Jump;
If Debug then
If Debug then
Writeln('Found bones in inventory');
Writeln('Found bones in inventory');
If WaitUpTextMulti(['Store','tore'],RandomRange(5000,6000)) Then
If WaitUpTextMulti(['Store','tore'],RandomRange(5000,6000)) Then
Begin
Begin
If Debug then
If Debug then
Writeln('Found option to store in BOB');
Writeln('Found option to store in BOB');
ClickMouse2(False);
ClickMouse2(False);
If WaitOptionMulti(['re-A','-All','ll F','ll D','ll B'],RandomRange(2000,3000)) Then
If WaitOptionMulti(['re-A','-All','ll F','ll D','ll B'],RandomRange(2000,3000)) Then
Begin
Begin
If Debug then
If Debug then
Writeln('Found option to deposit all');
Writeln('Found option to deposit all');
WaitInvCountDec(4000);
WaitInvCountDec(4000);
Result:=True;
Result:=True;
BankTime:=2;
BankTime:=2;
End;
End;
End;
End;
Jump:
Jump:
MouseBox(420,38,430,46,Mouse_Move);
MouseBox(420,38,430,46,Mouse_Move);
If Debug then
If Debug then
Writeln('Trying to close BOB menu');
Writeln('Trying to close BOB menu');
If WaitUpTextMulti(['Close','lose'],2000) Then
If WaitUpTextMulti(['Close','lose'],2000) Then
ClickMouse2(True);
ClickMouse2(True);
MarkTime(T);
MarkTime(T);
Repeat
Repeat
Wait(100);
Wait(100);
If CheckStuff Then
If CheckStuff Then
Break;
Break;
If TimeFromMark(T)>10000 Then
If TimeFromMark(T)>10000 Then
Begin
Begin
If Debug Then
If Debug Then
Writeln('Probably failed to close summoning interface');
Writeln('Probably failed to close summoning interface');
Break;
Break;
End;
End;
Until Not IsUpTextMultiCustom(['Close','lose']);
Until Not IsUpTextMultiCustom(['Close','lose']);
End;
End;
Function TzBank: Boolean;
Function TzBank: Boolean;
Var
Var
X,Y,H,I,CTS: Integer;
X,Y,H,I,CTS: Integer;
TPA: TPointArray;
TPA: TPointArray;
ATPA: T2DPointArray;
ATPA: T2DPointArray;
Begin
Begin
If Debug Then
If Debug Then
Writeln('ENTERING TZHAAR BANK FUNCTION');
Writeln('ENTERING TZHAAR BANK FUNCTION');
Result:=False;
Result:=False;
CheckStuff;
CheckStuff;
If Not WaitLoggedIn(1000) Then
If Not WaitLoggedIn(1000) Then
Exit;
Exit;
MouseSpeed := RandomRange(18, 23);
MouseSpeed := RandomRange(18, 23);
If FindDTMRotated(TzhaarDTM,X,Y,MSX1,MSY1,MSX2,MSY2,-Pi,Pi,Pi/30,aFound) Then
If FindDTMRotated(TzhaarDTM,X,Y,MSX1,MSY1,MSX2,MSY2,-Pi,Pi,Pi/30,aFound) Then
Begin
Begin
If Debug Then
If Debug Then
Writeln('Found DTM Tzhaar');
Writeln('Found DTM Tzhaar');
HumanMMouse(X,Y,4,4);
HumanMMouse(X,Y,4,4);
If (WaitUpTextMulti(['Mej','Talk','Jal'],RandomRange(200,250))) Then
If (WaitUpTextMulti(['Mej','Talk','Jal'],RandomRange(200,250))) Then
Begin
Begin
If Debug Then
If Debug Then
Writeln('Found DTM banker');
Writeln('Found DTM banker');
ClickMouse2(False);
ClickMouse2(False);
If WaitOption('ank',RandomRange(400,500)) Then
If WaitOption('ank',RandomRange(400,500)) Then
Begin
Begin
If Debug Then
If Debug Then
Writeln('Found DTM option to open bank');
Writeln('Found DTM option to open bank');
Result:=True;
Result:=True;
Exit;
Exit;
End;
End;
End;
End;
End;
End;
CTS := GetColorToleranceSpeed;
CTS := GetColorToleranceSpeed;
ColorToleranceSpeed(2);
ColorToleranceSpeed(2);
SetColorSpeed2Modifiers(0.32, 2.85);
SetColorSpeed2Modifiers(0.32, 2.85);
FindColorsSpiralTolerance(MSCX, MSCY, TPA, 3064035, MSX1, MSY1, MSX2, MSY2, 8);
FindColorsSpiralTolerance(MSCX, MSCY, TPA, 3064035, MSX1, MSY1, MSX2, MSY2, 8);
ColorToleranceSpeed(CTS);
ColorToleranceSpeed(CTS);
SetColorSpeed2Modifiers(0.2, 0.2);
SetColorSpeed2Modifiers(0.2, 0.2);
ATPA := SplitTPAEx(TPA, 10, 10);
ATPA := SplitTPAEx(TPA, 10, 10);
SortATPASize(ATPA,True);
SortATPASize(ATPA,True);
If Debug Then
If Debug Then
DebugATPABounds(ATPA);
DebugATPABounds(ATPA);
If (Length(ATPA) = 0) Then
If (Length(ATPA) = 0) Then
Begin
Begin
If Debug Then
If Debug Then
Writeln('No colors found for banker');
Writeln('No colors found for banker');
Exit;
Exit;
End;
End;
H := High(ATPA);
H := High(ATPA);
For I := 0 To H Do
For I := 0 To H Do
Begin
Begin
MiddleTPAEx(ATPA[I], X, Y);
MiddleTPAEx(ATPA[I], X, Y);
If Debug Then
If Debug Then
Writeln(tostr(Length(ATPA[I])));
Writeln(tostr(Length(ATPA[I])));
If (Length(ATPA[I]) < 20) then
If (Length(ATPA[I]) < 20) then
Continue;
Continue;
HumanMMouse(X,Y,4,4);
HumanMMouse(X,Y,4,4);
If (WaitUpTextMulti(['Mej','Talk','Jal'],RandomRange(200,250))) Then
If (WaitUpTextMulti(['Mej','Talk','Jal'],RandomRange(200,250))) Then
Begin
Begin
If Debug Then
If Debug Then
Writeln('Found banker');
Writeln('Found banker');
ClickMouse2(False);
ClickMouse2(False);
If WaitOption('ank',RandomRange(400,500)) Then
If WaitOption('ank',RandomRange(400,500)) Then
Begin
Begin
If Debug Then
If Debug Then
Writeln('Found option to open bank');
Writeln('Found option to open bank');
Result:=True;
Result:=True;
Exit;
Exit;
End;
End;
End;
End;
End;
End;
End;
End;
{*******************************************************************************
{*******************************************************************************
By: Flight and GGzz
By: Flight and GGzz
*******************************************************************************}
*******************************************************************************}
Function GetRingCount: Integer;
Function GetRingCount: Integer;
var
var
S, S2: String;
S, S2: String;
begin
begin
If Debug Then
If Debug Then
Writeln('ENTERING GETRINGCOUNT FUNCTION');
Writeln('ENTERING GETRINGCOUNT FUNCTION');
GameTab(tab_equip);
GameTab(tab_equip);
if WearingItem(11) then
if WearingItem(11) then
begin
begin
MouseEquippedItem('ring', 3);
MouseEquippedItem('ring', 3);
Wait(RandomRange(175, 250));
Wait(RandomRange(175, 250));
S := GetUpText;
S := GetUpText;
Wait(RandomRange(175, 250));
Wait(RandomRange(175, 250));
S2 := Between('(', ')', S);
S2 := Between('(', ')', S);
if not (S2 = '') then
if not (S2 = '') then
begin
begin
If Debug Then
If Debug Then
Writeln('We have '+S2+' ring charges left');
Writeln('We have '+S2+' ring charges left');
Result := StrToIntDef(S2, 8);
Result := StrToIntDef(S2, 8);
end
end
end else
end else
Result := 0;
Result := 0;
end;
end;
Procedure ToBank;
Procedure ToBank;
Var
Var
X,Y,T,R: integer;
X,Y,T,R: integer;
Begin
Begin
If Debug Then
If Debug Then
Writeln('ENTERING TOBANK PROCEDURE');
Writeln('ENTERING TOBANK PROCEDURE');
CheckStuff;
CheckStuff;
If Not WaitLoggedIn(1000) Then
If Not WaitLoggedIn(1000) Then
Exit;
Exit;
If (GetCurrentTab)<>(Tab_Equip) Then
If (GetCurrentTab)<>(Tab_Equip) Then
WaitGameTab(Tab_Equip,5000);
WaitGameTab(Tab_Equip,5000);
If LowerCase(RingType)='duel' Then
If LowerCase(RingType)='duel' Then
Begin
Begin
If Debug Then
If Debug Then
Writeln('RingType is duel');
Writeln('RingType is duel');
R:= GetRingCount
R:= GetRingCount
Ring:= R - 1;
Ring:= R - 1;
If CountColorTolerance(1677077,679,363,717,401,50)>0 Then
If CountColorTolerance(1677077,679,363,717,401,50)>0 Then
Begin
Begin
If Debug then
If Debug then
Writeln('Found Ring Teleporting');
Writeln('Found Ring Teleporting');
ClickMouse2(False);
ClickMouse2(False);
WaitOptionMulti(['astle','Cast','stle'],900);
WaitOptionMulti(['astle','Cast','stle'],900);
If Debug then
If Debug then
Writeln('Waiting for bank');
Writeln('Waiting for bank');
If (GetCurrentTab)<>(Tab_Inv) Then
If (GetCurrentTab)<>(Tab_Inv) Then
WaitGameTab(Tab_Inv,5000);
WaitGameTab(Tab_Inv,5000);
If LowerCase(AltarDirection)='s' Then
If LowerCase(AltarDirection)='s' Then
MakeCompass('N');
MakeCompass('N');
SetAngle(SRL_ANGLE_HIGH);
SetAngle(SRL_ANGLE_HIGH);
MarkTime(T);
MarkTime(T);
Repeat
Repeat
Wait(Random(100));
Wait(Random(100));
If (TimeFromMark(T)>10000) Or (CheckStuff) Then
If (TimeFromMark(T)>10000) Or (CheckStuff) Then
Begin
Begin
If Debug Then
If Debug Then
Writeln('Didnt find bank symbol');
Writeln('Didnt find bank symbol');
Break;
Break;
End;
End;
Until FindSymbol(X,Y,'Bank');
Until FindSymbol(X,Y,'Bank');
End Else
End Else
Begin
Begin
Writeln('Couldnt find duel ring to get to bank, TERMINATING');
Writeln('Couldnt find duel ring to get to bank, TERMINATING');
TerminateScript;
TerminateScript;
End;
End;
End Else
End Else
Begin
Begin
If Debug Then
If Debug Then
Writeln('Ringtype tzhaar');
Writeln('Ringtype tzhaar');
If WaitFindDTMEx(TRingDTM,X,Y,MIX1,MIY1,MIX2,MIY2,50,3000) Then
If WaitFindDTMEx(TRingDTM,X,Y,MIX1,MIY1,MIX2,MIY2,50,3000) Then
Begin
Begin
If Debug then
If Debug then
Writeln('Found ring, teleporting');
Writeln('Found ring, teleporting');
HumanMMouse(X,Y,4,4);
HumanMMouse(X,Y,4,4);
ClickMouse2(False);
ClickMouse2(False);
WaitOptionMulti(['port','Tele','lepo'],900);
WaitOptionMulti(['port','Tele','lepo'],900);
MarkTime(T);
MarkTime(T);
Repeat
Repeat
Wait(Random(100));
Wait(Random(100));
If TimeFromMark(T)>5000 Then
If TimeFromMark(T)>5000 Then
Begin
Begin
If Debug Then
If Debug Then
Writeln('Didnt find npc chat for caves');
Writeln('Didnt find npc chat for caves');
Exit;
Exit;
End;
End;
Until FindNPCChatTextMulti(['aves','Cave','Caves'],Nothing);
Until FindNPCChatTextMulti(['aves','Cave','Caves'],Nothing);
TypeSendEx('3',False);
TypeSendEx('3',False);
If Debug then
If Debug then
Writeln('Waiting for bank');
Writeln('Waiting for bank');
If (GetCurrentTab)<>(Tab_Inv) Then
If (GetCurrentTab)<>(Tab_Inv) Then
WaitGameTab(Tab_Inv,5000);
WaitGameTab(Tab_Inv,5000);
If LowerCase(AltarDirection)='s' Then
If LowerCase(AltarDirection)='s' Then
MakeCompass('N');
MakeCompass('N');
MarkTime(T);
MarkTime(T);
Repeat
Repeat
Wait(Random(100));
Wait(Random(100));
If (TimeFromMark(T)>10000) Or (CheckStuff) Then
If (TimeFromMark(T)>10000) Or (CheckStuff) Then
Begin
Begin
If Debug then
If Debug then
Writeln('Didnt find bank symbol, teleport failed');
Writeln('Didnt find bank symbol, teleport failed');
Break;
Break;
End;
End;
Until (FindSymbol(X,Y,'Bank')) Or (FindSymbol(X,Y,'Minigame'));
Until (FindSymbol(X,Y,'Bank')) Or (FindSymbol(X,Y,'Minigame'));
End Else
End Else
Begin
Begin
Writeln('Couldnt find tzhaar ring, TERMINATING');
Writeln('Couldnt find tzhaar ring, TERMINATING');
TerminateScript;
TerminateScript;
End;
End;
End;
End;
End;
End;
Function BankingFailSafe: Boolean;
Function BankingFailSafe: Boolean;
Var
Var
X,Y,H,I,CTS,T: Integer;
X,Y,H,I,CTS,T: Integer;
TPA: TPointArray;
TPA: TPointArray;
ATPA: T2DPointArray;
ATPA: T2DPointArray;
Begin
Begin
If Debug then
If Debug the