Results 1 to 9 of 9

Thread: Reflection Click on an object

  1. #1
    Join Date
    May 2009
    Posts
    799
    Mentioned
    2 Post(s)
    Quoted
    16 Post(s)

    Default Reflection Click on an object

    I always seem to have trouble with the simplest stuff .

    So.. Why does this not work ? I'ts supposed to click on the bank in lumby, The I'D is from RSBot and should be correct :x...

    if findobject(p,36786) then
    begin
    WriteLn('Found the BANK!');
    xt := TileToMS(p, Random(1));
    mouse(xt.x,xt.y,3,3,true);
    end;

  2. #2
    Join Date
    Oct 2006
    Location
    ithurtsithurtsithurtsithurts
    Posts
    2,930
    Mentioned
    7 Post(s)
    Quoted
    135 Post(s)

    Default

    While it's not exactly what you're looking for, you can just use this to open the bank:
    SCAR Code:
    R_OpenBankBooth('lb');

  3. #3
    Join Date
    May 2009
    Posts
    799
    Mentioned
    2 Post(s)
    Quoted
    16 Post(s)

    Default

    Quote Originally Posted by senrath View Post
    While it's not exactly what you're looking for, you can just use this to open the bank:
    SCAR Code:
    R_OpenBankBooth('lb');
    I tried That function.. Or another one that does the same.. It works .. But why does my scrap of code not click the bank ?

  4. #4
    Join Date
    Oct 2006
    Location
    ithurtsithurtsithurtsithurts
    Posts
    2,930
    Mentioned
    7 Post(s)
    Quoted
    135 Post(s)

    Default

    I'm not entirely sure, what is it doing? Is it hanging, or skipping by it without doing anything? But in general, don't use FindObject. It takes waaaaay too long. Try using FindObjectEx instead.

  5. #5
    Join Date
    May 2009
    Posts
    799
    Mentioned
    2 Post(s)
    Quoted
    16 Post(s)

    Default

    That is True. The whole client lags, when the function is called.

    The if statement becomes false and the script is "Successfully executed"...

    Should find the ID though ;/.

    Gotta try the ex version

  6. #6
    Join Date
    Oct 2006
    Location
    ithurtsithurtsithurtsithurts
    Posts
    2,930
    Mentioned
    7 Post(s)
    Quoted
    135 Post(s)

    Default

    Yeah, it lags because FindObject looks in the entire loaded area for the object. FindObjectEx takes an additional parameter that tells it how many tiles from the center it should look.

    Anyway, try it with the FindObjectEx, then if that doesn't work, double check your ID.

  7. #7
    Join Date
    May 2009
    Posts
    799
    Mentioned
    2 Post(s)
    Quoted
    16 Post(s)

    Default

    There is the id:


    And im using the ex version now, which creates much less lag .
    if findobjectex(p,36786,22) then
    begin
    WriteLn('Found the Door');
    xt := TileToMS(p, Random(1));
    mouse(xt.x,xt.y-15,3,3,true);
    end;

    But still... it doesnt find the object :/

  8. #8
    Join Date
    Oct 2006
    Location
    ithurtsithurtsithurtsithurts
    Posts
    2,930
    Mentioned
    7 Post(s)
    Quoted
    135 Post(s)

    Default

    Okay, that's not the proper ID for some reason. Use 7054 instead of 36786.

  9. #9
    Join Date
    May 2009
    Posts
    799
    Mentioned
    2 Post(s)
    Quoted
    16 Post(s)

    Default

    Thanks alot for your help.. much appreciated.. Works well now.

    Though i wonder why the ID in rsbot is another one than the scar reflection finds :x...

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
  •