solarwind
2007-10-10 17:19:19
SolarMiner is a great guild coal miner that reliably and quickly mines coal and banks it for you. It uses the KYAB bot SCAR extension to deliver flawless walking (never gets lost) and animation and motion detection for script speed and accuracy. It is still pretty early in development, but it is rapidly getting better and better. To download it, simply make an account at the KYAB forums at http://www.kyab.asssoft.org and follow this link: http://www.kyab.asssoft.org/smf/index.php/topic,637.0.html
Edit: since Ram wanted me to post the script, here it is.
The script requires the latest KYAB.scar and KYAB bot, get them at http://www.kyab.asssoft.org.
Please note that this contribution uses the KYAB bot and is 99% a fully valid SRL script.
I would also like an answer from an administrator (particularly the one who closed the other thread).
Note: This is my thread and no flaming is allowed here. Do not flame me, any of the KYAB members or this script. It is a solid contribution out of OUR spare time and we don't need any of that crap from you.
Edit: since Ram wanted me to post the script, here it is.
{==============================================================================]
[ _________ .__ _____ .__ ]
[ / _____/ ____ | | _____ _______ / \ |__| ____ ___________ ]
[ \_____ \ / _ \| | \__ \\_ __ \/ \ / \| |/ \_/ __ \_ __ \ ]
[ / ( <_> ) |__/ __ \| | \/ Y \ | | \ ___/| | \/ ]
[ /_______ /\____/|____(____ /__| \____|__ /__|___| /\___ >__| ]
[ \/ \/ \/ \/ \/ ]
[ ]
[ The ultimate falador mining guild miner with perfect fail proof walking. ]
[ Version 2.10 ]
[ ]
[==============================================================================]
[ __ __ __ ]
[ _____________ ____ _/ /____ ____/ / / /_ __ __ ]
[ / ___/ ___/ _ \/ __ `/ __/ _ \/ __ / / __ \/ / / / ]
[ / /__/ / / __/ /_/ / /_/ __/ /_/ / / /_/ / /_/ / ]
[ \___/_/ \___/\__,_/\__/\___/\__,_/ /_.___/\__, / ]
[ /____/ ]
[ .__ .__ .___ ]
[ __________ | | _____ _________ _ _|__| ____ __| _/ ]
[ / ___/ _ \| | \__ \\_ __ \ \/ \/ / |/ \ / __ | ]
[ \___ ( <_> ) |__/ __ \| | \/\ /| | | \/ /_/ | ]
[ /____ >____/|____(____ /__| \/\_/ |__|___| /\____ | ]
[ \/ \/ \/ \/ ]
[ ]
[==============================================================================]
[ Official website of the KYAB bot: ]
[ <a href="http://www.kyab.asssoft.org" target="_blank">http://www.kyab.asssoft.org</a> ]
[ ]
[ ImpWiki - the best RuneScape cheating information site on the planet! ]
[ <a href="http://www.impwiki.org" target="_blank">http://www.impwiki.org</a> ]
[ ]
[ This script requires KYAB version 6.2 or greater, SCAR 3.12 or greater ]
[ and a recent SRL include. Get KYAB for free at the official KYAB website. ]
[ ]
[ This script complies with SRL scripting standards and the SRL library. ]
[ ]
[ Licensed under the terms of the GNU GPL v3.0 ]
[==============================================================================]
[ Credits: ]
[ * Solarwind: the initial script, idea and structure. ]
[ * Metho D: standard setup routines. ]
[ * The 1337: many script fixes such as deathwalk, failsafes and speed. ]
[ * Sumillion: took some of his mining ideas. ]
[==============================================================================]
[ Version history: ]
[ * v1.00 (Oct 6, 2070): Initial release, needs a lot of work, see todo. ]
[ * v1.20 (Oct 6, 2070): Many things fixed and improved. Need to fix ]
[ player statistics issue. ]
[ * v2.00 (Oct 7, 2070): Many fixes by The 1337. ]
[ * v2.10 (Oct 8, 2070): Script works much smoother now. ]
[==============================================================================]
[ Todo: ]
[ * Fix player statistics and timing issue. ]
[ * Add broken pickaxe and flying pick head support. ]
[ * Add more random paths. ]
[ * Add detection when someone mines the ores out of the rock before us. ]
[ * Add empty rock finding. (Rock that no one is mining.) ]
[==============================================================================]
[ Notes: ]
[ Animation code for mining a coal rock with a rune pickaxe: 624 ]
[ ]
[ Tile locations: from bank to mine: ]
[ West most bank booth tile: (3010, 3355) ]
[ East most bank booth tile: (3015, 3355) ]
[ Near guild: (3025, 3350) ]
[ Near ladder top: (3022, 3337) ]
[ Near ladder bottom: (3019, 9737) ]
[ ]
[ Rock group locations inside cave: ]
[ West rock set: (3033, 9737) ]
[ Middle rock set: (3043, 9738) ]
[ East rock set: (3049, 9739) ]
[ South rock set: (3038, 9734) ]
[ North rock set: (3038, 9742) ]
[ North east rock set: (3047, 9744) ]
[==============================================================================]
[==============================================================================}
program SolarMiner;
{.include SRL/SRL.scar}
{.include SRL/SRL/skill/Mining.scar}
{.include SRL/SRL/misc/KYAB.scar}
//========== Global variables: ==========\\
const
Version = 2.10;
const
MinutesPerPlayer = 15; // Time in minutes per player.
RandomMinutes = 5; // Random number under this gets added to above.
RunDir = 'N'; // Direction to run to when in fight.
RunFar = True; // Run far when in fight?
MaxSecRock = 7; // Maximum seconds to wait for a rock.
OreColour = 2703167;
var
x, y : integer;
DeathWalk : Array of TPoint;
var
OresMined, GemsReceived, GasAvoided, TotalMinutesPerPlayer, RunTime : integer;
//========== Player controls: ==========\\
procedure DeclarePlayers;
begin
HowManyPlayers := 1;
CurrentPlayer := 0;
NumberOfPlayers(HowManyPlayers);
Players[0].Name := '...'; //Your RuneScape user name.
Players[0].Pass := '...'; //Your RuneScape password.
Players[0].Nick := '...'; //3 to 4 letters from your name.
Players[0].Booleans[0] := true; //Is pickaxe wielded?
Players[0].Active := true;
end;
procedure ProgressReport;
var
PActive, Spaces : string;
i, k, SpaceNumber : Integer;
begin
SRLRandomsReport;
if Players[CurrentPlayer].Active then
PActive := 'true'
else
PActive := 'false';
WriteLn(' ');
WriteLn('//========== SolarMiner v' + FloatToStr(Version) + ' ==========\\');
WriteLn('//========== Global statistics ==========\\');
WriteLn(' Worked for ' + TimeRunning);
WriteLn(' Mined ' + inttostr(OresMined)+(' ores.'));
if(GemsReceived > 0)then
WriteLn(' Received ' + IntToStr(GemsReceived) + ' gem(s).');
if(GasAvoided > 0)then
WriteLn(' Avoided gas ' + IntToStr(GasAvoided) + ' time(s).');
WriteLn('//========== Player statistics ==========\\');
WriteLn(' Name: ' + Players[CurrentPlayer].Name);
WriteLn(' Mining Lvl: ' + IntToStr(Players[CurrentPlayer].Level[15]));
WriteLn(' Worked for: ' + IntToStr(Players[CurrentPlayer].Worked) + ' minutes.');
WriteLn(' Banked: ' + IntToStr(Players[CurrentPlayer].Banked) + ' time(s).');
WriteLn(' Active: ' + PActive);
WriteLn(' LastRandom: ' + Players[CurrentPlayer].Rand);
WriteLn('\\========================================//');
{
WriteLn('============================================');
for i := 0 to HowManyPlayers - 1 do
begin
if Players[i].Active then
PActive:='True'
else
PActive:='False';
SpaceNumber := 12 - Length(Players[i].Name);
for k := 0 to SpaceNumber do
Spaces := Spaces + ' ';
WriteLn(IntToStr(i) + ': ' + Players[i].Name + Spaces +
'= ' + PActive + ', ' + IntToStr(Players[i].Banked) + ' Bank(s)' +
', Worked ' + IntToStr(Players[i].Worked) + ' minutes, ' +
'Random: ' + Players[i].Rand);
Spaces := '';
end
WriteLn('============================================');
}
end;
procedure DeathWalkArray;
begin
SetArrayLength(DeathWalk,31);
DeathWalk[0].X:=3229; DeathWalk[0].Y:=3219;
DeathWalk[1].X:=3233; DeathWalk[1].Y:=3229;
DeathWalk[2].X:=3223; DeathWalk[2].Y:=3238;
DeathWalk[3].X:=3218; DeathWalk[3].Y:=3250;
DeathWalk[4].X:=3216; DeathWalk[4].Y:=3263;
DeathWalk[5].X:=3213; DeathWalk[5].Y:=3275;
DeathWalk[6].X:=3205; DeathWalk[6].Y:=3280;
DeathWalk[7].X:=3195; DeathWalk[7].Y:=3280;
DeathWalk[8].X:=3183; DeathWalk[8].Y:=3285;
DeathWalk[9].X:=3169; DeathWalk[9].Y:=3288;
DeathWalk[10].X:=3158; DeathWalk[10].Y:=3292;
DeathWalk[11].X:=3144; DeathWalk[11].Y:=3297;
DeathWalk[12].X:=3130; DeathWalk[12].Y:=3296;
DeathWalk[13].X:=3116; DeathWalk[13].Y:=3296;
DeathWalk[14].X:=3102; DeathWalk[14].Y:=3296;
DeathWalk[15].X:=3089; DeathWalk[15].Y:=3291;
DeathWalk[16].X:=3077; DeathWalk[16].Y:=3290;
DeathWalk[17].X:=3073; DeathWalk[17].Y:=3282;
DeathWalk[18].X:=3064; DeathWalk[18].Y:=3277;
DeathWalk[19].X:=3053; DeathWalk[19].Y:=3277;
DeathWalk[20].X:=3039; DeathWalk[20].Y:=3276;
DeathWalk[21].X:=3025; DeathWalk[21].Y:=3278;
DeathWalk[22].X:=3012; DeathWalk[22].Y:=3279;
DeathWalk[23].X:=3004; DeathWalk[23].Y:=3288;
DeathWalk[24].X:=3005; DeathWalk[24].Y:=3301;
DeathWalk[25].X:=3006; DeathWalk[25].Y:=3314;
DeathWalk[26].X:=3005; DeathWalk[26].Y:=3328;
DeathWalk[27].X:=3006; DeathWalk[27].Y:=3340;
DeathWalk[28].X:=3006; DeathWalk[28].Y:=3351;
DeathWalk[29].X:=3011; DeathWalk[29].Y:=3357;
DeathWalk[30].X:=3011; DeathWalk[30].Y:=3358;
end;
procedure TheDeathWalk;
var r : integer;
begin
KYAB_Log('Death walk');
for r := 0 to 30 do
begin
Status('Death-Walking');
NewWalkToTile(DeathWalk[r].X, DeathWalk[r].Y);
FFlag(0);
end;
end;
//========== Random methods: ==========\\
function FindFastRandoms : boolean; // By WT-Fakawi.
var
i: Integer;
begin
for I := 1 to 11 do
begin
case I of
1: if FindDead then
begin
Result := True;
TheDeathWalk;
end;
2: if FindMod then
Result := True;
3: if FindMime then
Result := True;
4: if FindMaze then
Result := True;
5: if FindQuiz then
Result := True;
6: if FindTalk then
Result := True;
7: begin
if NoGameTab then
begin
Result := True;
Players[CurrentPlayer].loc := 'No GameTab';
KYAB_Log('No GameTab, logout');
Logout;
Exit;
end;
end;
9 : if RC then
Result := True;
10 : if FindFight then
begin
Result := True;
RunTo(RunDir, RunFar);
end;
11: if FindTalk then
Result := True;
end;
Wait(1);
end;
end;
function SumCheckGas(rx, ry: Integer) : boolean;
var
TempMouseSpeed, GasTime: Integer;
begin
Result := FindGas(rx, ry - 20);
if(Result)then
begin
KYAB_Log('Gas found!');
TempMouseSpeed := MouseSpeed;
MouseSpeed := 5;
MouseFindNoFlag(MMCX, MMCY + 4, 1, 1);
MarkTime(GasTime);
MouseSpeed := TempMouseSpeed;
while(TimeFromMark(GasTime) < 35000)do
if(Random(20) > 15)then
IdleTime(500, 500, 0.4)
else
Wait(RandomRange(500, 1000));
GasAvoided := GasAvoided + 1;
ReportVars[2] := ReportVars[2] + 1;
end;
end;
procedure FindRandoms;
begin
KYAB_Log('Checking for randoms.');
FindFastRandoms;
FindNormalRandoms;
end;
function RandSleep(min, max : integer) : boolean;
begin
Sleep(min + random(max - min));
result := true;
end;
//========== Mining methods: ==========\\
function RockGone(rx, ry: Integer): Boolean;
begin
Result := not FindColorSpiralTolerance(rx, ry, OreColour, rx - 10, ry - 10, rx + 10, ry + 10, 10);
end;
procedure WorkUntilMined(wx, wy : integer);
var
i, MineTime: integer;
Breakout : boolean;
begin
MarkTime(MineTime);
while(LoggedIn)and(not Breakout) do
begin
for i := 1 to 4 do
begin
case i of
1 : begin
KYAB_Log(IntToStr(i) + ' FindFastRandoms.');
if(FindFastRandoms) then
begin
Breakout := True;
break;
end;
end;
2 : begin
KYAB_Log(IntToStr(i) + ' FindFastRandoms.');
if(SumCheckGas(wx, wy)) then
begin
Breakout := True;
break;
end;
end;
3 : begin
KYAB_Log(IntToStr(i) + ' Check for ore in rock.');
if(RockGone(wx, wy)) then
exit;
end;
4 : begin
KYAB_Log(IntToStr(i) + ' Check for timeout.');
if(TimeFromMark(MineTime) > MaxSecRock * 1000) then
exit;
end;
end;
sleep(10);
end;
if(Random(100) > 90)then
IdleTime(500, 500, 0.4);
end;
end;
function FindCoal : boolean;
begin
KYAB_Log('Find coal');
if(FindObj(x, y, 'ocks', OreColour, 12)) then
begin
result := true;
end;
end;
function ClickCoal : boolean;
begin
RandSleep(100, 500);
if(FindCoal) then
begin
SumCheckGas(x, y);
Mouse(x, y, 5, 5, true);
end;
result := true;
OresMined := OresMined + 1;
end;
function FindLadder(kind : Integer) : boolean;
var
i : Integer;
kindp, targetp : TPoint;
begin
if(kind = 1)then
begin
kindp.x := 3019;
kindp.y := 3337;
targetp.x := 3019;
targetp.y := 9737;
end else
if(kind = 2)then
begin
kindp.x := 3019;
kindp.y := 9737;
targetp.x := 3019;
targetp.y := 3337;
end;
//Keep trying to climb the ladder until we reach our destination.
repeat
if(FindObj(x, y, 'adder', 6716, 10)) then
Mouse(x, y, 5, 5, true);
RandSleep(3500, 4000);
if(AtTile(targetp.x, targetp.y, 10))then
begin
result := true;
KYAB_Log('We climbed the ladder!');
break;
end else
begin
KYAB_Log('Could not find the ladder, trying again.');
end;
until(false);
end;
//========== Walking methods: ==========\\
function WalkToMine : boolean;
begin
SetRun(true);
KYAB_Log('Walking to the guild.');
NewWalkToTileTol(3025, 3350, 3); //Walk near the mining guild.
FFlag(random(5));
KYAB_Log('Walking to the ladder.');
NewWalkToTileTol(3022, 3337, 3); //Walk to the ladder.
FFlag(random(5));
KYAB_Log('Finding and clicking the ladder.');
FindLadder(1);
RandSleep(3500, 4000);
KYAB_Log('Walking to the west rock set.');
NewWalkToTileTol(3033, 9737, 3); //Walk to the west rock set.
FFlag(random(5));
result := true;
end;
function WalkToBank : boolean;
begin
SetRun(false);
NewWalkToTileTol(3042, 9740, 3); //Walk to the center to avoid errors.
FFlag(random(5));
NewWalkToTileTol(3031, 9735, 3); //Walk to the west rock set.
FFlag(random(5));
NewWalkToTileTol(3019, 9737, 3); //Walk to the ladder.
FFlag(random(5));
KYAB_Log('Finding and clicking the ladder.');
FindLadder(2);
RandSleep(3500, 4000);
NewWalkToTileTol(3025, 3350, 3); //Walk ouside the guild area.
FFlag(random(5));
NewWalkToTileTol(3012, 3356, 2); //Walk to the bank.
FFlag(random(5));
result := true;
end;
procedure AutoWalker;
begin
//If we are near the bank:
if(AtTile(3012, 3355, 35))then
begin
KYAB_Log('We are near the bank, walking to guild.');
WalkToMine;
FFlag(random(5));
end;
//If we are in the guild.
if(AtTile(3043, 9738, 35))then
begin
KYAB_Log('Already at mine.');
end;
//If we have full inventory in the guild.
if(AtTile(3019, 9737, 45) and InvFull)then
begin
KYAB_Log('Already at mine with full inventory.');
WalkToBank;
FFlag(random(5));
end;
end;
procedure StoreAll;
begin
KYAB_Log('Storing all ores.');
OpenBankQuiet('feb');
DepositAll;
CloseBank;
end;
//========== General script methods: ==========\\
procedure SetupScript;
begin
ClearDebug;
SetupSRL;
KYAB_connect;
DeclarePlayers;
CheckUserNicks;
Sleep(100);
end;
procedure SetupPlayer;
begin
if not(LoggedIn)then
LoginPlayer;
MakeCompass('N');
HighestAngle;
GameTab(2);
Players[CurrentPlayer].Level[15] := GetSkillLevel('mining');
TotalMinutesPerPlayer := MinutesPerPlayer + Random(RandomMinutes);
GameTab(4);
MarkTime(RunTime);
end;
function TimeToSwitchPlayers: boolean;
begin
if(TimeFromMark(RunTime) / 60 / 1000 > TotalMinutesPerPlayer)then
begin
result := true;
KYAB_Log('Time for player is up.');
end else
result := false;
end;
function Mining : boolean;
begin
if(GetAnimation = 624) then
begin
result := true;
end else
begin
result := false;
end;
end;
procedure SleepWhileMoving;
begin
while(GetMotion > 0) do
begin
KYAB_Log('Sleep while moving...');
Sleep(1000);
end;
end;
//========== Event loop: ==========\\
function EventLoop : boolean;
begin
AutoWalker;
repeat
while(not Mining) do
begin
KYAB_Log('Mining...');
FindRandoms;
ClickCoal;
Sleep(1000);
SleepWhileMoving;
end;
KYAB_Log('WorkUntilMined...');
WorkUntilMined(x, y);
until(InvFull);
if(InvFull) then
begin
KYAB_Log('Inventory is full, walking back to bank to deposit all items.');
AutoWalker;
StoreAll;
end;
result := true;
end;
//========== Main method: ==========\\
begin
SetupScript;
KYAB_Log('===== Starting script. =====');
repeat
SetupPlayer;
repeat
EventLoop;
ProgressReport;
if(TimeToSwitchPlayers) then
LogOut;
until not(LoggedIn);
NextPlayer(true);
until not(Players[CurrentPlayer].Active);
KYAB_Log('All players are inactive.');
KYAB_Close;
end.
The script requires the latest KYAB.scar and KYAB bot, get them at http://www.kyab.asssoft.org.
Please note that this contribution uses the KYAB bot and is 99% a fully valid SRL script.
I would like to point out the Jukka's guildminer, which uses SCARSCAPE is still up, yet SolarMiner since it uses KYAB is not.
Explain please.
-badman1
I would also like an answer from an administrator (particularly the one who closed the other thread).
Note: This is my thread and no flaming is allowed here. Do not flame me, any of the KYAB members or this script. It is a solid contribution out of OUR spare time and we don't need any of that crap from you.