Results 1 to 6 of 6

Thread: [Lape Reflection] HowTo: Find area's with changing coords.

  1. #1
    Join Date
    Aug 2014
    Posts
    93
    Mentioned
    2 Post(s)
    Quoted
    36 Post(s)

    Default [Lape Reflection] HowTo: Find area's with changing coords.

    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:

    Code:
    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.

    Code:
    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!

    Code:
    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:

    Code:
    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:


    Code:
    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!
    Code:
    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

  2. #2
    Join Date
    Sep 2012
    Location
    Netherlands
    Posts
    2,752
    Mentioned
    193 Post(s)
    Quoted
    1468 Post(s)

    Default

    ty for contributing!

    ps: parse the code so its easier to read.

  3. #3
    Join Date
    Aug 2014
    Posts
    93
    Mentioned
    2 Post(s)
    Quoted
    36 Post(s)

    Default

    Quote Originally Posted by hoodz View Post
    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.

  4. #4
    Join Date
    May 2012
    Posts
    16
    Mentioned
    1 Post(s)
    Quoted
    0 Post(s)

    Default

    thanks

  5. #5
    Join Date
    Oct 2011
    Location
    England
    Posts
    401
    Mentioned
    10 Post(s)
    Quoted
    176 Post(s)

    Default

    Cheers, this would be useful for making a gilded altar script

    Thanks!
    Yer a wizard, 'oopi

  6. #6
    Join Date
    May 2012
    Posts
    108
    Mentioned
    3 Post(s)
    Quoted
    45 Post(s)

    Default

    thanks for this nice little guide, might make something from it

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •