SRL Archive - Research & Development Lounge

Resource dungeon coal miner and banker [with world hopping]


rj

2013-04-12 18:43:33

I am currently working on a f2p/members coal miner and banker, this script will hop to a random world (and you can choose which worlds you don't want it to hop too) if there are a set(by you) number of people! It will also say a random message upon that logout, of course it will not always say it, the odds of it saying the random messages will be determined by you! I have not yet added basic things to the script such as smart/declare players


Progress log:

April 12

-click rock function
-f2p/members/both world array list

April 13

-basic world switching method(not close to done)
-SPS checking left or right of mine (almost done)

Will be using a combination of @Flight's Brakemouse and Superwindmouse AND my own signature antiban
Script so far:

program CoalRaper;

{
Credits to:

Flight - Mousemovements
superuser - Surfaces
NKN - Being picky about giving credits

}

{$DEFINE SMART}

{$i srl/srl.simba}
{$i srl/srl/misc/SmartGraphics.simba}
{$i sps/sps.simba}
{$i su_surfaces.simba}

var
obj_coal_rock,obj_deposite: TSurfaceObject;
World_valid:TintegerArray;
logout_message:TstringArray;
MineTimeout, player_count, PSX1, PSY1, PSX2, PSY2, Seconds:Integer;
StartTime, XpGained, OresMined, tries, bad_rocks:Integer;
Hop_mode, Status, reason, Log_action:string;
Procedure DeclareVs;
begin
NumberOfPlayers(1);
Players[0].Name := '';
Players[0].Pass := '';
Players[0].Active := True;
MineTimeout := 3800; // timeout of mining rock
Hop_mode := 'yes'; // [yes], [no]
Log_action := 'yes' // type in "no" if you don't want to
player_count := 3; // number of players before hopping
// change location were it logs to at line 164

{free worlds}

world_Valid := [3, 7, 8, 11, 13, 17, 19, 20, 29, 33, 34, 38, 41, 43, 57, 61, 80, 81, 108, 120, 135, 136]



{members worlds}

//world_Valid := [1, 2, 4, 5, 6, 9, 10, 12, 14, 15, 16, 18, 21, 22, 23, 24, 25, 26, 27, 28, 30, 31, 32, 35, 36, 37, 39, 40, 42, 44, 45, 46, 48, 49, 50, 51, 52, 53, 54, 56, 58, 59, 60, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 27, 73, 74, 76, 77, 78, 79, 82, 83, 84, 85, 86, 87, 88, 89, 91, 92, 96, 97, 98, 99, 100, 103, 104, 105, 106, 114, 115, 116, 117, 119, 123, 124, 134, 137, 138, 139]



{both worlds}

//world_Valid := [3, 7, 8, 11, 13, 17, 19, 20, 29, 33, 34, 38, 41, 43, 57, 61, 80, 81, 108, 120, 135, 136, 1, 2, 4, 5, 6, 9, 10, 12, 14, 15, 16, 18, 21, 22, 23, 24, 25, 26, 27, 28, 30, 31, 32, 35, 36, 37, 39, 40, 42, 44, 45, 46, 48, 49, 50, 51, 52, 53, 54, 56, 58, 59, 60, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 27, 73, 74, 76, 77, 78, 79, 82, 83, 84, 85, 86, 87, 88, 89, 91, 92, 96, 97, 98, 99, 100, 103, 104, 105, 106, 114, 115, 116, 117, 119, 123, 124, 134, 137, 138, 139]


//logout_message := ['to full','to many bots ffs'] // message to say if world is full
//message_odds := [1,1000] // 1 out of 1000
PSX1 := 251;
PSY1 := 213;
PSX2 := 264;
PSY2 := 233;
end;
Procedure SuperWindMouse(xs, ys, xe, ye, gravity, wind, minWait, maxWait, maxStep, targetArea: extended);
Var
veloX,veloY,windX,windY,veloMag,dist,randomDist,lastDist,step: extended;
lastX,lastY,MSP,W: integer;
sqrt2,sqrt3,sqrt5: extended;
Begin
MSP := MouseSpeed;
sqrt2:= sqrt(2);
sqrt3:= sqrt(3);
sqrt5:= sqrt(5);
While hypot(xs - xe, ys - ye) > 1 Do
Begin
dist:= hypot(xs - xe, ys - ye);
wind:= minE(wind, dist);
If dist >= targetArea Then
Begin
windX:= windX / sqrt3 + (random(round(wind) * 2 + 1) - wind) / sqrt5;
windY:= windY / sqrt3 + (random(round(wind) * 2 + 1) - wind) / sqrt5;
End Else
Begin
windX:= windX / sqrt2;
windY:= windY / sqrt2;
If (maxStep < 3) Then
Begin
maxStep:= random(3) + 3.0;
End Else
Begin
maxStep:= maxStep / sqrt5;
End;
End;
veloX:= veloX + windX;
veloY:= veloY + windY;
veloX:= veloX + gravity * (xe - xs) / dist;
veloY:= veloY + gravity * (ye - ys) / dist;
if hypot(veloX, veloY) > maxStep then
Begin
randomDist:= maxStep / 2.0 + random(round(maxStep) div 2);
veloMag:= sqrt(veloX * veloX + veloY * veloY);
veloX:= (veloX / veloMag) * randomDist;
veloY:= (veloY / veloMag) * randomDist;
End;
lastX:= Round(xs);
lastY:= Round(ys);
xs:= xs + veloX;
ys:= ys + veloY;

Case RanDom(50) Of
1..25: W := (MSP + (RanDom((MSP/4))));
26..50: W := (MSP - (RanDomRange((MSP/2), MSP-1)));
End;
If (W < 1) Then
W := 1;

If (lastX <> Round(xs)) Or (lastY <> Round(ys)) Then
MoveMouse(Round(xs), Round(ys));

step:= hypot(xs - lastX, ys - lastY);
wait(W);
lastdist:= dist;
End;

If (Round(xe) <> Round(xs)) or (Round(ye) <> Round(ys)) Then
MoveMouse(Round(xe), Round(ye));

MouseSpeed := MSP;
End;

Procedure HumanMMouse(eX, eY, ranX, ranY: Integer);
Var
randSpeed: extended;
X,Y,X2,Y2,j,Dist,MP: integer;
Begin
j := MouseSpeed;
GetMousePos(X, Y);
Dist := Distance(X, Y, eX, eY);
MP := Round(Dist/150);
If MP < 0 Then
MP := 1;

randSpeed := (random(MouseSpeed) / 2.0 + MouseSpeed) / 10.0;
X2 := RanDomRange(eX-(j*MP), eX+(j*MP));
Y2 := RanDomRange(eY-(j*MP), eY+(j*MP));
SuperWindMouse(X, Y, X2, Y2, 11, 8, 10.0 / randSpeed, 12.0 / randSpeed, 10.0 * randSpeed, 10.0 * randSpeed);
GetMousePos(X, Y);
MMouse(eX, eY, ranX, ranY);
MouseSpeed := j;
End;
procedure WriteProgress;
Var
OresPerHour,XpPerHour, CashGained, CashPerHour:Integer;
begin
Seconds := (1 + ((Getsystemtime - StartTime) / 1000));
XpGained := (OresMined*50);
XpPerHour := (3600 * XPGained) / (Seconds);
OresPerHour := (3600 * OresMined) / Seconds;
CashGained := (OresMined*250);
CashPerHour := (3600 * CashGained) / Seconds;
ClearDebug;
Writeln('*****************************');
Writeln('Time Running:' + TimeRunning + '');
Writeln('State:' + Status);
writeln('Mining XP: ' + ToStr(XPGained) + ' | ' + ToStr(XpPerHour) + ' per hour');
writeLn('Coal Mined: ' + ToStr(OresMined) + ' | ' + ToStr(OresPerHour) + ' per hour');
writeLn('Cash gained: ' + ToStr(CashGained) + ' | ' + ToStr(CashPerHour) + ' per hour');
Writeln('*****************************');
end;
function OpenReportFile(): integer;
var
fileName, Bot_SavePath: string;
begin

Bot_SavePath := 'C:/Simba/'
if (not directoryExists(Bot_SavePath)) then
forceDirectories(Bot_SavePath);

fileName := 'Coal Raper [MJ style].txt';
fileName := Bot_SavePath + fileName;

try
if (fileExists(fileName)) then
result := appendFile(fileName)
else
result := createFile(fileName);
except
writeln('OpenSRLLogFile: '+exceptionToString(exceptionType, exceptionParam));
end;
end;
procedure update_state_log(s: string);
var
tmpFile: integer;
begin
status := s;
writeProgress;
if Log_action = 'no' then exit;
tmpFile := OpenReportFile();

if (tmpFile >= 0) then
try
writeFileString(tmpFile, '['+msToTime(getTimeRunning(), TIME_BARE)+']: '+s+#13+#10);
except
Writeln('Error writing File');
finally
closeFile(tmpFile);
end;
end;
procedure AntiBan;
begin
case random(10000) of
1: MakeCompass(255 - Random(30));
2: MakeCompass(255 + Random(30));
3..10: Wait(RandomRange(1500, 4000));
11..12: Wait(RandomRange(2000, 17000));
13..19: RandomRClick;
20..70: BoredHuman;
end;
end;
procedure InitRocks();
begin
SMART_ClearMS();
CreateSurfaceParts(obj_coal_rock, 2);

with obj_coal_rock do begin
parts[0].c := 1460836;
parts[0].hm := 0.05;
parts[0].sm := 1.21;
parts[0].t := 10;
parts[0].minw := 4; // At least 4 pixels wide.
parts[0].maxw := 35; // No more than 80 pixels wide.
parts[0].minh := 4; // At least 4 pixels tall.
parts[0].maxh := 30; // No more than 80 pixel tall.
parts[0].step := 9;
parts[0].max_distance := 200;

parts[1].c := 2303269;
parts[1].hm := 1.67;
parts[1].sm := 0.15;
parts[1].t := 10;
parts[1].filter := @SurfaceFilterClosest; // We want to have the closest iron rock next to us.
parts[1].minw := 5;
parts[1].maxw := parts[0].maxw;
parts[1].minh := 5;
parts[1].maxh := parts[0].maxh;
parts[1].step := 16;
parts[1].max_distance := parts[0].max_distance;

name := 'Coal ore';
uptext := 'Coal';
filter := @SurfaceFilterClosest;
end;
CreateSurfaceParts(obj_Deposite, 2);
with obj_Deposite do begin
parts[0].c := 6845305;
parts[0].hm := 0.16;
parts[0].sm := 0.07;
parts[0].t := 8; //5
parts[0].minw := 1;
parts[0].maxw := 120;
parts[0].minh := 1;
parts[0].maxh := 130;
parts[0].step := 9;
parts[0].max_distance := 900;

parts[1].c := 5140096;
parts[1].hm := 0.05;
parts[1].sm := 0.38;
parts[1].t := 13; //4
parts[1].filter := @SurfaceFilterClosest;
parts[1].minw := 5;
parts[1].maxw := parts[0].maxw;
parts[1].minh := 5;
parts[1].maxh := parts[0].maxh;
parts[1].step := 16;
parts[1].max_distance := parts[0].max_distance;

name := 'Deposite booth';
uptext := 'deposite';
filter := @SurfaceFilterClosest;
end;
end;
Procedure SwitchWorld;
Var
o, j:Integer;
begin
update_state_log('Hopping worlds because ' + reason)
o := Random(high(World_Valid))
j := Random(high(logout_message))
//i := Random(message_odds[1])// := ['1','1000'] // 1 out of 1000
//if (i>=message_odds[0]) then smartsendkeys(ToStr(logout_message[j]),5,5);
ChangeWorld(World_Valid[o]);
end;
function NeedHop: Boolean;
begin
Result := CountDots('player') >=player_count
end;
Procedure B_FindAbNormalRandoms;
Var
Rand_bad:Integer;
begin
Rand_bad := RandomRange(3, 10)
if not loggedin then
begin
update_state_log('Logging in')
LoginPlayer;
ExitSquealOfFortune;
SetAngle(SRL_ANGLE_HIGH)
end;
if Hop_mode = 'no' then exit;
if bad_rocks >= Rand_bad then
begin
reason := 'Bad colors';
SwitchWorld;
bad_rocks := 0;
end;
if tries >= 10 then
begin
reason := 'Too many tries';
SwitchWorld;
bad_rocks := 0;
end;
if NeedHop then
begin
reason := 'Too many people';
SwitchWorld;
bad_rocks := 0;
end;
end;
function NearBank(): boolean;
var
P:Tpoint;
begin
Result := false;
SPS_Setup(RUNESCAPE_OTHER,['dwarven_mine']);
SPS_AnyAngle := True;
SPS_MatchesPercent := 0.45;
SPS_Tolerance := 500.000;
p := SPS_Getmypos;
if PointInBox(p, IntToBox(88, 602, 168, 667)) then
begin
result := true;
end;
end;
function BoxScreen: Boolean;
var
X,Y:Integer;
begin
Result := FindColorTolerance(X, Y, 4512575, 296, 330-50, 301, 336-50, 10)
end;
Procedure WalkMine;
Var
ToMine:TPointArray;
begin
SPS_Setup(RUNESCAPE_OTHER,['dwarven_mine']);
SPS_AnyAngle := True;
SPS_MatchesPercent := 0.45;
SPS_Tolerance := 500.000;
update_state_log('Walking to mine')
ToMine:=[Point(102,633),Point(103,633),Point(104,634),Point(106,635),Point(108,636),Point(111,636),Point(114,636),Point(116,637),Point(119,637),Point(121,636),Point(123,636),Point(126,637),Point(129,637),Point(131,637),Point(134,638),Point(138,638),Point(140,639),Point(141,640),Point(143,640),Point(147,640),Point(151,640),Point(154,640),Point(158,640),Point(162,640),Point(164,640),Point(167,640),Point(172,641),Point(175,641),Point(180,640),Point(184,639)];
SPS_WalkPath(ToMine);
if NearBank then
begin
WalkMine;
end;
end;
function Lowshift: Boolean;
var
PBox: TBox;
begin
PBox := IntToBox(PSX1, PSY1 - 50, PSX2, PSY2 - 50);
Result := (AveragePixelShift(PBox, 250, 350) < 60);
Writeln(IntToStr(AveragePixelShift(PBox, 400, 500)));
end;
function Barb_DepositScreen: Boolean;
var
X, Y: Integer;
begin
Result := FindText(x, y, 'osit Box', UpCharsEx, 314, 85-50, 389, 96-50);
end;
Procedure StoreAll;
begin
HumanMMouse(312,328-50,8,8)
ClickMouse2(Mouse_Left)
Wait(RandomRange(150, 600));
end;
Procedure ClickBox;
var
BankCount:Integer;
begin
if (invfull) and (BoxScreen) then
begin
StoreAll;
exit;
end;
while (isMoving) do
wait(5);
if FindSurfaceObject(obj_Deposite, MSX1, MSY1, MSX2, MSY2) then
begin
update_state_log('Found bank at (' + ToStr(obj_Deposite.p.x) + '),(' + ToStr(obj_Deposite.p.y) + ')')
WriteProgress;
Humanmmouse(obj_Deposite.p.x,obj_Deposite.p.y,7,7)
Wait(RandomRange(35, 300));
clickmouse2(mouse_left)
MarkTime(BankCount);
if didyellowclick then
begin
Wait(RandomRange(35, 700));
ClickBox;
exit;
end;
repeat
Wait(RandomRange(25, 600));
Until (TimeFromMark(BankCount) > 5000) or(BoxScreen);
end;
end;
Procedure Bank;
Var
ToBank:TPointArray;
begin
SPS_Setup(RUNESCAPE_OTHER,['dwarven_mine']);
SPS_AnyAngle := True;
SPS_MatchesPercent := 0.45;
SPS_Tolerance := 500.000;
update_state_log('Walking to bank')
ToBank:=[Point(171,638),Point(168,638),Point(164,639),Point(160,639),Point(157,639),Point(155,639),Point(150,639),Point(145,638),Point(142,638),Point(137,637),Point(134,638),Point(130,638),Point(127,637),Point(123,637),Point(120,636),Point(116,637),Point(112,638),Point(109,636),Point(106,635),Point(101,634),Point(97,631)];
SPS_WalkPath(ToBank);
if NearBank then
begin
ClickBox;
StoreAll;
end;
if not NearBank then
begin
Bank;
end;
end;
procedure MineCoal;
var
OreCount, MineCount, r_wait: Integer;
c_angle: Extended;
begin
if not FindSurfaceObject(obj_coal_rock, MSX1, MSY1, MSX2, MSY2) then
begin
if (tries > 6) then
begin
WalkMine;
exit;
end;
if (tries > 0) then
begin
update_state_log('Cannot find rock waiting') r_wait := (tries * (random(500)) + Random(1000));
Wait(RandomRange(0, (300 + r_wait)));
end;
tries := tries + 1 c_angle := (rs_GetCompassAngleDegrees);
update_state_log('Cannot find rock ajusting compass') if (c_angle >= 180) then
MakeCompass(c_angle - Random(179));
if (c_angle <= 180) then
MakeCompass(c_angle + Random(179));
end;
if FindSurfaceObject(obj_coal_rock, MSX1, MSY1, MSX2, MSY2) then
begin
update_state_log('Found rock at (' + ToStr(obj_coal_rock.p.x) + '),(' + ToStr(obj_coal_rock.p.y) + ')') WriteProgress;
Humanmmouse(obj_coal_rock.p.x, obj_coal_rock.p.y, 7, 7) case random(45) of
1..38: Wait(RandomRange(35, 300));
39..43: Wait(RandomRange(100, 600));
44..45: Wait(RandomRange(200, 1000));
end;
clickmouse2(mouse_left) if didyellowclick then
begin
update_state_log('Misclicked re-trying') Wait(RandomRange(700, 2500));
while ismoving do
wait(3);
MineCoal;
exit;
end;
if FindBlackChatMessage('here') then
begin
update_state_log('Found text [here] the rock is empty!') bad_rocks := bad_rocks + 1;
exit;
end;
Flag;
OreCount := InvCount + 1 MarkTime(MineCount);
repeat
update_state_log('Mining') AntiBan;
case random(1000) of
1..700: Wait(RandomRange(150, 500));
701..850: Wait(RandomRange(200, 750));
851..985: Wait(RandomRange(300, 900));
986..1000: Wait(RandomRange(409, 1100));
end;
Wait(RandomRange(35, 400));
until (TimeFromMark(MineCount) > MineTimeout) or (InvCount = OreCount);
if (InvCount = OreCount) then
begin
OresMined := OresMined + 1;
bad_rocks := 0;
end;
B_FindAbNormalRandoms;
tries := 0;
end;
end;
begin
SetupSRL;
SRL_SIXHOURFIX := TRUE;
update_state_log('')
update_state_log('**********Officer Barbrady Coal Raper**********')
update_state_log('************Log file of bot actions**********')
update_state_log('')
update_state_log('Loading surfaces')
InitRocks();
update_state_log('Declaring variables')
DeclareVs;
StartTime := GetSystemTime;
WriteProgress;
repeat
if not invfull and nearbank then
begin
walkmine;
B_FindAbNormalRandoms;
end;
if invfull then
begin
Bank;
B_FindAbNormalRandoms;
end;
WriteProgress;
SMART_ClearMS();
B_FindAbNormalRandoms;
MineCoal;
Until False;
end.

Olly

2013-04-12 19:06:04

Lol, I started this about a week ago :( mine wont be out anytime soon because im trying and testing out alot of different methods..

BTW does worldswitcher.simba not work anymore or.?

rj

2013-04-12 19:10:15

From: Ollybest
Lol, I started this about a week ago :( mine wont be out anytime soon because im trying and testing out alot of different methods..

BTW does worldswitcher.simba not work anymore or.?


Not sure yet i'm just getting basic setup stuff down, right now I'm just working on easy stuff

happy hippo

2013-04-13 07:07:46

Best of luck barbrady

prabhsun

2013-04-13 19:02:04

From: Officer Barbrady
I am currently working on a f2p/members coal miner and banker, this script will hop to a random world (and you can choose which worlds you don't want it to hop too) if there are a set(by you) number of people! It will also say a random message upon that logout, of course it will not always say it, the odds of it saying the random messages will be determined by you! I have not yet added basic things to the script such as smart/declare players


Progress log:

April 12

-click rock function
-f2p/members/both world array list

April 13

-basic world switching method(not close to done)
-SPS checking left or right of mine (almost done)

Will be using a combination of @Flight's Brakemouse and Superwindmouse AND my own signature antiban
Script so far:

{$DEFINE SMART8}
{$i srl/srl.simba}
{$i sps/sps.simba}
//{$I SRL/SRL/misc/SmartGraphics.simba}
var
world_free, world_members, world_both, World_skip:TintegerArray;
logout_message:TstringArray;
MineTimeout, player_count, Message_odds:Integer;
Hop_mode:string;
Procedure DeclareVs;
begin
MineTimeout := 10000; // timeout of mining rock
Hop_mode := 'none'; // [free], [members], [both], [none]
World_skip := [1, 2, 12] // world you dont want to hop to
player_count := 7; // number of players before hopping
logout_message := ['to full','to many bots ffs'] // message to say if world is full
message_odds := 1 // odds of saying the messages above [out of 1000]
end;
Procedure SuperWindMouse(xs, ys, xe, ye, gravity, wind, minWait, maxWait, maxStep, targetArea: extended);
Var
veloX,veloY,windX,windY,veloMag,dist,randomDist,lastDist,step: extended;
lastX,lastY,MSP,W: integer;
sqrt2,sqrt3,sqrt5: extended;
Begin
MSP := MouseSpeed;
sqrt2:= sqrt(2);
sqrt3:= sqrt(3);
sqrt5:= sqrt(5);
While hypot(xs - xe, ys - ye) > 1 Do
Begin
dist:= hypot(xs - xe, ys - ye);
wind:= minE(wind, dist);
If dist >= targetArea Then
Begin
windX:= windX / sqrt3 + (random(round(wind) * 2 + 1) - wind) / sqrt5;
windY:= windY / sqrt3 + (random(round(wind) * 2 + 1) - wind) / sqrt5;
End Else
Begin
windX:= windX / sqrt2;
windY:= windY / sqrt2;
If (maxStep < 3) Then
Begin
maxStep:= random(3) + 3.0;
End Else
Begin
maxStep:= maxStep / sqrt5;
End;
End;
veloX:= veloX + windX;
veloY:= veloY + windY;
veloX:= veloX + gravity * (xe - xs) / dist;
veloY:= veloY + gravity * (ye - ys) / dist;
if hypot(veloX, veloY) > maxStep then
Begin
randomDist:= maxStep / 2.0 + random(round(maxStep) div 2);
veloMag:= sqrt(veloX * veloX + veloY * veloY);
veloX:= (veloX / veloMag) * randomDist;
veloY:= (veloY / veloMag) * randomDist;
End;
lastX:= Round(xs);
lastY:= Round(ys);
xs:= xs + veloX;
ys:= ys + veloY;

Case RanDom(50) Of
1..25: W := (MSP + (RanDom((MSP/4))));
26..50: W := (MSP - (RanDomRange((MSP/2), MSP-1)));
End;
If (W < 1) Then
W := 1;

If (lastX <> Round(xs)) Or (lastY <> Round(ys)) Then
MoveMouse(Round(xs), Round(ys));

step:= hypot(xs - lastX, ys - lastY);
wait(W);
lastdist:= dist;
End;

If (Round(xe) <> Round(xs)) or (Round(ye) <> Round(ys)) Then
MoveMouse(Round(xe), Round(ye));

MouseSpeed := MSP;
End;

Procedure HumanMMouse(eX, eY, ranX, ranY: Integer);
Var
randSpeed: extended;
X,Y,X2,Y2,j,Dist,MP: integer;
Begin
j := MouseSpeed;
GetMousePos(X, Y);
Dist := Distance(X, Y, eX, eY);
MP := Round(Dist/150);
If MP < 0 Then
MP := 1;

randSpeed := (random(MouseSpeed) / 2.0 + MouseSpeed) / 10.0;
X2 := RanDomRange(eX-(j*MP), eX+(j*MP));
Y2 := RanDomRange(eY-(j*MP), eY+(j*MP));
SuperWindMouse(X, Y, X2, Y2, 11, 8, 10.0 / randSpeed, 12.0 / randSpeed, 10.0 * randSpeed, 10.0 * randSpeed);
GetMousePos(X, Y);
MMouse(eX, eY, ranX, ranY);
MouseSpeed := j;
End;
Procedure loadInts;
begin
world_free := [3, 7, 8, 11, 13, 17, 19, 20, 29, 33, 34, 38, 41, 43, 57, 61, 80, 81, 108, 120, 135, 136]
world_members := [1, 2, 4, 5, 6, 9, 10, 12, 14, 15, 16, 18, 21, 22, 23, 24, 25, 26, 27, 28, 30, 31, 32, 35, 36, 37, 39, 40, 42, 44, 45, 46, 48, 49, 50, 51, 52, 53, 54, 56, 58, 59, 60, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 27, 73, 74, 76, 77, 78, 79, 82, 83, 84, 85, 86, 87, 88, 89, 91, 92, 96, 97, 98, 99, 100, 103, 104, 105, 106, 114, 115, 116, 117, 119, 123, 124, 134, 137, 138, 139]
world_both := [3, 7, 8, 11, 13, 17, 19, 20, 29, 33, 34, 38, 41, 43, 57, 61, 80, 81, 108, 120, 135, 136, 1, 2, 4, 5, 6, 9, 10, 12, 14, 15, 16, 18, 21, 22, 23, 24, 25, 26, 27, 28, 30, 31, 32, 35, 36, 37, 39, 40, 42, 44, 45, 46, 48, 49, 50, 51, 52, 53, 54, 56, 58, 59, 60, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 27, 73, 74, 76, 77, 78, 79, 82, 83, 84, 85, 86, 87, 88, 89, 91, 92, 96, 97, 98, 99, 100, 103, 104, 105, 106, 114, 115, 116, 117, 119, 123, 124, 134, 137, 138, 139]
end;
Procedure SwitchTo;
var
o, k, v, j:Integer;
begin
Case LowerCase(Hop_mode) of
'free':
begin
o := high(world_free)
k := random(o)
for j := 0 to high(world_free) do
begin
if k = World_skip[v] then
begin
v := v+1
end;
end;
end;
'members':
begin
o := high(world_members)
k := random(o)
for j := 0 to o do
begin
if k = World_skip[v] then
begin
v := v+1
end;
end;
end;
'both':
begin
o := high(world_both)
k := random(o)
for j := 0 to o do
begin
if k = World_skip[v] then
begin
v := v+1
end;
end;
end;
'none': exit;
end;
end;
function NearBank(): boolean;
var
ToBankVar: TPointArray;
P:Tpoint;
begin
Result := false;
SPS_Setup(RUNESCAPE_OTHER,['dwarven_mine']);
SPS_MatchesPercent := 0.45;
SPS_Tolerance := 500.000;
p := SPS_Getmypos;
if PointInBox(p, IntToBox(88, 602, 168, 667)) then
begin
result := true;
end;
end;
function IsRightMine(): boolean;
var
ToBankVar: TPointArray;
P:Tpoint;
begin
Result := false;
SPS_Setup(RUNESCAPE_OTHER,['dwarven_mine']);
SPS_MatchesPercent := 0.45;
SPS_Tolerance := 500.000;
p := SPS_Getmypos;
if PointInBox(p, IntToBox(169, 642, 210, 671)) then
begin
result := true;
end;
end;
function IsLeftMine(): boolean;
var
ToBankVar: TPointArray;
P:Tpoint;
begin
Result := false;
SPS_Setup(RUNESCAPE_OTHER,['dwarven_mine']);
SPS_MatchesPercent := 0.45;
SPS_Tolerance := 500.000;
p := SPS_Getmypos;
if PointInBox(p, IntToBox(163, 609, 205, 643)) then
begin
result := true;
end;
end;
function Lowshift: Boolean;
var
PBox: TBox;
begin
PBox := IntToBox(244, 211 - 50, 270, 244 - 50);
Result := (AveragePixelShift(PBox, 250, 350) < 50);
end;
function ClickRock: Boolean;
var
tmpCTS, i, L, Counter: Integer;
ObjTPA: TPointArray;
ObjATPA: T2DPointArray;
X, Y, DMCount, Moves, MineCount, OreCount: Integer;
begin
Moves := 0;
DMCount := 0;
tmpCTS := GetToleranceSpeed;
SetColorToleranceSpeed(2);
SetToleranceSpeed2Modifiers(0.02, 0.17); // .06 .90 3029853 6
FindColorsTolerance(ObjTPA, 935263, MSX1, MSY1, MSX2, MSY2, 6);
SplitTPAWrap(ObjTPA, 10, ObjATPA);
SortATPASize(ObjATPA, True);
SetColorToleranceSpeed(tmpCTS);
SetToleranceSpeed2Modifiers(0.02, 0.02);
DMCount := RandomRange(3, 5);
L := High(ObjATPA) MarkTime(Counter);
for i := 0 to L do
begin
MiddleTPAEx(ObjATPA[i], X, Y);
repeat
begin
Moves := Moves + 1;
Wait(RandomRange(100, 200));
HumanMMouse(RandomRange(X - 8, X + 8), RandomRange(y - 8, y + 8), 0, 0);
if (IsUpTextMultiCustom(['Coal', 'oal', 'ine Coal'])) then
begin
clickmouse2(mouse_Left);
if didyellowclick then exit;
Flag;
OreCount := InvCount + 1
MarkTime(MineCount);
repeat
begin
Wait(RandomRange(135, 250));
writeln('mining')
end;
Until (TimeFromMark(MineCount) > MineTimeout) or(InvCount=OreCount) or (Lowshift);
Break;
end;
end;
until (Moves > DMCount) if (TimeFromMark(Counter) > 1500) then
begin
if IsLeftMine then
begin
case random(8) of
1: SPS_BlindWalk(IntToPoint(183,647));
2: SPS_BlindWalk(IntToPoint(190,646));
3: SPS_BlindWalk(IntToPoint(195,647));
4: SPS_BlindWalk(IntToPoint(177,650));
5: SPS_BlindWalk(IntToPoint(180,652));
6: SPS_BlindWalk(IntToPoint(184,652));
7: SPS_BlindWalk(IntToPoint(190,650));
8: SPS_BlindWalk(IntToPoint(196,651));
end;
end;
Break;
end;
end;
Result := False;
end;
begin
setupSRL;
DeclareVs;
SRL_SIXHOURFIX := TRUE;
ExitSquealOfFortune;
ClickRock;
repeat
ClickRock;
Until False;
end.


Hey barbrady. Could you add mining guild resource dungeon with addy and runite rocks?? world hopping would be great for those ores. If you dont mind that is.

rj

2013-04-23 16:12:40

Here is a quick 6 minute log:

[00:00:00]: 
[00:00:01]: **********Officer Barbrady Coal Raper**********
[00:00:01]: ************Log file of bot actions**********
[00:00:01]:
[00:00:01]: Loading surfaces
[00:00:01]: Declaring variables
[00:00:01]: Logging in
[00:00:09]: Found rock at (344),(133)
[00:00:12]: Mining
[00:00:13]: Mining
[00:00:13]: Mining
[00:00:14]: Mining
[00:00:15]: Mining
[00:00:15]: Mining
[00:00:17]: Found rock at (316),(157)
[00:00:19]: Mining
[00:00:19]: Mining
[00:00:20]: Mining
[00:00:22]: Mining
[00:00:24]: Found rock at (321),(243)
[00:00:25]: Mining
[00:00:26]: Mining
[00:00:27]: Mining
[00:00:28]: Mining
[00:00:29]: Found rock at (235),(48)
[00:00:32]: Mining
[00:00:33]: Mining
[00:00:33]: Mining
[00:00:34]: Mining
[00:00:35]: Mining
[00:00:35]: Mining
[00:00:37]: Cannot find rock ajusting compass
[00:00:39]: Cannot find rock waiting
[00:00:40]: Cannot find rock ajusting compass
[00:00:42]: Cannot find rock waiting
[00:00:42]: Cannot find rock ajusting compass
[00:00:44]: Found rock at (448),(197)
[00:00:45]: Misclicked re-trying
[00:00:48]: Cannot find rock waiting
[00:00:48]: Cannot find rock ajusting compass
[00:00:49]: Cannot find rock waiting
[00:00:49]: Cannot find rock ajusting compass
[00:00:50]: Found rock at (410),(143)
[00:00:51]: Misclicked re-trying
[00:00:54]: Found rock at (263),(150)
[00:00:55]: Found text [here] the rock is empty!
[00:00:56]: Found rock at (262),(152)
[00:00:57]: Mining
[00:00:58]: Mining
[00:00:59]: Mining
[00:00:59]: Mining
[00:01:00]: Mining
[00:01:01]: Mining
[00:01:02]: Found rock at (261),(150)
[00:01:03]: Mining
[00:01:04]: Mining
[00:01:05]: Mining
[00:01:06]: Mining
[00:01:07]: Mining
[00:01:07]: Mining
[00:01:09]: Found rock at (261),(150)
[00:01:09]: Found text [here] the rock is empty!
[00:01:10]: Found rock at (261),(150)
[00:01:11]: Found text [here] the rock is empty!
[00:01:12]: Found rock at (261),(150)
[00:01:12]: Found text [here] the rock is empty!
[00:01:13]: Found rock at (261),(150)
[00:01:13]: Found text [here] the rock is empty!
[00:01:14]: Hopping worlds because Bad colors
[00:01:53]: Found rock at (345),(153)
[00:01:55]: Mining
[00:01:56]: Mining
[00:01:56]: Mining
[00:01:57]: Mining
[00:02:00]: Found rock at (321),(203)
[00:02:01]: Mining
[00:02:02]: Mining
[00:02:02]: Mining
[00:02:03]: Mining
[00:02:04]: Mining
[00:02:05]: Hopping worlds because Too many people
[00:02:45]: Found rock at (163),(207)
[00:02:57]: Mining
[00:02:57]: Mining
[00:02:58]: Mining
[00:02:58]: Mining
[00:02:59]: Mining
[00:03:00]: Mining
[00:03:00]: Mining
[00:03:01]: Hopping worlds because Too many people
[00:03:41]: Found rock at (287),(174)
[00:03:43]: Mining
[00:03:43]: Mining
[00:03:44]: Mining
[00:03:45]: Mining
[00:03:46]: Mining
[00:03:48]: Found rock at (287),(174)
[00:03:48]: Mining
[00:03:49]: Mining
[00:03:50]: Mining
[00:03:50]: Mining
[00:03:51]: Mining
[00:03:52]: Mining
[00:03:52]: Mining
[00:03:54]: Found rock at (163),(206)
[00:03:55]: Mining
[00:03:56]: Mining
[00:03:56]: Mining
[00:03:57]: Mining
[00:03:58]: Mining
[00:04:00]: Found rock at (329),(13)
[00:04:03]: Mining
[00:04:04]: Mining
[00:04:05]: Mining
[00:04:06]: Mining
[00:04:06]: Mining
[00:04:08]: Cannot find rock ajusting compass
[00:04:11]: Cannot find rock waiting
[00:04:11]: Cannot find rock ajusting compass
[00:04:13]: Found rock at (263),(42)
[00:04:15]: Mining
[00:04:16]: Mining
[00:04:17]: Mining
[00:04:17]: Mining
[00:04:18]: Mining
[00:04:18]: Mining
[00:04:20]: Cannot find rock ajusting compass
[00:04:21]: Found rock at (268),(209)
[00:04:22]: Mining
[00:04:23]: Mining
[00:04:25]: Mining
[00:04:25]: Mining
[00:04:26]: Mining
[00:04:27]: Cannot find rock ajusting compass
[00:04:30]: Cannot find rock waiting
[00:04:30]: Cannot find rock ajusting compass
[00:04:32]: Cannot find rock waiting
[00:04:33]: Cannot find rock ajusting compass
[00:04:35]: Cannot find rock waiting
[00:04:37]: Cannot find rock ajusting compass
[00:04:38]: Cannot find rock waiting
[00:04:38]: Cannot find rock ajusting compass
[00:04:40]: Cannot find rock waiting
[00:04:40]: Cannot find rock ajusting compass
[00:04:40]: Found rock at (97),(71)
[00:04:41]: Misclicked re-trying
[00:04:44]: Found rock at (252),(151)
[00:04:45]: Mining
[00:04:46]: Mining
[00:04:48]: Found rock at (217),(107)
[00:04:49]: Mining
[00:04:50]: Mining
[00:04:51]: Mining
[00:04:52]: Mining
[00:04:52]: Mining
[00:04:53]: Mining
[00:04:53]: Mining
[00:04:55]: Found rock at (380),(91)
[00:04:58]: Mining
[00:04:59]: Mining
[00:05:00]: Mining
[00:05:01]: Mining
[00:05:01]: Mining
[00:05:01]: Mining
[00:05:03]: Cannot find rock ajusting compass
[00:05:05]: Cannot find rock waiting
[00:05:05]: Cannot find rock ajusting compass
[00:05:08]: Cannot find rock waiting
[00:05:08]: Cannot find rock ajusting compass
[00:05:09]: Cannot find rock waiting
[00:05:09]: Cannot find rock ajusting compass
[00:05:12]: Cannot find rock waiting
[00:05:13]: Cannot find rock ajusting compass
[00:05:15]: Cannot find rock waiting
[00:05:15]: Cannot find rock ajusting compass
[00:05:16]: Cannot find rock waiting
[00:05:17]: Cannot find rock ajusting compass
[00:05:20]: Hopping worlds because Too many people
[00:05:58]: Walking to mine
[00:06:05]: Walking to mine
[00:06:07]: Walking to mine
[00:06:10]: Found rock at (398),(304)
[00:06:13]: Mining
[00:06:13]: Mining
[00:06:14]: Mining
[00:06:15]: Mining
[00:06:16]: Mining
[00:06:17]: Found rock at (319),(178)
[00:06:19]: Mining
[00:06:19]: Mining
[00:06:20]: Mining
[00:06:21]: Mining
[00:06:22]: Mining
[00:06:24]: Found rock at (232),(9)
[00:06:27]: Mining
[00:06:27]: Mining
[00:06:28]: Mining
[00:06:28]: Mining
[00:06:29]: Mining
[00:06:31]: Cannot find rock ajusting compass
[00:06:32]: Found rock at (120),(194)
[00:06:34]: Mining
[00:06:35]: Mining
[00:06:35]: Mining
[00:06:36]: Mining
[00:06:38]: Cannot find rock ajusting compass
[00:06:39]: Cannot find rock waiting
[00:06:40]: Cannot find rock ajusting compass
[00:06:41]: Cannot find rock waiting
[00:06:41]: Cannot find rock ajusting compass
[00:06:43]: Found rock at (137),(45)
[00:06:44]: Misclicked re-trying
[00:06:48]: Found rock at (230),(212)
[00:06:50]: Mining
[00:06:50]: Mining
[00:06:51]: Mining
[00:06:52]: Mining
[00:06:53]: Mining
[00:06:53]: Mining
[00:06:54]: Hopping worlds because Too many people


rock detection has to be improved, ALMOST DONE

t4q

2013-04-24 04:10:50

very nice script but why not make guild miner instead :)

rj

2013-04-24 05:08:06

From: t4q
very nice script but why not make guild miner instead :)


Have you ever been to the mining guild… 5x more bots

t4q

2013-04-24 05:20:36

From: Officer Barbrady
Have you ever been to the mining guild… 5x more bots

Not recently, tnx for the info

Peanuts

2013-06-19 12:23:23

Are you sure you cant get an angle where you don't have to move the compass much?

Just cos it'll save time..

I've being noticed that movecompass shiz is slowwwwwwww…

rj

2013-06-19 14:31:33

From: Peanuts
Are you sure you cant get an angle where you don't have to move the compass much?

Just cos it'll save time..

I've being noticed that movecompass shiz is slowwwwwwww…


This thread is 2 months old and the script has been released since then (although I don't like the condition it's in, it still works using sps/radial)