SCAR Code:
{=========================================================================]
[ PowerMiner ]
[ version: 4.01 ]
[=========================================================================]
| Description: |
| A macro that you can run in any mine. It'll mine a full load of either|
| tin, copper, iron, or coal and drop it once it's full, then continue |
| minning.This version is perfect it just needs updating when new |
| random events come out. |
| Instructions: |
| 1.V-bright, 32bit resolution. |
| 2.Need SCAR version 2.02 at least |
| 3.Run script next to the full rock you want to mine. |
| 4.Recomended to have extra pickaxes in your inventory. |
| 5.Click and drag the crosshair over the Runescape client. |
| Then press the green arrow.(make sure camera view is all the way up)|
| 6.A window should pop-up,on the drop down menu select |
| your ore type and click start. |
| 7.The script should begin power mining |
[=========================================================================]
program StupidPowerMiner;
{.include SRL\SRL.scar}
{.include SRL\SRL\skill\mining.scar}
const
//=//================Colors(Leave as 0 to let script find)=============\=\\
RockColor1= 2702653;//Colors of rocks in main screen.
RockColor2= 3559247;
RockColor3= 2834753;
MMPickColor= 8750477;//Pick symbol color. [SS:2575992]
MMOreColor= 4416666;//Mini map ore color. [SS:4010803]
//=\\=================================================================//=\\
//=\\ Under the varibles you may disable the forms and setup options. //=\\
//=\\=================================================================//=\\
var
OreCol,OreTol1,OreTol2,DroppedOres,OreType,MapOreColor,MapPickColor,
NotStuckMark,RunMark,MaxWait,SetRunTime,x1,y1:integer;
XpPerOre:extended;
RunDirection:string;
Look4Gas,DropAllButPick,LogsOut,Chats,Rotates:boolean;
procedure Setup;
begin
//=//==============================Setup===============================\=\\
LogsOut:= true;//If you want to log out every so often for antiban.
Chats:= true;//If you want to randomly chat for anti-ban.
Look4Gas:= true;//Set to false if you are having trouble with it constantly finding gas.
Rotates:= true;//If you want to randomly rotate the screen for anti-ban.
MaxWait:= 20;//Maximum time in seconds to wait while mining a rock.
SetRunTime:= 300;//Sets run every chosen amount of seconds.
RunDirection:= 'N';//Direction to run away from.
DropAllButPick:= true;//If you want to drop gems, gold, etc. instead of just ores.
//=\\=================================================================//=\\
end;
//DO NOT TOUCH BELOW
//==============================Misc Procedures===============================\\
procedure GetOreType;
begin
if(OreType=1)then//1-Copper
begin
OreCol:=4550039;
OreTol1:=15;OreTol2:=35;
XpPerOre:= 17.5;
end;
if(OreType=2)then//2-Tin
begin
OreCol:=10263976;
OreTol1:=15;OreTol2:=35;
XpPerOre:= 17.5;
end;
if(OreType=3)then//3-Iron
begin
OreCol:=2371664;
OreTol1:=5;OreTol2:=25;
XpPerOre:= 35;
end;
if(OreType=4)then//4-coal
begin
OreCol:=2900546;
OreTol1:=5;OreTol2:=13;
XpPerOre:= 50;
end;
end;
procedure SetColors;
begin
OreColor1:=RockColor1;
OreColor2:=RockColor2;
OreColor3:=RockColor3;
MapPickColor:=MMPickColor;
MapOreColor:=MMOreColor;
end;
//=========================Color Finding Procedures===========================\\
function FindMapOreColor:integer;
var
MapOre,MapOre2:integer;
begin
MapOre := BitmapFromString(3, 3,
'3D2C345948546D5D624A39416D5D626D5D625948546D5D626D5D62' +
'');
MapOre2 := BitmapFromString(3, 3,
'061115222D35364243131E22364243364243222D35364243364243' +
'');
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 FindColors;
var
c:integer;
begin
WriteLn('Finding colors please Wait...');
repeat
c:=c+1;
if(MapOreColor>0)and(MapPickColor>0)and(OreColor1>0)and(OreColor2>0)and
(OreColor3>0)then
Break;
FindOreColors(OreCol,OreTol1,OreTol2);
MapPickColor:=GetSymbolColor(x,y,'mining spot');
MapOreColor:=FindMapOreColor;
if(c>=10)then
begin
WriteLn('Could not find colors, please stand next to a full rock and '+
'make sure the mining spot symbol is visible in the minimap, then'+
' run the script again');
TerminateScript;
end;
until(c>10)
end;
//========================Random Protection Procedures========================\\
procedure ReturnToRocks;
begin
if(not(FindMMColor(x,y,MapPickColor)))then
begin
if(FindMMColor(x,y,MapOreColor))then
begin
Mouse(x,y,1,1,true);
Flag;
end
else if(not(FindMMColor(x,y,MapPickColor)))and
(not(FindMMColor(x,y,MapOreColor)))then
begin
writeln('Lost!!!');
TerminateScript;
end;
end;
if(FindColorSpiral(x,y,MapPickColor,565,5,725,160))then
begin
Mouse(x,y,1,1,true);
Flag;
ClickMMColorTol(MapOreColor,10);
end;
end;
procedure TimedProcedures;
begin
if(TimeFromMark(NotStuckMark)>60000)then
begin
ReturnToRocks;
MarkTime(NotStuckMark);
end;
if(TimeFromMark(RunMark)>SetRunTime*1000)then
begin
MarkTime(RunMark);
SetRun(true);
end;
end;
procedure FindRandoms;
begin
FindNormalRandoms;
antiban
if findcolortolerance(x1,y1,255,244,142,286,156,10)then
begin
if random(2) = 1 then if(HpPercent < 90) then
begin
runto(RunDirection,true)
End
End
if FindGas(x,y) then RunTo(RunDirection,false);
if Findname Then FindTalk;
end;
//-----//-----//-----//-----//-----//-----//-----//-----//-----//--
//-----\\-----\\-----//-----\\-----\\-----//-----\\-----\\-----\\--
function FindObjB(var cx, cy: Integer; Text: String; color, tolerance: Integer): Boolean;
var
Timees,x, y, a, c, i, x1, y1, x2, y2: Integer;
begin
if (FindMSColorTol(x, y, color, tolerance)) then
begin
x1 := 245;
y1 := 165;
x2 := 277;
y2 := 185;
repeat
if (not (Loggedin)) then
break;
a := a + 1;
if (a = 1) then
c := c + 1;
if (a = 3) then
c := c + 1;
for i := 1 to c do
begin
if (a = 1) then
begin
x1 := x1 + 30;
x2 := x2 + 30;
End;
if (a = 2) then
begin
y1 := y1 - 20;
y2 := y2 - 20;
End;
if (a = 3) then
begin
x1 := x1 - 30;
x2 := x2 - 30;
End;
if (a = 4) then
begin
y1 := y1 + 20;
y2 := y2 + 20;
End;
if (x1 = 485) and (x2 = 517) then
x2 := x2 - 2;
if (y1 = 325) and (y2 = 345) then
y2 := y2 - 7;
if (x2 > 515) then
Break;
if (FindColorTolerance(x, y, color, x1, y1, x2, y2, tolerance)) then
begin
Timees:=Timees+1
MMouse(x, y, 0, 0)
cx := x; cy := y;
if(Timees>10)
then
begin
timees:=0
End;
wait(100+random(30))
if (IsUpText(Text)) then
begin
Result := True;
Break;
End;
End;
End;
if (a = 4) then
a := 0;
until (x2 > 515) or (Result = True);
End;
timees:=0
End;
//-----//-----//-----//-----//-----//-----//-----//-----//-----//--
//-----\\-----\\-----//-----\\-----\\-----//-----\\-----\\-----\\--
//============================Main Screen Procedures==========================\\
procedure DropIfNeeded;
begin
if(InventoryFull)then
begin
DroppedOres:=DroppedOres+(CountItemBmpTol(Ore,50));
dwarfitem
end
end;
procedure Mine;
var
SysTime:integer;
begin
SetRandomOreColor;
SendArrowSilentWait(1, 100 + random(500));
if(FindObjB(x,y,'Mine',OreColor,5))then
begin
if(not(FindGas(x,y)))then
begin
Mouse(x,y,4,4,true);
if(FlagPresent)then
begin
Flag;
Wait(500+random(500));
end;
MarkTime(SysTime);
repeat
if(not(FindColorSpiral(x,y,OreColor,210,130,300,220)))then
Break;
FindRandoms;
Wait(500+Random(500));
until(not(GetColor(109,430)=0)and(not(GetColor(195,426)=0)))or
(TimeFromMark(SysTime)>=MaxWait*1000)
MarkTime(NotStuckMark);
end;
end;
end;
//==================================Main Line=================================\\
begin
SetupSRL
SetupSRLMining
Setup;
ActivateClient
GetOreType;
SetColors;
FindColors;
if(FindPickHeadColor)then
begin
MarkTime(NotStuckMark);
MarkTime(RunMark);
writeln('Map pick color: '+inttostr(MapPickColor)+' Map ore color: ')
repeat
TimedProcedures;
DropIfNeeded;
FindRandoms;
Mine;
Wait(100+random(50));
until(false)
end;
end.