Psychor
2007-12-03 15:50:19
For some reason since today i can't get SMART to start anymore. Asfar as i'm aware nothing has changed on my PC. I have tried to reinstall Scar 3.12c and also tried 3.13 both with SRL4 #6 and #7. Firefox is open, and i've tried rebooting and shutting down for a longer period. I allways get the error
On another thread Ben said
I'm sure that's the problem as my client won't load at all.
Anyone any ideas?
Psychor
EDIT: posted the script
[Runtime Error] : Exception: Access violation at address 01D310AB in module 'Embedded SMART.dll'. Read of address 000006DC in line 57 in script C:\Program Files\SCAR 3.12\includes\SRL/SRL/misc/smart.scar
On another thread Ben said
Just so happens that that address is within SmartGetColor (big surprise, thats why I wanted to know whats on line 38 ) and the problem is happening on an read rather than a write meaning that you are trying to get a color that is not on the RS screen. So, possibly find what is trying to get a bad-positioned color and change it
I'm sure that's the problem as my client won't load at all.
Anyone any ideas?
Psychor
EDIT: posted the script
program GoldMiner;
{.include SRL/SRL/misc/smart.scar}
{.include SRL/SRL.scar}
{.Include SRL/SRL/skill/Mining.scar}
{.Include SRL/SRL/misc/MusicLocation.scar}
{.include SRL/SRL/misc/MiscellaneousColorFinder.scar}
//************************* Setup starts here *************************
Const
LoadsTotal = 50; // How many loads to mine
Code = ''; // Bankpin
BankingSpot = 0; // Where to Bank, 0 for Zanaris, 1 for Ardougne
LogingTime = 0; // Minutes the script wil run before a temporary logout (0 for no logging)
Procedure DeclarePlayers;
begin
HowManyPlayers := 2; // How many players to use.
NumberOfPlayers( HowManyPlayers ); // Leave this.
CurrentPlayer := 0; // Start Player
SRLId := ''; // Your SRL ID Username
SRLPassword := ''; // Your SRL ID Password
Players[0].Name := ''; // UserName
Players[0].Pass := ''; // Password
Players[0].Nick := ''; // 3/4 String of Name
Players[0].Active := True; // Use this account? True / False
Players[1].Name := ''; // UserName
Players[1].Pass := ''; // Password
Players[1].Nick := ''; // 3/4 String of Name
Players[1].Active := True; // Use this account? True / False
//************************** Setup ends here **************************
end;
Var
dtmGold, GoldOre, dtmFruit, bmpGrasroad, bmpDirtRoad, dtmWhistle, PlayerSwitch: Integer;
MiningRock, DialRing, cx, cy, dtmGem, GemsTotal, LastTotal, NewTotal, Rockx, Rocky : Integer;
Plantx, Planty, Loads, dtmArdougneBank, GColor, GemRandom, RunStart, LoadsT: Integer;
Name1, Name2, Name3, Name4: string;
Procedure Setup;
begin
bmpGrasRoad := BitmapFromString(8, 4, 'beNqbIp7aJYqMMieIQxCR4j' +
'lTxCEIuzgASqohOw==');
bmpDirtRoad := BitmapFromString2(False, 'a26AE978DAED8AB911C03' +
'00CC35692ACCF2EA338DE7FA4881A22551A1C0F2011D1B90B94B3' +
'204DCBA7E802EF06A3D19B07AAA25AC08FA9D8866AC7F1C185B4B' +
'D9F558C0515D9CFE86D073518BCE0796F30878BB1AC9FDFF30522' +
'8');
dtmWhistle := DTMFromString('78DA639CC7C0C0D0C10006CC108AA124279B8' +
'10B483302F17F20609C0C64F430A00146241248AF0412138950D3' +
'48400DC83D7544A8998A5F0D003CC70C5E');
dtmGold := DTMFromString('78DA63AC62606098C30006CC108AE1F666690' +
'62E20CD08C4FF8180B10EC8E86740038C482490CE04128B09A8A9' +
'00122B09A86926C29C62203101BF1A00480F0C3D');
dtmFruit := DTMFromString('78DA637CC2C0C0B09301054CCDDECFC00AA41' +
'981F83F1030DE03327630A00146241248BFC63407590D13887E0A' +
'24D61330E73990384040CD7D20B18F32F78000004453112A');
dtmGem := DTMFromString('78DA635CC4C0C050CE80027885AA187418191' +
'88088E13F1030CE04320A18D000231209A457018926026AE612A1' +
'66251176AD011235F8D50000A5010B82');
dtmArdougneBank := DTMFromString('78DA6394656060D06440014D759D0C3A8C0C0' +
'C40C4F01F081841F2B2103966B82A462412486B01092D026A7480' +
'84197E3500F65F0709');
Name2 := 'temp';
Name3 := 'temp';
Name4 := 'temp';
SetupSRL;
ScriptID := '395';
ClearDebug;
// activateclient;
DeclarePlayers;
if LoggedIn then Logout;
LoginPlayer;
end;
Procedure ScriptStart;
begin
Wait(10000);
ArrangeInv;
SetRun(True);
Wait(100 + Random(50));
SetChat('off', 2);
Wait(100 + Random(50));
FindPickHeadColor;
GameTab(4);
Wait(100 + Random(50));
MakeCompass('n');
HighestAngle;
Wait(100 + Random(50));
if (LogingTime > 0) then
MarkTime(RunStart);
end;
procedure Report;
Var
GoldExp, GemExp, TotalExp: Integer;
begin
Inc(LoadsT);
GoldExp := GoldOre * 65;
GemExp := GemsTotal * 65;
TotalExp := GoldExp + GemExp;
Writeln('|~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~');
Writeln('| Psychor ');
writeln('| Brimhaven Gold Miner Progress report ');
writeln('|~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~');
Writeln('| ');
writeln('| You banked ' + IntToStr(LoadsT) + ' loads');
writeln('| Mined ' + IntToStr(GoldOre) + ' Gold Ore');
writeln('| Mined ' + IntToStr(GemsTotal) + ' Gems');
writeln('| You gained a total of ' + IntToStr(TotalExp) + ' Mining Exp');
writeln('|~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~');
end;
Procedure TimedLogoutLogin;
begin
if ((timefrommark(Runstart)) >= ((LogingTime * 60000) + (Random(60000)))) then
begin
Logout;
Wait(600000 + Random(60000));
LoginPlayer;
MarkTime(Runstart);
end;
end;
{SLR function ChatsBlackText adjusted to blue text, needed in checkchat}
function ChatsBlueText: array of string;
var
I: Byte;
tpa: TPointArray;
begin
SetArrayLength(tpa, 9);
for I := 8 DownTo 1 do
tpa[i] := TextCoords(i);
SetArrayLength(Result, 9);
for I := 1 to 8 do
Result[I] := Trim(GetTextAtEx(tpa[i].x - 2, tpa[i].y - 2, 0, SmallChars, False,
False, 0, 1, 16711680, 80, False, tr_AllChars));
end;
{SLR function IsChatBlackTextAnyLine & LastChatter put together and
some modification. Should return False if the talkers name as been recorded before.
To avoid people continiously asking the same thing trying to catch you}
function CheckChat(ChatTxt1, ChatTxt2, ChatTxt3, ChatTxt4: string): Boolean;
var
a: Integer;
textP: TPoint;
TheLines: array of string;
I: Byte;
begin
Result := False;
TheLines := ChatsBlueText;
for I := 8 DownTo 1 do
if (Pos(ChatTxt1, TheLines[I]) <> 0) or
(Pos(ChatTxt2, TheLines[I]) <> 0) or
(Pos(ChatTxt3, TheLines[I]) <> 0) or
(Pos(ChatTxt4, TheLines[I]) <> 0) then
begin
textP := TextCoords(I);
Name1 := LowerCase(Trim(GetTextAtEx(textP.x - 2, textP.y - 2, 0, SmallChars, False, False, 0, 1,
0, 60, False, tr_allChars)));
a := Pos(':', Name1);
if (a <> 0) then
begin
Delete(Name1, a, a);
Wait(200 + Random(100));
if (not(Name1 = Name2)) and
(not(Name1 = Name3)) and
(not(Name1 = Name4)) then
begin
Name4 := Name3;
Name3 := Name2;
Name2 := Name1;
Result := True;
Exit;
end;
end;
end;
end;
function GroundColor: Integer; //FindFaladorRoadColor slightly adjusted
var
DColor, c, TX, TY: Integer;
begin
if (not (LoggedIn)) then
Exit;
while (c <= 100) do
begin
IncEx(c, 5);
if (FindBitmapToleranceIn(bmpDirtRoad, TX, TY, 600, 25, 680, 120, c))
then
begin
DColor := GetColor(TX, TY);
if (DColor > 2500000) and (DColor < 5500000) then
begin
Result := DColor;
// writeln('GroundColor = ' + IntToStr(DColor));
break;
end;
end;
end;
if (Result = 0) then
WriteLn('ERROR: GroundColor NOT Found');
end;
{Covered symbolfinder}
function FSymbol(Symbol: String; Times: Integer; Click: Boolean): Boolean;
var i, x1, y1: Integer;
begin
if (not (LoggedIn)) then
Exit;
repeat
begin
if (FindSymbol(x1, y1, (Symbol))) then
begin
if (Click) then
Mouse(x1, y1, 2, 2, true);
FFlag(0);
Result := True;
Exit;
end else
begin
wait(1000 + random(500));
Inc(i);
Writeln('Symbol not found');
Result := False;
end;
end;
until (i >= Times);
end;
function CountItemDtm(Dtm: Integer): Integer;
var
i, x, y: Integer;
TB: Tbox;
begin
if (not (LoggedIn)) then
Exit;
Result := 0; // Same thing as in Setup
GameTab(4);
for i := 1 to 28 do
begin
TB := InvBox(i);
if ExistsItem(i) then
if FindDtm(Dtm, x, y, TB.x1, TB.y1, TB.x2, TB.y2) then
Inc(Result);
end;
end;
procedure antiban;
begin
Case Random(5) Of
0 : HoverSkill('Mining', False);
1 : begin
GameTab(1+Random(12));
Wait(2000+Random(400));
GameTab(4);
end;
2 : RandomRClick;
3 : PickUpMouse;
4 : almostlogout;
end;
GameTab(4);
end;
{My plant random finder}
Function FindPlant: Boolean;
Begin
if (not (LoggedIn)) then
Exit;
if FindObjCustom(Plantx, Planty, ['lant', 'ick ', 'ange'], [8999], 5) then
begin
Plants := Plants + 1;
Result := True;
end;
end;
{My plant random solver}
Procedure HandlePlant;
Var
Planti: Integer;
Begin
repeat
If Not LoggedIn then
Break;
Wait(500 + random(100));
FindObjCustom(Plantx, Planty, ['lant', 'ick ', 'ange'], [8999], 5);
Wait(300 + Random(100));
Mouse(Plantx, Planty, 0, 0, False);
Wait(200 + Random(100));
ChooseOption('ick');
FFlag(0);
Wait(500 + random(100));
Planti := Planti + 1;
if (not(CountItemDtm(dtmFruit) >= 1)) then
Wait(900 + Random(200));
Until (CountItemDtm(dtmFruit) >= 1) or (Planti >= 5) or (FindFight);
// if (FindFight) then
// begin
// RunTo('N', True);
// Wait(15000 + random(5000));
// RunBack;
// end;
end;
Procedure FindRandoms;
Var
GemsBeforeRandom, GemsAfterRandom: Integer;
begin
if (not (LoggedIn)) then
Exit;
GemsBeforeRandom := CountItemDtm(dtmGem);
FindNormalRandoms;
GemsAfterRandom := CountItemDtm(dtmGem);
if (GemsAfterRandom > GemsBeforeRandom) then
GemRandom := 1;
if (FindPlant) then
HandlePlant;
if FindFight then
begin
RunTo('N', True);
Wait(15000 + random(5000));
RunBack;
If not(FSymbol('mining spot', 3, True)) then
begin
RadialWalk(FindRockColor, 270, 350, 50, 2, 2);
FFlag(0);
Wait(100 + Random(50));
end;
end;
end;
{will find the faery rings and use them to teleport to Zanaris}
Function UseRing: Boolean;
Var
fi2, Ringx, Ringy: Integer;
Begin
MouseSpeed := 8;
repeat
FindObjCustom(Ringx, Ringy, ['airy', 'ring', 'ry r'], [5005958, 6335109, 5466770], 5);
fi2 := fi2 + 1;
until (IsUpTextMulti('airy', 'ring', 'ry r')) or (fi2 >= 10)
if (IsUpTextMulti('airy', 'ring', 'ry r'))then
begin
Mouse(Ringx, Ringy, 0, 0, True);
FFlag(0);
Wait(4500 + Random(500));
Result := True;
end;
if not(GetMusic = 'Faerie') then
Result := False;
MouseSpeed := 10;
GameTab(4);
end;
Procedure BankToRing;
var
fi, fi2:Integer; //???????????????
Begin
if (not (LoggedIn)) or (PlayerSwitch = 1) then
Exit;
DialRing := 0;
fi := 0;
fi2 := 0;
if Random(5) = 1 then
antiban;
GColor := GroundColor;
RadialWalk(GColor, 130, 180, 55, 2, +2);
FFlag(0);
Wait(100 + Random(100));
Radialwalk(GColor, 140, 90, 60, 2, +2); // I prefer using loops for walking, it's safer, but thats just my opinion again.
FFlag(0);
Wait(100 + Random(100));
FSymbol('transportation', 5, True);
FFlag(0);
Wait(100 + Random(100));
end;
Function FindDialRing:Boolean;
var
fi:Integer;
Begin
if (not (LoggedIn)) then
Exit;
MouseSpeed := 8;
fi := 0;
repeat
FindObjCustom(cx, cy, ['se ', 'ring', 'ry r'], [1913843, 1320109, 4346107], 5);
Inc(fi);
until (Result) or (fi >= 5);
MouseSpeed := 10;
end;
Procedure OpenRing;
Begin
if (not (LoggedIn)) or (PlayerSwitch = 1) then
Exit;
FindDialRing;
if (DialRing >= 2) then
PlayerSwitch := 1;
if (not(IsUpTextMulti('se ', 'ring', 'ry r')))then
begin
case Random(3) of
0: Begin
Mouse(643, 112, 2, 2, True);
FFlag(0);
Wait(100 + Random(100));
end;
1: Begin
Mouse(655, 117, 3, 3, True);
FFlag(0);
Wait(100 + Random(100));
end;
2: Begin
Mouse(658, 114, 2, 2, True);
FFlag(0);
Wait(100 + Random(100));
end;
end;
FindDialRing;
end;
if (IsUpTextMulti('airy', 'ring', 'ry r'))then
begin
Mouse(cx, cy, 0, 0, True);
FFlag(0);
Wait(100 + Random(100));
end;
DialRing := DialRing + 1;
end;
Procedure ClickWhistle;
Var
Whistlex, Whistley: Integer;
begin
if (not (LoggedIn)) then
Exit;
GameTab(4);
Wait(100 + Random(100));
FindDTM(dtmWhistle, Whistlex, Whistley, 552, 202, 732, 460);
Mouse(Whistlex, Whistley, 2, 2, True);
Wait(4500 + Random(500));
end;
Procedure DialToLand;
Var
di1, di2, di3: Integer;
begin
di1 := 0;
di2 := 0;
di3 := 0;
if (not (LoggedIn)) or (PlayerSwitch = 1) then
Exit;
Wait(500 + Random(200));
MMouse(93, 176, 5, 5);
Wait(100 + Random(100));
if (not(IsUpTextMulti('otate', 'kwise', 'te-cl'))) then
OpenRing;
if IsUpTextMulti('otate', 'kwise', 'te-cl') then
begin
repeat
MouseBox(65, 155, 115, 210, True);
Wait(2200 + Random(300));
Inc(di1);
until (di1 = 3)
end;
begin
repeat
Wait(200 + Random(100));
MouseBox(242, 155, 280, 210, True);
Wait(2200 + Random(300));
Inc(di2);
until (di2 = 3);
end;
begin
repeat
Wait(200 + Random(100));
MouseBox(410, 155, 445, 210, True);
Wait(2200 + Random(300));
Inc(di3);
until (di3 = 2);
end;
MouseBox(188, 268, 332, 301, True);
Wait(4500 + Random(500));
end;
Procedure LandToOutpost;
begin
case (GetMusic) of
'Miles Away': ClickWhistle;
'Faerie': begin
Wait(1000 + Random(500));
if not(GetMusic = 'Miles Away') then
begin
DialRing := 0;
OpenRing;
DialToLand;
if not(GetMusic = 'Miles Away') then
PlayerSwitch := 1;
end;
ClickWhistle;
end
else
begin
Writeln('Oops, misdialed........Trying again');
DialRing := 0;
UseRing;
OpenRing;
DialToLand;
if not(GetMusic = 'Miles Away') then
PlayerSwitch := 1;
ClickWhistle;
end;
end;
end;
Procedure OutpostToMine;
Begin
if (not (LoggedIn)) or (PlayerSwitch = 1) then
Exit;
Wait(100 + Random(100));
If not(FSymbol('mining spot', 3, True)) then
begin
RadialWalk(FindRockColor, 180, 240, 60, 2, 2);
FFlag(0);
Wait(100 + Random(50));
end;
FFlag(0);
Wait(100 + Random(100));
end;
Function LostRock: Boolean;
var
x, y: Integer;
begin
Result := False;
if (FindColorTolerance(x, y, 2829102, Rockx - 5, Rocky - 5, Rockx + 5, Rocky + 5, 3)) or
(FindColorTolerance(x, y, 5461082, Rockx - 5, Rocky - 5, Rockx + 5, Rocky + 5, 3)) or
(FindColorTolerance(x, y, 5132116, Rockx - 5, Rocky - 5, Rockx + 5, Rocky + 5, 3)) then
Result := True;
end;
{The checkchat has been the latest addition and hasn't been tested yet}
Procedure WaitUntilMined;
Var
Slevel, i: Integer;
begin
if (not (LoggedIn)) then
Exit;
if FindBlackChatMessage('vailable') then
Exit;
Repeat
If (Not (LoggedIn)) or (InvFull) or (LostRock) then
Break;
if (CheckChat('Mng lvl', 'ining lvl', 'ining level', 'Mng level')) then
begin
Slevel := GetSkillLevel('mining');
Wait(200 + Random(50));
GameTab(4);
SendText(IntToStr(Slevel));
Wait(200 + Random(50));
SendText(Chr(13));
end;
NewTotal := CountItemDtm(dtmGold);
Inc(i);
If (not(NewTotal > LastTotal)) then
Wait(500 + Random(200));
until (NewTotal > LastTotal) or (i >= 20);
if (NewTotal > LastTotal) then
begin
LastTotal := NewTotal;
MiningRock := 0;
end;
end;
{This one can cause me to walk around abit, have to find a better way to do this}
Procedure UpdateRockCord;
Var
ui, fi: Integer;
begin
If Not LoggedIn then
exit;
repeat
If (Not (LoggedIn)) or (InvFull) then
Break;
fi := 0;
if FindObjCustom(Rockx, Rocky, ['ock ', 'ine '], [4565694, 4631744], 3) then
begin
if (GasCheck(Rockx, Rocky)) then
begin
Mouse(650, 83, 1, 1, True);
Wait(15000 + Random(2000));
end;
Mouse(Rockx, Rocky, 0, 0, True);
If (FlagPresent) then
begin
FFlag(0);
Wait(500 + Random(200));
FindRandoms;
fi := 1;
Inc(ui);
end;
if (GasCheck(Rockx, Rocky)) then
begin
Mouse(650, 83, 1, 1, True);
Wait(15000 + Random(2000));
end;
end;
until (fi = 0) or (ui >= 6)
end;
Procedure GoldMining;
Var
MiningTime: Integer;
begin
If Not LoggedIn or (PlayerSwitch = 1) then exit;
MarkTime(MiningTime);
repeat
If Not LoggedIn then
Break;
if FindObjCustom(Rockx, Rocky, ['ock ', 'ine '], [4565694, 4631744], 3) then
begin
if (GasCheck(Rockx, Rocky)) then
Wait(15000 + Random(2000));
Mouse(Rockx, Rocky, 0, 0, True);
If (FlagPresent) then
begin
FFlag(0);
Wait(500 + Random(200));
UpdateRockCord;
end;
if FindBlackChatMessage('vailable') then
Begin
MiningRock := MiningRock + 1;
Wait(2000 + Random(500));
if (MiningRock >= 3) then
Begin
Mouse(652, 73, 2, 2, True);
FFlag(0);
Wait(5000 + Random(500));
MiningRock := 0;
end;
end;
if (GasCheck(Rockx, Rocky)) then
begin
Mouse(650, 83, 1, 1, True);
Wait(15000 + Random(2000));
end;
FindRandoms;
Wait(200 + Random(50));
if (FindGas(Rockx, Rocky)) then
begin
Mouse(650, 83, 1, 1, True);
Wait(15000 + Random(2000));
end;
FindPick;
Wait(100 + Random(50));
WaitUntilMined;
end else
Wait(2000 + Random(500));
if ((timefrommark(MiningTime)) >= (600000 + Random(60000))) then
Exit;
until (InvFull);
end;
function GrasColor: Integer; //FindFaladorRoadColor slightly adjusted
var
DColor, c, TX, TY: Integer;
begin
while (c <= 100) do
begin
If Not LoggedIn then
exit;
IncEx(c, 5);
if (FindBitmapToleranceIn(bmpGrasRoad, TX, TY, 630, 30, 700, 80, c))
then
begin
DColor := GetColor(TX, TY);
if (DColor > 1000000) and (DColor < 3000000) then
begin
Result := DColor;
// writeln('GrasColor = ' + IntToStr(DColor));
break;
end;
end;
end;
if (Result = 0) then
WriteLn('ERROR: GrasColor NOT Found');
end;
{Abit onorthodox, considering there's no real visual mark on the minimap for this spot
although i'm going to try it with a DDTM one of next days}
Procedure MineToOutpost;
Var
nfi, mi: Integer;
begin
if (not (LoggedIn)) or (PlayerSwitch = 1) then
Exit;
MakeCompass('n');
RadialWalk(GrasColor, 10, 80, 70, +2, -4);
FFlag(0);
Wait(100 + Random(100));
ClickWhistle;
if not(GetMusic = 'Miles Away') then
begin
repeat
nfi := 0;
repeat
Mouse(645 + nfi, 73, 2, 2, True);
wait(20 + Random(10));
if (not(FlagPresent)) then
Inc(nfi);
until (FlagPresent) or (nfi >= 5);
FFlag(0);
Wait(200 + Random(100));
ClickWhistle;
Inc(mi);
Until (Getmusic = 'Miles Away') or (mi >= 5);
If (mi >= 5) then
PlayerSwitch := 1;
end;
GameTab(4);
Wait(100 + Random(100));
end;
Procedure OutpostToZanaris;
begin
if (not (LoggedIn)) or (PlayerSwitch = 1) then
Exit;
Radialwalk(FindWaterColor, 350, 270, 70, 2, 2);
Wait(1500 + Random(100));
FFlag(0);
Wait(100 + Random(100));
if (not(FSymbol('transportation', 2, True))) then
begin
case random(3) of
0: Begin
Mouse(588, 67, 2, 2, True);
FFlag(0);
Wait(100 + Random(100));
FSymbol('transportation', 5, True);
end;
1: Begin
Mouse(611, 61, 2, 2, True);
FFlag(0);
Wait(100 + Random(100));
FSymbol('transportation', 5, True);
end;
2: Begin
Mouse(590, 60, 2, 2, True);
FFlag(0);
Wait(100 + Random(100));
FSymbol('transportation', 5, True);
end;
end;
end;
Wait(1500 + Random(100));
FFlag(0);
Wait(100 + Random(100));
end;
Procedure RingToBank;
Begin
if (not (LoggedIn)) or (PlayerSwitch = 1) then
Exit;
if (not(UseRing)) then
begin
MouseBox(635, 93, 643, 101, True);
FFlag(0);
Wait(200 + Random(50));
Usering;
if not(GetMusic = 'Faerie') then
PlayerSwitch := 1;
end;
GColor := GroundColor;
RadialWalk(GColor, 300, 350, 65, 2, 2);
Wait(200 + Random(100));
FFlag(0);
Wait(100 + Random(100));
RadialWalk(GColor, 330, 270, 65, 2, 2);
Wait(200 + Random(100));
FFlag(0);
Wait(100 + Random(100));
If (not(FSymbol('bank', 5, True))) then
begin
RadialWalk(GColor, 320, 280, 45, 2, 2);
FFlag(0);
Wait(100 + Random(100));
end;
end;
Procedure BankOpenZanaris;
Var
Bankx, Banky, bi: Integer;
Begin
if (not (LoggedIn)) or (PlayerSwitch = 1) then
Exit;
repeat
if FindObjCustom(Bankx, Banky, ['lk-to', 'anker'], [4803152, 13754336], 5) then
begin
Inc(bi);
Mouse(Bankx, Banky, 0, 0, False);
Wait(300 + Random(100));
ChooseOption('ank ');
FFlag(0);
Wait(1200 + Random(300));
if Pinscreen then
InPin(code);
end;
Wait(300 + Random(50));
if (bi = 5) then
begin
Mouse(630, 100, 2, 2, True);
FFlag(0);
Wait(200 + Random(50));
end;
if (bi >= 10) then
PlayerSwitch := 1;
until (BankScreen) or (bi >= 10);
Wait(200 + Random(50));
end;
Procedure BankIt;
Begin
GemsTotal := GemsTotal + (CountItemDtm(dtmGem)) - (GemRandom);
GoldOre := GoldOre + (CountItemDtm(dtmGold));
ReportVars[1]:= CountItemDtm(dtmGold);
ReportVars[2]:= CountItemDtm(dtmGem) - (GemRandom);
GemRandom := 0;
Case BankingSpot of
0: begin
ReportVars[0]:= 1;
Deposit(3, 28, 2);
end;
1: begin
FixBank;
ReportVars[3]:= 1;
Deposit(2, 28, 2);
end;
end;
Wait(200 + Random(50));
CloseBank;
Wait(300 + Random(100));
FindRandoms;
Loads := Loads + 1;
NewTotal := 0;
LastTotal := 0;
Banks := Banks + 1;
SRLRandomsReport;
Wait(200 + Random(50));
Report;
if (LogingTime > 0) then
TimedLogoutLogin;
end;
Procedure BankToDocks;
begin
if (not (LoggedIn)) or (PlayerSwitch = 1) then
Exit;
FSymbol('water', 5, True);
Wait(2500 + Random(200));
FFlag(0);
Wait(200 + Random(50));
RadialWalk(FindWaterColor, 120, 180, 40, 2, 2);
Wait(1500 + Random(200));
FFlag(0);
Wait(200 + Random(50));
FSymbol('transportation', 5, True);
FFlag(0);
Wait(200 + Random(50));
end;
Function LeaveShip:Boolean;
Var
Shipx, Shipy, Shipi: Integer;
Begin
if (not (LoggedIn)) or (PlayerSwitch = 1) then
Exit;
repeat
If Not LoggedIn then
Break;
Inc(Shipi);
Wait(200 + Random(50));
FindObjCustom(Shipx, Shipy, ['angp', 'lank'], [3496050, 3759480], 3);
until (Result) or (Shipi >= 3)
if (Result) then
begin
Mouse(Shipx, Shipy, 2, 2, True);
Wait(6500 + Random(500));
FFlag(0);
end;
end;
Procedure BoatToBrimhaven;
Var
Capi, Capx, Capy: Integer;
begin
if (not (LoggedIn)) or (PlayerSwitch = 1) then
Exit;
repeat
If Not LoggedIn then
Break;
Wait(500 + Random(100));
if FindObjCustom(Capx, Capy, ['apta', 'arna'], [7490574, 9001486], 5) then
begin
Mouse(Capx, Capy, 0, 0, False);
Wait(100 + Random(50));
if (ChooseOption('ay-')) then
begin
FFlag(0);
Wait(6500 + Random(500));
LeaveShip;
end;
Inc(Capi);
end;
until (not(GetMusic = 'Baroque')) or (Capi >= 10)
Gametab(4);
end;
Procedure DocksToMine;
Var
Walk: Integer;
Begin
if (not (LoggedIn)) or (PlayerSwitch = 1) then
Exit;
RadialWalk(FindWaterColor, 180, 250, 60, 2, 2);
Wait(2500 + Random(500));
FFlag(0);
Wait(200 + Random(50));
For Walk := 1 to 4 do
begin
RadialWalk(FindWaterColor, 220, 310, 55, 2, 2);
Wait(3000 + Random(500));
FFlag(0);
Wait(200 + Random(50));
end;
RadialWalk(FindWaterColor, 350, 450, 55, 2, 2);
Wait(3500 + Random(500));
FFlag(0);
Wait(200 + Random(50));
If not(FSymbol('mining spot', 3, True)) then
begin
RadialWalk(FindRockColor, 350, 40, 60, 2, 2);
FFlag(0);
Wait(100 + Random(50));
end;
FFlag(0);
Wait(200 + Random(100));
end;
Procedure MineToDocks;
Var
Walk: Integer;
begin
if (not (LoggedIn)) or (PlayerSwitch = 1) then
Exit;
SetRun(False);
Gametab(4);
For Walk := 1 to 2 do
begin
RadialWalk(FindWaterColor, 230, 180, 50, 2, 2);
Wait(3500 + Random(500));
FFlag(0);
Wait(200 + Random(50));
end;
For Walk := 1 to 4 do
begin
RadialWalk(FindWaterColor, 120, 20, 50, 2, 2);
Wait(2500 + Random(500));
FFlag(0);
Wait(200 + Random(50));
end;
end;
Procedure BoatToArdougne;
Var
Officeri, Officerx, Officery: Integer;
begin
if (not (LoggedIn)) or (PlayerSwitch = 1) then
Exit;
repeat
If Not LoggedIn then
Break;
Wait(500 + Random(100));
if FindObjCustom(Officerx, Officery, ['usto', 'fice'], [7684931, 6699578], 5) then
begin
Mouse(Officerx, Officery, 0, 0, False);
Wait(200 + Random(50));
if (ChooseOption('ay-')) then
begin
FFlag(0);
Wait(6500 + Random(500));
LeaveShip;
end;
Inc(Officeri);
end;
until (not(GetMusic = 'Jolly R')) or (Officeri >= 10)
GameTab(4);
end;
Procedure DocksToBank;
Var
x, y, ArdougneBank: Integer;
begin
if (not (LoggedIn)) or (PlayerSwitch = 1) then
Exit;
MakeCompass('n');
Fsymbol('transportation', 10, True);
FFlag(0);
Wait(200 + Random(50));
RadialRoadWalk(FindRoadColor, 270, 315, 60, 2, 2);
Wait(1500 + Random(500));
FFlag(0);
Wait(200 + Random(50));
Fsymbol('water', 5, True);
FFlag(0);
Wait(200 + Random(50));
if (DTMRotated(Ardougnebank, x, y, MMx1, MMy1, MMx2, MMy2)) then
begin
Mouse(x, y, 2, 2, True);
FFlag(0);
Wait(200 + random(50));
end;
OpenBankGlass('vwb', False, False);
if (Pinscreen) then
InPin(code);
end;
begin
Setup;
ScriptStart;
repeat
If not loggedin then
nextplayer(false);
Case BankingSpot of
0: Begin
BankToRing;
OpenRing;
DialToLand;
LandToOutpost;
OutpostToMine;
GoldMining;
MineToOutpost;
OutpostToZanaris;
RingToBank;
BankOpenZanaris;
BankIt;
end;
1: Begin
BankToDocks;
BoatToBrimhaven;
DocksToMine;
GoldMining;
MineToDocks;
BoatToArdougne;
DocksToBank;
BankIt;
end;
end;
if (Loads >= LoadsTotal) or (PlayerSwitch = 1) then
begin
NextPlayer(True);
ScriptStart;
Loads := 0;
PlayerSwitch := 0;
end;
until (False);
end.