SCAR Code:
////////////////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////////////////
////////////////////////Runescapian's Dwarfen Mines Miner///////////////////////////////////
//////////////////////////////////Version 1.0///////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////////////////
///////This script mines and banks Iron, Copper, Tin, or Coal from the Dwarfen Mines////////
///////To run it, set up the stuff under 'const' and under 'procedure DeclarePlayers;'//////
///////Start at the Fally East bank.////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////////////////
///////Now, we all know the big problem with the Dwarfen Mines - Scorpians. This ///////////
///////Script will evade those scorpians by choosing a spot suitable for your combat ///////
///////level. Anyone with Combat 65+ will be sent to the mines with scorpians //////////////
///////(level 65 because the King Scorpians are level 32 and will not attack anyone ////////
///////over twice their level). However, you have the option of choosing where to go ///////
///////if you want./////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////////////////
/////Creds go to Da 0wner and everyone else who helped ( with errors/bugs) and all /////////
//////////////////the SRL Devs(for making these wonderful functions) :)/////////////////////
////////////////////////////////////////////////////////////////////////////////////////////
{
There are many different mines to mine at. Below is a list.
Scorpian infested
(The center would be the big pillar west of the stairs when you go down)
*Eastern Coal (ec)
*Southern Coal (sc) //default for coal
*Western Iron (wi) //default for iron
*NorthWest Copper (nwc) //default for copper
*NorthEast Tin (net) //default for tin
*Northern Coal (nc)
Safe spots (no scorpians)
(The Center is where the iron, copper, and one tin rock are located)
*SouthEast Tin (set) //default for tin
*Eastern Iron (ei)
*Center Iron (ci) //default for iron
*Center Copper (cc) //default for copper
*SouthWest Copper (swc)
**NOTE** - If you're under level 65 and you make it automatically pick a mine for you to mine coal, the script will go
to the next player after walking down the stairs.
So if you have a certain spot you want to mine at, put it in under the DeclarePlayers procedure
where it asks for it.
Remember, post progress reports on my thread and report any, I mean ANY, bugs you find. Whether
it gets lost, goes to the wrong mine, whatever.
Happy Autoing! :}
program DwarfMiner;
{.include SRL\SRL.scar}
var x,y,lvl, x1, y1, x2, y2, centerDDTM, CenterTol, CenterArea: integer;
const
FirstPlayer = 0; //Player to start with
world = 49;
procedure DeclarePlayers;
begin
SRLID:= ''; //put in your SRL Stats ID
SRLPassword:= ''; //put in your SRL Stats Password
HowManyPlayers := 5; //Leave these three lines be, unless you know what you're doing
CurrentPlayer := FirstPlayer;
NumberOfPlayers(HowManyPlayers);
Players[0].Name :='zezima'; //Runescape username
Players[0].Pass :='hilsioa'; //Runescape password
Players[0].Nick :='ezim'; //3 letters from the middle of you Runescape username
Players[0].Active:=True; //Do you want to use this player?
Players[0].Strings[0]:='rune'; //Type of pickaxe - 'rune', 'addy', 'mith', 'steel', 'iron', 'bronze'
Players[0].Booleans[0]:=false; //Is the pickaxe equipped? true or false
Players[0].Booleans[1]:=false; //Do you want the script to find out which mine to go to for the ore
//you want (true), or do you want to set it (false)?
Players[0].Strings[1]:='nwc'; //if the above option is false, set your location (see beginning of
//script to know what the following abbreviations mean) -
//ec, sc, wi, nwc, net, nc
//set, ei, ci, cc, swc
Players[0].Strings[2]:='iron'; //type of ore you want to mine - tin, copper, iron, coal
Players[1].Name :=''; //Runescape username
Players[1].Pass :=''; //Runescape password
Players[1].Nick :='nick'; //3 letters from the middle of you Runescape username
Players[1].Active:=False; //Do you want to use this player?
Players[1].Strings[0]:='rune'; //Type of pickaxe - 'rune', 'addy', 'mith', 'steel', 'iron', 'bronze'
Players[1].Booleans[0]:=false; //Is the pickaxe equipped? true or false
Players[1].Booleans[1]:=true; //Do you want the script to find out which mine to go to for the ore
//you want (true), or do you want to set it (false)?
Players[1].Strings[1]:='ec'; //if the above option is false, set your location (see beginning of
//script to know what the following abbreviations mean) -
//ec, sc, wi, nwc, net, nc
//set, ei, ci, cc, swc
Players[1].Strings[2]:='iron'; //type of ore you want to mine - tin, copper, iron, coal
Players[2].Name :=''; //Runescape username
Players[2].Pass :=''; //Runescape password
Players[2].Nick :='nick'; //3 letters from the middle of you Runescape username
Players[2].Active:=False; //Do you want to use this player?
Players[2].Strings[0]:='rune'; //Type of pickaxe - 'rune', 'addy', 'mith', 'steel', 'iron', 'bronze'
Players[2].Booleans[0]:=false; //Is the pickaxe equipped? true or false
Players[2].Booleans[1]:=true; //Do you want the script to find out which mine to go to for the ore
//you want (true), or do you want to set it (false)?
Players[2].Strings[1]:='ec'; //if the above option is false, set your location (see beginning of
//script to know what the following abbreviations mean) -
//ec, sc, wi, nwc, net, nc
//set, ei, ci, cc, swc
Players[2].Strings[2]:='iron'; //type of ore you want to mine - tin, copper, iron, coal
Players[3].Name :=''; //Runescape username
Players[3].Pass :=''; //Runescape password
Players[3].Nick :='nick'; //3 letters from the middle of you Runescape username
Players[3].Active:=False; //Do you want to use this player?
Players[3].Strings[0]:='rune'; //Type of pickaxe - 'rune', 'addy', 'mith', 'steel', 'iron', 'bronze'
Players[3].Booleans[0]:=false; //Is the pickaxe equipped? true or false
Players[3].Booleans[1]:=true; //Do you want the script to find out which mine to go to for the ore
//you want (true), or do you want to set it (false)?
Players[3].Strings[1]:='ec'; //if the above option is false, set your location (see beginning of
//script to know what the following abbreviations mean) -
//ec, sc, wi, nwc, net, nc
//set, ei, ci, cc, swc
Players[3].Strings[2]:='iron'; //type of ore you want to mine - tin, copper, iron, coal
Players[4].Name :=''; //Runescape username
Players[4].Pass :=''; //Runescape password
Players[4].Nick :='nick'; //3 letters from the middle of you Runescape username
Players[4].Active:=False; //Do you want to use this player?
Players[4].Strings[0]:='rune'; //Type of pickaxe - 'rune', 'addy', 'mith', 'steel', 'iron', 'bronze'
Players[4].Booleans[0]:=false; //Is the pickaxe equipped? true or false
Players[4].Booleans[1]:=true; //Do you want the script to find out which mine to go to for the ore
//you want (true), or do you want to set it (false)?
Players[4].Strings[1]:='ec'; //if the above option is false, set your location (see beginning of
//script to know what the following abbreviations mean) -
//ec, sc, wi, nwc, net, nc
//set, ei, ci, cc, swc
Players[4].Strings[2]:='iron'; //type of ore you want to mine - tin, copper, iron, coal
end;
procedure LoadCenterDDTM;
var
CenterMP: TDTMPointDef;
CenterSP: array[0..2] of TDTMPointDef;
CenterDDTMskel: TDTM;
CenterTol, CenterArea: Integer;
begin
CenterTol:=30;
CenterArea:=1;
CenterMP.x := 585;
CenterMP.y := 122;
CenterMP.areasize := 1;
CenterMP.areashape := 0;
CenterMP.color := 2252936;
CenterMP.tolerance := CenterTol;
CenterSP[0].x := 579;
CenterSP[0].y := 137;
CenterSP[0].areasize := CenterArea;
CenterSP[0].areashape := 0;
CenterSP[0].color := 5193797;
CenterSP[0].tolerance := CenterTol;
CenterSP[1].x := 572;
CenterSP[1].y := 110;
CenterSP[1].areasize := CenterArea;
CenterSP[1].areashape := 0;
CenterSP[1].color := 5193797;
CenterSP[1].tolerance := CenterTol;
CenterSP[2].x := 604;
CenterSP[2].y := 121;
CenterSP[2].areasize := CenterArea;
CenterSP[2].areashape := 0;
CenterSP[2].color := 15262962;
CenterSP[2].tolerance := CenterTol;
CenterDDTMSkel.MainPoint:=CenterMP;
CenterDDTMSkel.SubPoints:=CenterSP;
CenterDDTM:=AddDTM(CenterDDTMSkel);
end;
procedure TheDTMs;
begin
LoadCenterDDTM;
end;
procedure CheckSRLstats;
begin
end;
function Picklost: Boolean;
begin
end;
function Brokenpick : Boolean;
begin
end;
function Lostpick : Boolean;
begin
end;
procedure Findpickhead;
begin
end;
function Findgas : Boolean;
begin
end;
procedure Solvegas;
begin
end;
procedure AntiRandom;
begin
end;
procedure AntiBan;
begin
end;
procedure Login;
begin
Disguise('DwarfMiner - Running');
ActivateClient;
if not (Loggedin) then Loginplayer;
SetAngle(true);
MakeCompass('N');
SetBar('brightness', 4);
Lvl:=GetCombatLevel;
end;
procedure WalktoMine;
begin
RadialWalk(FindFallyRoadColor,40,110,72,99,99);
FFlag(6);
RadialWalk(FindFallyRoadColor,30,110,72,99,99);
FFlag(6);
RadialWalk(FindFallyRoadColor,50,120,72,99,99);
if FindObjTPA(x,y, 7377573, 17, -1, 10, 10, 50, ['pen', 'oord']) then
begin
mouse(x,y,2,2,true);
Writeln('Opened the door!');
end;
if FindObjTPA(x,y, 5790047, 17, -1, 10, 10, 50, ['own', 'air']) then
begin
mouse(x,y,2,2,true);
Writeln('Going down the staircase...');
if Inchat('reach') then
begin
if FindObjTPA(x,y, 7377573, 17, -1, 10, 10, 50, ['pen', 'oord']) then
begin
mouse(x,y,2,2,true);
Writeln('Opened the door!');
end;
if FindObjTPA(x,y, 5790047, 17, -1, 10, 10, 50, ['own', 'air']) then
begin
mouse(x,y,2,2,true);
Writeln('Going down the staircase...');
end;
end;
wait(5000+random(1000));
end
else
begin
writeln('Could not find stairs')
NextPlayer(false);
end;
end;
procedure EasternCoal;
begin
{You can see one coal rock. The Mining procedure waits for a total
of 35 sec for a rock to show up.}
Writeln('We are at the mine! (I think)');
end;
procedure SouthernCoal;
var looked, rx,ry: integer;
begin
looked:=0;
repeat
if DTMrotated(CenterDDTM, x,y,x1,y1,x2,y2) then
begin
mouse(x,y,2,2,true); //The DDTM usually doesn't work, but I kept
break; //it there as a failsafe.
end;
If FindColorSpiral(x,y,FindRockColor,558,85,578,116) then
begin
mouse(x,y,2,2,true);
wait(2500+random(300));
break;
end
else
begin
Centertol:=Centertol+3;
Centerarea:=Centerarea+1;
looked:=looked+1;
if (looked=6) then
begin
Writeln('Could not find the mining spot');
Disguise('Waiting for Next Player');
NextPlayer(false);
Disguise('DwarfMiner - Running');
end;
end;
until (looked=6);
If FindColorSpiralTolerance(x,y,FindRockColor,647,112,587,144,10) then
begin
mouse(x,y,2,2,true);
wait(2000);
Writeln('We are at the mine! (I think)')
exit;
end
else
begin
mouse(592+random(12),150+random(13),4,3,true); //I know cords are bad, but randomized ones aren't too bad
end;
wait(1000);
Writeln('We are at the mine! (I think)');
end;
procedure WesternIron;
var looked,tried, rx,ry: integer;
begin
looked:=0;
repeat
if DTMrotated(CenterDDTM, x,y,x1,y1,x2,y2) then
begin
mouse(x,y,2,2,true); //The DDTM usually doesn't work, but I kept
break; //it there as a failsafe.
end;
If FindColorSpiral(x,y,FindRockColor,558,85,578,116) then
begin
mouse(x,y,2,2,true);
wait(2500+random(300));
break;
end
else
begin
Centertol:=Centertol+3;
Centerarea:=Centerarea+1;
looked:=looked+1;
if (looked=6) then
begin
Writeln('Could not find the mining spot');
Disguise('Waiting for Next Player');
NextPlayer(false);
Disguise('DwarfMiner - Running');
end;
end;
until (looked=6);
repeat
If FindColorSpiralTolerance(x,y,FindRockColor,641,87,581,60,10) then
begin
mouse(x,y,2,2,true);
wait(2000);
writeln('We are at the mine! (I think)');
break;
end;
wait(1000);
tried:=tried+1;
until(tried=25)
Writeln('We are at the mine! (I think)');
end;
procedure NorthWestCopper;
var looked,tried, rx,ry: integer;
begin
looked:=0;
repeat
if DTMrotated(CenterDDTM, x,y,x1,y1,x2,y2) then
begin
mouse(x,y,2,2,true); //The DDTM usually doesn't work, but I kept
break; //it there as a failsafe.
end;
If FindColorSpiral(x,y,FindRockColor,558,85,578,116) then
begin
mouse(x,y,2,2,true);
wait(2500+random(300));
break;
end
else
begin
Centertol:=Centertol+3;
Centerarea:=Centerarea+1;
looked:=looked+1;
if (looked=6) then
begin
Writeln('Could not find the mining spot');
Disguise('Waiting for Next Player');
NextPlayer(false);
Disguise('DwarfMiner - Running');
end;
end;
until (looked=6);
mouse(615+random(6),58+random(7),4,3,true);
wait(2000);
writeln('We are at the mine! (I think)');
end;
procedure NorthEastTin;
begin
{You can see the tin rocks, no need to walk anywhere}
writeln('We are at the mine! (I think)');
end;
procedure NorthernCoal;
var looked,tried, rx,ry: integer;
begin
looked:=0;
repeat
if DTMrotated(CenterDDTM, x,y,x1,y1,x2,y2) then
begin
mouse(x,y,2,2,true); //The DDTM usually doesn't work, but I kept
break; //it there as a failsafe.
end;
If FindColorSpiral(x,y,FindRockColor,558,85,578,116) then
begin
mouse(x,y,2,2,true);
wait(2500+random(300));
break;
end
else
begin
Centertol:=Centertol+3;
Centerarea:=Centerarea+1;
looked:=looked+1;
if (looked=6) then
begin
Writeln('Could not find the mining spot');
Disguise('Waiting for Next Player');
NextPlayer(false);
Disguise('DwarfMiner - Running');
end;
end;
until (looked=6);
If FindColorSpiralTolerance(x,y,FindRockColor,635,65,597,27,10) then
begin
mouse(x,y,2,2,true)
wait(2000);
exit;
end
else
begin
mouse(615+random(14),58+random(13),4,3,true);
end;
wait(2000);
mouse(634+random(11),31+random(14),6,4,true);
wait(2000);
end;
procedure SouthEastTin;
begin
end;
procedure EasternIron;
begin
end;
procedure CenterIron;
begin
end;
procedure CenterCopper;
begin
end;
procedure SouthWestCopper;
begin
end;
procedure Autopickspot;
begin
if(Lvl<65) then
begin
case Players[CurrentPlayer].Strings[2] of
'coal' : SouthernCoal;
'iron' : WesternIron;
'copper' : NorthWestCopper;
'tin' : NorthEastTin;
end;
end
else
begin
case Players[CurrentPlayer].Strings[2] of
'tin' : SouthEastTin;
'iron' : CenterIron;
'copper' : CenterCopper;
'coal' : begin
Writeln('There is no coal for characters under 65. If you would still like to mine coal, please restart the script and set your own location');
NextPlayer(false);
end;
end;
end;
end;
procedure Manualpickspot;
begin
case Players[CurrentPlayer].Strings[1] of
'ec' : EasternCoal;
'sc' : SouthernCoal;
'wi' : WesternIron;
'nwc' : NorthWestCopper;
'net' : NorthEastTin;
'nc' : NorthernCoal;
'set' : SouthEastTin;
'ei' : EasternIron;
'ci' : CenterIron;
'cc' : CenterCopper;
'swc' : SouthWestCopper;
end;
end;
procedure ToMiningSpot;
begin
if (Players[CurrentPlayer].Booleans[1] = true) then
begin
AutoPickSpot;
end
else
begin
ManualPickSpot;
end;
end;
procedure Minetheore;
begin
end;
procedure Walktobank;
begin
end;
procedure Bankore;
begin
end;
begin
SetupSRL;
DeclarePlayers;
Login;
TheDTMs;
//WalktoMine;
ToMiningSpot;
Disguise('DwarfMiner - Stopped');
end.