HarryJames
02-24-2011, 01:55 AM
I'm tired, it's late.
How do I correctly implement finding an object and then clicking it?
program FightCaveRunner;
{$DEFINE SMART}
{$i SRL/SRL.scar}
{$i Reflection/Reflection.simba}
procedure DeclarePlayers;
begin
HowManyPlayers := 1;
NumberOfPlayers(HowManyPlayers);
CurrentPlayer := 0;
with Players[0] do
begin
Name := '';
Pass := '';
Nick := 'ake';
Active:=True;
end;
end;
var
playerAtCaves : boolean;
tmp : integer;
Procedure atCaves;
begin
if (DistanceFrom(Tile(2438, 5168)) < 6) then
begin
writeln('We''re at the caves!');
playerAtCaves := True;
end else
begin
writeln('looks like we''re not at the caves');
playerAtCaves := False;
end;
end;
Procedure findCaveEntrace;
var
entrance: TNPCArray;
cavePoint: TPoint;
Begin
// tmp := GetObjectAt(Point(2439,5167),0).ID;
// writeln(tmp);// Gets object ID at a certain point
entrance := SortNPCs(GetNPCs(9356));
cavePoint := Tile(2439,5167);
Mouse(cavePoint.x, cavePoint.y, 10, 10, False);
End;
{
Notes for me!
ID: 9356 should be the entrace
writeln('Object ID:'+ GetObjectAt(Point(2438,5167),0).ID); Gets object ID at a certain point
}
Procedure MainLoop;
Begin
Smart_Signed := true;
Smart_Server := 34;
Smart_SuperDetail := false;
SetupSRL;
DeclarePlayers;
LoginPlayer;
findCaveEntrace;
//writeln(GetMyPos);
//wait(3000);
//writeln(GetMyPos);
end;
begin
MainLoop;
end.
Why is this not working?
Thanks <3
How do I correctly implement finding an object and then clicking it?
program FightCaveRunner;
{$DEFINE SMART}
{$i SRL/SRL.scar}
{$i Reflection/Reflection.simba}
procedure DeclarePlayers;
begin
HowManyPlayers := 1;
NumberOfPlayers(HowManyPlayers);
CurrentPlayer := 0;
with Players[0] do
begin
Name := '';
Pass := '';
Nick := 'ake';
Active:=True;
end;
end;
var
playerAtCaves : boolean;
tmp : integer;
Procedure atCaves;
begin
if (DistanceFrom(Tile(2438, 5168)) < 6) then
begin
writeln('We''re at the caves!');
playerAtCaves := True;
end else
begin
writeln('looks like we''re not at the caves');
playerAtCaves := False;
end;
end;
Procedure findCaveEntrace;
var
entrance: TNPCArray;
cavePoint: TPoint;
Begin
// tmp := GetObjectAt(Point(2439,5167),0).ID;
// writeln(tmp);// Gets object ID at a certain point
entrance := SortNPCs(GetNPCs(9356));
cavePoint := Tile(2439,5167);
Mouse(cavePoint.x, cavePoint.y, 10, 10, False);
End;
{
Notes for me!
ID: 9356 should be the entrace
writeln('Object ID:'+ GetObjectAt(Point(2438,5167),0).ID); Gets object ID at a certain point
}
Procedure MainLoop;
Begin
Smart_Signed := true;
Smart_Server := 34;
Smart_SuperDetail := false;
SetupSRL;
DeclarePlayers;
LoginPlayer;
findCaveEntrace;
//writeln(GetMyPos);
//wait(3000);
//writeln(GetMyPos);
end;
begin
MainLoop;
end.
Why is this not working?
Thanks <3