PDA

View Full Version : [Lape Reflection] HowTo: Find area's with changing coords.



Rare Scripts
07-02-2015, 07:42 PM
Hello! :)

I hope to help some of you out with the known coords changing (Talking about NMZ inside, POH inside, etc etc :) )


Since we can't get the coords we need the find the closest Object, lets say we are inside our house and we want to check that (Ive seen some posts for this!)

Lets start with a clean function first:



function AtHouse: Boolean;
begin
if not locPlayer.isLoggedIn then Exit;

end;


Lets start it!

First we need to make a TReflectObject Variable to reconise the Object.



function AtHouse: Boolean;
var
Portal: TReflectObject;
begin
if not locPlayer.isLoggedIn then Exit;
end;


After we made the Variable we are ready to make the Portal Object!



if Portal.Find(Portal,ID,DIST) then
begin
writeln('We are Inside House, result = true!');
result := true;
end;


If you type Portal. it will show you a list what you can do with your Variable. :)

Full house Function:



function AtHouse: Boolean;
var
Portal : TReflectObject;
begin
if not locPlayer.isLoggedIn then Exit;

if Portal.Find(Portal,ID,DIST) then
begin
writeln('We are Inside House, result = true!');
result := true;
end;
end;



Now that we got the function we need to add it into the loop and add a Procedure to it:




begin
initAL;
Reflect.Setup;
ScarDisguise;
SetupDaPlayer;
repeat
if not locPlayer.isLoggedIn then LoginPlayer(False); //Always add this :P

if (atHouse) then ExitPortal;

until(False);
EndMessage;
end;



Now lets make the ExitPortal procedure, its kinda the same! :)


procedure ExitPortal;
var
Portal:TReflectObject;
Pointz:TPoint;
begin
if not locPlayer.isLoggedIn then Exit;

if Portal.Find(Portal,ID,DIST) then
begin
writeln('Found Portal, lets exit it!');
Pointz := Portal.GetMsPoint; //If we found the portal we need to convert it to screen coords.
HumanMMouse(Pointz,4,4);
wait(randomrange(60,180));
fastClick(Mouse_Left);

wait(randomrange(700,1400));

end;

end;

Hope i helped some of u :)

Hoodz
07-02-2015, 09:41 PM
ty for contributing!

ps: parse the code so its easier to read.

Rare Scripts
07-02-2015, 11:15 PM
ty for contributing!

ps: parse the code so its easier to read.

Tyty!
Maybe ill write a full Lape tutorial for a script start > finish with failsafes etc etc.
There is none around :O

-Rare.

Drogon
08-14-2015, 09:38 PM
thanks

anth_
08-15-2015, 01:01 AM
Cheers, this would be useful for making a gilded altar script :)

Thanks!

Blak Fishy
10-27-2015, 02:06 AM
thanks for this nice little guide, might make something from it