exuals
03-04-2013, 02:54 AM
I used this to get to 50 mining from 30.
Set your user/pass in player deceleration.
Set colors of the iron on line 140 in the second array, line 146 if you need to adjust speed.
Stand here:
http://i48.tinypic.com/n3vpec.jpg
Features:
Gas checking
Very fast
100% Accurate rock finding
You still have to watch it.
Thanks to Flight for the mouse functions;
http://villavu.com/forum/showthread.php?t=80386&highlight=move+mouse+smooth
NOT HELPING PEOPLE WITH SETUP, CONSIDER IT THE ANTI-LEECH.
program exualsArdyMiner07;
{$DEFINE SMART}
{$I SRL/SRL.simba}
{$I P07Include.simba}
var
X, Y: Integer;
ERock, SRock, WRock: TBox;
Procedure P07_DeclarePlayer;
begin
P07_PlayerName:='';
P07_PlayerPass:='';
end;
Procedure BrakeWindMouse(xs, ys, xe, ye, gravity, wind, minWait, maxWait, targetArea: extended);
var
veloX,veloY,windX,windY,veloMag,dist,randomDist,la stDist,D: extended;
lastX,lastY,MSP,W,TDist,T: integer;
sqrt2,sqrt3,sqrt5,PDist,maxStep: extended;
begin
MSP := MouseSpeed;
sqrt2:= sqrt(2);
sqrt3:= sqrt(3);
sqrt5:= sqrt(5);
TDist := Distance(Round(xs), Round(ys), Round(xe), Round(ye));
if (TDist < 1) then
TDist := 1;
MarkTime(T);
repeat
if (TimeFromMark(T)>5000) then
break;
dist:= hypot(xs - xe, ys - ye);
wind:= minE(wind, dist);
if (dist < 1) then
dist := 1;
PDist := (dist/TDist);
if (PDist < 0.01) then
PDist := 0.01;
if (PDist >= 0.15) then //15% (or higher) dist to destination
begin
D := (Round((Round(dist)*0.3))/5);
if (D < 20) then
D := 20;
end else if (PDist < 0.15) then
begin
if ((PDist <= 0.15) and (PDist >= 0.10)) then //10%-15%
D := RandomRange(8, 13)
else if (PDist < 0.10) then //< 10%
D := RandomRange(4, 7);
end;
if (D <= Round(dist)) then
maxStep := D
else
maxStep := Round(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;
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;
if (lastX <> Round(xs)) or (lastY <> Round(ys)) then
MoveMouse(Round(xs), Round(ys));
W := (Random((Round(100/MSP)))*6);
if (W < 5) then
W := 5;
W := Round(W*1.2);
wait(W);
lastdist:= dist;
until(hypot(xs - xe, ys - ye) < 1)
if (Round(xe) <> Round(xs)) or (Round(ye) <> Round(ys)) then
MMouse(Round(xe), Round(ye), 0, 0);
MouseSpeed := MSP;
end;
Procedure BrakeMMouse(eX, eY, ranX, ranY: Integer);
var
randSpeed: extended;
X,Y,MS: integer;
begin
MS := MouseSpeed;
randSpeed := (random(MouseSpeed) / 2.0 + MouseSpeed) / 10.0;
GetMousePos(X, Y);
BrakeWindMouse(X, Y, RandomRange(eX-ranX, eX+ranX), RandomRange(eY-ranY,eY+ranY), 8, 5, 10.0 / randSpeed, 15.0 / randSpeed, 10.0 * randSpeed);
MouseSpeed := MS;
end;
procedure checkForGas;
begin
if (AveragePixelShift(WRock, 250, 500) > 330) then
begin
WriteLn('Found gas, waiting 40s');
Wait(40000);
end;
if (AveragePixelShift(ERock, 250, 500) > 330) then
begin
WriteLn('Found gas, waiting 40s');
Wait(40000);
end;
if (AveragePixelShift(SRock, 250, 500) > 330) then
begin
WriteLn('Found gas, waiting 40s');
Wait(40000);
end;
end;
procedure ClickRock;
begin
if (P07_FindObjEx(x, y, ['Mine', 'Rocks'], [2503507, 1910851, 2042951, 2371663], 8, 15, 200, 150, 330, 240)) then
begin
BrakeMMouse(x, y, 0, 0);
Wait(50 + Random(30));
P07_MouseBox(x, y, x, y, mouse_left);
end;
Wait(RandomRange(600, 800));
end;
procedure initAntiRand;
begin
ERock := IntToBox( 285, 165, 315, 190);
WRock := IntToBox( 235, 210, 255, 225);
SRock := IntToBox( 275, 260, 315, 295);
end;
begin
SetupSRL();
P07_DeclarePlayer;
SetupP07Include;
ActivateClient;
ClearDebug;
initAntiRand;
repeat
if (not P07_LoggedIn) then
begin
P07_LogInPlayer;
P07_MakeCameraAngleHigh;
P07_MakeCompassNorth;
end;
if (P07_LoggedIn) then
begin
checkForGas;
ClickRock;
if P07_InvFull then
P07_DropAllExcept([1]);
end;
until(isKeyDown(113));
end.
Set your user/pass in player deceleration.
Set colors of the iron on line 140 in the second array, line 146 if you need to adjust speed.
Stand here:
http://i48.tinypic.com/n3vpec.jpg
Features:
Gas checking
Very fast
100% Accurate rock finding
You still have to watch it.
Thanks to Flight for the mouse functions;
http://villavu.com/forum/showthread.php?t=80386&highlight=move+mouse+smooth
NOT HELPING PEOPLE WITH SETUP, CONSIDER IT THE ANTI-LEECH.
program exualsArdyMiner07;
{$DEFINE SMART}
{$I SRL/SRL.simba}
{$I P07Include.simba}
var
X, Y: Integer;
ERock, SRock, WRock: TBox;
Procedure P07_DeclarePlayer;
begin
P07_PlayerName:='';
P07_PlayerPass:='';
end;
Procedure BrakeWindMouse(xs, ys, xe, ye, gravity, wind, minWait, maxWait, targetArea: extended);
var
veloX,veloY,windX,windY,veloMag,dist,randomDist,la stDist,D: extended;
lastX,lastY,MSP,W,TDist,T: integer;
sqrt2,sqrt3,sqrt5,PDist,maxStep: extended;
begin
MSP := MouseSpeed;
sqrt2:= sqrt(2);
sqrt3:= sqrt(3);
sqrt5:= sqrt(5);
TDist := Distance(Round(xs), Round(ys), Round(xe), Round(ye));
if (TDist < 1) then
TDist := 1;
MarkTime(T);
repeat
if (TimeFromMark(T)>5000) then
break;
dist:= hypot(xs - xe, ys - ye);
wind:= minE(wind, dist);
if (dist < 1) then
dist := 1;
PDist := (dist/TDist);
if (PDist < 0.01) then
PDist := 0.01;
if (PDist >= 0.15) then //15% (or higher) dist to destination
begin
D := (Round((Round(dist)*0.3))/5);
if (D < 20) then
D := 20;
end else if (PDist < 0.15) then
begin
if ((PDist <= 0.15) and (PDist >= 0.10)) then //10%-15%
D := RandomRange(8, 13)
else if (PDist < 0.10) then //< 10%
D := RandomRange(4, 7);
end;
if (D <= Round(dist)) then
maxStep := D
else
maxStep := Round(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;
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;
if (lastX <> Round(xs)) or (lastY <> Round(ys)) then
MoveMouse(Round(xs), Round(ys));
W := (Random((Round(100/MSP)))*6);
if (W < 5) then
W := 5;
W := Round(W*1.2);
wait(W);
lastdist:= dist;
until(hypot(xs - xe, ys - ye) < 1)
if (Round(xe) <> Round(xs)) or (Round(ye) <> Round(ys)) then
MMouse(Round(xe), Round(ye), 0, 0);
MouseSpeed := MSP;
end;
Procedure BrakeMMouse(eX, eY, ranX, ranY: Integer);
var
randSpeed: extended;
X,Y,MS: integer;
begin
MS := MouseSpeed;
randSpeed := (random(MouseSpeed) / 2.0 + MouseSpeed) / 10.0;
GetMousePos(X, Y);
BrakeWindMouse(X, Y, RandomRange(eX-ranX, eX+ranX), RandomRange(eY-ranY,eY+ranY), 8, 5, 10.0 / randSpeed, 15.0 / randSpeed, 10.0 * randSpeed);
MouseSpeed := MS;
end;
procedure checkForGas;
begin
if (AveragePixelShift(WRock, 250, 500) > 330) then
begin
WriteLn('Found gas, waiting 40s');
Wait(40000);
end;
if (AveragePixelShift(ERock, 250, 500) > 330) then
begin
WriteLn('Found gas, waiting 40s');
Wait(40000);
end;
if (AveragePixelShift(SRock, 250, 500) > 330) then
begin
WriteLn('Found gas, waiting 40s');
Wait(40000);
end;
end;
procedure ClickRock;
begin
if (P07_FindObjEx(x, y, ['Mine', 'Rocks'], [2503507, 1910851, 2042951, 2371663], 8, 15, 200, 150, 330, 240)) then
begin
BrakeMMouse(x, y, 0, 0);
Wait(50 + Random(30));
P07_MouseBox(x, y, x, y, mouse_left);
end;
Wait(RandomRange(600, 800));
end;
procedure initAntiRand;
begin
ERock := IntToBox( 285, 165, 315, 190);
WRock := IntToBox( 235, 210, 255, 225);
SRock := IntToBox( 275, 260, 315, 295);
end;
begin
SetupSRL();
P07_DeclarePlayer;
SetupP07Include;
ActivateClient;
ClearDebug;
initAntiRand;
repeat
if (not P07_LoggedIn) then
begin
P07_LogInPlayer;
P07_MakeCameraAngleHigh;
P07_MakeCompassNorth;
end;
if (P07_LoggedIn) then
begin
checkForGas;
ClickRock;
if P07_InvFull then
P07_DropAllExcept([1]);
end;
until(isKeyDown(113));
end.