SRL Archive - OSR Help

Power-miner help


stabstabstun

2013-05-20 13:56:14

I have everything working based on a tutorial but I cannot find out how to accurately have the bot pick out the iron ore, I was trying to get it working using WorldMiners Color/tolerance specs as well as finding my own.

I am trying to mine in 07 scape dwarven mine right by the first iron ores straight down on the right hand side of the cave.

EDIT#1:

Switched over to Text grabbing/ATPA.

Questions:
1. am I using text grabbing in conjuction with ATPA or picking and choosing?
2. [Error] C:\Simba\Scripts\MyMinerTest.simba(94:1): Identifier expected at line 93
Compiling failed. (On the "Procedure: DeclarePlayers" Line
3. how would I go about looping procedures?
something like
If not Findrock then
panic
else
FindRock();?

Also i'm trying to get my code working here
(largely copy and paste atm as I try to figure what works, I take no credit)
program New;
{$Define SMART8}
{$include SRL/SRL.simba}
{$i P07Include.simba}

procedure P07_FindRockBomb;
var
tpa: TPointArray;
begin
SetColorToleranceSpeed(2);
SetColorSpeed2Modifiers(0.14, 0.51);
FindColorsTolerance(tpa, 6190211, 217 , 127, 329, 228, 19);
SetColorToleranceSpeed(1);
SetColorspeed2Modifiers(0.2, 0.2);
if Length(tpa) > 65 then
begin
MMouse(P07_MMCX,P07_MMCY,1,1);
wait(95);
ClickMouse2(mouse_left);
wait(RandomRange(35000,60000)); // Edit this as you please.
end;
end;

Function FindRock: Boolean;
var
B: TBox;
TPA,TPA2: TPointArray;
i,CTS,X,Y: Integer;
ATPA: T2DPointArray;
begin
Result := False;
if (not loggedin) then exit;
CTS := GetColorToleranceSpeed;

ColorToleranceSpeed(2);
SetColorSpeed2Modifiers(0.05, 0.20);
FindColorsSpiralTolerance(MSCX, MSCY, TPA, 2371662, MSX1, MSY1, MSX2, MSY2, 7);
SetColorSpeed2Modifiers(0.02, 0.02);
ColorToleranceSpeed(CTS);

if (Length(TPA) < 1) then
Exit;

ATPA := TPAToATPAEx(TPA, 22, 22);
SortATPAFromFirstpoint(ATPA, Point(MSCX, MSCY));

for i := 0 to High(ATPA) do
begin

B := GetTPABounds(ATPA[i]);

with B do
begin
ColorToleranceSpeed(2);
SetColorSpeed2Modifiers(0.01, 2.26);
FindColorsSpiralTolerance(MSCX, MSCY, TPA2, 2371662, B.X1, B.Y1, B.X2, B.Y2, 10);
SetColorSpeed2Modifiers(0.02, 0.02);
ColorToleranceSpeed(CTS);

if (Length(TPA2) > 0) then
begin
MiddleTPAEx(ATPA[i], X, Y);
//smart_debugATPA(true,ATPA);
Result := True;
MMouse(X, Y, 6, 6);
if WaitUpTextMulti(['Mine','Rocks'], 300) then
begin
Result := True;
Exit;
end;
end;
end;
end;
end;

Procedure MineClay;
var
Orecount,MineCount,Timeout: Integer;
begin
if (not loggedin) then exit;

if WaitUpTextMulti(['Mine','Rocks'], 300) then
begin
WriteLn('Found the uptex');
clickmouse2(mouse_left);
MarkTime(MineCount);
Timeout := RandomRange(4000, 6000);
OreCount := InvCount + 1
repeat
Wait(RandomRange(15, 200));
writeln('Mining');
Exit;
Procedure DeclarePlayers;
begin
HowManyPlayers := 1;
NumberOfPlayers(HowManyPlayers);
CurrentPlayer := 0;

Players[0].Name :='';
Players[0].Pass :='';
Players[0].Nick :='noso';
Players[0].Active:=True;
end;

procedure AntiBan;
begin
if(not(LoggedIn))then
exit;
case Random(8) of
0:
begin
HoverSkill('Minning', false);
wait(2453+Random(432));
end;
1: PickUpMouse;
2:
begin
MakeCompass('N');
wait(100+random(133));
MakeCompass('S');
wait(50+random(133));
MakeCompass('N');
end;
end;
end;
begin
SetUpSRL;
ActivateClient;
DeclarePlayers;
LoginPlayer;





end.

Flight

2013-05-20 14:07:48

Phew I could spend a lot of time explaining specifically how to find rocks containing certain ores but it's after 1:00 AM now and I'm a bit sleepy… I'll leave you with this advice: look over Naum's tutorial labelled "Wizzy plugin" or something close to that, it's in the Advanced Scripting Tutorials in the tutorials section. Get a bit of basic knowledge of TPAs & ATPAs. Then when you've, at least, a basic idea of what they are and how the work look over this thread relating very close to yours:
http://villavu.com/forum/showthread.php?t=102536

In there we discuss exactly finding a rock containing a certain type of ore. Pay close attention to my posts as I try to explain out my own methods for doing it, I even included a rock-finding function; that should help you quite a bit if you understand how it works.

Good luck mate!

stabstabstun

2013-05-20 14:21:54

@Above
thank you for the quick response!

EDIT:
updated and posted with some new questions

t4q

2013-05-21 04:33:16

From: stabstabstun
@Above
thank you for the quick response!

EDIT:
updated and posted with some new questions


On the line 93 you are missing until and end. Look through your mineClay; procedure.