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./////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////////////////
{
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 :='gouliker'; //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]:='sc'; //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;
function LoadCenterDDTM: integer;
var
CenterMP: TDTMPointDef;
CenterSP: array of TDTMPointDef;
CenterDDTM: TDTM;
CenterTol, CenterArea: Integer;
begin
CenterTol:=15;
CenterArea:=1;
SetArrayLength(CenterSP, 4);
CenterMP.x := 567;
CenterMP.y := 107;
CenterMP.areasize := 1;
CenterMP.areashape := 0;
CenterMP.color := 6513497;
CenterMP.tolerance := CenterTol;
CenterSP[0].x := 565;
CenterSP[0].y := 99;
CenterSP[0].areasize := CenterArea;
CenterSP[0].areashape := 0;
CenterSP[0].color := 15658734;
CenterSP[0].tolerance := CenterTol;
CenterSP[1].x := 561;
CenterSP[1].y := 113;
CenterSP[1].areasize := CenterArea;
CenterSP[1].areashape := 0;
CenterSP[1].color := 2901347;
CenterSP[1].tolerance := CenterTol;
CenterSP[2].x := 558;
CenterSP[2].y := 96;
CenterSP[2].areasize := CenterArea;
CenterSP[2].areashape := 0;
CenterSP[2].color := 3092005;
CenterSP[2].tolerance := CenterTol;
CenterSP[3].x := 564;
CenterSP[3].y := 99;
CenterSP[3].areasize := CenterArea;
CenterSP[3].areashape := 0;
CenterSP[3].color := 15658734;
CenterSP[3].tolerance := CenterTol;
CenterDDTM.MainPoint := CenterMP;
CenterDDTM.SubPoints := CenterSP;
result := AddDTM(CenterDDTM);
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 Checkcblvl;
begin
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', 'case']) 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;
end;
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.}
end;
procedure SouthernCoal;
var looked,tried, rx,ry: integer;
begin
Writeln('check1');
looked:=0;
repeat
if FindDTM(CenterDDTM, x,y,x1,y1,x2,y2) then
begin
mouse(x,y,2,2,true);
break;
end
else
begin
Centertol:=Centertol+3;
Centerarea:=Centerarea+1;
looked:=looked+1;
if (looked=6) then
begin
NextPlayer(false);
Writeln('Could not find the mining spot');
end;
end;
until (looked=6);
repeat
if FindSymbolIn(rx, ry,'mining spot', 578, 87, 631, 120) then
begin
mouse(x,y,2,2,true);
break;
end;
wait(1000);
tried:=tried+1;
until (tried=25);
Writeln('We''''re at the mine!');
end;
procedure WesternIron;
var looked,tried, rx,ry: integer;
begin
looked:=0;
repeat
if FindDTM(CenterDDTM, x,y,x1,y1,x2,y2) then
begin
mouse(x,y,2,2,true);
break;
end
else
begin
Centertol:=Centertol+3;
Centerarea:=Centerarea+1;
looked:=looked+1;
if (looked=6) then
begin
NextPlayer(false);
Writeln('Could not find the mining spot');
end;
end;
until (looked=6);
repeat
if FindSymbolIn(rx, ry,'mining spot', 578, 87, 631, 120) then
begin
mouse(x,y,2,2,true);
break;
end;
wait(1000);
tried:=tried+1;
until (tried=25);
Writeln('We''''re at the mine!');
end;
procedure NorthWestCopper;
begin
end;
procedure NorthEastTin;
begin
{You can see the tin rocks, no need to walk anywhere}
end;
procedure NorthernCoal;
begin
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[2] 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.