Log in

View Full Version : Need a bit of help with my FindObj



IsoMorphic
03-21-2012, 11:29 AM
Dont tell me to use DTM's for a rock. anyways



Procedure MineClay;
var
x, y, PlusOne, timer: integer;
begin
MakeCompass('N');
SetAngle(SRL_ANGLE_HIGH)
Repeat
PlusOne = InvCount + 1


if FindObj(x, y, 'ocks', 7647960, 10) then
writeln('Mining rock');
Mouse(x,y,0,0,true);
ChooseOption('Min');
MarkTime(timer);
repeat

Until(InvCount = PlusOne) or (TimeFromMark(timer) > 10000 + random(100))
if(InvCount = PlusOne)
Inc(mined);

Until(InvFull);

End;

With this error


[Error] (31:1): Internal error (20) at line 30
And line 30 is
if FindObj(x, y, 'ocks', 7647960, 10) then

So wtf? Yes i am using Yohojo and kbClayBanker As a skeleton (i did copy a bit of stuff from kbclaybanker with the mining, but i copyed that line to see if it was a problem with my typing, obviously not...)
So credits to ^^

If you want my full script please post here and i will release it in code here (in an EDIT) Thanks, hope some help for tomorrow


EDIT: What the hell why not



program Walktobank;
{$DEFINE SMART}
{$i SRL\SRL.simba}
{$i sps/sps.simba} //Walking around
Var
myPath, myPath2:TPointArray;
mined:Integer;

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

Players[0].Name := '******'; //Your Runescape username here.
Players[0].Pass := '***********'; //Your Runescape password here.
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 MineClay;
var
x, y, PlusOne, timer: integer;
begin
MakeCompass('N');
SetAngle(SRL_ANGLE_HIGH)
Repeat
PlusOne = InvCount + 1


if FindObj(x, y, 'ocks', 7647960, 10) then
writeln('Mining rock');
Mouse(x,y,0,0,true);
ChooseOption('Min');
MarkTime(timer);
repeat

Until(InvCount = PlusOne) or (TimeFromMark(timer) > 10000 + random(100))
if(InvCount = PlusOne)
Inc(mined);

Until(InvFull);

End;
Procedure WalkBank;
begin

SPS_Setup(RUNESCAPE_SURFACE,['10_7', '11_7']);

myPath := [Point(4165, 3057), Point(4186, 3051), Point(4194, 3048), Point(4199, 3037), Point(4207, 3028), Point(4213, 3018), Point(4221, 3006), Point(4227, 2987), Point(4236, 2971), Point(4252, 2971), Point(4275, 2971), Point(4302, 2972), Point(4309, 2977), Point(4320, 2984), Point(4342, 2984), Point(4370, 2986), Point(4397, 2983), Point(4411, 2985), Point(4419, 2987), Point(4438, 2987), Point(4467, 2976), Point(4485, 2967), Point(4494, 2949), Point(4522, 2936), Point(4556, 2936), Point(4559, 2934), Point(4580, 2924), Point(4579, 2911), Point(4579, 2906)];
Disguise('Walking to bank');

SPS_WalkPath(myPath);
end;

Procedure WalkMine;
Begin
SPS_Setup(RUNESCAPE_SURFACE,['10_7', '11_7']);
myPath2 := [Point(4582, 2915), Point(4545, 2937), Point(4525, 2940), Point(4504, 2943), Point(4496, 2952), Point(4486, 2961), Point(4477, 2970), Point(4456, 2985), Point(4426, 2985), Point(4392, 2976), Point(4354, 2990), Point(4331, 2990), Point(4313, 2985), Point(4302, 2979), Point(4288, 2975), Point(4274, 2975), Point(4244, 2989), Point(4223, 3027), Point(4213, 3045), Point(4208, 3060), Point(4195, 3060), Point(4176, 3060), Point(4168, 3058)];
Writeln('Walking back to mine');
End;
Procedure Done;
begin
Disguise('Script is done. We are at the bank.');
End;




begin

SetupSRL;
DeclarePlayers; //This runs your DeclarePlayers procedure, making sure that the script has a player to run.
LoginPlayer; //This logs in your player.
MakeCompass('N');
SetAngle(SRL_ANGLE_HIGH)
;




end.


Thanks, and night

Kyle Undefined
03-21-2012, 12:53 PM
You're missing a whole bunch of stuff...

In your MineClay procedure, the SetAngle needs a ";" at the end.

Then, the "PlusOne = InvCount + 1" needs a ";" AND it should be ":=".

The "if(InvCount = PlusOne)" needs a "then" after it.

Those changes will get it to compile.

the flea
03-21-2012, 01:06 PM
you may also want to consider using a different object finding method for finding your rocks. I think TPA's would work considerably better here than the standard findobj