-chaos-
2006-05-21 01:52:20
Duplicate identifier means theres another variable/const like that somewhere else all you need to do is change it :p
[php]{================================================= ========================]
[ SRL East Varrock Miner 1.0.1b1 ]
[ ]
[ NAME : Varrock East Miner. ]
[ WRITER : Kernel Klink ]
[ CATEGORY : Miner ]
[ DESCRIPTION : See Below. ]
[ USAGE : Miner/Banker for Iron, Tin, and Copper. ]
[ AUTOCOLOR : Yes ]
[ NOTES : My first SRL style script. Love it or hate it. ]
[ CONTACT : Klink.Kernel@gmail.com ]
[ ]
[ ]
[================================================== =======================]
[ *Description: ]
[ A macro that mines a full load of Iron, Tin, or Copper at the East ]
[ Varrock Mine and banks at the East Varrock Bank. ]
[================================================== =======================]
[ Instructions. ]
[================================================== =======================]
[ 1. USE Runescape with Low Detail, Very Bright. ]
[ 2. Set your Screen to 32 bit TRUE color. ]
[ 3. Set Playernames and Passwords in DeclarePlayers. ]
[ 4. SET HOWMANYPLAYERS inside DeclarePlayers ]
[ 5. Have pickaxe WIELDED! ]
[ 6. Recommended to have extra pickaxes in first bank slot. ]
[ 7. START @ VARROCK EASTBANK LEFTMOST BANKBOOTH FACE MM PERFECTLY NORTH ]
[ 8. Have EVERY other player of yours positioned @ Varrock eastbank ]
[ leftmost bankbooth. ]
[ 9. SET the ORE you wish to mine in DeclarePlayers in the Players[].Skill]
[ variable. ]
[ 10. CLICK and DRAG the CROSSHAIR over the Runescape client. Then press ]
[ the green arrow. ]
[================================================== =======================}
program VarrockEastMiner;
{.include SRL/SRL.Scar}
{.include SRL/SRL/Skill/Mining.Scar}
var
x1, y1: Integer;
MiniMapRockColor, MiniMapMineColor: Integer;
TotalOres: Integer;
NBox: Integer;
{+++++++++++++++++++++++++++++++++++++++++++++++++ +++++++++++++++++++++++++++++}
const
StartPlayer = 0;
TripsPerCharacter = 7; // Number of loads to complete before switching player.
MaxWait = 8; // Interval to wait between clicking rocks while mining.
FindOreColor = False; // Keep this at false unless told otherwise. This way
// the script does not need to find the Ore Color. It
// works anyways.
ActivelyDebug = False;
{+++++++++++++++++++++++++++++++++++++++++++++++++ +++++++++++++++++++++++++++++}
VersionNumber = '1.0.1b1'; // Do NOT change this constant.
{+++++++++++++++++++++++++++++++++++++++++++++++++ +++++++++++++++++++++++++++++}
procedure DeclarePlayers;
begin
HowManyPlayers:= 4; // Set Number of Players here.
NumberOfPlayers(HowManyPlayers); // Sets the Players Array Length;
CurrentPlayer:= StartPlayer; // CurrentPlayer = Array Index
Players[0].Name :='';
Players[0].Pass :='';
Players[0].Nick :='';
Players[0].Loc :='Varrock';
Players[0].Skill:='Tin'; // Type of Ore you wish to mine.
// Valid arguments: Copper, Tin, or Iron
// Make sure the first letter of the ore is
// capitalized.
Players[0].Active:=True;
Players[1].Name :='';
Players[1].Pass :='';
Players[1].Nick :='';
Players[1].Loc :='Varrock';
Players[1].Skill:='Iron';
Players[1].Active:=True;
Players[2].Name :='';
Players[2].Pass :='';
Players[2].Nick :='';
Players[2].Loc :='Varrock';
Players[2].Skill:='Copper';
Players[2].Active:=True;
Players[3].Name :='';
Players[3].Pass :='';
Players[3].Nick :='';
Players[3].Loc :='Varrock';
Players[3].Skill:='Tin';
Players[3].Active:=True;
Players[4].Name :='';
Players[4].Pass :='';
Players[4].Nick :='';
Players[4].Loc :='Varrock';
Players[4].Skill:='Iron';
Players[4].Active:=True;
Players[5].Name :='';
Players[5].Pass :='';
Players[5].Nick :='';
Players[5].Loc :='Varrock';
Players[5].Skill:='Copper';
Players[5].Active:=True;
WriteLn(IntToStr(HowManyPlayers) + ' Players');
end;
{+++++++++++++++++++++++++++++++++++++++++++++++++ +++++++++++++++++++++++++++++}
procedure ActiveDebug(Text: String);
begin
if(ActivelyDebug)then
WriteLn('[Debug]: ' + Text);
if(not(ActivelyDebug))then
Status('[Debug]: ' + Text);
end;
{+++++++++++++++++++++++++++++++++++++++++++++++++ +++++++++++++++++++++++++++++}
procedure PlayerStats;
var
Active: string;
i: Integer;
begin
WriteLn('———————————————');
WriteLn('Name : ' + Players[CurrentPlayer].Name);
WriteLn('Number : ' + IntToStr(CurrentPlayer));
WriteLn('Mining Level : ' + IntToStr(Players[CurrentPlayer].MiningLevel));
WriteLn('Select Skill : ' + Players[CurrentPlayer].Skill);
WriteLn('Worked for : ' + IntToStr(Players[CurrentPlayer].Worked) + ' minutes.');
WriteLn('Banked : ' + IntToStr(Players[CurrentPlayer].Banked) + ' times.');
if(Players[CurrentPlayer].Active)then
Active:= 'True'
else
Active:= 'False';
WriteLn('Active : '+ Active);
WriteLn('Location : '+ Players[CurrentPlayer].loc);
WriteLn('———————————————');
for i := 0 to HowManyPlayers-1 do
begin
if Players.Active=True then
Active:='True'
else
Active:= 'False';
WriteLn((IntToStr(i)) + ' : ' + Players.name + ' = ' + Active +'. - Lvl : ' + IntToStr(Players.MiningLevel) +
'. - B :' + IntToStr(Players.Banked)+' Times.' +
' - : ' + IntToStr(Players.Worked) + ' mins.' + ' - Loc: ' + Players.loc);
end;
WriteLn('———————————————');
end;
{+++++++++++++++++++++++++++++++++++++++++++++++++ +++++++++++++++++++++++++++++}
procedure ProgressReport;
begin
begin
WriteLn(' ');
WriteLn('<============== -'+VersionNumber+'- Progress Report ===============>');
writeln('Worked for '+ TimeRunning);
WriteLn('Banked '+IntToStr(banks)+' loads.');
if (Players[CurrentPlayer].Skill= 'Tin') then
begin
WriteLn('Banked ' + IntToStr(TotalOres) + ' Tin ores.');
WriteLn('Gained ' + FloatToStr(17.5 * TotalOres) + 'xp.');
end;
if (Players[CurrentPlayer].Skill= 'Copper') then
begin
WriteLn('Banked ' + IntToStr(TotalOres) + ' Copper ores.');
WriteLn('Gained ' + FloatToStr(17.5 * TotalOres) + 'xp.');
end;
if (Players[CurrentPlayer].Skill= 'Iron') then
begin
WriteLn('Banked ' + IntToStr(TotalOres) + ' Iron ores.');
WriteLn('Gained ' + FloatToStr(35 * TotalOres) + 'xp.');
end;
WriteLn('Random Event Report:');
if(fights>0)then
WriteLn(' Fought '+IntToStr(fights)+' Time.');
if(talks>0)then
WriteLn(' Talked to '+IntToStr(talks)+' Random event.');
if(lamps>0)then
WriteLn(' Used lamps '+IntToStr(lamps)+' Time.');
if(doctors>0)then
WriteLn(' Solved '+IntToStr(doctors)+' Fords.');
if(frogs>0)then
WriteLn(' Solved '+IntToStr(frogs)+' Frog.');
if(NBox>0)then
WriteLn(' Solved '+IntToStr(NBox)+' Box[es].');
if(demons>0)then
WriteLn(' Solved '+IntToStr(demons)+' Demon.');
if(logs>0)then
WriteLn(' Logged in '+IntToStr(logs)+' Time.');
WriteLn('<======================================== ================>');
end;
PlayerStats;
end;
{+++++++++++++++++++++++++++++++++++++++++++++++++ +++++++++++++++++++++++++++++}
procedure LoadStuff;
begin
end;
{+++++++++++++++++++++++++++++++++++++++++++++++++ +++++++++++++++++++++++++++++}
function FindEastVarrockRoadColor(RX1, RY1, RX2, RY2:integer): Integer;
var
C,TX,TY: Integer;
bmpVarrockEastRoad: Integer;
begin
bmpVarrockEastRoad := BitmapFromString(6, 6, 'z78DA33333075' +
'3475341B76240021642F89');
while(C < 65)do
begin
C:=C+5;
if(FindBitMapToleranceIn(bmpVarrockEastRoad, TX, TY, RX1, RY1, RX2, RY2, C))then
begin
RoadColor:=GetColor(TX,TY);
Players[CurrentPlayer].Loc:= 'Varrock';
Result:=RoadColor;
WriteLn('RoadColor: ' + IntToStr(RoadColor) + ', X = ' + IntToStr(TX) +
', Y = ' + IntToStr(TY));
Break;
end;
end;
if(Result = 0)then
begin
WriteLn('ERROR: RoadColor NOT Found. Start the script over again or switch ' +
'worlds. Terminating script.');
TerminateScript;
end;
FreeBitmap(bmpVarrockEastRoad);
end;
{+++++++++++++++++++++++++++++++++++++++++++++++++ +++++++++++++++++++++++++++++}
function FindMapOreColor:integer;
var
MapOre,MapOre2:integer;
begin
MapOre:= BitmapFromString(3, 3,
'3D2C345948546D5D624A39416D5D626D5D625948546D5D626 D5D62' +
'');
MapOre2:= BitmapFromString(3, 3,
'061115222D35364243131E22364243364243222D353642433 64243' +
'');
if(FindBitmapsProgressiveTol(MapOre, MapOre2, 0, 0, 0, 65, 5, 587, 41, 705, 118))then
Result:= GetColor(x+1,y+1);
FreeBitmap(MapOre);
FreeBitmap(MapOre2);
end;
{+++++++++++++++++++++++++++++++++++++++++++++++++ +++++++++++++++++++++++++++++}
procedure FindColorOfOre(Ore: String);
var
Count: Integer;
begin
if(OreColor1 = 0)or(OreColor2 = 0)or(OreColor3 = 0)then
begin
Count:= 0;
case(Ore)of
'Iron':
repeat
if(FindOreColors(2503250, 5, 15))then
break;
Count:= Count + 1
if(Count > 99)then
begin
WriteLn('Could not find Ore Color –> Switching player.')
Logout;
end;
until(Count > 99);
'Tin':
repeat
if(FindOreColors(8750479, 5, 15))then
break;
Count:= Count + 1
if(Count > 99)then
begin
WriteLn('Could not find Ore Color –> Switching player.')
Logout;
end;
until(Count > 99);
'Copper':
repeat
if(FindOreColors(4483472, 5, 15))then
break;
Count:= Count + 1
if(Count > 99)then
begin
WriteLn('Could not find Ore Color –> Switching player.')
Logout;
end;
until(Count > 99);
end;
end;
end;
{+++++++++++++++++++++++++++++++++++++++++++++++++ +++++++++++++++++++++++++++++}
procedure ResetOreColors;
begin
OreColor1:= 0;
OreColor2:= 0;
OreColor3:= 0;
end;
{+++++++++++++++++++++++++++++++++++++++++++++++++ +++++++++++++++++++++++++++++}
procedure SetupScript;
var
c: Integer;
begin
SetupSRL;
SetupSRLMining;
LoadStuff;
EquipPick:= True; // Wielding.
PickUpItems:=True; // to pick up random items when pickhead is gone.
DeclarePlayers;
ActivateClient;
LoginPlayer;
Wait(1000 + Random(500));
FindEastVarrockRoadColor(580, 50, 630, 80);
MiniMapRockColor:= FindMapOreColor;
WriteLn('MiniMapRockColor: ' + IntToStr(MiniMapRockColor));
SymbolAccuracy:= 0.4; // temporarily reduce symbolaccuracy for better symbol spotting
repeat
C:= C + 1;
wait(100);
BankColor:= GetSymbolColor(x1, y1, 'bank');
until (C>100) or (BankColor<>0);
WriteLn('BankColor = '+ IntToStr(BankColor));
if(BankColor > 0)then
Players[CurrentPlayer].loc:= 'Varrock'
else
begin
WriteLn('ERROR: BankColor NOT Found. Start the script over again or switch ' +
'to a less-crowded world. Terminating script.');
TerminateScript;
end;
SymbolAccuracy:= 0.8; // set symbolacc. to default
end;
{+++++++++++++++++++++++++++++++++++++++++++++++++ +++++++++++++++++++++++++++++}
function PlayerIsInBank: Boolean;
begin
if(FindColor(x1, y1, BankColor, MMX1, MMY1, MMX2, MMY2))then
begin
ActiveDebug('Current player is in the Bank.');
Players[CurrentPlayer].loc:= 'Varrock';
Result:= True;
end;
end;
{+++++++++++++++++++++++++++++++++++++++++++++++++ +++++++++++++++++++++++++++++}
function PlayerIsAtMine(Click: Boolean): Boolean;
begin
if(FindMMColor(x1, y1, MiniMapMineColor))then
begin
if(Click)then
begin
Mouse(x1, y1, 3, 3, True);
Flag;
end;
ActiveDebug('Player is at Mining Site.');
Players[CurrentPlayer].loc:= 'Mine';
Result:= True;
end;
end;
{+++++++++++++++++++++++++++++++++++++++++++++++++ +++++++++++++++++++++++++++++
+ A random box clicker. Will try to solve the box ONCE, by a random click +
+ @ any of the three answers. THIS IS NOT A BOXSOLVER, JUST A BOXCLICKER! +
++++++++++++++++++++++++++++++++++++++++++++++++++ +++++++++++++++++++++++++++++}
function GambleNewBox:Boolean;
var
xb, yb :integer;
begin
if(FindBitMapToleranceIn(NewBox, xb, yb, MIX1, MIY1, MIX2, MIY2, 20))then
begin
Mouse(xb, yb, 0, 0, True);
Wait(2000);
case(Random(3))of
0: Mouse(145, 295, 4, 4, True);
1: Mouse(270, 295, 4, 4, True);
2: Mouse(381, 295, 4, 4, True);
end;
IdleTime(4000, 2000, 1.0);
if(FindBitMapToleranceIn(NewBox, xb, yb, MIX1, MIY1, MIX2, MIY2, 20))then
begin
WriteLn('Box Missed');
Logout;
Exit;
end else;
begin
writeln('Box solved');
NBox:= NBox + 1;
Result:=True;
end;
end;
end;
{+++++++++++++++++++++++++++++++++++++++++++++++++ +++++++++++++++++++++++++++++}
function HandleGas: Boolean;
var
gx, gy:integer;
begin
SetRandomOreColor;
if(FindColorSpiralTolerance(gx, gy, Orecolor, 210, 130, 300, 220, 5))then
begin
if(FindGas(gx, gy))then
begin
PlayerIsAtMine(True);
Result:=True;
end;
end;
end;
{+++++++++++++++++++++++++++++++++++++++++++++++++ +++++++++++++++++++++++++++++}
procedure RunAway;
begin
case(Players[CurrentPlayer].loc)of
'Varrock': RunTo('E', False);
'To bank': RunTo('S', False)
'To mine': RunTo('N', False);
'Mine': RunTo('N', True);
end;
end;
{+++++++++++++++++++++++++++++++++++++++++++++++++ +++++++++++++++++++++++++++++}
procedure FindRandoms;
begin
CloseWindow;
FindLamp('mining');
FindDead;
//FindMod;
FindMime;
FindMaze;
FindQuiz;
FindFrog;
FindDoctor;
GambleNewBox;
FindDemon;
if(FindFight)then
RunAway;
if(Findname)then
FindTalk;
if(FindNewBox)then
begin
Players[CurrentPlayer].Active:= False;
Logout;
end;
end;
{+++++++++++++++++++++++++++++++++++++++++++++++++ +++++++++++++++++++++++++++++}
procedure Bank;
begin
if(not(LoggedIn))then
Exit;
if(NoPick)and(EquipPick)then
begin
if(InventoryFull)then
begin
if(FindBitmapSpiralTolerance(Ore, x, y, 559, 210, 735, 460, 25))then
begin
Mouse(x, y, 5, 5, false);
ChooseOption(x, y, 'Drop');
end;
end;
GameTab(5);
Mouse(593, 303, 0, 0, true);
Wait(Random(1000) + 2000);
GameTab(4);
end;
TotalOres:= TotalOres + (CountItemBmpTol(Ore, 50));
MarkTime(Mark);
if(not(BankScreen))then
begin
repeat
if(not(Loggedin))then
Break;
OpenBank3;
until((BankScreen)or(TimeFromMark(Mark)>60000));
end;
if(BankScreen)then
begin
Wait(Random(2000) + 200);
FixBank;
if(NoPick)then
begin
ClickAllItemsColorWait('All', 65536, 1000 + Random(100));
Wait(Random(2000) + 200);
Withdraw(1, 1, 1);
Wait(Random(2000) + 200);
end else
begin
if(not(EquipPick))then
Deposit(2, 28, 2);
Wait(Random(2000) + 200);
if(EquipPick)then
begin
ClickAllItemsColorWait('All', 65536, 1000 + Random(100));
Wait(Random(2000) + 200);
end;
end;
CloseWindow;
if(NoPick)and(EquipPick)then
begin
FindPickHeadColor;
Wait(Random(1000) + 200);
ClickItemColor(hc1, True);
end;
Banks:= Banks + 1;
Players[CurrentPlayer].Banked:= Players[CurrentPlayer].Banked + 1;
NoPick:= False;
end;
end;
{+++++++++++++++++++++++++++++++++++++++++++++++++ +++++++++++++++++++++++++++++}
procedure MineTheRocks;
var
SysTime:integer;
begin
if(FindOreColor)then
SetRandomOreColor
else
case(Players[CurrentPlayer].Skill)of
'Iron': OreColor:= 2503250;
'Tin': OreColor:= 8750479;
'Copper': Orecolor:= 4483472;
end;
if(not(LoggedIn))then
Exit;
if(FindObj(x, y, 'Mine', OreColor, 5))then
begin
if(not(FindGas(x, y)))then
begin
Mouse(x, y, 5, 0, true);
if(FlagPresent)then
begin
Flag;
Wait(500 + Random(500));
end;
MarkTime(SysTime);
repeat
if(not(Loggedin))then
Break;
Wait(500 + Random(500));
FindRandoms;
FindPick;
if(HandleGas)then
Break;
until(not(GetColor(109, 430) =0 )and(not(GetColor(195, 426) = 0)))or
(TimeFromMark(SysTime) >= MaxWait * 1000)
end;
end;
end;
{+++++++++++++++++++++++++++++++++++++++++++++++++ +++++++++++++++++++++++++++++}
procedure WalkToVarrockEastMine;
begin
if(not(LoggedIn))then
Exit;
ActiveDebug('Walking to mine.');
Players[CurrentPlayer].loc:= 'To mine';
RadialWalk(RoadColor, 0, 110, 65, -1, 1);
RadialWalk(RoadColor, 45, 135, 55, -1, 1);
MarkTime(Mark);
repeat
if(TimeFromMark(Mark) > 120000)then
begin
Logout;
Exit;
end;
FindRandoms;
LinearWalk(RoadColor, 90, 45, -1, 1);
until(FindColor(x1, y1, RoadColor, 630, 10, 680, 40));
ActiveDebug('Reached intersection –> Heading south.');
MarkTime(Mark);
if(MiniMapMineColor = 0)then
SymbolAccuracy:= 0.5;
repeat
if(TimeFromMark(Mark) > 120000)then
begin
Logout;
Exit;
end;
FindRandoms;
RadialWalk(RoadColor, 90, 220, 54, -1, 1);
until((FindSymbol(x1, y1, 'mining spot'))and(MiniMapMineColor = 0))or
((FindMMColor(x1, y1, MiniMapMineColor))and(not(MiniMapMineColor = 0)));
if(MiniMapMineColor = 0)then
begin
MiniMapMineColor:= GetSymbolColor(x1, y1, 'mining spot');
WriteLn('MiniMapMine Color = ' + IntToStr(MiniMapMineColor));
Mouse(x1, y1, 3, 3, True);
Flag;
SymbolAccuracy:= 0.8;
end else
begin
Mouse(x1, y1, 3, 3, True);
Flag;
end;
end;
{+++++++++++++++++++++++++++++++++++++++++++++++++ +++++++++++++++++++++++++++++}
procedure WalkToVarrockEastBank;
begin
if(not(LoggedIn))then
Exit;
ActiveDebug('Walking to Bank.');
Players[CurrentPlayer].loc:= 'To bank';
LinearWalk(RoadColor, 45, 70, -1, 1);
Wait(500 + Random(500));
RadialWalk(RoadColor, 390, 300, 60, -1, 1);
MarkTime(Mark);
repeat
if(TimeFromMark(Mark) > 120000)then
begin
Logout;
Exit;
end;
FindRandoms;
RadialWalk(RoadColor, 390, 300, 45, -1, 1);
until(FindColor(x1, y1, MiniMapRockColor, 595, 5, 700, MMCY - 10)); //80
ActiveDebug('Reached Intersection –> Heading west.');
RadialWalk(RoadColor, 320, 200, 45, 1, 1);
Wait(500 + Random(500));
RadialWalk(RoadColor, 320, 200, 35, 1, 1);
MarkTime(Mark);
repeat
if(TimeFromMark(Mark) > 120000)then
begin
Logout;
Exit;
end;
FindRandoms;
LinearWalk(RoadColor, 255, 55, -1, 1);
until(FindMMColor(x1, y1, BankColor));
Mouse(x1, y1, 3, 3, True);
Flag;
ToBankers(BankColor, 1, 1);
Players[CurrentPlayer].loc:= 'Varrock';
end;
{+++++++++++++++++++++++++++++++++++++++++++++++++ +++++++++++++++++++++++++++++}
begin
SetupScript;
NickNameBMP:= CreateBitmapMaskFromText(Players[CurrentPlayer].Nick,UpChars); // In case we started logged in not logged out.
repeat
Players[CurrentPlayer].MiningLevel:= GetSkillLevel('mine');
if(LoggedIn)then
begin
SetChat('on',1);
SetChat('off',2);
SetChat('off',3);
FixChat;
SetChat('on',1);
end;
PerfectNorth;
if(not(FindPickheadColor))then
Logout;
GameTab(4);
if(PlayerIsInBank)then
WalkToVarrockEastMine;
if(PlayerIsAtMine(False))then
begin
Wait(2000 + Random(500));
if(FindOreColor)then
FindColorOfOre(Players[CurrentPlayer].Skill);
Wait(1000 + Random(500));
SetRun(True);
MarkTime(Mark);
repeat
MineTheRocks;
Wait(100);
FindRandoms;
if(not(Loggedin))then
Break;
until(InventoryFull)or(NoPick)or(TimeFromMark(Mark ) > 1800000);
SetRun(False);
PerfectNorth;
WalkToVarrockEastBank;
Bank;
FindRandoms;
Players[CurrentPlayer].MiningLevel:= GetSkillLevel('mining');
ProgressReport;
PerfectNorth;
end;
if((LoggedIn)and(Players[CurrentPlayer].Banked mod TripsPerCharacter = 0))then
begin
SetChat('off', 1);
repeat
Wait(1000);
FindRandoms;
until(not(LoggedIn));
ResetOreColors;
NextPlayer(True);
end;
if(not(Loggedin))then
begin
ResetOreColors;
NextPlayer(False);
end;
until(False);
end.[/php]
hope it helped
-chaos-
2006-05-21 01:53:15
Duplicate identifier means theres another variable/const like that somewhere else all you need to do is change it :p
[php]{================================================= ========================]
[ SRL East Varrock Miner 1.0.1b1 ]
[ ]
[ NAME : Varrock East Miner. ]
[ WRITER : Kernel Klink ]
[ CATEGORY : Miner ]
[ DESCRIPTION : See Below. ]
[ USAGE : Miner/Banker for Iron, Tin, and Copper. ]
[ AUTOCOLOR : Yes ]
[ NOTES : My first SRL style script. Love it or hate it. ]
[ CONTACT : Klink.Kernel@gmail.com ]
[ ]
[ ]
[================================================== =======================]
[ *Description: ]
[ A macro that mines a full load of Iron, Tin, or Copper at the East ]
[ Varrock Mine and banks at the East Varrock Bank. ]
[================================================== =======================]
[ Instructions. ]
[================================================== =======================]
[ 1. USE Runescape with Low Detail, Very Bright. ]
[ 2. Set your Screen to 32 bit TRUE color. ]
[ 3. Set Playernames and Passwords in DeclarePlayers. ]
[ 4. SET HOWMANYPLAYERS inside DeclarePlayers ]
[ 5. Have pickaxe WIELDED! ]
[ 6. Recommended to have extra pickaxes in first bank slot. ]
[ 7. START @ VARROCK EASTBANK LEFTMOST BANKBOOTH FACE MM PERFECTLY NORTH ]
[ 8. Have EVERY other player of yours positioned @ Varrock eastbank ]
[ leftmost bankbooth. ]
[ 9. SET the ORE you wish to mine in DeclarePlayers in the Players[].Skill]
[ variable. ]
[ 10. CLICK and DRAG the CROSSHAIR over the Runescape client. Then press ]
[ the green arrow. ]
[================================================== =======================}
program VarrockEastMiner;
{.include SRL/SRL.Scar}
{.include SRL/SRL/Skill/Mining.Scar}
var
x1, y1: Integer;
MiniMapRockColor, MiniMapMineColor: Integer;
TotalOres: Integer;
NBox: Integer;
{+++++++++++++++++++++++++++++++++++++++++++++++++ +++++++++++++++++++++++++++++}
const
StartPlayer = 0;
TripsPerCharacter = 7; // Number of loads to complete before switching player.
MaxWait = 8; // Interval to wait between clicking rocks while mining.
FindOreColor = False; // Keep this at false unless told otherwise. This way
// the script does not need to find the Ore Color. It
// works anyways.
ActivelyDebug = False;
{+++++++++++++++++++++++++++++++++++++++++++++++++ +++++++++++++++++++++++++++++}
VersionNumber = '1.0.1b1'; // Do NOT change this constant.
{+++++++++++++++++++++++++++++++++++++++++++++++++ +++++++++++++++++++++++++++++}
procedure DeclarePlayers;
begin
HowManyPlayers:= 4; // Set Number of Players here.
NumberOfPlayers(HowManyPlayers); // Sets the Players Array Length;
CurrentPlayer:= StartPlayer; // CurrentPlayer = Array Index
Players[0].Name :='';
Players[0].Pass :='';
Players[0].Nick :='';
Players[0].Loc :='Varrock';
Players[0].Skill:='Tin'; // Type of Ore you wish to mine.
// Valid arguments: Copper, Tin, or Iron
// Make sure the first letter of the ore is
// capitalized.
Players[0].Active:=True;
Players[1].Name :='';
Players[1].Pass :='';
Players[1].Nick :='';
Players[1].Loc :='Varrock';
Players[1].Skill:='Iron';
Players[1].Active:=True;
Players[2].Name :='';
Players[2].Pass :='';
Players[2].Nick :='';
Players[2].Loc :='Varrock';
Players[2].Skill:='Copper';
Players[2].Active:=True;
Players[3].Name :='';
Players[3].Pass :='';
Players[3].Nick :='';
Players[3].Loc :='Varrock';
Players[3].Skill:='Tin';
Players[3].Active:=True;
Players[4].Name :='';
Players[4].Pass :='';
Players[4].Nick :='';
Players[4].Loc :='Varrock';
Players[4].Skill:='Iron';
Players[4].Active:=True;
Players[5].Name :='';
Players[5].Pass :='';
Players[5].Nick :='';
Players[5].Loc :='Varrock';
Players[5].Skill:='Copper';
Players[5].Active:=True;
WriteLn(IntToStr(HowManyPlayers) + ' Players');
end;
{+++++++++++++++++++++++++++++++++++++++++++++++++ +++++++++++++++++++++++++++++}
procedure ActiveDebug(Text: String);
begin
if(ActivelyDebug)then
WriteLn('[Debug]: ' + Text);
if(not(ActivelyDebug))then
Status('[Debug]: ' + Text);
end;
{+++++++++++++++++++++++++++++++++++++++++++++++++ +++++++++++++++++++++++++++++}
procedure PlayerStats;
var
Active: string;
i: Integer;
begin
WriteLn('———————————————');
WriteLn('Name : ' + Players[CurrentPlayer].Name);
WriteLn('Number : ' + IntToStr(CurrentPlayer));
WriteLn('Mining Level : ' + IntToStr(Players[CurrentPlayer].MiningLevel));
WriteLn('Select Skill : ' + Players[CurrentPlayer].Skill);
WriteLn('Worked for : ' + IntToStr(Players[CurrentPlayer].Worked) + ' minutes.');
WriteLn('Banked : ' + IntToStr(Players[CurrentPlayer].Banked) + ' times.');
if(Players[CurrentPlayer].Active)then
Active:= 'True'
else
Active:= 'False';
WriteLn('Active : '+ Active);
WriteLn('Location : '+ Players[CurrentPlayer].loc);
WriteLn('———————————————');
for i := 0 to HowManyPlayers-1 do
begin
if Players.Active=True then
Active:='True'
else
Active:= 'False';
WriteLn((IntToStr(i)) + ' : ' + Players.name + ' = ' + Active +'. - Lvl : ' + IntToStr(Players.MiningLevel) +
'. - B :' + IntToStr(Players.Banked)+' Times.' +
' - : ' + IntToStr(Players.Worked) + ' mins.' + ' - Loc: ' + Players.loc);
end;
WriteLn('———————————————');
end;
{+++++++++++++++++++++++++++++++++++++++++++++++++ +++++++++++++++++++++++++++++}
procedure ProgressReport;
begin
begin
WriteLn(' ');
WriteLn('<============== -'+VersionNumber+'- Progress Report ===============>');
writeln('Worked for '+ TimeRunning);
WriteLn('Banked '+IntToStr(banks)+' loads.');
if (Players[CurrentPlayer].Skill= 'Tin') then
begin
WriteLn('Banked ' + IntToStr(TotalOres) + ' Tin ores.');
WriteLn('Gained ' + FloatToStr(17.5 * TotalOres) + 'xp.');
end;
if (Players[CurrentPlayer].Skill= 'Copper') then
begin
WriteLn('Banked ' + IntToStr(TotalOres) + ' Copper ores.');
WriteLn('Gained ' + FloatToStr(17.5 * TotalOres) + 'xp.');
end;
if (Players[CurrentPlayer].Skill= 'Iron') then
begin
WriteLn('Banked ' + IntToStr(TotalOres) + ' Iron ores.');
WriteLn('Gained ' + FloatToStr(35 * TotalOres) + 'xp.');
end;
WriteLn('Random Event Report:');
if(fights>0)then
WriteLn(' Fought '+IntToStr(fights)+' Time.');
if(talks>0)then
WriteLn(' Talked to '+IntToStr(talks)+' Random event.');
if(lamps>0)then
WriteLn(' Used lamps '+IntToStr(lamps)+' Time.');
if(doctors>0)then
WriteLn(' Solved '+IntToStr(doctors)+' Fords.');
if(frogs>0)then
WriteLn(' Solved '+IntToStr(frogs)+' Frog.');
if(NBox>0)then
WriteLn(' Solved '+IntToStr(NBox)+' Box[es].');
if(demons>0)then
WriteLn(' Solved '+IntToStr(demons)+' Demon.');
if(logs>0)then
WriteLn(' Logged in '+IntToStr(logs)+' Time.');
WriteLn('<======================================== ================>');
end;
PlayerStats;
end;
{+++++++++++++++++++++++++++++++++++++++++++++++++ +++++++++++++++++++++++++++++}
procedure LoadStuff;
begin
end;
{+++++++++++++++++++++++++++++++++++++++++++++++++ +++++++++++++++++++++++++++++}
function FindEastVarrockRoadColor(RX1, RY1, RX2, RY2:integer): Integer;
var
C,TX,TY: Integer;
bmpVarrockEastRoad: Integer;
begin
bmpVarrockEastRoad := BitmapFromString(6, 6, 'z78DA33333075' +
'3475341B76240021642F89');
while(C < 65)do
begin
C:=C+5;
if(FindBitMapToleranceIn(bmpVarrockEastRoad, TX, TY, RX1, RY1, RX2, RY2, C))then
begin
RoadColor:=GetColor(TX,TY);
Players[CurrentPlayer].Loc:= 'Varrock';
Result:=RoadColor;
WriteLn('RoadColor: ' + IntToStr(RoadColor) + ', X = ' + IntToStr(TX) +
', Y = ' + IntToStr(TY));
Break;
end;
end;
if(Result = 0)then
begin
WriteLn('ERROR: RoadColor NOT Found. Start the script over again or switch ' +
'worlds. Terminating script.');
TerminateScript;
end;
FreeBitmap(bmpVarrockEastRoad);
end;
{+++++++++++++++++++++++++++++++++++++++++++++++++ +++++++++++++++++++++++++++++}
function FindMapOreColor:integer;
var
MapOre,MapOre2:integer;
begin
MapOre:= BitmapFromString(3, 3,
'3D2C345948546D5D624A39416D5D626D5D625948546D5D626 D5D62' +
'');
MapOre2:= BitmapFromString(3, 3,
'061115222D35364243131E22364243364243222D353642433 64243' +
'');
if(FindBitmapsProgressiveTol(MapOre, MapOre2, 0, 0, 0, 65, 5, 587, 41, 705, 118))then
Result:= GetColor(x+1,y+1);
FreeBitmap(MapOre);
FreeBitmap(MapOre2);
end;
{+++++++++++++++++++++++++++++++++++++++++++++++++ +++++++++++++++++++++++++++++}
procedure FindColorOfOre(Ore: String);
var
Count: Integer;
begin
if(OreColor1 = 0)or(OreColor2 = 0)or(OreColor3 = 0)then
begin
Count:= 0;
case(Ore)of
'Iron':
repeat
if(FindOreColors(2503250, 5, 15))then
break;
Count:= Count + 1
if(Count > 99)then
begin
WriteLn('Could not find Ore Color –> Switching player.')
Logout;
end;
until(Count > 99);
'Tin':
repeat
if(FindOreColors(8750479, 5, 15))then
break;
Count:= Count + 1
if(Count > 99)then
begin
WriteLn('Could not find Ore Color –> Switching player.')
Logout;
end;
until(Count > 99);
'Copper':
repeat
if(FindOreColors(4483472, 5, 15))then
break;
Count:= Count + 1
if(Count > 99)then
begin
WriteLn('Could not find Ore Color –> Switching player.')
Logout;
end;
until(Count > 99);
end;
end;
end;
{+++++++++++++++++++++++++++++++++++++++++++++++++ +++++++++++++++++++++++++++++}
procedure ResetOreColors;
begin
OreColor1:= 0;
OreColor2:= 0;
OreColor3:= 0;
end;
{+++++++++++++++++++++++++++++++++++++++++++++++++ +++++++++++++++++++++++++++++}
procedure SetupScript;
var
c: Integer;
begin
SetupSRL;
SetupSRLMining;
LoadStuff;
EquipPick:= True; // Wielding.
PickUpItems:=True; // to pick up random items when pickhead is gone.
DeclarePlayers;
ActivateClient;
LoginPlayer;
Wait(1000 + Random(500));
FindEastVarrockRoadColor(580, 50, 630, 80);
MiniMapRockColor:= FindMapOreColor;
WriteLn('MiniMapRockColor: ' + IntToStr(MiniMapRockColor));
SymbolAccuracy:= 0.4; // temporarily reduce symbolaccuracy for better symbol spotting
repeat
C:= C + 1;
wait(100);
BankColor:= GetSymbolColor(x1, y1, 'bank');
until (C>100) or (BankColor<>0);
WriteLn('BankColor = '+ IntToStr(BankColor));
if(BankColor > 0)then
Players[CurrentPlayer].loc:= 'Varrock'
else
begin
WriteLn('ERROR: BankColor NOT Found. Start the script over again or switch ' +
'to a less-crowded world. Terminating script.');
TerminateScript;
end;
SymbolAccuracy:= 0.8; // set symbolacc. to default
end;
{+++++++++++++++++++++++++++++++++++++++++++++++++ +++++++++++++++++++++++++++++}
function PlayerIsInBank: Boolean;
begin
if(FindColor(x1, y1, BankColor, MMX1, MMY1, MMX2, MMY2))then
begin
ActiveDebug('Current player is in the Bank.');
Players[CurrentPlayer].loc:= 'Varrock';
Result:= True;
end;
end;
{+++++++++++++++++++++++++++++++++++++++++++++++++ +++++++++++++++++++++++++++++}
function PlayerIsAtMine(Click: Boolean): Boolean;
begin
if(FindMMColor(x1, y1, MiniMapMineColor))then
begin
if(Click)then
begin
Mouse(x1, y1, 3, 3, True);
Flag;
end;
ActiveDebug('Player is at Mining Site.');
Players[CurrentPlayer].loc:= 'Mine';
Result:= True;
end;
end;
{+++++++++++++++++++++++++++++++++++++++++++++++++ +++++++++++++++++++++++++++++
+ A random box clicker. Will try to solve the box ONCE, by a random click +
+ @ any of the three answers. THIS IS NOT A BOXSOLVER, JUST A BOXCLICKER! +
++++++++++++++++++++++++++++++++++++++++++++++++++ +++++++++++++++++++++++++++++}
function GambleNewBox:Boolean;
var
xb, yb :integer;
begin
if(FindBitMapToleranceIn(NewBox, xb, yb, MIX1, MIY1, MIX2, MIY2, 20))then
begin
Mouse(xb, yb, 0, 0, True);
Wait(2000);
case(Random(3))of
0: Mouse(145, 295, 4, 4, True);
1: Mouse(270, 295, 4, 4, True);
2: Mouse(381, 295, 4, 4, True);
end;
IdleTime(4000, 2000, 1.0);
if(FindBitMapToleranceIn(NewBox, xb, yb, MIX1, MIY1, MIX2, MIY2, 20))then
begin
WriteLn('Box Missed');
Logout;
Exit;
end else;
begin
writeln('Box solved');
NBox:= NBox + 1;
Result:=True;
end;
end;
end;
{+++++++++++++++++++++++++++++++++++++++++++++++++ +++++++++++++++++++++++++++++}
function HandleGas: Boolean;
var
gx, gy:integer;
begin
SetRandomOreColor;
if(FindColorSpiralTolerance(gx, gy, Orecolor, 210, 130, 300, 220, 5))then
begin
if(FindGas(gx, gy))then
begin
PlayerIsAtMine(True);
Result:=True;
end;
end;
end;
{+++++++++++++++++++++++++++++++++++++++++++++++++ +++++++++++++++++++++++++++++}
procedure RunAway;
begin
case(Players[CurrentPlayer].loc)of
'Varrock': RunTo('E', False);
'To bank': RunTo('S', False)
'To mine': RunTo('N', False);
'Mine': RunTo('N', True);
end;
end;
{+++++++++++++++++++++++++++++++++++++++++++++++++ +++++++++++++++++++++++++++++}
procedure FindRandoms;
begin
CloseWindow;
FindLamp('mining');
FindDead;
//FindMod;
FindMime;
FindMaze;
FindQuiz;
FindFrog;
FindDoctor;
GambleNewBox;
FindDemon;
if(FindFight)then
RunAway;
if(Findname)then
FindTalk;
if(FindNewBox)then
begin
Players[CurrentPlayer].Active:= False;
Logout;
end;
end;
{+++++++++++++++++++++++++++++++++++++++++++++++++ +++++++++++++++++++++++++++++}
procedure Bank;
begin
if(not(LoggedIn))then
Exit;
if(NoPick)and(EquipPick)then
begin
if(InventoryFull)then
begin
if(FindBitmapSpiralTolerance(Ore, x, y, 559, 210, 735, 460, 25))then
begin
Mouse(x, y, 5, 5, false);
ChooseOption(x, y, 'Drop');
end;
end;
GameTab(5);
Mouse(593, 303, 0, 0, true);
Wait(Random(1000) + 2000);
GameTab(4);
end;
TotalOres:= TotalOres + (CountItemBmpTol(Ore, 50));
MarkTime(Mark);
if(not(BankScreen))then
begin
repeat
if(not(Loggedin))then
Break;
OpenBank3;
until((BankScreen)or(TimeFromMark(Mark)>60000));
end;
if(BankScreen)then
begin
Wait(Random(2000) + 200);
FixBank;
if(NoPick)then
begin
ClickAllItemsColorWait('All', 65536, 1000 + Random(100));
Wait(Random(2000) + 200);
Withdraw(1, 1, 1);
Wait(Random(2000) + 200);
end else
begin
if(not(EquipPick))then
Deposit(2, 28, 2);
Wait(Random(2000) + 200);
if(EquipPick)then
begin
ClickAllItemsColorWait('All', 65536, 1000 + Random(100));
Wait(Random(2000) + 200);
end;
end;
CloseWindow;
if(NoPick)and(EquipPick)then
begin
FindPickHeadColor;
Wait(Random(1000) + 200);
ClickItemColor(hc1, True);
end;
Banks:= Banks + 1;
Players[CurrentPlayer].Banked:= Players[CurrentPlayer].Banked + 1;
NoPick:= False;
end;
end;
{+++++++++++++++++++++++++++++++++++++++++++++++++ +++++++++++++++++++++++++++++}
procedure MineTheRocks;
var
SysTime:integer;
begin
if(FindOreColor)then
SetRandomOreColor
else
case(Players[CurrentPlayer].Skill)of
'Iron': OreColor:= 2503250;
'Tin': OreColor:= 8750479;
'Copper': Orecolor:= 4483472;
end;
if(not(LoggedIn))then
Exit;
if(FindObj(x, y, 'Mine', OreColor, 5))then
begin
if(not(FindGas(x, y)))then
begin
Mouse(x, y, 5, 0, true);
if(FlagPresent)then
begin
Flag;
Wait(500 + Random(500));
end;
MarkTime(SysTime);
repeat
if(not(Loggedin))then
Break;
Wait(500 + Random(500));
FindRandoms;
FindPick;
if(HandleGas)then
Break;
until(not(GetColor(109, 430) =0 )and(not(GetColor(195, 426) = 0)))or
(TimeFromMark(SysTime) >= MaxWait * 1000)
end;
end;
end;
{+++++++++++++++++++++++++++++++++++++++++++++++++ +++++++++++++++++++++++++++++}
procedure WalkToVarrockEastMine;
begin
if(not(LoggedIn))then
Exit;
ActiveDebug('Walking to mine.');
Players[CurrentPlayer].loc:= 'To mine';
RadialWalk(RoadColor, 0, 110, 65, -1, 1);
RadialWalk(RoadColor, 45, 135, 55, -1, 1);
MarkTime(Mark);
repeat
if(TimeFromMark(Mark) > 120000)then
begin
Logout;
Exit;
end;
FindRandoms;
LinearWalk(RoadColor, 90, 45, -1, 1);
until(FindColor(x1, y1, RoadColor, 630, 10, 680, 40));
ActiveDebug('Reached intersection –> Heading south.');
MarkTime(Mark);
if(MiniMapMineColor = 0)then
SymbolAccuracy:= 0.5;
repeat
if(TimeFromMark(Mark) > 120000)then
begin
Logout;
Exit;
end;
FindRandoms;
RadialWalk(RoadColor, 90, 220, 54, -1, 1);
until((FindSymbol(x1, y1, 'mining spot'))and(MiniMapMineColor = 0))or
((FindMMColor(x1, y1, MiniMapMineColor))and(not(MiniMapMineColor = 0)));
if(MiniMapMineColor = 0)then
begin
MiniMapMineColor:= GetSymbolColor(x1, y1, 'mining spot');
WriteLn('MiniMapMine Color = ' + IntToStr(MiniMapMineColor));
Mouse(x1, y1, 3, 3, True);
Flag;
SymbolAccuracy:= 0.8;
end else
begin
Mouse(x1, y1, 3, 3, True);
Flag;
end;
end;
{+++++++++++++++++++++++++++++++++++++++++++++++++ +++++++++++++++++++++++++++++}
procedure WalkToVarrockEastBank;
begin
if(not(LoggedIn))then
Exit;
ActiveDebug('Walking to Bank.');
Players[CurrentPlayer].loc:= 'To bank';
LinearWalk(RoadColor, 45, 70, -1, 1);
Wait(500 + Random(500));
RadialWalk(RoadColor, 390, 300, 60, -1, 1);
MarkTime(Mark);
repeat
if(TimeFromMark(Mark) > 120000)then
begin
Logout;
Exit;
end;
FindRandoms;
RadialWalk(RoadColor, 390, 300, 45, -1, 1);
until(FindColor(x1, y1, MiniMapRockColor, 595, 5, 700, MMCY - 10)); //80
ActiveDebug('Reached Intersection –> Heading west.');
RadialWalk(RoadColor, 320, 200, 45, 1, 1);
Wait(500 + Random(500));
RadialWalk(RoadColor, 320, 200, 35, 1, 1);
MarkTime(Mark);
repeat
if(TimeFromMark(Mark) > 120000)then
begin
Logout;
Exit;
end;
FindRandoms;
LinearWalk(RoadColor, 255, 55, -1, 1);
until(FindMMColor(x1, y1, BankColor));
Mouse(x1, y1, 3, 3, True);
Flag;
ToBankers(BankColor, 1, 1);
Players[CurrentPlayer].loc:= 'Varrock';
end;
{+++++++++++++++++++++++++++++++++++++++++++++++++ +++++++++++++++++++++++++++++}
begin
SetupScript;
NickNameBMP:= CreateBitmapMaskFromText(Players[CurrentPlayer].Nick,UpChars); // In case we started logged in not logged out.
repeat
Players[CurrentPlayer].MiningLevel:= GetSkillLevel('mine');
if(LoggedIn)then
begin
SetChat('on',1);
SetChat('off',2);
SetChat('off',3);
FixChat;
SetChat('on',1);
end;
PerfectNorth;
if(not(FindPickheadColor))then
Logout;
GameTab(4);
if(PlayerIsInBank)then
WalkToVarrockEastMine;
if(PlayerIsAtMine(False))then
begin
Wait(2000 + Random(500));
if(FindOreColor)then
FindColorOfOre(Players[CurrentPlayer].Skill);
Wait(1000 + Random(500));
SetRun(True);
MarkTime(Mark);
repeat
MineTheRocks;
Wait(100);
FindRandoms;
if(not(Loggedin))then
Break;
until(InventoryFull)or(NoPick)or(TimeFromMark(Mark ) > 1800000);
SetRun(False);
PerfectNorth;
WalkToVarrockEastBank;
Bank;
FindRandoms;
Players[CurrentPlayer].MiningLevel:= GetSkillLevel('mining');
ProgressReport;
PerfectNorth;
end;
if((LoggedIn)and(Players[CurrentPlayer].Banked mod TripsPerCharacter = 0))then
begin
SetChat('off', 1);
repeat
Wait(1000);
FindRandoms;
until(not(LoggedIn));
ResetOreColors;
NextPlayer(True);
end;
if(not(Loggedin))then
begin
ResetOreColors;
NextPlayer(False);
end;
until(False);
end.[/php]
hope it helped