Log in

View Full Version : Why won't my powerminer click that rock?



IsoMorphic
04-22-2012, 03:29 AM
Heres my script:


program ScriptNameHere;

{$i SRL\SRL.simba}

var
objo:Integer;

procedure DeclarePlayers;
begin
HowManyPlayers := 1;
NumberOfPlayers(HowManyPlayers);
CurrentPlayer := 0;

Players[0].Name := 'NAME HERE!!!!'; //Your Runescape username here.
Players[0].Pass := 'No no no!'; //Your Runescape password here.
Players[0].Nick := 'kil'; //3 letters from your screen name (not first)
Players[0].Active := True; //Set to True if you want to use this player. Set to False to disable this player.
Players[0].Pin := 'Your_Bank_PIN'; //Put your Bank PIN here. Leave alone if you don't have a Bank PIN.
end;
Procedure Proggy;
begin
writeln('*******************************');
writeln('Blackys Iron powerminer. Enjoy!!');
writeln('You have been running for: ' + TimeRunning);
writeln('You have Mined: ' + IntToStr(objo));
writeln('*******************************');
End;
Procedure ANTIBAN;
begin

Case Random(30) of
0: begin
RandomRClick;
end;
1: begin
BoredHuman;
End;
2: begin
PickUpMouse;
End;
3: begin ExamineInv; end;
4: HoverSkill('mining',false);
5: RandomAngle(1);

End;

end;
function colour: Integer;
var
arP: TPointArray;
arC: TIntegerArray;
tmpCTS, i, arL: Integer;
begin
tmpCTS := GetColorToleranceSpeed;
ColorToleranceSpeed(2);
SetColorSpeed2Modifiers(0.05, 0.16);

if not (FindColorsTolerance(arP, 2109010, MSX1, MSY1, MSX2, MSY2, 5)) then
begin
Writeln('Failed to find the color, no result.');
ColorToleranceSpeed(tmpCTS);
SetColorSpeed2Modifiers(0.2, 0.2);
Exit;
end;

arC := GetColors(arP);
ClearSameIntegers(arC);
arL := High(arC);

for i := 0 to arL do
begin
Result := arC[i];
Writeln('AutoColor = ' + IntToStr(arC[i]));
Break;
end;

ColorToleranceSpeed(tmpCTS);
SetColorSpeed2Modifiers(0.2, 0.2);

if (i = arL + 1) then
Writeln('AutoColor failed in finding the color.');
end;
Procedure Ironer;
var
x,y,plusone,timer:integer;
begin
plusone := InvCount + 1;
x := MSCX;
y := MSCY;
//if FindObjTPA(x,y,WillowColour,3,2,15,60,400,['Chop']) then
if FindObj(x,y,'Mine',colour,5) then
begin
Mouse(x,y,2,2,false);


Flag;
MarkTime(timer);


Repeat
Antiban;
wait(1500);
Until(InvCount = plusone) or (TimeFromMark(timer) > 60000)
if(InvCount = plusone) then
writeln('Mined');
end;
end;
procedure Dropper;
begin
writeln('Dropping ore');
DropAll;
writeln('Dropped ore');
wait(2000 + Random(30));
end;



begin
SetupSRL;
DeclarePlayers;
LoginPlayer;

Repeat
//ACA procedure and chop/mine/fish/mousepress/etc goes here.
colour;
Ironer;
if(InvFull) then
begin
//Drop/bank and/or walking procedure goes here...
Dropper;
ClearDebug;
Proggy;
End;
Until(false)
end.


I know im using FindObj, i though FindObjTPA might not be working... but its working fine. When i move my mouse about 2 seconds later it goes and click the inventory button (probably the PlusOne Procedure)

Thanks in advance!!

Gucci
04-22-2012, 03:31 AM
Does it right click the ore?

tehq
04-22-2012, 03:39 AM
Gucci asked that because you have (cleaned up a bit)
if FindObj(x, y, 'Mine', colour, 5) then
begin
Mouse(x, y, 2, 2, false);
end;

If you want it to left click the rock, change the false to true or mouse_left

IsoMorphic
04-22-2012, 03:48 AM
It doesnt move the mouse after clicking the bag tab

tehq
04-22-2012, 03:59 AM
Update the main post with this:

program ScriptNameHere;

{$i SRL\SRL.simba}

var
objo:Integer;

procedure DeclarePlayers;
begin
HowManyPlayers := 1;
NumberOfPlayers(HowManyPlayers);
CurrentPlayer := 0;

Players[0].Name := 'NAME HERE!!!!'; //Your Runescape username here.
Players[0].Pass := 'No no no!'; //Your Runescape password here.
Players[0].Nick := 'kil'; //3 letters from your screen name (not first)
Players[0].Active := True; //Set to True if you want to use this player. Set to False to disable this player.
Players[0].Pin := 'Your_Bank_PIN'; //Put your Bank PIN here. Leave alone if you don't have a Bank PIN.
end;

Procedure Proggy;
begin
writeln('*******************************');
writeln('Blackys Iron powerminer. Enjoy!!');
writeln('You have been running for: ' + TimeRunning);
writeln('You have Mined: ' + IntToStr(objo));
writeln('*******************************');
End;

Procedure ANTIBAN;
begin
Case Random(30) of
0 : RandomRClick;
1 : BoredHuman;
2 : PickUpMouse;
3 : ExamineInv;
4 : HoverSkill('mining',false);
5 : RandomAngle(1);
End;
end;

function colour: Integer;
var
arP: TPointArray;
arC: TIntegerArray;
tmpCTS, i, arL: Integer;
begin
tmpCTS := GetColorToleranceSpeed;
ColorToleranceSpeed(2);
SetColorSpeed2Modifiers(0.05, 0.16);

if not (FindColorsTolerance(arP, 2109010, MSX1, MSY1, MSX2, MSY2, 5)) then
begin
Writeln('Failed to find the color, no result.');
ColorToleranceSpeed(tmpCTS);
SetColorSpeed2Modifiers(0.2, 0.2);
Exit;
end;

arC := GetColors(arP);
ClearSameIntegers(arC);
arL := High(arC);

for i := 0 to arL do
begin
Result := arC[i];
Writeln('AutoColor = ' + IntToStr(arC[i]));
Break;
end;

ColorToleranceSpeed(tmpCTS);
SetColorSpeed2Modifiers(0.2, 0.2);

if (i = arL + 1) then
Writeln('AutoColor failed in finding the color.');
end;

Procedure Ironer;
var
x, y, plusone, timer:integer;
begin
plusone := InvCount + 1;
x := MSCX;
y := MSCY;
//if FindObjTPA(x,y,WillowColour,3,2,15,60,400,['Chop']) then
if FindObj(x, y, 'Mine', colour, 5) then
begin
Mouse(x, y, 2, 2, false);
Flag;
MarkTime(timer);
Repeat
Antiban;
wait(1500);
Until(InvCount = plusone) or (TimeFromMark(timer) > 60000)
if(InvCount = plusone) then
writeln('Mined');
end;
end;

procedure Dropper;
begin
writeln('Dropping ore');
DropAll;
writeln('Dropped ore');
wait(2000 + Random(30));
end;


begin
SetupSRL;
DeclarePlayers;
LoginPlayer;
Repeat
//ACA procedure and chop/mine/fish/mousepress/etc goes here.
colour;
Ironer;
if(InvFull) then
begin
//Drop/bank and/or walking procedure goes here...
Dropper;
ClearDebug;
Proggy;
End;
Until(false);
end.

I'm going to bed, but now other members will be able to read it easily. If no one else solves it then pm me tomorrow :)

Total
04-22-2012, 04:01 AM
Are you running SMART or no? I had this same problem when making my first script where it would open the inv tab and just sit there, but when I ran it in SMART it worked.

John
04-22-2012, 05:27 AM
Are you running SMART or no? I had this same problem when making my first script where it would open the inv tab and just sit there, but when I ran it in SMART it worked.

I am also wondering this, smart may solve your problem.

Imanoobbot
04-22-2012, 06:49 AM
So this function should work. Just write in here if you got another problem.


function FindIron: Boolean;
var
arP, arAP: TPointArray;
arC, arUC: TIntegerArray;
ararP: T2DPointArray;
tmpCTS, i, j, arL, arL2: Integer;
P: TPoint;
X, Y, Z: Extended;
begin
tmpCTS := GetColorToleranceSpeed;
ColorToleranceSpeed(2);
SetColorSpeed2Modifiers(0.08, 0.94);

if not(FindColorsTolerance(arP, 2109010, MSX1, MSY1, MSX2, MSY2, 6)) then
begin
Writeln('Rock Color not found...');
ColorToleranceSpeed(tmpCTS);
SetColorSpeed2Modifiers(0.2, 0.2);
Exit;
end;

arC := GetColors(arP);
arUC := arC;
ClearSameIntegers(arUC);
arL := High(arUC);
arL2 := High(arC);

for i := 0 to arL do
begin
ColorToXYZ(arC[i], X, Y, Z);

if (X >= 4.13) and (X <= 10.17) and (Y >= 3.71) and (Y <= 8.43) and (Z >= 2.49) and (Z <= 4.36) then
begin
for j := 0 to arL2 do
begin
if (arUC[i] = arC[j]) then
begin
SetLength(arAP, Length(arAP) + 1);
arAP[High(arAP)] := arP[j];
end;
end;
end;
end;

SortTPAFrom(arAP, Point(MSCX, MSCY));
ararP := SplitTPAEx(arAP, 10, 10);
arL := High(ararP);

for i := 0 to arL do
begin
if (Length(ararP[i]) < 10) then Continue;
P := MiddleTPA(ararP[i]);
MMouse(P.x, P.y, 5, 5);
Wait(100 + Random(100));
if (IsUpText('Min')) and (IsUpText('Iron')) then
begin;
Mouse(p.x, p.y, 3, 3, True);
Result := True;
Break;
end;
end;

ColorToleranceSpeed(tmpCTS);
SetColorSpeed2Modifiers(0.2, 0.2);

if (i = arL + 1) then
begin
Writeln('Rock not found...');
Exit;
end;
end;