SCAR Code:
//This is my first script, a powerminer.Put your pickaxe in the first slot. If you are taking
//more than one pickaxe be aware that the least valuable one's heads might get lost.
//If you bring multiple pickaxes that are the same (like 2 rune picks) one's head might get lost
//Otherwise just fill in the info in lines 20-72 and you should be ready to go!
//****WARNING**** If you take 2 or more of the same most valuable pick, you might end up losing
//all except one (or none if the head finder fails :p)
//If the autocolor isn't working go to my 'AutoColor' procedure and change the colors
//(I haven't tested most of them) and please report to me that they weren't working
//Will not drop all of the ores (only 20), this doesn't matter though since you'll still be mining/dropping
//at the same rate, however make sure to set the amount of loads you want to do a bit higher
//If the best pick is lost, the script will stop
//If you have multiple picks, when the script says that it has fixed it, it's not 100% accurate
//Most likely this will not work on the rocks that are covered in the brown stuff
//Unless you change the colors in the AutoColor procedure
//Big thanks to Derek-, Method, Santa_Clause, and JackLKrawl for helping me fix errors and
//suggesting what functions I should use
//an even BIGGER thanks to Derek- for changing the password (and telling me it :p)
//of a char I had left in the script
program PowerMinerByScapian;
{.include SRL/SRL.scar}
var RockColor1, RockColor2, RockColor3, Ore, AmountLoads, inventories, x, y:integer;
var BronzePick, IronPick, SteelPick, MithPick, AddyPick, RunePick, PickStick:integer;
var LostPick, PickHeadInven, UnivPick:integer;
var PickFound:boolean;
const
YourSRLId = ''; //Enter your SRL Stats ID number, if you don't have one go here - <a href="http://www.stats.srl-forums.com/" target="_blank">http://www.stats.srl-forums.com/</a>
YourSRLPassword =''; //Your SRL Stats password
Rundirection = 'E'; //Direction to run, north, south etc. n, s, e, or w
RockTolerance = 10; //10 should be fine, but if it's not finding the rock then increase it and/or change the above colors
WaitTime = 10000; //Time you want it to wait in between clicking rocks (multiply by 1000,
//1 second = 1000, 2 seconds = 2000, etc)
//NOTE: The script will try to start another rock right after finishing
//one, however it takes approx 2 sec until it finds out
IfGasFound = 20000; //Time you want it to wait after it finds a gas (before mining again)
//same thing with the 1 second = 1000
Loads = 15; //How many loads do you want each character to do before logging out?
MineRockLength = 600000; ////Time you want it to try to mine an inventory of rocks before giving up (multiply by 1000,
//1 second = 1000, 2 seconds = 2000, etc)
Procedure DeclarePlayers;
begin
HowManyPlayers := 4; //Ignore this line, just be sure to set the players you won't be using False
NumberOfPlayers(HowManyPlayers); //Ignore this line
CurrentPlayer := 0; //Which player do you want to start with? (0 is the first player)
Players[0].Name := ''; //Put the name of your rs character here
Players[0].Pass := ''; //Put the password of your rs character here
Players[0].Nick := ''; //Put 3-4 letters of your rs name in here(Not the first letter
//and no spaces or _'s.
Players[0].Active := True; //Are you using this player? True is Yes, False is no.
Players[0].Strings[1]:= 'coal'; //What ore are you mining? copper, tin, iron, coal, mith
//NOTE: IF ADDY OR RUNE YOU'LL HAVE TO SET YOUR OWN COLORS
//IN THE AUTOCOLOR PROCEDURE(it's right after this DeclarePlayers)
Players[0].Integers[1]:= 1; //How many pickaxes on the character?
Players[1].Name := '';
Players[1].Pass := ''; //to set the rest of these up just refer to the above instructions
Players[1].Nick := '';
Players[1].Active := False;
Players[1].Strings[1]:= 'copper';
Players[1].Integers[1]:= 1;
Players[2].Name := '';
Players[2].Pass := '';
Players[2].Nick := '';
Players[2].Active := False;
Players[2].Strings[1]:= 'copper';
Players[2].Integers[1]:= 1;
Players[3].Name := '';
Players[3].Pass := '';
Players[3].Nick := '';
Players[3].Active := False;
Players[3].Strings[1]:= 'copper';
Players[3].Integers[1]:= 1;
end;
procedure AutoColor;
begin
If (Players[CurrentPlayer].Strings[1] = 'copper') then
begin
RockColor1 := 3890561;
RockColor2 := 3463635;
RockColor3 := 3624564;
exit;
end;
if (Players[CurrentPlayer].Strings[1] = 'tin') then
begin
RockColor1 := 6053220;
RockColor2 := 8750479;
RockColor3 := 9079701;
exit;
end;
if (Players[CurrentPlayer].Strings[1] = 'iron') then
begin
RockColor1 := 2832734;
RockColor2 := 1844541;
RockColor3 := 2898785;
exit;
end;
if (Players[CurrentPlayer].Strings[1] = 'coal') then
begin
RockColor1 := 2438967;
RockColor2 := 2966339;
RockColor3 := 2768703;
exit;
end;
if (Players[CurrentPlayer].Strings[1] = 'mith') then
begin
RockColor1 := 6570819;
RockColor2 := 7950930;
RockColor3 := 6373697;
exit;
end;
if (Players[CurrentPlayer].Strings[1] = 'addy') then
begin
{RockColor1 := ;
RockColor2 := ;
RockColor3 := ;
exit;
Just fill the rockcolors out and remove braces}
Writeln('You have to put your own colors if you want to powermine addy');
NextPlayer(false);
end;
if (Players[CurrentPlayer].Strings[1] = 'rune') then
begin
{RockColor1 := ;
RockColor2 := ;
RockColor3 := ;
exit;
Just fill the rockcolors out and remove braces}
Writeln('You have to put your own colors if you want to powermine rune');
NextPlayer(false);
end;
end;
procedure AvoidGas;
begin
wait(IfGasFound);
if (FindColorTolerance (x, y, 9806756, 0, 0, 400, 400, 3)) then
begin
wait(10000);
end
else
begin
exit;
end;
end;
procedure FindingGas; //Colors of the gas are from Masterkill will get my own soon
begin
if (FindColorTolerance (x, y, 10596274, 0, 0, 400, 400, 3)) then
begin
AvoidGas;
end;
if (FindColorTolerance (x, y, 9806756, 0, 0, 400, 400, 3)) then
begin
AvoidGas;
end;
if (FindColorTolerance (x, y, 9017755, 0, 0, 400, 400, 3)) then
begin
AvoidGas;
end;
if (FindColorTolerance (x, y, 8821148, 0, 0, 400, 400, 3)) then
begin
AvoidGas;
end;
end;
function WhatPick :string;
begin
BronzePick := DTMFromString('78DA639460666010666240068E46720CEC409' +
'A1188FF0301A32C508D24AA1A882C8C04D2F240356204D48802D5' +
'C81150230454A34C400D3F508D160135BC40353A04D4F01161973' +
'0117EE727EC77009D1506D6');
IronPick := DTMFromString('78DA631467666078CFC8800C1C6D6C18D8813' +
'448F43F10302A02D57C435503918591405A02A8E62B0135C24035' +
'FF08A8E103AAE16022ACE63F017378806A3E1150230D54F316BF1' +
'A00853D0C59');
SteelPick := DTMFromString('78DA633CC2C4C0200CC448202B3989811D483' +
'302F17F2060DC09941743550391859140FA0C116A0E00E51508A8' +
'D907945721A0E624505E94809A53407949026A7600E5B588708F3' +
'40135BB099B03007CB90E23');
MithPick := DTMFromString('78DA637464666078CFC8800C0C8DBC18D8813' +
'448F43F10309A03D5703031A00246241248DB03D5FC62C4AFC616' +
'A8E61F0135D64498630154F39F08359F08A8F104AAF946408D1B5' +
'0CD07FC6A00EE190EDE');
AddyPick := DTMFromString('78DA637CC7C4C0200CC448C0D2C38A811D483' +
'302F17F2060FC01949746550391859140FA33505E94809AB74079' +
'29026A5E00E55508A8790A94D724A0E609505E8708731409A8790' +
'C941723A0E611505E03BF1A003F4C0F5A');
RunePick := DTMFromString('78DA637CCBC4C0F09E91011998790430B0036' +
'990E87F2060FC0E54F30D550D44164602E9D74035BF09A8790154' +
'F39F809A2740351C4CF8D53C05CAFF2560CE73A09A4F04D47C00A' +
'A79835F0D00CE18131B');
PickStick := DTMFromString('78DA6314666060906140038C4824901601124' +
'204D44801095E026A40F2CA04D408000929026A048184220135E2' +
'404214BF1A00B23A014A'); //MasterKill's pickhandle dtm
PickHeadInven := DTMFromString('78DA63CC63626098C1C8800CCC5D2D18FE036' +
'990E87F20602C06AA998EAA06220B2381740E50CD6C026A92816A' +
'E6105093448439E540359308A82905AA9945404D3661BB00E78C0' +
'E10');
UnivPick := DTMFromString('78DA637464666078CFC80002FF1920C0D0C88' +
'B811D488344FF0301A339500D0713032A60442281B43D50CD2F46' +
'FC6A6C816AFE1150634D8439164035FF8950F389801A4FA09A6F0' +
'4D4B801D57CC0AF060024FF0FDD');
Gametab(4)
if FindDTM(RunePick, x,y, MIX1, MIY1, MIX2, MIY2) then
begin
Result := 'rune';
Writeln('You have a rune pick. Tell Scapian if this is not correct');
exit;
end;
if FindDTM(AddyPick, x,y, MIX1, MIY1, MIX2, MIY2) then
begin
Result := 'addy';
Writeln('You have an addy pick. Tell Scapian if this is not correct');
exit;
end;
if FindDTM(MithPick, x,y, MIX1, MIY1, MIX2, MIY2) then
begin
Result := 'mith';
Writeln('You have a mith pick. Tell Scapian if this is not correct');
exit;
end;
if FindDTM(SteelPick, x,y, MIX1, MIY1, MIX2, MIY2) then
begin
Result := 'steel';
Writeln('You have a steel pick. Tell Scapian if this is not correct');
exit;
end;
if FindDTM(IronPick, x,y, MIX1, MIY1, MIX2, MIY2) then
begin
Result := 'iron';
Writeln('You have an iron pick. Tell Scapian if this is not correct');
exit;
end;
if FindDTM(BronzePick, x,y, MIX1, MIY1, MIX2, MIY2) then
begin
Result := 'bronze';
Writeln('You have a bronze pick. Tell Scapian if this is not correct');
exit;
end
else
begin
Writeln('Couldnt find the pick');
TerminateScript;
end;
end;
Function PickLost: boolean;
begin
if(WhatPick = 'rune') then
if not (FindDTM(RunePick, x,y, MIX1, MIY1, MIX2, MIY2)) then
begin
if(FindDTM(PickStick, x,y, MIX1, MIY1, MIX2, MIY2)) then
begin
Result := true;
Writeln('OH NO! The rune pickaxes head is gone! Lets try to find it');
LostPick := 1;
exit;
end
else
begin
Writeln('Hmm, either the pick is broken or there is a flaw in the script');
Writeln('If the pick is not broken, report this to Scapian, terminating script');
TerminateScript;
end;
end
else
begin
Result := false;
exit;
end;
if(WhatPick = 'addy') then
if not (FindDTM(AddyPick, x,y, MIX1, MIY1, MIX2, MIY2)) then
begin
if(FindDTM(PickStick, x,y, MIX1, MIY1, MIX2, MIY2)) then
begin
Result := true;
Writeln('OH NO! The addy pickaxes head is gone! Lets try to find it');
LostPick := 2;
exit;
end
else
begin
Writeln('Hmm, either the pick is broken or there is a flaw in the script');
Writeln('If the pick is not broken, report this to Scapian, terminating script');
TerminateScript;
end;
end
else
begin
Result := false;
exit;
end;
if(WhatPick = 'mith') then
if not (FindDTM(MithPick, x,y, MIX1, MIY1, MIX2, MIY2)) then
begin
if(FindDTM(PickStick, x,y, MIX1, MIY1, MIX2, MIY2)) then
begin
Result := true;
Writeln('OH NO! The mith pickaxes head is gone! Lets try to find it');
LostPick := 3;
exit;
end
else
begin
Writeln('Hmm, either the pick is broken or there is a flaw in the script');
Writeln('If the pick is not broken, report this to Scapian, terminating script');
Writeln('If the pick IS broken, make sure to mention it when posting proggy');
TerminateScript;
end;
end
else
begin
Result := false;
exit;
end;
if(WhatPick = 'steel') then
if not (FindDTM(SteelPick, x,y, MIX1, MIY1, MIX2, MIY2)) then
begin
if(FindDTM(PickStick, x,y, MIX1, MIY1, MIX2, MIY2)) then
begin
Result := true;
Writeln('OH NO! The steel pickaxes head is gone! Lets try to find it');
LostPick := 4;
exit;
end
else
begin
Writeln('Hmm, either the pick is broken or there is a flaw in the script');
Writeln('If the pick is not broken, report this to Scapian, terminating script');
TerminateScript;
end;
end
else
begin
Result := false;
exit;
end;
if(WhatPick = 'iron') then
if not (FindDTM(IronPick, x,y, MIX1, MIY1, MIX2, MIY2)) then
begin
if(FindDTM(PickStick, x,y, MIX1, MIY1, MIX2, MIY2)) then
begin
Result := true;
Writeln('OH NO! The iron pickaxes head is gone! Lets try to find it');
LostPick := 5;
exit;
end
else
begin
Writeln('Hmm, either the pick is broken or there is a flaw in the script');
Writeln('If the pick is not broken, report this to Scapian, terminating script');
TerminateScript;
end;
end
else
begin
Result := false;
exit;
end;
if(WhatPick = 'bronze') then
if not (FindDTM(BronzePick, x,y, MIX1, MIY1, MIX2, MIY2)) then
begin
if(FindDTM(PickStick, x,y, MIX1, MIY1, MIX2, MIY2)) then
begin
Result := true;
Writeln('OH NO! The bronze pickaxes head is gone! Lets try to find it');
LostPick := 6;
exit;
end
else
begin
Writeln('Hmm, either the pick is broken or there is a flaw in the script');
Writeln('If the pick is not broken, report this to Scapian, terminating script');
TerminateScript;
end;
end
else
begin
Result := false;
exit;
end;
end;
procedure FindPickaxe;
var FindingPickTries: integer;
begin
FindingPickTries := 0;
if(PickLost = true) then
begin
if(LostPick = 1) then
begin
repeat
if(FindObjCustom(x, y, ['Head', 'ick'], [6379586,8352599], 13)) then
begin
Mouse(x, y, 0, 0, True);
Writeln('WOOT! Found the pick head!');
PickFound := true;
exit;
end
else
begin
FindingPickTries := FindingPickTries + 1;
end;
until(FindingPickTries > 10);
PickFound := false;
end;
if(LostPick = 2) then
begin
repeat
if(FindObjCustom(x, y, ['Head', 'ick'], [4017213,3819834], 13)) then
begin
Mouse(x, y, 0, 0, True);
Writeln('WOOT! Found the pick head!');
PickFound := true;
exit;
end
else
begin
FindingPickTries := FindingPickTries + 1;
end;
until(FindingPickTries > 10);
PickFound := false;
end;
if(LostPick = 3) then
begin
repeat
if(FindObjCustom(x, y, ['Head', 'ick'], [5322551,5519929], 13)) then
begin
Mouse(x, y, 0, 0, True);
Writeln('WOOT! Found the pick head!');
PickFound := true;
exit;
end
else
begin
FindingPickTries := FindingPickTries + 1;
end;
until(FindingPickTries > 10);
PickFound := false;
end;
if(LostPick = 4) then
begin;
repeat
if(FindObjCustom(x, y, ['Head', 'ick'], [7765887,6316135], 13)) then
begin
Mouse(x, y, 0, 0, True);
Writeln('WOOT! Found the pick head!');
PickFound := true;
exit;
end
else
begin
FindingPickTries := FindingPickTries + 1;
end;
until(FindingPickTries > 10);
PickFound := false;
end;
if(LostPick = 5) then
repeat
if(FindObjCustom(x, y, ['Head', 'ick'], [5526619,5197909], 13)) then
begin
Mouse(x, y, 0, 0, True);
Writeln('WOOT! Found the pick head!');
PickFound := true;
exit;
end
else
begin
FindingPickTries := FindingPickTries + 1;
end;
until(FindingPickTries > 10);
PickFound := false;
end;
if(LostPick = 6) then
begin
repeat
if(FindObjCustom(x, y, ['Head', 'ick'], [1846843,1978944], 13)) then
begin
Mouse(x, y, 0, 0, True);
Writeln('WOOT! Found the pick head!');
PickFound := true;
exit;
end
else
begin
FindingPickTries := FindingPickTries + 1;
end;
until(FindingPickTries > 10);
PickFound := false;
end
else
begin
exit;
end;
end;
procedure FixThePick;
begin
if(PickFound = true) then
begin
if(FindDTM(PickHeadInven, x,y, MIX1, MIY1, MIX2, MIY2)) then
begin
mouse(x,y,1,1,false);
ChooseOption('Use');
end;
if(FindDTM(PickStick, x, y, MIX1, MIY1, MIX2, MIY2)) then
begin
mouse(x,y,0,0,true);
end;
if(FindDTM(UnivPick, x, y, MIX1, MIY1, MIX2, MIY2)) then
begin
Writeln('Pick fixed!');
exit;
end
else
begin
Writeln('Uh-Oh, something went wrong with fixing the pick');
Writeln('Tell Scapian if your best pick isnt completely fixed');
end;
end;
if (PickFound = false) then
begin
exit;
end;
end;
procedure Randoms;
begin
FindNormalRandoms;
if (FindFight) then
RunAway(rundirection, false, 1, 5000);
end;
procedure Mining;
var TimeMining,Tries, MiningRock:integer;
begin
MarkTime(TimeMining);
repeat
repeat
MarkTime(MiningRock);
Tries:=0;
if(not(LoggedIn))then
begin
Exit;
end;
if (FindObjCustom(x, y, ['Mine','ine O','ne Or','e Ore','Ore'], [RockColor1, RockColor2, RockColor3], RockTolerance)) then
Mouse(x, y, 0, 0, True)
else
begin
Tries:=Tries+1
if (Tries = 25) then
begin
Writeln('Couldnt find the color 25 times, terminating script');
TerminateScript;
end;
end;
if FindNPCChatText('inventory is too full to hold any more', Nothing) then
begin
exit;
end;
if FindNPCChatText('have the Mining level to use', Nothing) then
begin
Writeln('Something is wrong with the pickaxe :\');
exit;
end;
Randoms;
FindingGas;
RandomRClick;
RandomRClick;
Randoms;
PickLost;
FindPickaxe;
FixThePick;
GameTab(4);
until(FindBlackChatMessage('You manage to mine')) or (TimeFromMark(MiningRock) > WaitTime)
until(InvFull) or (TimeFromMark(TimeMining) > MineRockLength+random(20000))
end;
procedure Drop;
var FailedDrop, DropTries, Dropping:Integer;
begin
Ore := DTMFromString('78DA63CC66626078C28002E6476B30E830323' +
'00011C37F20602C07AA79CE8006189148205D0854F39A809A34A0' +
'9A8F04D4E401D5BC27A0A606A8E60101352540353709A84900AA7' +
'94B404D2C50CD0BFC6A007EB41170');
{Ore := DTMFromString('78DA63FCC8C4C030919101199C2A3262F80FA' +
'441A2FF8180F12D50CD7C543510591809A47F01D5CC24A0E63F50' +
'4D0F0135CF8830E72150CD0C026A7E03D54C25A0E62B504D2B7E3' +
'500380212C7'); Another DTM, just in case the other one not working...}
MarkTime(Dropping)
DropTries := 0;
FailedDrop := 0;
repeat
if FindDTM(Ore, x,y, MIX1, MIY1, MIX2, MIY2) then
begin
Mouse(x,y,1,1,false);
ChooseOption('rop');
DropTries:=DropTries+1;
wait(1);
Randoms;
PickLost;
FindPickaxe;
FixThePick;
end
else
begin
FailedDrop:=FailedDrop+1;
end;
if (FailedDrop=30) then
begin
Writeln('Tried dropping the ore 30 times but failed, report this bug to Runescapian, terminating script...')
NextPlayer(false);
end;
until(DropTries = 20) or (TimeFromMark(Dropping)>300000)
Inventories:=Inventories+1;
AmountLoads:=AmountLoads+1;
end;
procedure AntiBan; //by SRL Devs
var Ban: Integer;
begin
Ban:= random(5);
case Ban of
0: RandomRClick;
1: HoverSkill('mining', False);
2: PickUpMouse;
5: BoredHuman;
end;
end;
procedure CheckSrlId;
begin
if (YourSRLId = '') then
begin
Writeln('You need an SRL Stats account to use this script :)')
Writeln('If you dont have one, go here - http://www.stats.srl-forums.com')
Writeln('Signing up takes 1 minute, dont be lazy')
Writeln('Srl stats are awesome, you can show off how long you have been running scripts!')
TerminateScript;
end
else
begin
exit;
end;
if (YourSRLPassword = '') then
begin
Writeln('You need an SRL Stats account to use this script :)')
Writeln('If you dont have one, go here - http://www.stats.srl-forums.com')
Writeln('Signing up takes 1 minute, dont be lazy')
Writeln('Srl stats are awesome, you can show off how long you have been running scripts!')
TerminateScript;
end
else
begin
exit;
end;
end;
procedure proggy;
begin
Writeln('|\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/|');
Writeln('|\/\/\/\/\/\/ Power Miner by Scapian /\/\/\/\/\/\/\|');
Writeln('|\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/|');
Writeln('|\/\ We have done ' + intToStr(inventories) + ' inventories of ores so far! /\|');
Writeln('|\/\ We worked ' + TimeRunning + '/\/\/\/\/\/\/\/\/\|');
Writeln('|\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/|');
Writeln('|\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\//\/\/\/\|');
end;
procedure siggy;
begin
Writeln('I hope you had a great experience with the Scapian Power Miner!');
Writeln(' Hope to see you again! ');
Writeln(' _/_/_/ _/');
Writeln(' _/ _/_/_/ _/_/_/ _/_/_/ _/_/_/ _/_/_/');
Writeln(' - _/_/ _/ _/ _/ _/ _/ _/ _/ _/ _/ _/');
Writeln(' _/ _/ _/ _/ _/ _/ _/ _/ _/ _/ _/');
Writeln(' _/_/_/ _/_/_/ _/_/_/ _/_/_/ _/ _/_/_/ _/ _/');
Writeln(' _/');
Writeln(' _/');
end;
procedure login;
begin
if (not(loggedin)) then
begin
loginplayer;
findnormalrandoms;
wait(1000);
SetBar(4, 1, 1, 1);
end
else
begin
findnormalrandoms;
wait(1000);
setBar(4, 1, 1, 1);
end;
end;
procedure EnoughLoads;
begin
if(AmountLoads=Loads)then
begin
NextPlayer(True);
AmountLoads:=0;
SetAngle(True);
MakeCompass('N');
end;
end;
begin
SetupSRL;
ScriptID := '532';
SRLId := YourSRLId;
SRLPassword:= YourSRLPassword;
CheckSrlId;
ActivateClient;
DeclarePlayers;
login;
repeat
if(not(LoggedIn))then
begin
Exit;
end;
WhatPick;
AutoColor;
Mining;
Drop;
Randoms;
AntiBan;
proggy;
EnoughLoads;
until(false)
Siggy;
end.