Results 1 to 21 of 21

Thread: Ladder detecting (picture inside)

  1. #1
    Join Date
    Mar 2012
    Posts
    51
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default Ladder detecting (picture inside)

    How can I detect this ladder?



    my script to find it doesnt work:

    Code:
      var Ladder,x,y:integer;
      ToArea:TPointArray;
    begin
    MakeCompass('N');
      SetAngle(SRL_ANGLE_HIGH);
     Ladder := DTMFromString('mwQAAAHic42RgYDBiYmAwAWJDILYGYi0g1gViKyC2BGINIOZlZGD4BlSrwAhhg/B3BgiWZ4TgbGcVBjd9WYaZaQ4MmjLCDKGmsgz+JooMgWZKDHMynBiqg0wYiAGMRGA4AADm/AyO');
      repeat
    if FindDTM(Ladder, x, y,MSX1, MSY1, MSX2, MSY2) then
     begin
     Mouse(x, y, 0, 0, true);
     end;
     until  isUpText('lank');
    Last edited by Mor; 04-05-2012 at 05:50 PM.

  2. #2
    Join Date
    May 2008
    Location
    ;)
    Posts
    576
    Mentioned
    0 Post(s)
    Quoted
    1 Post(s)

    Default

    CTS2/DTMs with high tolerance, etc.
    Basically, the normal ways.

    What about it is hard to detect?

  3. #3
    Join Date
    Mar 2012
    Posts
    51
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Quote Originally Posted by nickrules View Post
    CTS2/DTMs with high tolerance, etc.
    Basically, the normal ways.

    What about it is hard to detect?
    I tried DTM,Pls look the code I'v added.
    what is wrong with it?

  4. #4
    Join Date
    Feb 2012
    Location
    Somewhere, over the rainbow...
    Posts
    2,272
    Mentioned
    3 Post(s)
    Quoted
    45 Post(s)

    Default

    If you can walk to a certain point consistently, then why not just a make a TBox around the door and then make your script find the color within that TBox?


    EDIT: then you can put in that TBox co-ordinates instead of MSX1, MSY1, MSX2, MSY2....

  5. #5
    Join Date
    Mar 2012
    Posts
    51
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Quote Originally Posted by abu_jwka View Post
    If you can walk to a certain point consistently, then why not just a make a TBox around the door and then make your script find the color within that TBox?


    EDIT: then you can put in that TBox co-ordinates instead of MSX1, MSY1, MSX2, MSY2....
    I will try to do it and edit .
    Thanks

  6. #6
    Join Date
    Feb 2012
    Location
    Somewhere, over the rainbow...
    Posts
    2,272
    Mentioned
    3 Post(s)
    Quoted
    45 Post(s)

    Default

    Quote Originally Posted by Mor View Post
    I will try to do it and edit .
    Thanks
    Here, I wrote up this little explanation for someone else and now I'm gonna post it here too

    I thought you would say that, first imagine making a box around the door, now make it slightly bigger so that the door would still be in that box if you moved a bit to the left or a bit to the right.

    Still got that box image in your head? Good? Now get your color picker tool and click the top left hand corner of your imaginary box. Then click the bottom right-hand corner.

    Well done! You should now have four co-ordinates in your debug box, replace them with MSX1, MSY1, MSX2, MSY2 and your box will come to life!

    Voila!

  7. #7
    Join Date
    Mar 2012
    Posts
    51
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Quote Originally Posted by abu_jwka View Post
    Here, I wrote up this little explanation for someone else and now I'm gonna post it here too
    I did it, still doesnt work.

    here is the code after the changes:

    Code:
      var Ladder,x,y:integer;
      ToArea:TPointArray;
    begin
    MakeCompass('N');
      SetAngle(SRL_ANGLE_HIGH);
      repeat
      Ladder:= DTMFromString('mrAAAAHic42BgYGBlZGBgAeJfQLYwIwT/BLKFoPQ9IH4PxEeB+BiUD8LvoOJt6S4MgdYKDDNKfRnaMlwYahLsGPrzPBiCbRQZQmwVGQgBRgIYBgASvxJe');
    if FindDTM(Ladder, x, y,239, 200, 264, 249) then
     begin
     Mouse(x, y, 0, 0, true);
     end;
     until  isUpText('lank');

  8. #8
    Join Date
    Feb 2012
    Location
    Somewhere, over the rainbow...
    Posts
    2,272
    Mentioned
    3 Post(s)
    Quoted
    45 Post(s)

    Default

    Make a bigger box...



    EDIT: Check your DTM is working by printing it into the DTM Editor..... sometimes if you reload Runescape the graphics change and the DTM won't be found

  9. #9
    Join Date
    Mar 2012
    Posts
    426
    Mentioned
    0 Post(s)
    Quoted
    9 Post(s)

    Default

    Try FindDTMRotated as well.

  10. #10
    Join Date
    Jan 2010
    Posts
    1,414
    Mentioned
    0 Post(s)
    Quoted
    1 Post(s)

    Default

    TPAs/ATPAs. You can create specific minimum and maximum pixels to create a very strict way of searching for the object. That would solve it for you.
    Simba Code:
    (* Main *)

    repeat
      WriteLn('I am an idiot!');
    until(False);

  11. #11
    Join Date
    Mar 2012
    Posts
    51
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Quote Originally Posted by abu_jwka View Post
    Make a bigger box...



    EDIT: Check your DTM is working by printing it into the DTM Editor..... sometimes if you reload Runescape the graphics change and the DTM won't be found
    I found 2 problems:
    1.when I check it in DTM Editor I see something else highlighted in the
    picture ,
    far away from the object that I want to find. and I have tried 3 times to make new DTM, and the same problem...
    2.when I start the script the mouse doesn't move.
    how can I fix it?
    Last edited by Mor; 04-05-2012 at 07:14 PM.

  12. #12
    Join Date
    Feb 2012
    Location
    Somewhere, over the rainbow...
    Posts
    2,272
    Mentioned
    3 Post(s)
    Quoted
    45 Post(s)

    Default

    Quote Originally Posted by Mor View Post
    I found 2 problems:
    1.when I check it in DTM Editor I see something else highlighted in the
    picture ,
    far away from the object that I want to find. and I have tried 3 times to make new DTM, and the same problem...
    2.when I start the script the mouse doesn't move.
    how can I fix it?
    It means you need to make better DTM's. If you still can't make one good enough, I suggest using a different method, TPA's maybe?

  13. #13
    Join Date
    Mar 2012
    Posts
    51
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Finally, I did it with the TPA method.
    thank you all for the helping!!!
    I really appreciate that

  14. #14
    Join Date
    Jan 2009
    Location
    Turlock/LA, California
    Posts
    1,494
    Mentioned
    3 Post(s)
    Quoted
    66 Post(s)

    Default

    Quote Originally Posted by RISK View Post
    TPAs/ATPAs. You can create specific minimum and maximum pixels to create a very strict way of searching for the object. That would solve it for you.
    thats what i would suggest also. imo, its the best way of detecting any object on the MS (generally).

    nvm u fixed it. good job!

  15. #15
    Join Date
    Mar 2012
    Posts
    51
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Now I need little suggestion from you for the repeat condition. It will continue to find the ladder until what?I cant find any condition for it because there is nothing like uptext after click this ladder.
    here is my script and I marked the repeat...until problem:

    Code:
    procedure XXX;
      var
      MyTPA : TPointArray;
      MyPoint : TPoint;
      x, y, i : Integer;
      ToArea:TPointArray;
    begin
    MakeCompass('N');
      SetAngle(SRL_ANGLE_HIGH);
    repeat
      FindColorsTolerance(MyTPA, 2772329, 235, 203, 271, 271, 10);
      if Length(MyTPA) = 0 then FindColorsTolerance(MyTPA, 3432579, MSX1, MSY1, MSX2, MSY2, 10);
      for i := 0 to High(MyTPA)do
      begin
        MyPoint := MyTPA[i]
        MMouse (MyPoint.x, MyPoint.y, 3, 3);
        if (IsUpTextMultiCustom(['lank'])) then
        begin
        wait(500);
          GetMousePos(x, y);
          Mouse(x, y, 2, 2, true);
          Wait(500+random(250));
        end;
        end;
        until ???
      Wait(350+random(350));
     SPS_Setup(runescape_surface,['9_10','8_10']);
     ToBananasArea := [Point(3657, 4078), Point(3648, 4076), Point(3634, 4077), Point(3625, 4077), Point(3611, 4077), Point(3597, 4079), Point(3585, 4075), Point(3575, 4071), Point(3567, 4065), Point(3558, 4061), Point(3548, 4059), Point(3534, 4058), Point(3525, 4057), Point(3510, 4055), Point(3501, 4055), Point(3497, 4050), Point(3500, 4043), Point(3502, 4021)];
      SPS_WalkPath(ToBananasArea);
      wait(1000);
    end;
    Last edited by Mor; 04-05-2012 at 07:53 PM.

  16. #16
    Join Date
    Feb 2012
    Location
    Somewhere, over the rainbow...
    Posts
    2,272
    Mentioned
    3 Post(s)
    Quoted
    45 Post(s)

    Default

    until True?

    Once it's found it it will stop...

  17. #17
    Join Date
    Mar 2012
    Posts
    51
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Quote Originally Posted by abu_jwka View Post
    until True?

    Once it's found it it will stop...

    lol thank you.
    I didn't know about this function, it makes all very simple

  18. #18
    Join Date
    May 2008
    Location
    ;)
    Posts
    576
    Mentioned
    0 Post(s)
    Quoted
    1 Post(s)

    Default

    Quote Originally Posted by abu_jwka View Post
    until True?

    Once it's found it it will stop...
    No, that just means it's going to *assume* it got out of the boat.

    Code:
    procedure XXX;
      var
      MyTPA : TPointArray;
      MyPoint : TPoint;
      x, y, i : Integer;
      ToArea:TPointArray;
    begin
    MakeCompass('N');
      SetAngle(SRL_ANGLE_HIGH);
    repeat
      FindColorsTolerance(MyTPA, 2772329, 235, 203, 271, 271, 10);
      if Length(MyTPA) = 0 then FindColorsTolerance(MyTPA, 3432579, MSX1, MSY1, MSX2, MSY2, 10);
      for i := 0 to High(MyTPA)do
      begin
        MyPoint := MyTPA[i]
        MMouse (MyPoint.x, MyPoint.y, 3, 3);
        end;
        until(IsUpTextMultiCustom(['lank']))
    clickmouse2(mouse_left);
      Wait(350+random(350));
     SPS_Setup(runescape_surface,['9_10','8_10']);
     ToBananasArea := [Point(3657, 4078), Point(3648, 4076), Point(3634, 4077), Point(3625, 4077), Point(3611, 4077), Point(3597, 4079), Point(3585, 4075), Point(3575, 4071), Point(3567, 4065), Point(3558, 4061), Point(3548, 4059), Point(3534, 4058), Point(3525, 4057), Point(3510, 4055), Point(3501, 4055), Point(3497, 4050), Point(3500, 4043), Point(3502, 4021)];
      SPS_WalkPath(ToBananasArea);
      wait(1000);
    end;
    Restructure your loop, now it will loop finding until it sees uptext, break, and then click.

    Excuse my standards, I made the edit in-browser.

  19. #19
    Join Date
    Mar 2012
    Posts
    51
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Quote Originally Posted by nickrules View Post
    No, that just means it's going to *assume* it got out of the boat.

    Code:
    procedure XXX;
      var
      MyTPA : TPointArray;
      MyPoint : TPoint;
      x, y, i : Integer;
      ToArea:TPointArray;
    begin
    MakeCompass('N');
      SetAngle(SRL_ANGLE_HIGH);
    repeat
      FindColorsTolerance(MyTPA, 2772329, 235, 203, 271, 271, 10);
      if Length(MyTPA) = 0 then FindColorsTolerance(MyTPA, 3432579, MSX1, MSY1, MSX2, MSY2, 10);
      for i := 0 to High(MyTPA)do
      begin
        MyPoint := MyTPA[i]
        MMouse (MyPoint.x, MyPoint.y, 3, 3);
        end;
        until(IsUpTextMultiCustom(['lank']))
    clickmouse2(mouse_left);
      Wait(350+random(350));
     SPS_Setup(runescape_surface,['9_10','8_10']);
     ToBananasArea := [Point(3657, 4078), Point(3648, 4076), Point(3634, 4077), Point(3625, 4077), Point(3611, 4077), Point(3597, 4079), Point(3585, 4075), Point(3575, 4071), Point(3567, 4065), Point(3558, 4061), Point(3548, 4059), Point(3534, 4058), Point(3525, 4057), Point(3510, 4055), Point(3501, 4055), Point(3497, 4050), Point(3500, 4043), Point(3502, 4021)];
      SPS_WalkPath(ToBananasArea);
      wait(1000);
    end;
    Restructure your loop, now it will loop finding until it sees uptext, break, and then click.

    Excuse my standards, I made the edit in-browser.
    Thank you .
    And no problem about your standards,As it doesn't bother me in this case.
    edit: your fix doesn't work for me,after clicking on the ladder it continues to search.
    the True function works good.

    And thank you all again.
    Last edited by Mor; 04-05-2012 at 09:47 PM.

  20. #20
    Join Date
    May 2008
    Location
    ;)
    Posts
    576
    Mentioned
    0 Post(s)
    Quoted
    1 Post(s)

    Default

    Quote Originally Posted by Mor View Post
    Thank you .
    And no problem about your standards,As it doesn't bother me in this case.
    edit: your fix doesn't work for me,after clicking on the ladder it continues to search.
    the True function works good.

    And thank you all again.
    That's impossible. It would only click if it was hovering over the object, at which point, it would no longer be searching, because it had broken out of that loop. I'll take a look again at what might be going on, because if it keeps searching, there's something bigger that's wrong.

    E: While not directly related to the problem, this should work better:
    Simba Code:
    procedure XXX;
      var
      MyTPA : TPointArray;
      MyPoint : TPoint;
      x, y, i : Integer;
      ToArea:TPointArray;
      tobananasarea:tpointarray;
    begin
      MakeCompass('N');
      SetAngle(SRL_ANGLE_HIGH);
      FindColorsTolerance(MyTPA, 2772329, 235, 203, 271, 271, 10);
      if Length(MyTPA) = 0 then
        FindColorsTolerance(MyTPA, 3432579, MSX1, MSY1, MSX2, MSY2, 10);

        for i := 0 to High(MyTPA)do      //hovers over each point in the array the array
        begin
          MyPoint := MyTPA[i]
          MMouse (MyPoint.x, MyPoint.y, 3, 3);
          if IsUpTextMultiCustom(['lank']) then
            clickmouse2(mouse_left);
            break;
        end;

      Wait(350+random(350));
      SPS_Setup(runescape_surface,['9_10','8_10']);
      ToBananasArea := [Point(3657, 4078), Point(3648, 4076), Point(3634, 4077), Point(3625, 4077), Point(3611, 4077), Point(3597, 4079), Point(3585, 4075), Point(3575, 4071), Point(3567, 4065), Point(3558, 4061), Point(3548, 4059), Point(3534, 4058), Point(3525, 4057), Point(3510, 4055), Point(3501, 4055), Point(3497, 4050), Point(3500, 4043), Point(3502, 4021)];
      SPS_WalkPath(ToBananasArea);
      wait(1000);
    end;
    Last edited by nickrules; 04-05-2012 at 11:11 PM.

  21. #21
    Join Date
    Mar 2012
    Posts
    51
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Quote Originally Posted by nickrules View Post
    That's impossible. It would only click if it was hovering over the object, at which point, it would no longer be searching, because it had broken out of that loop. I'll take a look again at what might be going on, because if it keeps searching, there's something bigger that's wrong.

    E: While not directly related to the problem, this should work better:
    Simba Code:
    procedure XXX;
      var
      MyTPA : TPointArray;
      MyPoint : TPoint;
      x, y, i : Integer;
      ToArea:TPointArray;
      tobananasarea:tpointarray;
    begin
      MakeCompass('N');
      SetAngle(SRL_ANGLE_HIGH);
      FindColorsTolerance(MyTPA, 2772329, 235, 203, 271, 271, 10);
      if Length(MyTPA) = 0 then
        FindColorsTolerance(MyTPA, 3432579, MSX1, MSY1, MSX2, MSY2, 10);

        for i := 0 to High(MyTPA)do      //hovers over each point in the array the array
        begin
          MyPoint := MyTPA[i]
          MMouse (MyPoint.x, MyPoint.y, 3, 3);
          if IsUpTextMultiCustom(['lank']) then
            clickmouse2(mouse_left);
            break;
        end;

      Wait(350+random(350));
      SPS_Setup(runescape_surface,['9_10','8_10']);
      ToBananasArea := [Point(3657, 4078), Point(3648, 4076), Point(3634, 4077), Point(3625, 4077), Point(3611, 4077), Point(3597, 4079), Point(3585, 4075), Point(3575, 4071), Point(3567, 4065), Point(3558, 4061), Point(3548, 4059), Point(3534, 4058), Point(3525, 4057), Point(3510, 4055), Point(3501, 4055), Point(3497, 4050), Point(3500, 4043), Point(3502, 4021)];
      SPS_WalkPath(ToBananasArea);
      wait(1000);
    end;
    Now it works perfect.
    Probably the repeat was the problem.
    Thank you.

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
  •