Log in

View Full Version : im total lost



dkosciu
08-27-2007, 04:00 PM
Hi its just me, the resident total nooblet and im lost as hell when trying to use any scripts for scar. recently ive tried to use this script and cant get it to work. usualy it just goes to rs window and dose nothing. can any one give me like a step by step on how to use. thanks

program RimmingtonAutoMinerV0_98;
{.include SRL/SRL.scar}
{.include SRL/SRL/skill/Mining.scar}
{.include SRL/SRL/extended/xAutoTalk.scar}
{.include SRL/SRL/extended/xAntiBan.scar}
{.include SRL/SRL/extended/xInventory.scar}

{~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~}
{~~~~~~~~~~~~~~~~~~~~~~~~~~~~Introduction~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~}
{~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~}

{About Me:
I just recently got into autoing, first stumbling upon Nexus/iBot/whatever
it is. I didn't really like the community, or the program all that much.
From there I somehow stumbled upon SCAR and SRL. I didn't expect to be
active in the community, or autoing at all for that matter, hence my
username being "NewToAutoing". I didn't really put much thought into it,
lol. Anyway, I started learning how to script and really enjoyed it, so
here I am, with my first (real) script.}

{About This Script:
This script started off as a powerminer which was technically my second
script. My first was an autologin from desktop, lol. Anyway, I kept trying
to make it better, fix it, and so on, with the longish-term goal of making it
bank eventually. This script is the result.}

{DESCRIPTION:
This script will mine copper, tin, iron, or gold (depending on
which you select) at the Rimmington mine. It will walk to Falador
East Bank, and store all the ores/other random junk you acquire whilst
mining. It will then walk back to the mine and repeat the cycle.}

{INSTRUCTIONS:
You can start the script at either Falador East Bank or the Rimmington
mine. You must have a pickaxe equipped or in your inventory (obviously).
You only need to set up lines 70,103, and 143-189. Explanations
are at each of the sections you must fill out.}

{~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~}
{~~~~~~~~~~~~~~~~~~~~~~~Variables and Constants~~~~~~~~~~~~~~~~~~~~~~}
{~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~}

var
{~~~~~~~~~~~~~~~~~~~~Regular Script Variables~~~~~~~~~~~~~~~~~~~~~~~~}
OreDTM,GemDTM,TokenDTM,ClayDTM,WhichDTM,MainDTM,MM Bankers,MMBankersDTM,
MMIronRocks,MMTinRocks,MMCopperRocks,MMGoldRocks,M MClayRocks,WhichMMBMP,
RockColor1,RockColor2,RockColor3,MMRockColor,TheOt herColor,TheColor,
TimesBanked,OresMined,GemsMined,TokensObtained,Wai tTime,Tries,
Searches,ScrewUps,RoadScrewUps,BankAttempts1,BankA ttempts2,OtherBankAttempts1,
OtherBankAttempts2,SplitSearches: Integer;
DidRandomHappen,BankersFound,BankFound: Boolean;
RockText,RockText2: string;
{~~~~~~~~~~~~~~~~~~~~~~~Dynamic DTM Variables~~~~~~~~~~~~~~~~~~~~~~~~}
CopperDTMSubPoints: array[0..4] of TDTMPointDef;
TinDTMSubPoints: array[0..3] of TDTMPointDef;
IronDTMSubPoints: array[0..3] of TDTMPointDef;
GoldDTMSubPoints: array[0..3] of TDTMPointDef;
ClayDTMSubPoints: array[0..4] of TDTMPointDef;
BankDTMSubPoints: array[0..5] of TDTMPointDef;
RoadDTMSubPoints: array[0..2] of TDTMPointDef;
FallyGateDTMSubPoints: array[0..3] of TDTMPointDef;
CopperCGMainPoint,TinCGMainPoint,IronCGMainPoint,G oldCGMainPoint,ClayCGMainPoint,
RoadCGMainPoint,FallyGateCGMainPoint,BankCGMainPoi nt: TDTMPointDef;
CopperRockTDTM,TinRockTDTM,IronRockTDTM,GoldRockTD TM,ClayRockTDTM,
RoadTDTM,FallyGateTDTM,BankSplitTDTM: TDTM;
CopperRockDTM,TInRockDTM,IronRockDTM,GoldRockDTM,C layRockDTM,WhichMMDTM,
RoadSplitDTM,FallyGateDTM,BankSplitDTM: Integer;
WhichAngle: Extended;

const
{~~~~~~~~~~~~~~~~~~~~~Regular Script Constants~~~~~~~~~~~~~~~~~~~~~~~}
AmountOfOres = 0; //Amount of ores the script should end at
RunDirec = 'N'; //North,South,East,West. No need to change.
Version = 'V0.98';
{~~~~~~~~~~~~~~~~~~~~~~Dynamic DTM Constants~~~~~~~~~~~~~~~~~~~~~~~~~}
Tolerance = 1;
AreaSize = 1;
AreaShape = 0;

{~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~}
{~~~~~~~~~~~~~~~~~~~~Rockcolors, no need to change~~~~~~~~~~~~~~~~~~~}
{~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~}

CopperColor1 = 6724073;
CopperColor2 = 7577834;
CopperColor3 = 5146327;
TinColor1 = 10658478;
TinColor2 = 10921649;
TinColor3 = 8750479;
IronColor1 = 2898528;
IronColor2 = 2240332;
IronColor3 = 1778233;
GoldColor1 = 1952504;
GoldColor2 = 2015209;
GoldColor3 = 1817317;
ClayColor1 = 8435411;
ClayColor2 = 7581647;
ClayColor3 = 5273999;

{~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~}
{~~~~~~~~~~~~~~~~~~~~~~~~Set up players below~~~~~~~~~~~~~~~~~~~~~~~~}
{~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~}
procedure DeclarePlayers;
begin
{Don't change HowManyPlayers unless you add or delete players from
the script below. If change it you'll get errors. Emphasis on the
"Active or not."}
HowManyPlayers := 6; //Number of PLAYERS. Active or not.
NumberOfPlayers(HowManyPlayers);
CurrentPlayer := 0; //Player to start on.

{~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~}
{
For .Name put in your screenname/username
For .Pass put in your password
For .Nick put in your nickname. Your nickname is composed of 3-5
noncapital letters from the middle of your screenname, without any
spaces or numbers.
Options for .Loc are:
"Rimmington" meaning the Rimmington Mine
and
"Falador" meaning Falador East Bank
Putting in anything else or mispelling anything will result
in errors.
Once again, only put "Rimmington" or "Falador", without the
"s, in between the usual 's.
Options for .String1 are "tin" "copper" "iron" "gold" and "clay"
Place the one you choose between the usual 's, do not use "s.
For .Integer1 put in the amount of ores you want that individual
account to mine before switching to the next account.
For .Active it simply means whether or not you are using the account.
The default is player 0 is set to true, the rest are set to false. If you
use more than 1 account you must set the player you use to true. If you are
using only 1 account simply input the information for player 0 and do
not touch anything else.
The following is an example of how to fill out the form.
Do NOT edit this form, as it will have no effect on the script.
Players[0].Name := 'screenname';
Players[0].Pass := 'password';
Players[0].Nick := 'eenn';
Players[0].Loc := 'rimmington';
Players[0].String1 := 'iron';
Players[0].Integer1 := 100
Players[0].Active := True;
}
{~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~}

Players[0].Name := 'NewToAutoings'; //Screenname
Players[0].Pass := 'RimmingtonAutoMiner'; //Password
Players[0].Nick := 'V0.98'; //Nickname
Players[0].Loc := '~~~'; //Current Location
Players[0].String1 := '~~~'; //Rock to mine
Players[0].Integer1 := 0; //Amount of loads to mine(for this account)
Players[0].Active := True; //Are you using this account?

Players[1].Name := 'NewToAutoings';
Players[1].Pass := 'RimmingtonAutoMiner';
Players[1].Nick := 'V0.98';
Players[1].Loc := '~~~';
Players[1].String1 := '~~~';
Players[1].Integer1 := 0;
Players[1].Active := False; //Set to True to use this player

Players[2].Name := 'UserName';
Players[2].Pass := 'Password';
Players[2].Nick := '3-4 letters of UserName';
Players[2].Loc := '~~~';
Players[2].String1 := '~~~';
Players[2].Integer1 := 0;
Players[2].Active := False; //Set to True to use this player

Players[3].Name := 'UserName';
Players[3].Pass := 'Password';
Players[3].Nick := '3-4 letters of UserName';
Players[3].Loc := '~~~';
Players[3].String1 := '~~~';
Players[3].Integer1 := 0;
Players[3].Active := False; //Set to True to use this player

Players[4].Name := 'UserName';
Players[4].Pass := 'Password';
Players[4].Nick := '3-4 letters of UserName';
Players[4].Loc := '~~~';
Players[4].String1 := '~~~';
Players[4].Integer1 := 0;
Players[4].Active := False; //Set to True to use this player

Players[5].Name := 'UserName';
Players[5].Pass := 'Password';
Players[5].Nick := '3-4 letters of UserName';
Players[5].Loc := '~~~';
Players[5].String1 := '~~~';
Players[5].Integer1 := 0;
Players[5].Active := False; //Set this to True to use this player

NickNameBMP := CreateBitmapMaskFromText(Players[CurrentPlayer].Nick, UpChars);
end;

{~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~}
{~~~Don't touch any of the below unless you know what you're doing~~~}
{~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~}

{~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~}
{~~~~~~~~~~~~~~~~~~~~~~~~~~~DYNAMIC DTMS~~~~~~~~~~~~~~~~~~~~~~~~~~~~~}
{~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~}

procedure CheckRockColor;
begin
TheColor := FindRoadColor;
if (MMRockColor = 4675162) then
MMRockColor := 6051154;
if (MMRockColor = 6974579) then
MMRockColor := 6973025;
if ((MMRockColor = TheColor) or
(MMRockColor = 6910053) or
(MMRockColor = 5004895) or
(MMRockColor = 4741724) or
(MMRockColor = 6643553) or
(MMRockColor = 6709088) or
(MMRockColor = 4345939) or
(MMRockColor = 4675162))then
begin
repeat
MMRockColor := FindRockColor;
Wait(2000+random(1000));
ScrewUps := ScrewUps + 1;
Status('FindRockColor screwed up ' + IntToStr(ScrewUps) + ' time(s).');
until ((not(MMRockColor = TheColor)) and
(not(MMRockColor = 6910053)) and
(not(MMRockColor = 5004895)) and
(not(MMRockColor = 4741724)) and
(not(MMRockColor = 6643553)) and
(not(MMRockColor = 6709088)) and
(not(MMRockColor = 4345939)) and
(not(MMRockColor = 4675162))) or
(ScrewUps = 5) or
(ScrewUps = 10) or
(ScrewUps = 15) or
(ScrewUps = 20)
if (ScrewUps >= 20) then
begin
Status('FindRockColor is screwed up.');
Writeln('FindRockColor is screwed up. Account is lost.');
LogOut;
NextPlayer(False);
ScrewUps := 0;
end;
if (ScrewUps < 20) and
(not(ScrewUps = 15)) and
(not(ScrewUps = 10)) and
(not(ScrewUps = 5)) then
begin
Status('Corrected rock color');
ScrewUps := 0;
end;
end;
end;

function IsRockColorCorrect: Boolean;
begin
Result := False;
if ((MMRockColor = TheColor) or
(MMRockColor = 6910053) or
(MMRockColor = 5004895) or
(MMRockColor = 4741724) or
(MMRockColor = 6643553) or
(MMRockColor = 6709088) or
(MMRockColor = 4938846) or
(MMRockColor = 4345939) or
(MMRockColor = 5135458)) then
begin
repeat
MMRockColor := FindRockColor;
Wait(2000+random(1000));
ScrewUps := ScrewUps + 1;
Status('FindRockColor screwed up ' + IntToStr(ScrewUps) + ' time(s).');
until ((not(MMRockColor = TheColor)) and
(not(MMRockColor = 6910053)) and
(not(MMRockColor = 5004895)) and
(not(MMRockColor = 4741724)) and
(not(MMRockColor = 6643553)) and
(not(MMRockColor = 6709088)) and
(not(MMRockColor = 4938846)) and
(not(MMRockColor = 4345939)) and
(not(MMRockColor = 5135458))) or
(ScrewUps = 5) or
(ScrewUps = 10) or
(ScrewUps = 15) or
(ScrewUps = 20)
if (ScrewUps >= 20) then
begin
Status('FindRockColor is screwed up.');
Writeln('FindRockColor is screwed up. Account is lost.');
LogOut;
NextPlayer(False);
ScrewUps := 0;
Exit;
end;
if (ScrewUps < 20) and
(not(ScrewUps = 15)) and
(not(ScrewUps = 10)) and
(not(ScrewUps = 5)) then
begin
Result := True;
Status('Corrected rock color');
ScrewUps := 0;
end;
end;
end;

procedure SetCopperRockDTM;
begin
CopperCGMainPoint.x:=49;
CopperCGMainPoint.y:=15;
CopperCGMainPoint.areasize:=1;
CopperCGMainPoint.areashape:=0;
CopperCGMainPoint.color:=0;
CopperCGMainPoint.tolerance:=255;

CopperDTMSubPoints[0].x:=37;
CopperDTMSubPoints[0].y:=13;
CopperDTMSubPoints[0].areasize:=AreaSize;
CopperDTMSubPoints[0].areashape:=AreaShape;
CopperDTMSubPoints[0].color:=MMRockColor;
CopperDTMSubPoints[0].tolerance:=Tolerance;

CopperDTMSubPoints[1].x:=11;
CopperDTMSubPoints[1].y:=36;
CopperDTMSubPoints[1].areasize:=AreaSize;
CopperDTMSubPoints[1].areashape:=AreaShape;
CopperDTMSubPoints[1].color:=MMRockColor;
CopperDTMSubPoints[1].tolerance:=Tolerance;

CopperDTMSubPoints[2].x:=22;
CopperDTMSubPoints[2].y:=55;
CopperDTMSubPoints[2].areasize:=AreaSize;
CopperDTMSubPoints[2].areashape:=AreaShape;
CopperDTMSubPoints[2].color:=MMRockColor;
CopperDTMSubPoints[2].tolerance:=Tolerance;

CopperDTMSubPoints[3].x:=12;
CopperDTMSubPoints[3].y:=44;
CopperDTMSubPoints[3].areasize:=AreaSize;
CopperDTMSubPoints[3].areashape:=AreaShape;
CopperDTMSubPoints[3].color:=MMRockColor;
CopperDTMSubPoints[3].tolerance:=Tolerance;

CopperDTMSubPoints[4].x:=7;
CopperDTMSubPoints[4].y:=48;
CopperDTMSubPoints[4].areasize:=AreaSize;
CopperDTMSubPoints[4].areashape:=AreaShape;
CopperDTMSubPoints[4].color:=MMRockColor;
CopperDTMSubPoints[4].tolerance:=Tolerance;

CopperRockTDTM.MainPoint := CopperCGMainPoint;
CopperRockTDTM.SubPoints := CopperDTMSubPoints;
CopperRockDTM := AddDTM(CopperRockTDTM);
end;

procedure SetTinRockDTM;
begin
TinCGMainPoint.x:=24;
TinCGMainPoint.y:=8;
TinCGMainPoint.areasize:=1;
TinCGMainPoint.areashape:=0;
TinCGMainPoint.color:=0;
TinCGMainPoint.tolerance:=255;

TinDTMSubPoints[0].x:=17;
TinDTMSubPoints[0].y:=6;
TinDTMSubPoints[0].areasize:=AreaSize;
TinDTMSubPoints[0].areashape:=AreaShape;
TinDTMSubPoints[0].color:=MMRockColor;
TinDTMSubPoints[0].tolerance:=Tolerance;

TinDTMSubPoints[1].x:=26;
TinDTMSubPoints[1].y:=14;
TinDTMSubPoints[1].areasize:=AreaSize;
TinDTMSubPoints[1].areashape:=AreaShape;
TinDTMSubPoints[1].color:=MMRockColor;
TinDTMSubPoints[1].tolerance:=Tolerance;

TinDTMSubPoints[2].x:=11;
TinDTMSubPoints[2].y:=18;
TinDTMSubPoints[2].areasize:=AreaSize;
TinDTMSubPoints[2].areashape:=AreaShape;
TinDTMSubPoints[2].color:=MMRockColor;
TinDTMSubPoints[2].tolerance:=Tolerance;

TinDTMSubPoints[3].x:=7;
TinDTMSubPoints[3].y:=24;
TinDTMSubPoints[3].areasize:=AreaSize;
TinDTMSubPoints[3].areashape:=AreaShape;
TinDTMSubPoints[3].color:=MMRockColor;
TinDTMSubPoints[3].tolerance:=Tolerance;

TinRockTDTM.MainPoint := TinCGMainPoint;
TinRockTDTM.SubPoints := TinDTMSubPoints;
TinRockDTM := AddDTM(TinRockTDTM);
end;

procedure SetIronRockDTM;
begin
IronCGMainPoint.x:=5;
IronCGMainPoint.y:=11;
IronCGMainPoint.areasize:=1;
IronCGMainPoint.areashape:=0;
IronCGMainPoint.color:=0;
IronCGMainPoint.tolerance:=255;

IronDTMSubPoints[0].x:=7;
IronDTMSubPoints[0].y:=19;
IronDTMSubPoints[0].areasize:=AreaSize;
IronDTMSubPoints[0].areashape:=AreaShape;
IronDTMSubPoints[0].color:=MMRockColor;
IronDTMSubPoints[0].tolerance:=Tolerance;

IronDTMSubPoints[1].x:=12;
IronDTMSubPoints[1].y:=14;
IronDTMSubPoints[1].areasize:=AreaSize;
IronDTMSubPoints[1].areashape:=AreaShape;
IronDTMSubPoints[1].color:=MMRockColor;
IronDTMSubPoints[1].tolerance:=Tolerance;

IronDTMSubPoints[2].x:=12;
IronDTMSubPoints[2].y:=6;
IronDTMSubPoints[2].areasize:=AreaSize;
IronDTMSubPoints[2].areashape:=AreaShape;
IronDTMSubPoints[2].color:=MMRockColor;
IronDTMSubPoints[2].tolerance:=Tolerance;

IronDTMSubPoints[3].x:=20;
IronDTMSubPoints[3].y:=25;
IronDTMSubPoints[3].areasize:=AreaSize;
IronDTMSubPoints[3].areashape:=AreaShape;
IronDTMSubPoints[3].color:=MMRockColor;
IronDTMSubPoints[3].tolerance:=Tolerance;

IronRockTDTM.MainPoint := IronCGMainPoint;
IronRockTDTM.SubPoints := IronDTMSubPoints;
IronRockDTM := AddDTM(IronRockTDTM);
end;

procedure SetGoldRockDTM;
begin
GoldCGMainPoint.x:=15;
GoldCGMainPoint.y:=6;
GoldCGMainPoint.areasize:=1;
GoldCGMainPoint.areashape:=0;
GoldCGMainPoint.color:=0;
GoldCGMainPoint.tolerance:=255;

GoldDTMSubPoints[0].x:=16;
GoldDTMSubPoints[0].y:=12;
GoldDTMSubPoints[0].areasize:=AreaSize;
GoldDTMSubPoints[0].areashape:=AreaShape;
GoldDTMSubPoints[0].color:=MMRockColor;
GoldDTMSubPoints[0].tolerance:=Tolerance;

GoldDTMSubPoints[1].x:=8;
GoldDTMSubPoints[1].y:=6;
GoldDTMSubPoints[1].areasize:=AreaSize;
GoldDTMSubPoints[1].areashape:=AreaShape;
GoldDTMSubPoints[1].color:=MMRockColor;
GoldDTMSubPoints[1].tolerance:=Tolerance;

GoldDTMSubPoints[2].x:=32;
GoldDTMSubPoints[2].y:=13;
GoldDTMSubPoints[2].areasize:=AreaSize;
GoldDTMSubPoints[2].areashape:=AreaShape;
GoldDTMSubPoints[2].color:=MMRockColor;
GoldDTMSubPoints[2].tolerance:=Tolerance;

GoldDTMSubPoints[3].x:=36;
GoldDTMSubPoints[3].y:=8;
GoldDTMSubPoints[3].areasize:=AreaSize;
GoldDTMSubPoints[3].areashape:=AreaShape;
GoldDTMSubPoints[3].color:=MMRockColor;
GoldDTMSubPoints[3].tolerance:=Tolerance;

GoldRockTDTM.MainPoint := GoldCGMainPoint;
GoldRockTDTM.SubPoints := GoldDTMSubPoints;
GoldRockDTM := AddDTM(GoldRockTDTM);
end;

procedure SetClayRockDTM;
begin
ClayCGMainPoint.x:=43;
ClayCGMainPoint.y:=11;
ClayCGMainPoint.areasize:=1;
ClayCGMainPoint.areashape:=0;
ClayCGMainPoint.color:=0;
ClayCGMainPoint.tolerance:=255;

ClayDTMSubPoints[0].x:=41;
ClayDTMSubPoints[0].y:=23;
ClayDTMSubPoints[0].areasize:=AreaSize;
ClayDTMSubPoints[0].areashape:=AreaShape;
ClayDTMSubPoints[0].color:=MMRockColor;
ClayDTMSubPoints[0].tolerance:=Tolerance;

ClayDTMSubPoints[1].x:=50;
ClayDTMSubPoints[1].y:=30;
ClayDTMSubPoints[1].areasize:=AreaSize;
ClayDTMSubPoints[1].areashape:=AreaShape;
ClayDTMSubPoints[1].color:=MMRockColor;
ClayDTMSubPoints[1].tolerance:=Tolerance;

ClayDTMSubPoints[2].x:=35;
ClayDTMSubPoints[2].y:=36;
ClayDTMSubPoints[2].areasize:=AreaSize;
ClayDTMSubPoints[2].areashape:=AreaShape;
ClayDTMSubPoints[2].color:=MMRockColor;
ClayDTMSubPoints[2].tolerance:=Tolerance;

ClayDTMSubPoints[3].x:=31;
ClayDTMSubPoints[3].y:=41;
ClayDTMSubPoints[3].areasize:=AreaSize;
ClayDTMSubPoints[3].areashape:=AreaShape;
ClayDTMSubPoints[3].color:=MMRockColor;
ClayDTMSubPoints[3].tolerance:=Tolerance;

ClayDTMSubPoints[4].x:=16;
ClayDTMSubPoints[4].y:=42;
ClayDTMSubPoints[4].areasize:=AreaSize;
ClayDTMSubPoints[4].areashape:=AreaShape;
ClayDTMSubPoints[4].color:=MMRockColor;
ClayDTMSubPoints[4].tolerance:=Tolerance;

ClayRockTDTM.MainPoint := ClayCGMainPoint;
ClayRockTDTM.SubPoints := ClayDTMSubPoints;
ClayRockDTM := AddDTM(ClayRockTDTM);
end;

procedure SetRoadSplitDTM;
begin
RoadCGMainPoint.x:=648;
RoadCGMainPoint.y:=83;
RoadCGMainPoint.areasize:=1;
RoadCGMainPoint.areashape:=0;
RoadCGMainPoint.color:=0;
RoadCGMainPoint.tolerance:=255;

RoadDTMSubPoints[0].x:=615;
RoadDTMSubPoints[0].y:=59;
RoadDTMSubPoints[0].areasize:=AreaSize;
RoadDTMSubPoints[0].areashape:=AreaShape;
RoadDTMSubPoints[0].color:=TheColor;
RoadDTMSubPoints[0].tolerance:=Tolerance;

RoadDTMSubPoints[1].x:=672;
RoadDTMSubPoints[1].y:=75;
RoadDTMSubPoints[1].areasize:=AreaSize;
RoadDTMSubPoints[1].areashape:=AreaShape;
RoadDTMSubPoints[1].color:=TheColor;
RoadDTMSubPoints[1].tolerance:=Tolerance;

RoadDTMSubPoints[2].x:=632;
RoadDTMSubPoints[2].y:=105;
RoadDTMSubPoints[2].areasize:=AreaSize;
RoadDTMSubPoints[2].areashape:=AreaShape;
RoadDTMSubPoints[2].color:=TheColor;
RoadDTMSubPoints[2].tolerance:=Tolerance;

RoadTDTM.MainPoint := RoadCGMainPoint;
RoadTDTM.SubPoints := RoadDTMSubPoints;
RoadSplitDTM := AddDTM(RoadTDTM);
end;

procedure SetFallyGateDTM;
begin
FallyGateCGMainPoint.x:=97;
FallyGateCGMainPoint.y:=84;
FallyGateCGMainPoint.areasize:=1;
FallyGateCGMainPoint.areashape:=0;
FallyGateCGMainPoint.color:=0;
FallyGateCGMainPoint.tolerance:=255;

FallyGateDTMSubPoints[0].x:=91;
FallyGateDTMSubPoints[0].y:=52;
FallyGateDTMSubPoints[0].areasize:=AreaSize;
FallyGateDTMSubPoints[0].areashape:=AreaShape;
FallyGateDTMSubPoints[0].color:=TheOtherColor;
FallyGateDTMSubPoints[0].tolerance:=Tolerance;

FallyGateDTMSubPoints[1].x:=63;
FallyGateDTMSubPoints[1].y:=68;
FallyGateDTMSubPoints[1].areasize:=AreaSize;
FallyGateDTMSubPoints[1].areashape:=AreaShape;
FallyGateDTMSubPoints[1].color:=TheOtherColor;
FallyGateDTMSubPoints[1].tolerance:=Tolerance;

FallyGateDTMSubPoints[2].x:=93;
FallyGateDTMSubPoints[2].y:=119;
FallyGateDTMSubPoints[2].areasize:=AreaSize;
FallyGateDTMSubPoints[2].areashape:=AreaShape;
FallyGateDTMSubPoints[2].color:=TheColor;
FallyGateDTMSubPoints[2].tolerance:=Tolerance;

FallyGateDTMSubPoints[3].x:=98;
FallyGateDTMSubPoints[3].y:=114;
FallyGateDTMSubPoints[3].areasize:=AreaSize;
FallyGateDTMSubPoints[3].areashape:=AreaShape;
FallyGateDTMSubPoints[3].color:=TheColor;
FallyGateDTMSubPoints[3].tolerance:=Tolerance;

FallyGateTDTM.MainPoint := FallyGateCGMainPoint;
FallyGateTDTM.SubPoints := FallyGateDTMSubPoints;
FallyGateDTM := AddDTM(FallyGateTDTM);
end;

procedure SetBankSplitDTM;
begin
BankCGMainPoint.x:=106;
BankCGMainPoint.y:=72;
BankCGMainPoint.areasize:=1;
BankCGMainPoint.areashape:=0;
BankCGMainPoint.color:=0;
BankCGMainPoint.tolerance:=255;

BankDTMSubPoints[0].x:=135;
BankDTMSubPoints[0].y:=70;
BankDTMSubPoints[0].areasize:=AreaSize;
BankDTMSubPoints[0].areashape:=AreaShape;
BankDTMSubPoints[0].color:=TheOtherColor;
BankDTMSubPoints[0].tolerance:=Tolerance;

BankDTMSubPoints[1].x:=78;
BankDTMSubPoints[1].y:=70;
BankDTMSubPoints[1].areasize:=AreaSize;
BankDTMSubPoints[1].areashape:=AreaShape;
BankDTMSubPoints[1].color:=TheOtherColor;
BankDTMSubPoints[1].tolerance:=Tolerance;

BankDTMSubPoints[2].x:=100;
BankDTMSubPoints[2].y:=104;
BankDTMSubPoints[2].areasize:=AreaSize;
BankDTMSubPoints[2].areashape:=AreaShape;
BankDTMSubPoints[2].color:=TheOtherColor;
BankDTMSubPoints[2].tolerance:=Tolerance;

BankDTMSubPoints[3].x:=135;
BankDTMSubPoints[3].y:=77;
BankDTMSubPoints[3].areasize:=AreaSize;
BankDTMSubPoints[3].areashape:=AreaShape;
BankDTMSubPoints[3].color:=TheOtherColor;
BankDTMSubPoints[3].tolerance:=Tolerance;

BankDTMSubPoints[4].x:=107;
BankDTMSubPoints[4].y:=90;
BankDTMSubPoints[4].areasize:=AreaSize;
BankDTMSubPoints[4].areashape:=AreaShape;
BankDTMSubPoints[4].color:=TheOtherColor;
BankDTMSubPoints[4].tolerance:=Tolerance;

BankSplitTDTM.MainPoint := BankCGMainPoint;
BankSplitTDTM.SubPoints := BankDTMSubPoints;
BankSplitDTM := AddDTM(BankSplitTDTM);
end;

{~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~}
{~~~~~~~~~~~~~~~~~~~~~~~~~~~ DTMS + BMPS ~~~~~~~~~~~~~~~~~~~~~~~~~~~~}
{~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~}

procedure LoadImages;
begin
MMBankers := BitmapFromString(13, 5, 'z78DA9D90390EC' +
'0300804BFB44E64C96E39F6FF4F32C129A899628A01512026 7B2F' +
'49D3E9E3FD0C9756B700F8BB52F1707202BDAE414C6F4FBB7 9BB2' +
'7E3BADEEFF5FA87BAD9EB07B50E59D7');

OreDTM := DTMFromString('78DA6394646060106740011EBA0A0CFF813 42' +
'310FF0702464E204392010D302291405A0448A81050A30424 E408' +
'A89101125C04D4A8030901026A0408AB010092B906EC');
GemDTM := DTMFromString('78DA63146560601066400102A2AD0CFF813 42' +
'310FF07024611204396010D302291405A8A0835DC98766155 C34B' +
'408D2090E024A0461E4888E35703008B7806D0');
TokenDTM := DTMFromString('78DA6394646060106540017CF98E0C27803 42' +
'310FF07024605208385010D302291405A8408357240428908 7308' +
'A95107122204D47012560300776806CF');
ClayDTM := DTMFromString('78DA6394626060106740018BBBA219FE036 94' +
'620FE0F048CB240061F031A60442281B40A901024A0066497 3401' +
'3572404292801A612021865F0D00572D07BB');
{~~~~~~~~~~~~~Used for aligning to correct rocks if DDTMs fail~~~~~~~~~~~~~~~~~}
MMIronRocks := BitmapFromString(13, 18, 'z78DAADD3410E' +
'80200C04C02F11B0D8B310FEFF240FD5A4A66959D44B0F402 6E96' +
'6E15273EA0CCCD24BDB1215CAC4326BAFAD0E3D19D6B4F34E 4384' +
'BF347DBE0F1AB3EDE48D4DCC3AB1A6DF6853CBD7ED41FD9EB 1E04' +
'D313D0D77EC76AB1AD2345CC31B823B5F34AF0FB669579292 1E90' +
'8F3DB7F96B2DDE4537CDEB86CCD5BFE37523D6264EB8A9F71 3277' +
'D7634FB131FF9C0DA09574E3BBF');
MMTinRocks := BitmapFromString(12, 12, 'z78DAA5914B0A' +
'C0300844AF64EA27EDB29FDCFF4A2D9885614810BA1964302 F3AD' +
'6220FB59AD1536EB6A31869F1BA9A96CF774D10F41262424E F713' +
'1CEF8C9CE954E94990E3DA7B7E73BABF4C75CD893DD6E4A22 6CAF' +
'BC69867F491197376CE2C49CC61B85150FC6BD83A2ABC8D3A 9B27' +
'4F881CCC67B8669A8334AFF39C170615BAEE');
MMCopperRocks := BitmapFromString(20, 12, 'z78DAADD14D0E' +
'84200C05E02B81FD4197E3E8FDAFA449593CD3A96960362FA 4907' +
'E409B4A2D671BCB0F7F49B7AA45AAADFD19DBC56C13A2EC5C A878' +
'B7D7DDADE675EB8C2EF667A175217FAB7FB92862FFE81F1E3 934C' +
'7C88DFE212FF2CE9B1C2A4A8DFDFDA3FE58C7DDBEAE7CDCFD 5D92' +
'10B19868999F239EB13AEEDA3A7251F42FF52EE6430FFABF8 B19D' +
'7EBBD9E1633EEFBAB33138C526FF9D77C7B06739C11D1451D 1377' +
'51B7CA98687901D15836BD');
MMGoldRocks := BitmapFromString(16, 11, 'z78DAB5934B0E' +
'80200C05AF24E947BAD478FF336984454D29790BD9CC02DA2 9790' +
'DAA5C8BE94B3ED9E45251DA79C0C2F2547ABADE8C24442CCD EC99' +
'4E019C91907981FF733EEDCD5E9225839891AD453F62F65B4 3F26' +
'CF5912BF2C43795E5F9AF7F603EB86ED6193DFE76CAF8777A AAB0' +
'019F92996F107CE1A2');
MMBankersDTM := DTMFromString('78DA6394616060906740017FFE308169462 89' +
'F518108351284D50000636206A6');
end;

procedure FreeImages;
begin
FreeBitmap(MMBankers);
FreeDTM(OreDTM);
FreeDTM(GemDTM);
FreeDTM(TokenDTM);
FreeDTM(ClayDTM);
FreeBitmap(MMIronRocks);
FreeBitmap(MMCopperRocks);
FreeBitmap(MMTinRocks);
FreeBitmap(MMGoldRocks);
end;

{~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~}
{~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ANTIRANDOM~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~}
{~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~}

function FindFastRandoms: Boolean; //By WT-Fakawi.
var
i: Integer;
begin
for i := 1 to 8 do
begin
case I of
1: if FindDead then
Result := True;
2: if FindMod then
Result := True;
3: if FindMime then
Result := True;
4: if FindMaze then
Result := True;
5: if FindQuiz then
Result := True;
6: if FindDemon then
Result := True;
7: begin
if NoGameTab then
begin
Result := True;
Players[CurrentPlayer].loc := 'No GameTab';
Logout;
Exit;
end;
end;
7: begin
if InBlack then
begin
Result := True;
Players[CurrentPlayer].loc := 'InBlack';
Logout;
Exit;
end;
end;
8: RC;
end;
wait(1);
end;
if (Result = true) then
DidRandomHappen := true;
end;

procedure AntiRandom;
begin
FindPick;
FindTalk;
FindNormalRandoms;
FindFastRandoms;
FindLamp('mining');
if (FindFight = true) then
begin
RunAwayDirection(RunDirec);
Wait(10000 + random(2000));
RunBack;
end;
end;

{~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~}
{~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ANTIBAN~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~}
{~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~}

procedure AntiBans;
begin
case Random(6) of
0: PickUpMouseEvery(5+random(5));
1: LeaveScreenEvery(5+random(5));
2: HoverEvery(20+random(10),'mining')
3: RandomRClickEvery(5+random(5));
4: begin
RotateEvery(5+random(5));
MakeCompass('N');
end;
5: begin
case random(3) of
0: TypeSend('So bored..');
1: TypeSend('*yawn*');
2: TypeSend('Mining lvls?');
end;
end;
end;
end;

{~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~}
{~~~~~~~~~~~~~~~~~~~~~~~~~SETTING ROCK COLOR~~~~~~~~~~~~~~~~~~~~~~~~~}
{~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~}

procedure SelectRock;
begin
Case Lowercase(Players[CurrentPlayer].String1) of
'copper':
begin
RockColor1 := CopperColor1;
RockColor2 := CopperColor2;
RockColor3 := CopperColor3;
end;
'tin':
begin
RockColor1 := TinColor1;
RockColor2 := TinColor2;
RockColor3 := TinColor3;
end;
'iron':
begin
RockColor1 := IronColor1;
RockColor2 := IronColor2;
RockColor3 := IronColor3;
end;
'gold':
begin
RockColor1 := GoldColor1;
RockColor2 := GoldColor2;
RockColor3 := GoldColor3;
end;
'clay':
begin
RockColor1 := ClayColor1;
RockColor2 := ClayColor2;
RockColor3 := ClayColor3;
end;
end;
end;

{~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~}
{~~~~~~~~~~~~~~~~~~~~~~~~~SETTING WAIT TIME~~~~~~~~~~~~~~~~~~~~~~~~~~}
{~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~}

procedure AdjustWaitTime;
begin
Case Lowercase(Players[CurrentPlayer].String1) of
'copper': WaitTime := 2000;
'tin' : WaitTime := 2000;
'iron' : WaitTime := 900;
'gold' : WaitTime := 5000;
'clay' : WaitTime := 1500
end;
end;

{~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~}
{~~~~~~~~~~~~~~~~~~~~~~~~~~MINING THE ROCK~~~~~~~~~~~~~~~~~~~~~~~~~~~}
{~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~}

procedure MineRock;
begin
SetRun(True);
repeat
Status('Looking for rock..');
if ((FindObj3(x,y,'ine',RockColor1,10)) or
(FindObj3(x,y,'ine',RockColor2,10)) or
(FindObj3(x,y,'ine',RockColor3,10))) then
begin
Status('Found rock!');
MMouse (x,y,2,2);
FindGas(x,y)
Wait(200+random(100));
Mouse(x,y,2,2,true);
FindGas(x,y)
AntiRandom;
Status('Waiting for ore');
Wait(500+random(500));
AntiRandom;
if not FindBlackChatMessage('no ore') or
not FindBlackChatMessage('currently available') then
begin
ClickToContinue;
if not FindBlackChatMessage('ongratulation') or
not FindBlackChatMessage('just advanced') then
begin
if not FindBlackChatMessage('manage') or
not FindBlackChatMessage('mine some') then
begin
Status('Did not get ore (?)');
repeat
AntiRandom;
Wait(WaitTime+random(500));
Tries := Tries + 1;
ClickToContinue;
Status('Searched for confirmation ' + IntToStr(Tries) + ' time(s).');
until FindBlackChatMessage('manage') or
FindBlackChatMessage('mine some') or
(Tries = 5)
if (Tries = 5) then
begin
Status('Did not find confirmation. Did not get ore.');
Tries := 0;
end else
begin
Status('Got the ore!');
Tries := 0;
end;
end else
begin
Status('Got the ore!');
Tries := 0;
end;
end;
end;
end;
until(InvFull = True);
end;

{~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~}
{~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ALIGNING~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~}
{~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~}

procedure AlignToCenter;
begin
FFlag(0);
Searches := 0;
Mouse(x,y,2,2,true);
FFlag(0);
Status('Looking for Mining Symbol');
if FindSymbol(x,y,'mining spot') then
begin
Status('Found Mining Symbol.');
Mouse(x,y,2,2,true);
Status('Clicked Mining Symbol.');
FFlag(0);
end else
begin
Status('Did not find mining symbol. Trying again.');
repeat
Wait(1000+random(500));
Searches := Searches + 1;
until (FindSymbol(x,y,'mining spot')) or (Searches = 5)
if (Searches = 5) then
begin
Status('Did not find mining symbol.');
Writeln('Did not find mining symbol. Account is lost.');
LogOut;
NextPlayer(False);
Exit;
end else
begin
Status('Found mining symbol on minimap!');
Mouse(x,y,2,2,true);
FFlag(0);
end;
end;
end;

procedure SetWhichImagesAndText;
begin
case Lowercase(Players[CurrentPlayer].string1) of
'copper':
begin
WhichMMDTM := CopperRockDTM;
WhichMMBMP := MMCopperRocks;
RockText := 'copper ore';
end;
'tin':
begin
WhichMMDTM := TinRockDTM;
WhichMMBMP := MMTinRocks;
RockText := 'tin ore';
end;
'iron':
begin
WhichMMDTM := IronRockDTM;
WhichMMBMP := MMIronRocks;
RockText := 'iron ore';
end;
'gold':
begin
WhichMMDTM := GoldRockDTM;
WhichMMBMP := MMGoldRocks;
RockText := 'gold ore';
end;
'clay':
begin
WhichMMDTM := ClayRockDTM;
WhichMMBMP := MMClayRocks;
RockText := 'pieces of clay';
end;
end;
end;

procedure SetRockDTM;
begin
case (Lowercase(Players[CurrentPlayer].string1)) of
'copper': SetCopperRockDTM;
'tin' : SetTinRockDTM;
'iron' : SetIronRockDTM;
'gold' : SetGoldRockDTM;
'clay' : SetClayRockDTM;
end;
end;

procedure FreeRockDTM;
begin
case Lowercase(Players[CurrentPlayer].string1) of
'copper': FreeDTM(CopperRockDTM);
'tin' : FreeDTM(TinRockDTM);
'iron' : FreeDTM(IronRockDTM);
'gold' : FreeDTM(GoldRockDTM);
'clay' : FreeDTM(ClayRockDTM);
end;
end;

procedure AlignToCorrectRocks;
begin
RockText2 := Replace(RockText,' ore','');
RockText2 := Replace(RockText2,'pieces of ','');
Status('Looking for ' + RockText2 + ' rocks on minimap..');
if FindDTMRotated(WhichMMDTM,x,y,MMX1,MMY1,MMX2,MMY2,-Pi/2,Pi/2,0.1,WhichAngle) then
begin
Mouse(x,y,2,2,true);
Status('Found ' + RockText2 + ' rocks on minimap.');
FFlag(0);
end else
begin
Status('Did not find ' + RockText2 + ' rocks on minimap on first try. Trying again.');
repeat
repeat
Wait(1000+random(500));
Searches := Searches + 1;
Status('Searched for ' + RockText2 + ' rocks ' + IntToStr(Searches) + ' time(s).');
until(IsRockColorCorrect = True)
SetRockDTM;
until (FindDTMRotated(WhichMMDTM,x,y,MMX1,MMY1,MMX2,MMY2 ,-Pi/2,Pi/2,0.1,WhichAngle)) or
(Searches >= 5)
if (Searches >= 5) then
begin
Status('Tried five times. Attempting FindDeformed. Expect lag..');
if (FindDeformed(x,y,WhichMMBMP,MMX1,MMY1,MMX2,MMY2)) then
begin
Status('Found ' + RockText2 + ' rocks on minimap!');
Mouse(x,y,2,2,true);
FFlag(0);
end else
begin
Status('Did not find ' + RockText2 + ' rocks on minimap.');
Writeln('Did not find ' + RockText2 + ' rocks on minimap. Account is lost.');
LogOut;
NextPlayer(False);
end;
end else
begin
Status('Found ' + RockText2 + ' rocks on minimap!');
Mouse(x,y,2,2,true);
FFlag(0);
end;
end;
end;

procedure AlignToRock;
begin
TheColor := FindRoadColor;
if (not(Lowercase(Players[CurrentPlayer].String1) = 'iron')) then
begin
AlignToCenter;
SetIronRockDTM;
WhichMMDTM := IronRockDTM;
WhichMMBMP := MMIronRocks;
RockText := 'iron';
AlignToCorrectRocks; //Makes it align to iron rocks
FreeDTM(IronRockDTM);
end;
end;

procedure Alignment;
begin
TheColor := FindRoadColor;
Searches := 0;
if (not(Lowercase(Players[CurrentPlayer].String1) = 'iron')) then
begin
AlignToCenter;
Searches := 0;
MMRockColor := FindRockColor;
CheckRockColor;
SetRockDTM;
SetWhichImagesAndText;
AlignToCorrectRocks;
FreeRockDTM;
end;
end;

{~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~}
{~~~~~~~~~~~~~~~~~~~~~~~~WALKING TO THE BANK~~~~~~~~~~~~~~~~~~~~~~~~~}
{~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~}

procedure CheckColor;
begin
if(Not(FindMMColor(x,y,TheColor)))then
begin
TheColor := FindRoadColor;
end;
end;

procedure CheckFallyColor;
begin
if(Not(FindMMColor(x,y,TheOtherColor)))then
begin
TheOtherColor:=FindFallyRoadColor;
end;
if (TheOtherColor = 6453628) or
(TheOtherColor = 4939360) then
begin
repeat
TheOtherColor := FindFallyRoadColor;
RoadScrewUps := RoadScrewUps + 1;
Status('FindFallyRoadColor screwed up ' + IntToStr(RoadScrewUps) + ' time(s).');
until (not(TheOtherColor = 6453628)) or
(not(TheOtherColor = 4939360)) or
(RoadScrewUps = 3) or
(RoadScrewUps = 6)
if (RoadScrewUps >= 6) then
begin
Status('FindFallyRoadColor is screwed up.');
Writeln('FindFallyRoadColor is screwed up. Account is lost.');
LogOut;
NextPlayer(False);
RoadScrewUps := 0;
end;
if (RoadScrewUps < 6) and
(not(RoadScrewUps = 3)) then
begin
Status('Corrected FallyRoadColor');
RoadScrewUps := 0;
end;
end;
end;

procedure WaitAndCheck;
begin
FFlag(4);
CheckColor;
end;

procedure WaitAndCheckFally;
begin
FFlag(4);
CheckFallyColor;
end;

procedure SearchForBankers;
begin
BankersFound := False;
if (FindDTMRotated(MMBankersDTM,x,y,MMX1,MMY1,MMX2,MM Y2,-Pi/2,Pi/2,0.1,WhichAngle)) then
BankersFound := True;
end;

procedure SearchForBank;
begin
ActivateClient;
BankFound := False;
Status('Attempting to find the booth..');
if (OpenBank3) then
begin
if (BankScreen = True) then
begin
Status('Opened bank.');
BankAttempts1 := 0;
BankAttempts2 := 0;
OtherBankAttempts1 := 0;
OtherBankAttempts2 := 0;
BankFound := True;
end;
end;
if (BankFound = False) then
begin
Status('Attempting FindBank...');
if (FindBank('feb')) then
begin
BankFound := True;
end;
end;
if (BankFound = False) then
begin
Status('Searching for bank symbol..');
if (FindSymbol(x,y,'bank')) then
begin
Mouse(x,y,2,2,true);
FFlag(0);
Mouse(MMCX+5,MMCY+5,2,2,true);
FFlag(0);
if (OpenBank3) then
begin
if (BankScreen = True) then
begin
Status('Opened bank.');
BankAttempts1 := 0;
BankAttempts2 := 0;
OtherBankAttempts1 := 0;
OtherBankAttempts2 := 0;
BankFound := True;
end;
end;
end;
end;
end;

function FindTheBank: Boolean;
begin
FFlag(0);
Result := False;
Status('Searching for bank..');
SearchForBank;
if (BankFound = False) then
begin
repeat
Wait(2000+random(500));
BankAttempts1 := BankAttempts1 + 1;
Status('Searched for bank symbol ' + IntToStr(BankAttempts1) + ' time(s).');
SearchForBank;
until (BankFound = True) or
(BankAttempts1 >= 3)
if (BankAttempts1 >= 3) then
begin
Status('Did not find bank symbol, searching for bankers..');
BankAttempts2 := BankAttempts2 + 1;
begin
repeat
Wait(2000+random(2000));
OtherBankAttempts1 := OtherBankAttempts1 + 1;
Status('Searched for bankers ' + IntToStr(OtherBankAttempts1) + ' time(s).');
SearchForBankers;
until(BankersFound = True) or
(OtherBankAttempts1 >= 2)
if (OtherBankAttempts1 >= 2) then
begin
OtherBankAttempts2 := OtherBankAttempts2 + 1;
end else
begin
if (BankersFound = True) then
begin
Mouse(x,y-10,2,2,true)
FFlag(0);
Status('Found bank!');
if (OpenBank3) then
begin
Status('Opened bank.');
Result := True;
BankAttempts1 := 0;
BankAttempts2 := 0;
OtherBankAttempts1 := 0;
OtherBankAttempts2 := 0;
end else
begin
Status('Did not find booth.');
Writeln('Did not find booth. Player is lost.');
LogOut;
NextPlayer(False);
Result := False;
BankAttempts1 := 0;
BankAttempts2 := 0;
OtherBankAttempts1 := 0;
OtherBankAttempts2 := 0;
Exit;
end;
end;
end;
if (OtherBankAttempts2 = 2) then
begin
Status('Could not find bank.');
Writeln('Could not find bank. Player is lost.');
LogOut;
NextPlayer(False);
BankAttempts1 := 0;
BankAttempts2 := 0;
OtherBankAttempts1 := 0;
OtherBankAttempts2 := 0;
Result := False;
Exit;
end;
end;
end else
begin
Status('Found bank and opened.');
Result := True;
BankAttempts1 := 0;
BankAttempts2 := 0;
OtherBankAttempts1 := 0;
OtherBankAttempts2 := 0;
end;
if (BankAttempts2 = 3) then
begin
Status('Could not find bank.');
Writeln('Could not find bank. Player is lost.');
LogOut;
NextPlayer(False);
BankAttempts1 := 0;
BankAttempts2 := 0;
OtherBankAttempts1 := 0;
OtherBankAttempts2 := 0;
Result := False;
Exit;
end;
end else
begin
if (BankScreen = True) then
begin
Status('Found bank and opened.');
BankAttempts1 := 0;
BankAttempts2 := 0;
OtherBankAttempts1 := 0;
OtherBankAttempts2 := 0;
Result := True;
end;
end;
end;

procedure LeavingMineToFirstSplit;
begin
Status('Leaving the mine..');
TheColor := FindRoadColor;
RadialRoadWalk(TheColor,380,270,60,2,2);
WaitAndCheck;
SetRoadSplitDTM;
repeat
RadialRoadWalk(TheColor,330,450,45,2,2);
WaitAndCheck;
SetRoadSplitDTM;
until (FindDTMRotated(RoadSplitDTM,x,y,MMX1,MMY1,MMX2,MM Y2,-Pi/2,Pi/2,0.1,WhichAngle))
Mouse(x,y,2,2,true);
WaitAndCheck;
Status('Reached first split!');
FreeDTM(RoadSplitDTM);
end;

procedure WalkingFirstSplitToFally;
begin
Status('Walking to Fally..');
repeat
RadialRoadWalk(TheColor,340,460,60,2,2);
WaitAndCheck;
until (FindFallyRoadColor<>0)
TheOtherColor := FindFallyRoadColor;
repeat
RadialRoadWalk(TheColor,340,460,60,2,2);
WaitAndCheck;
SetFallyGateDTM;
until (FindDTMRotated(FallyGateDTM,x,y,MMX1,MMY1,MMX2,MM Y2,-Pi/2,Pi/2,0.1,WhichAngle))
Mouse(x,y,2,2,true);
WaitAndCheckFally;
Status('Reached Fally!');
FreeDTM(FallyGateDTM);
end;

procedure WalkToBankAndOpen;
begin
SetBankSplitDTM;
Status('Walking to bank..');
repeat
RadialRoadWalk(TheOtherColor,320,410,40,2,2);
WaitAndCheckFally;
SetBankSplitDTM;
SplitSearches := SplitSearches + 1;
until(FindDTM(BankSplitDTM,x,y,MMX1,MMY1,MMX2,MMY2 )) or
(SplitSearches >= 7)
if (SplitSearches < 7) then
begin
Mouse(x,y,2,2,true);
FFlag(0);
Status('Reached split near bank.');
Wait(1000+random(1000));
Mouse(MMCX+(30+random(5)),MMCY+(30+random(5)),0,0, true);
FFlag(0);
SplitSearches := 0;
end else
begin
Status('Could not find split near bank. Attempting FindBank...');
if (FindBank('feb')) then
BankFound := True;
if (BankFound = False) then
begin
Status('FindBank failed. Searching for bank symbol..');
if (FindSymbol(x,y,'bank')) then
begin
Mouse(x,y,2,2,true);
FFlag(0);
Mouse(MMCX+5,MMCY+5,2,2,true);
FFlag(0);
if (OpenBank3) then
begin
if (BankScreen = True) then
begin
Status('Opened bank.');
BankAttempts1 := 0;
BankAttempts2 := 0;
OtherBankAttempts1 := 0;
OtherBankAttempts2 := 0;
BankFound := True;
end;
end;
end;
end;
if (BankFound = False) then
begin
SearchForBankers;
if (BankersFound = True) then
begin
Mouse(x,y-10,2,2,true)
FFlag(0);
Status('Found bank!');
if (OpenBank3) then
begin
Status('Opened bank.');
BankAttempts1 := 0;
BankAttempts2 := 0;
OtherBankAttempts1 := 0;
OtherBankAttempts2 := 0;
end else
begin
Status('Did not find booth.');
Writeln('Did not find booth. Player is lost.');
LogOut;
NextPlayer(False);
BankAttempts1 := 0;
BankAttempts2 := 0;
OtherBankAttempts1 := 0;
OtherBankAttempts2 := 0;
Exit;
end;
end;
end;
end;
if (BankFound = False) then
begin
repeat
Wait(2000+random(500));
until(FindTheBank = True)
end;
Status('Found and opened bank.');
SplitSearches := 0;
FreeDTM(BankSplitDTM);
end;

procedure WalkToTheBank;
begin
SetRun(False);
AlignToRock;
LeavingMineToFirstSplit;
WalkingFirstSplitToFally;
WalkToBankAndOpen;
end;

procedure WalkToBank;
begin
if (InvFull = True) then
begin
PerfectNorth;
WalkToTheBank;
end;
end;

{~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~}
{~~~~~~~~~~~~~~~~~~~~~~~~~~PROGRESS REPORT~~~~~~~~~~~~~~~~~~~~~~~~~~~}
{~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~}

procedure ProgressReport;
begin
ClearDebug;
Writeln('<~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~>');
Writeln('Banked: ' + IntToStr(TimesBanked) + ' times.');
Writeln('Mined: ' + IntToStr(OresMined) + ' ' + RockText + ' ores.');
Writeln('Obtained: ' + IntToStr(GemsMined) + ' gems.');
Writeln('Has been running for: ' + ScriptTime2(2));
Writeln('Thank you for using NewToAutoings RimmingtonAutoMiner' + Version);
Writeln('<~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~>');
end;

procedure FinalProgressReport;
begin
ClearDebug;
Writeln('<~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~>');
Writeln('Banked: ' + IntToStr(TimesBanked) + ' times.')
Writeln('Mined: ' + IntToStr(OresMined) + ' ' + RockText + ' ores.');
Writeln('Obtained: ' + IntToStr(GemsMined) + ' gems.');
Writeln('Ran for: ' + ScriptTime2(2));
Writeln('Thank you for using NewToAutoings RimmingtonAutoMiner' + Version);
Writeln('<~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~>');
end;

{~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~}
{~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~BANKING~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~}
{~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~}
procedure OreOrClay;
begin
if ((Lowercase(Players[CurrentPlayer].String1)) = 'clay') then
begin
MainDTM := ClayDTM;
end else
MainDTM := OreDTM;
end;

procedure RandomBanking;
begin
case Random(3) of
0: WhichDTM := MainDTM;
1: WhichDTM := GemDTM;
2: WhichDTM := TokenDTM;
end;
end;

procedure Banking;
begin
RandomBanking;
if (FindDTM(WhichDTM,x,y,MIX1,MIY1,MIX2,MIY2)) then
begin
Mouse(x,y,5,5,false);
Wait(100+random(100));
ChooseOptionEx('ll')
Wait(600+random(600));
end;
end;

procedure BankStuff;
begin
if (BankScreen = True) then
begin
if (FindDTM(MainDTM,x,y,MIX1,MIY1,MIX2,MIY2)) or
(FindDTM(GemDTM,x,y,MIX1,MIY1,MIX2,MIY2)) or
(FindDTM(TokenDTM,x,y,MIX1,MIY1,MIX2,MIY2))then
begin
repeat
Banking;
until(not(FindDTM(MainDTM,x,y,MIX1,MIY1,MIX2,MIY2) )) and
(not(FindDTM(GemDTM,x,y,MIX1,MIY1,MIX2,MIY2))) and
(not(FindDTM(TokenDTM,x,y,MIX1,MIY1,MIX2,MIY2)))
end;
TimesBanked := TimesBanked + 1;
CloseBank;
ProgressReport;
end else
begin
Status('Error. Did not open bank.');
Writeln('Error. Did not open bank. Player is lost.');
LogOut;
NextPlayer(False);
end;
end;

procedure Count;
begin
OresMined := OresMined + CountItemDTM(MainDTM);
GemsMined := GemsMined + CountItemDTM(GemDTM);
TokensObtained := TokensObtained + CountItemDTM(TokenDTM);
end;

{~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~}
{~~~~~~~~~~~~~~~~~~~~~~~~WALKING TO THE MINE~~~~~~~~~~~~~~~~~~~~~~~~~}
{~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~}

procedure CheckMMRockColor;
begin
if(Not(FindMMColor(x,y,MMRockColor)))then
begin
MMRockColor := FindRockColor;
CheckRockColor;
end;
end;

procedure LeavingFally;
begin
Status('Leaving the bank..');
TheOtherColor:=FindFallyRoadColor;
RadialRoadWalk(TheOtherColor,240,285,45,2,2);
WaitAndCheckFally;
Status('Leaving Fally...');
repeat
RadialRoadWalk(TheOtherColor,200,150,55,2,2);
WaitAndCheckFally;
until (FindRoadColor<>0)
TheColor := FindRoadColor;
repeat
RadialRoadWalk(TheOtherColor,200,150,55,2,2);
WaitAndCheckFally;
SetFallyGateDTM;
until (FindDTMRotated(FallyGateDTM,x,y,MMX1,MMY1,MMX2,MM Y2,-Pi/2,Pi/2,0.1,WhichAngle))
Mouse(x,y,2,2,true);
FFlag(0);
Status('Left Fally');
FreeDTM(FallyGateDTM);
end;

procedure GoingToMine;
begin
TheColor := FindRoadColor;
Status('Walking to the mine..');
repeat
RadialRoadWalk(TheColor,150,270,55,2,2);
WaitAndCheck;
until (FindRockColor<>0)
MMRockColor := FindRockColor;
repeat
RadialRoadWalk(TheColor,150,270,55,2,2);
WaitAndCheck;
CheckMMRockColor;
SetIronRockDTM;
until (FindDTMRotated(IronRockDTM,x,y,MMX1,MMY1,MMX2,MMY 2,-Pi/2,Pi/2,0.1,WhichAngle))
Mouse(x,y,2,2,true);
FFlag(0);
FreeDTM(IronRockDTM);
end;

procedure WalkToTheMine;
begin
LeavingFally;
GoingToMine;
end;

procedure WalkToMine;
begin
SetRun(True);
PerfectNorth;
WalkToTheMine;
end;

{~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~}
{~~~~~~~~~~~~~~~~~~~~~~~~~~~~PLAYER SETUP~~~~~~~~~~~~~~~~~~~~~~~~~~~~}
{~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~}

procedure SetUpPlayer;
begin
ActivateClient;
Status('Setting up compass..');
HighestAngle;
PerfectNorth;
Status('Setting chat and trade..');
SetChat('hide',1);
SetChat('off',2);
SetChat('off',3);
Status('Setting run mode..');
SetRun(True);
end;

{~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~}
{~~~~~~~~~~~~~~~~~~~~~~~~~~~~SCRIPT SETUP~~~~~~~~~~~~~~~~~~~~~~~~~~~~}
{~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~}

procedure Variables;
begin
BankAttempts1 := 0;
BankAttempts2 := 0;
OtherBankAttempts1 := 0;
OtherBankAttempts2 := 0;
TimesBanked := 0;
OresMined := 0;
GemsMined := 0;
TokensObtained := 0;
end;

procedure SetUpScript;
begin
SetUpSRL;
SetupSRLMining;
DeclarePlayers;
Variables;
LoadImages;
end;

{~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~}
{~~~~~~~~~~~~~~~~~~~~~~~~~~~~~MAIN LOOP~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~}
{~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~}

begin
SetUpScript;
ActivateClient;
repeat
if (not(LoggedIn)) then
begin
NextPlayer(True);
end;
SelectRock;
OreOrClay;
AdjustWaitTime;
SetUpPlayer;
FindPickHeadColor;
repeat
if(not(LoggedIn))then
Break;
AntiBans;
if ((Lowercase(Players[CurrentPlayer].Loc)) = 'falador') then
begin
WalkToMine;
Players[CurrentPlayer].loc := 'rimmington';
if (LoggedIn = false) then
begin
NextPlayer(false);
end
end;
Alignment;
MineRock;
Count;
WalkToBank;
if (LoggedIn = false) then
begin
NextPlayer(false);
end
BankStuff;
Players[CurrentPlayer].loc := 'falador';
until(TimesBanked = Players[CurrentPlayer].Integer1) or
(AmountOfOres = OresMined)
Logout;
until(AmountOfOres = OresMined)
FreeImages;
FinalProgressReport;
end.

{~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~}
{~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~CREDITS~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~}
{~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~}

{By: NewToAutoing
Thanks to: All the great tutorials that helped me learn how to script,
if i named them all the list would be far too long, and i don't really
remember all of them either. And obviously, to WT-Fawaki for the
FindFastRandoms procedure, as stated at it. Also to Pentti and
Smartzkid for helping me out when i got stuck.}

Hugolord
08-27-2007, 04:06 PM
No need for the whole script to be posted -.-

*sigh*

and it clearly again lack of the incapabilities of reading of a resident total nooblet lost as hell....



Hint = ITS NOT READY FOR SLR 4 YET!

RAM
08-28-2007, 11:02 PM
http://www.villavu.com/forum/showthread.php?t=16276