SRL Archive - OSR Help

"FIND" function not working with TReflectPlayerArray? LAPE REFLECTION


Vowel

2015-03-29 23:49:51

Hey, so I'm making a script that requires finding other players in your area and attacking them.. I've seen in many scripts and tutorials that a proper function would be something like this, however when I try to compile it, it returns "unknown declaration "Find" at line "

procedure attackPlayer();
var
Player: TReflectPlayerArray;

begin
wait(500 + random(1097);
while not MyPlayer.IsUnderAttack do
begin
if Player.Find('//enter user account name') then
begin
Reflect.Mouse.Move(Player.GetMSPoint, 2, 2);
wait(randomrange(50,10));
Reflect.Mouse.Click(Mouse_Left);
end;
end;
end

Turpinator

2015-03-30 01:08:35

Perhaps it doesnt exist?

tls

2015-03-30 02:14:10

Simple. It doesn't exist. The library isn't done.

Vowel

2015-03-30 02:23:22

From: tls
Simple. It doesn't exist. The library isn't done.


How could I go about finding a function to replace this?

Should I use another include to do this?

Just need to find the Player, find it's point so I can then click on it.

Laquisha

2015-03-30 02:46:25

From: Vowel
How could I go about finding a function to replace this?

Should I use another include to do this?

Just need to find the Player, find it's point so I can then click on it.


Just go something like:


procedure ClickPlayer(Name: String);
var
I: Integer;
Players: TReflectPlayerArray
begin
Players.GetAll();
for I := 0 to High(Players) do
if Players[I].GetName() = Name then
Reflect.Mouse.Move(Players[I].GetMSPoint(), 2, 2, MOUSE_LEFT);
end;

begin
ClickPlayer('Zezima');
end.

Vowel

2015-03-30 02:56:36

From: The Simba Noob
Just go something like:


procedure ClickPlayer(Name: String);
var
I: Integer;
Players: TReflectPlayerArray
begin
Players.GetAll();
for I := 0 to High(Players) do
if Players[I].GetName() = Name then
Reflect.Mouse.Move(Players[I].GetMSPoint(), 2, 2, MOUSE_LEFT);
end;

begin
ClickPlayer('Zezima');
end.


Thanks for the reply,

getting the following error @ (Reflect.Mouse.Move(Players.GetMSPoint(), 2, 2, MOUSE_LEFT);) with what you sent me:

"Don't know which overloaded method to call with params."


Also, TReflectPlayerArray only has one function .GetAll();, so I don't think .GetMSPoint will work with it.

Laquisha

2015-03-30 03:02:15

From: Vowel
Thanks for the reply,

getting the following error @ (Reflect.Mouse.Move(Players.GetMSPoint(), 2, 2, MOUSE_LEFT);) with what you sent me:

"Don't know which overloaded method to call with params."


Also, TReflectPlayerArray only has one function .GetAll();, so I don't think .GetMSPoint will work with it.


It was added the other day so you might need to download the ZIP from github and replace your files in c:/simba/includes/reflection

Laquisha

2015-03-30 03:15:44

From: Vowel
Thanks for the reply,

getting the following error @ (Reflect.Mouse.Move(Players.GetMSPoint(), 2, 2, MOUSE_LEFT);) with what you sent me:

"Don't know which overloaded method to call with params."


Also, TReflectPlayerArray only has one function .GetAll();, so I don't think .GetMSPoint will work with it.


Download the latest zip from the github

bg5

2015-03-30 03:53:22

Just extract somehow player's tile and use:

Result := Reflect.Tiles.TileToMs(Self.GetTile);

Vowel

2015-03-30 10:00:04

From: The Simba Noob
It was added the other day so you might need to download the ZIP from github and replace your files in c:/simba/includes/reflection


i have the newest zip from the github.

The problem is this:

with the line you provided me: "Reflect.Mouse.Move(Players[I[.GetMSPoint()"

Players is still a TReflectPlayerArray, and the function GetMSPoint.() doesn't work with it.. Just .GetAll()

Kyle

2015-03-30 11:09:26

Just added

procedure TReflectPlayerArray.Get(Name: string);
function TReflectPlayer.Find(Name: string): Boolean;
function TReflectPlayer.IsOnMS: Boolean;

So you can do:

if Player.Find('Name') then
if Player.IsOnMs then
Reflect.Mouse.Move(Player.GetMSPoint, 2, 2);

If there are any functions that anyone want's added, please use the suggestions forum as I have no other way of knowing since I can't know of all the functions you guys want!