Results 1 to 13 of 13

Thread: Can't figure out what's wrong..

  1. #1
    Join Date
    Sep 2010
    Posts
    5,762
    Mentioned
    136 Post(s)
    Quoted
    2739 Post(s)

    Default Can't figure out what's wrong..

    Problem solved! The RSPS was in OpenGL mode instead of safemode (never heard of a RSPS with OpenGL support..) so Simba couldn't get the colors!

  2. #2
    Join Date
    Mar 2006
    Location
    Belgium
    Posts
    3,564
    Mentioned
    111 Post(s)
    Quoted
    1475 Post(s)

    Default

    where's your mmouse, I guess you wanna clicK?

    Creds to DannyRS for this wonderful sig!

  3. #3
    Join Date
    Sep 2010
    Posts
    5,762
    Mentioned
    136 Post(s)
    Quoted
    2739 Post(s)

    Default

    Quote Originally Posted by Sjoe View Post
    where's your mmouse, I guess you wanna clicK?
    woops forgot that:

    Simba Code:
    function findCrab():Boolean;
    var
      TPA:TPointArray;
      ATPA:T2DPointArray;
      i, x, y:Integer;
      Bounds:TBox;
    begin
      ColorToleranceSpeed(2);
      SetColorSpeed2Modifiers(0.00, 0.10);
      FindColorsSpiralTolerance(256, 166, TPA, 3820363, 3, 3, 514, 339, 8);
      ColorToleranceSpeed(1);
      SetColorSpeed2Modifiers(0.02, 0.02);
      if (Length(TPA) > 0) then
      begin
        ATPA := TPAToATPAEx(TPA, 40, 40);
        filterTPAsBetween(ATPA, 1, 50);
        SortATPAFromFirstpoint(ATPA, Point(256, 166));
        DebugATPABounds(ATPA);
        for i := 0 to high(ATPA) do
        begin
          Bounds := GetTPABounds(ATPA[i]);
          MiddleTPAEx(ATPA[i], x, y);
          if not hpExists(Bounds, 0, 6) then
          begin
            result := true;
            mmouse(x, y, 0, 0);
            ClickMouse2(Mouse_left);
            //updatestate('Attacking rock crab');
            wait(1500);
            while (isMoving) do
              wait(200);
            exit;
          end;
        end;
      end;
    end;

    but that still didn't solve the issue

  4. #4
    Join Date
    Jan 2012
    Posts
    915
    Mentioned
    13 Post(s)
    Quoted
    87 Post(s)

    Default

    You have ACA looking at 250 tolerance. But your tolerance in the function isn't 250.

    Try that, and tell us what happens.


    FindColorsSpiralTolerance(256, 166, TPA, 3820363, 3, 3, 514, 339, 8);

  5. #5
    Join Date
    Sep 2010
    Posts
    5,762
    Mentioned
    136 Post(s)
    Quoted
    2739 Post(s)

    Default

    Quote Originally Posted by Vinyl Scratch View Post
    You have ACA looking at 250 tolerance. But your tolerance in the function isn't 250.

    Try that, and tell us what happens.


    FindColorsSpiralTolerance(256, 166, TPA, 3820363, 3, 3, 514, 339, 8);
    No, the values in my function is what ACA gave me, it couldn't find anything, so I set it to 250 to see if my colors were bad and it still couldn't find anything. So I'm doing something wrong..

  6. #6
    Join Date
    Jun 2012
    Posts
    4,867
    Mentioned
    74 Post(s)
    Quoted
    1663 Post(s)

    Default

    Add WriteLn everywhere to make sure it's doing what you want.

  7. #7
    Join Date
    Jan 2012
    Posts
    915
    Mentioned
    13 Post(s)
    Quoted
    87 Post(s)

    Default

    Quote Originally Posted by BMWxi View Post
    Add WriteLn everywhere to make sure it's doing what you want.
    This too.

    It's a good way to see where it's messing up.

  8. #8
    Join Date
    Sep 2010
    Posts
    5,762
    Mentioned
    136 Post(s)
    Quoted
    2739 Post(s)

    Default

    Simba Code:
    program autocrabs;
    {$I SRL/SRL.Simba}
    {$i SRL/srl/misc/debug.simba}
    procedure filterTPAsBetween(var atpa: T2DPointArray; len1, len2: integer);
    var
      h, l, i: integer;
      c: T2DPointArray;
    begin
      h := high(atpa);
      for i := 0 to h do
      begin
        l := length(atpa[i]);
        if (not (inRange(l, len1, len2))) then
        begin
          setLength(c, length(c) + 1);
          c[high(c)] := atpa[i];
        end;
      end;
      atpa := c;
    end;
    function getHp():Integer;
    begin
    end;
    Procedure report;
    begin
    end;
    function hpExists(bounds:TBox; offx, offy:Integer):Boolean;
    var
      TPA:TPointArray;
      ATPA:T2DPointArray;
    begin
      //if (not t_loggedin) then exit;
      ColorToleranceSpeed(2);
      SetColorSpeed2Modifiers(0.68, 0.00);
      FindColorsSpiralTolerance(256, 86, TPA, 47445, Bounds.X1-offx, Bounds.Y1-offy, Bounds.X2, Bounds.Y2, 8);
      ColorToleranceSpeed(1);
      SetColorSpeed2Modifiers(0.02, 0.02);
      if (Length(TPA)>0) then
      begin
        result := true;
      end;
    end;
    function findCrab():Boolean;
    var
      TPA:TPointArray;
      ATPA:T2DPointArray;
      i, x, y:Integer;
      Bounds:TBox;
    begin
      ColorToleranceSpeed(2);
      writeln('1');
      SetColorSpeed2Modifiers(0.00, 0.10);
      writeln('2');
      FindColorsSpiralTolerance(256, 166, TPA, 3820363, 3, 3, 514, 339, 8);
      writeln('3');
      ColorToleranceSpeed(1);
      writeln('4');
      SetColorSpeed2Modifiers(0.02, 0.02);
      writeln('5');
      if (Length(TPA) > 0) then
      begin
        writeln('found a tpa');
        ATPA := TPAToATPAEx(TPA, 40, 40);
        filterTPAsBetween(ATPA, 1, 50);
        SortATPAFromFirstpoint(ATPA, Point(256, 166));
        DebugATPABounds(ATPA);
        for i := 0 to high(ATPA) do
        begin
          Bounds := GetTPABounds(ATPA[i]);
          MiddleTPAEx(ATPA[i], x, y);
          if not hpExists(Bounds, 0, 6) then
          begin
            result := true;
            mmouse(x, y, 0, 0);
            ClickMouse2(Mouse_left);
            //updatestate('Attacking rock crab');
            wait(1500);
            while (isMoving) do
              wait(200);
            exit;
          end;
        end;
      end;
    end;
    begin
      activateclient;
      wait(800);
      if findcrab then
        writeln('found crab');
    end.

    It gets to 5. The TPA length is < 0 for some reason..

  9. #9
    Join Date
    Jan 2012
    Posts
    915
    Mentioned
    13 Post(s)
    Quoted
    87 Post(s)

    Default

    FindColorsSpiralTolerance is a boolean, put it in if..then statements.
    Last edited by Vinyl Scratch; 07-25-2013 at 10:42 PM. Reason: forgot a little bit.

  10. #10
    Join Date
    Sep 2010
    Posts
    5,762
    Mentioned
    136 Post(s)
    Quoted
    2739 Post(s)

    Default

    Quote Originally Posted by Vinyl Scratch View Post
    FindColorsSpiralTolerance is a boolean, put it in if..then statements.
    Doesn't have to be in if then because I check for the TPA length anyway

  11. #11
    Join Date
    Jan 2012
    Posts
    915
    Mentioned
    13 Post(s)
    Quoted
    87 Post(s)

    Default

    Quote Originally Posted by Officer Barbrady View Post
    Doesn't have to be in if then because I check for the TPA length anyway
    I know. But it helps us know when it's messing up.

  12. #12
    Join Date
    Dec 2007
    Posts
    2,112
    Mentioned
    71 Post(s)
    Quoted
    580 Post(s)

    Default

    The problem is your mixing up includes again. your probably using regular runescape functions on soulsplit or something.
    Edit : i think it's because it's loosing focus so there is no image buffer being passed to simba if that makes sense.
    Edit2 : to test this, just debug the current client image right before it hits if (Length(TPA) > 0) then... if the client it blank or doesnt = the actual window then it's loosing focus.
    Last edited by Kasi; 07-26-2013 at 02:27 AM.

  13. #13
    Join Date
    Sep 2010
    Posts
    5,762
    Mentioned
    136 Post(s)
    Quoted
    2739 Post(s)

    Default

    Quote Originally Posted by Kasi View Post
    The problem is your mixing up includes again. your probably using regular runescape functions on soulsplit or something.
    Edit : i think it's because it's loosing focus so there is no image buffer being passed to simba if that makes sense.
    Edit2 : to test this, just debug the current client image right before it hits if (Length(TPA) > 0) then... if the client it blank or doesnt = the actual window then it's loosing focus.
    Sorry for late response but ill have to test that tomorrow

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
  •