Page 1 of 2 12 LastLast
Results 1 to 25 of 28

Thread: sps_getMyPos fix [resolves spam clickNorth]

  1. #1
    Join Date
    Oct 2006
    Location
    Finland
    Posts
    433
    Mentioned
    1 Post(s)
    Quoted
    8 Post(s)

    Default sps_getMyPos fix [resolves spam clickNorth]

    Quote Originally Posted by Coh3n View Post
    rs_GetCompassAngleDegrees works fine. Click here for my explanation. Changing line 227 in Simba/Includes/SPS/SPS.simba to this should resolve the issue.
    Simba Code:
    if (inRange(round(rs_GetCompassAngleDegrees), 10, 350)) then
    The final solution ^^




    -----------------------------------------------------------------------------------------------------------




    Fix I posted earlier had a flaw, a huge flaw, in it and it took some measures that weren't really needed.

    This one appears to work just fine for me. Please test and report back if you find it to not work as supposed.

    It uses the blue and red colors on the compass to tell if its north.


    Simba Code:
    function SPS_GetMyPos: TPoint;
    var
      Minimap: T3DIntegerArray;
      t, map: integer;
    begin
      Result := Point(-1, -1);
     
      if not LoggedIn then
        Exit;

      if not SPS_Loaded then
        SPS_Load;
     
      // we should just rotate the minimap according to the minimap angle.
    if not(GetColor(544, 17)= 7699891) and not (GetColor(543, 29)= 3227717) then
        ClickNorth(True);

      t := getSystemTime;
      Minimap := SPS_GatherMinimap;
      if (High(Minimap) < 0) then
      begin
        if (SPS_Debug) then
          WriteLn('[SPS] Did not gather Minimap.');

        Exit;
      end;

      try
        map := SPS_FindMapInMapEx(
            Result.X, Result.Y, SPS_Worldmap, Minimap, SPS_Surface.Tolerance
          );

        if ((Result.X > 0) and (Result.Y > 0)) then
        begin
          Result := SPS_LocalToGlobal(SPS_Areas[map], Result.X, Result.Y);
        end;

        if (SPS_Debug) then
          writeln(format('[SPS] GetMyPos: Finished in %d ms. Location = %s',
            [getSystemTime - t, toStr(result)]));

      except
        Writeln('[SPS] ERROR in SPS_GetMyPos: ' + ExceptionToString(ExceptionType, ExceptionParam));
        SPS_WarnUser('SPS_GetMyPos', ExceptionToString(ExceptionType, ExceptionParam));
      end;
    end;

    Edit: Navigate to Includes/SPS/ and open sps.simba, find function called sps_getMyPos, replace it with ^^ and save it to apply this fix.

  2. #2
    Join Date
    Aug 2007
    Location
    Hawaii
    Posts
    3,880
    Mentioned
    7 Post(s)
    Quoted
    152 Post(s)

    Default

    Looking good. But we need a fix for the ChooseOption...
    Faith is an oasis in the heart which will never be reached by the caravan of thinking.

  3. #3
    Join Date
    Jul 2007
    Location
    Right now? Chair.
    Posts
    8,488
    Mentioned
    3 Post(s)
    Quoted
    12 Post(s)

    Default

    Simba Code:
    if not(GetColor(544, 17)= 7699891) and not (GetColor(543, 29)= 3227717) then

    Should it not be or? I guess and might work too..

    -RM

    I & I know Zion. It is in the spirit, body and mind of every one of us
    RMouse(obj: TMSIObject): boolean;

  4. #4
    Join Date
    Oct 2006
    Location
    Finland
    Posts
    433
    Mentioned
    1 Post(s)
    Quoted
    8 Post(s)

    Default

    If those aren't there, the compass "Pointer" isnt in correct direction, aka red pointer up and blue blob bottom end down
    thats why I used and instead of or, so it checks both of those points, up and down to avoid false activations. I think it should be more reliable this way.
    But yeah you most likely could just use OR there.


    Either way I've been having no problems with this one for now in my test runs, worked like a charm.

  5. #5
    Join Date
    Nov 2011
    Posts
    41
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    This may sound like a stupid question, but where can I plug this into Simba? Appreciate the quick ghetto fix, btw! I love this community. Keep the pressure on Jagex

  6. #6
    Join Date
    Oct 2006
    Location
    Finland
    Posts
    433
    Mentioned
    1 Post(s)
    Quoted
    8 Post(s)

    Default

    Quote Originally Posted by Tyrosus View Post
    This may sound like a stupid question, but where can I plug this into Simba? Appreciate the quick ghetto fix, btw! I love this community. Keep the pressure on Jagex
    Navigate to Includes/SPS/ and open sps.simba, find function called sps_getMyPos, replace and save it.

  7. #7
    Join Date
    Nov 2011
    Posts
    41
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Quote Originally Posted by DaWu View Post
    Navigate to Includes/SPS/ and open sps.simba, find function called sps_getMyPos, replace and save it.
    You rule, thank you for the speedy response. Still trying to learn how to script myself so I can contribute as well I'd love to join the fight for the bots, lol.

  8. #8
    Join Date
    Feb 2006
    Location
    Tracy/Davis, California
    Posts
    12,631
    Mentioned
    135 Post(s)
    Quoted
    418 Post(s)

    Default

    Anyone test and confirm this to work well?
    Should it be committed?

  9. #9
    Join Date
    Sep 2008
    Location
    Not here.
    Posts
    5,422
    Mentioned
    13 Post(s)
    Quoted
    242 Post(s)

    Default

    Quote Originally Posted by YoHoJo View Post
    Anyone test and confirm this to work well?
    Should it be committed?
    No, rs_GetCompassAngleDegrees should be fixed instead. This is just a quickfix.

  10. #10
    Join Date
    Oct 2006
    Location
    Finland
    Posts
    433
    Mentioned
    1 Post(s)
    Quoted
    8 Post(s)

    Default

    Quote Originally Posted by mormonman View Post
    No, rs_GetCompassAngleDegrees should be fixed instead. This is just a quickfix.
    Tho, sps_getMyPos only needs north for now.

  11. #11
    Join Date
    Feb 2006
    Location
    Tracy/Davis, California
    Posts
    12,631
    Mentioned
    135 Post(s)
    Quoted
    418 Post(s)

    Default

    Quote Originally Posted by mormonman View Post
    No, rs_GetCompassAngleDegrees should be fixed instead. This is just a quickfix.
    Ah yes okay. Someone should start tweaking that then, thanks.

  12. #12
    Join Date
    Oct 2006
    Location
    Finland
    Posts
    433
    Mentioned
    1 Post(s)
    Quoted
    8 Post(s)

    Default

    Im curious if anyone else even is having the same problem I made this fix for, hah.

  13. #13
    Join Date
    Nov 2011
    Location
    Sacramento, CA
    Posts
    53
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    yeah, im cutting yews and its right clicking compass set to north like crazy, ill add this in a bit. thanks.

    Edit: Just to clarify, do we add yours, DaWu, and his (Coh3n)? Bit nooby still.
    Last edited by piper101; 12-01-2011 at 04:49 AM.

  14. #14
    Join Date
    Feb 2006
    Location
    Tracy/Davis, California
    Posts
    12,631
    Mentioned
    135 Post(s)
    Quoted
    418 Post(s)

    Default

    Yea lots of people are DaWu, I was using Lumby West Miner/Banker and it was clicknorthing like crazy.

  15. #15
    Join Date
    Apr 2008
    Location
    Marquette, MI
    Posts
    15,252
    Mentioned
    138 Post(s)
    Quoted
    680 Post(s)

    Default

    rs_GetCompassAngleDegrees works fine. Click here for my explanation. Changing line 227 in Simba/Includes/SPS/SPS.simba to this should resolve the issue.
    Simba Code:
    if (inRange(round(rs_GetCompassAngleDegrees), 10, 350)) then
    Last edited by Coh3n; 12-01-2011 at 03:27 AM.

  16. #16
    Join Date
    Oct 2006
    Location
    Finland
    Posts
    433
    Mentioned
    1 Post(s)
    Quoted
    8 Post(s)

    Default

    ^Appears to work just fine too, so I guess this was purely SPS targetted miniupdate by jagex, as it only started to happen to me today.

  17. #17
    Join Date
    Feb 2006
    Location
    Tracy/Davis, California
    Posts
    12,631
    Mentioned
    135 Post(s)
    Quoted
    418 Post(s)

    Default

    Thanks Cohen! Will give that a whirl!

  18. #18
    Join Date
    Nov 2011
    Posts
    17
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Quote Originally Posted by Coh3n View Post
    rs_GetCompassAngleDegrees works fine. Click here for my explanation. Changing line 227 in Simba/Includes/SPS/SPS.simba to this should resolve the issue.
    Simba Code:
    if (inRange(round(rs_GetCompassAngleDegrees), 10, 350)) then
    Thank you, that worked like a charm . It's amazing how such a small change in numbers can have a huge impact on scripts.

  19. #19
    Join Date
    Nov 2011
    Posts
    67
    Mentioned
    0 Post(s)
    Quoted
    20 Post(s)

    Default

    Quote Originally Posted by Coh3n View Post
    rs_GetCompassAngleDegrees works fine. Click here for my explanation. Changing line 227 in Simba/Includes/SPS/SPS.simba to this should resolve the issue.
    Simba Code:
    if (inRange(round(rs_GetCompassAngleDegrees), 10, 350)) then
    Thanks, it worked, I shoulda

  20. #20
    Join Date
    Feb 2006
    Location
    Tracy/Davis, California
    Posts
    12,631
    Mentioned
    135 Post(s)
    Quoted
    418 Post(s)

    Default

    Cohen's fix works just fine!

  21. #21
    Join Date
    Nov 2011
    Posts
    20
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Works Flawless with Thanks!

  22. #22
    Join Date
    Apr 2008
    Location
    Marquette, MI
    Posts
    15,252
    Mentioned
    138 Post(s)
    Quoted
    680 Post(s)

    Default

    SPS has been updated, so everything should be working when your SPS updates (if you haven't updated manually already).

  23. #23
    Join Date
    Aug 2007
    Location
    Hawaii
    Posts
    3,880
    Mentioned
    7 Post(s)
    Quoted
    152 Post(s)

    Default

    Still spamming it.It's still clicking it at random pointless times. It sometimes clicks north 3 times in a row.

    I used Coh3n's fix.


    Sorry I forgot to change the 5 to 10.
    Faith is an oasis in the heart which will never be reached by the caravan of thinking.

  24. #24
    Join Date
    Nov 2011
    Posts
    6
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    thanks alot

  25. #25
    Join Date
    Feb 2006
    Location
    Tracy/Davis, California
    Posts
    12,631
    Mentioned
    135 Post(s)
    Quoted
    418 Post(s)

    Default

    Mine is still clicking compass pretty often.
    How would I need to edit the angles to make the range even more 'extreme' so it's clicked less?

    if (inRange(ang, 10, 350)) then


    Because before it was 5, 355
    The first one was increased to 10, yet second decreased to 350, I dun get it.
    If I set it to like 5, 355 would it be a super bigger range and thus click less often?

Page 1 of 2 12 LastLast

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
  •