Results 1 to 7 of 7

Thread: 50 Pixel Offset Problem

  1. #1
    Join Date
    Jun 2012
    Posts
    219
    Mentioned
    0 Post(s)
    Quoted
    1 Post(s)

    Default 50 Pixel Offset Problem

    Ok, I`m Currently Using Simba 991 and SMART 7.2

    Latest Plugins and Latest RSL,Latest SPS and the works.

    But I keep getting this 50 pixel offset error when clicking on a object that I find. Included you will see a Picture off what I mean.



    It was suggested that it was the code I`m using to find the mouse position after finding the object. (GetMousePos(x,y) Apparently GetMousePos do not work correctly at this moment. Can someone suggest an alternative way to get the x y coordinates after finding an object because in the mean time my character has moved nearer to the object.

    Simba Code:
    If FindObjTPA(x, y, 9079697, 6, 1, 15, 60, 50, ['ott']) then
            Begin
            WriteLn('Found Wheel');
              While IsMoving do
              Begin
                Wait(100);
              End;
            Case random(2) of
              0:  Begin
                    WriteLn('Right Clicked Potters Wheel The First Time');
                    GetMousePos(x,y); // Get Mouse Current Position
                    mouse(x, y, 5, 5, False); // Right Click To Bring Up Options
                    WaitOption('Form', 500); // Wait A Certain X Amount Of Seconds Before Clicking Option
                    Wait(1000 + random(400));
                    While IsMoving do
                    Begin
                      Wait(100);
                    End;
                  End;
              1:  Begin
                    WriteLn('Left Clicked Potters Wheel The First Time');
                    GetMousePos(x,y); // Get Mouse Current Position
                    mouse(x, y, 5, 5, True); // Left Click On Potters Wheel
                    Wait(1000 + random(400));
                    While IsMoving do
                    Begin
                      Wait(50);
                    End;
                    WriteLn('We Have Clicked The Potters Wheel The First Time');
                    WriteLn('We are now waiting for the Options Screen to appear.');
                    WriteLn('Waiting Now for 1 second');
                  End;
            End;
          End;

    Thanks

  2. #2
    Join Date
    Nov 2011
    Location
    Louisiana
    Posts
    881
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    You don't need to use GetMousePos at all.

    Just do this:

    Simba Code:
    if FindObjTPA() then
      MMouse (x, y, 5, 5);
      ClickMouse2(False);
      WaitOption('Form', 500);

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

    Default

    Talked to brandon yesterday, he basically said for every cord you pick yourself you need to manually -50 from the Y axis. Or call some SetBar (I forgot the name) functions.

  4. #4
    Join Date
    Mar 2012
    Location
    Color :D
    Posts
    938
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    GetMousePos(x,y);

    You did say this gets your current mouse position, that replaced the one you found with FindObjTPA. So your mouse function will only click at that?

  5. #5
    Join Date
    Nov 2011
    Location
    Louisiana
    Posts
    881
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Quote Originally Posted by YoHoJo View Post
    Talked to brandon yesterday, he basically said for every cord you pick yourself you need to manually -50 from the Y axis. Or call some SetBar (I forgot the name) functions.
    I just checked for this function in the include.

    To the OP: Call "SetBar" AFTER SetupSRL in your script. See what happens, I don't have time to test as it's bed time for me! Good luck.

  6. #6
    Join Date
    Feb 2011
    Location
    The Future.
    Posts
    5,600
    Mentioned
    396 Post(s)
    Quoted
    1598 Post(s)

    Default

    Simba Code:
    Function ClickedSomeObject: Boolean;
    var
      X, Y: Integer;

    begin
      if (FindObjectTPA(X, Y, 9079697, 6, 1, 15, 60, 50, ['ott'])) then
      begin
        MMouse(X, Y, 5, 5);       //x, y already contain the position of the object found. Just move the mouse to it..
        ClickMouse2(MOUSE_RIGHT); //menu is brought up..
        Result := WaitOptionMulti(['', '', ''], 600);
      end;
    end;
    Last edited by Brandon; 08-01-2012 at 07:00 AM.
    I am Ggzz..
    Hackintosher

  7. #7
    Join Date
    Jun 2012
    Posts
    219
    Mentioned
    0 Post(s)
    Quoted
    1 Post(s)

    Default

    Quote Originally Posted by Brandon View Post
    Simba Code:
    Function ClickedSomeObject: Boolean;
    var
      X, Y: Integer;

    begin
      if (FindObjectTPA(X, Y, 9079697, 6, 1, 15, 60, 50, ['ott'])) then
      begin
        MMouse(X, Y, 5, 5);       //x, y already contain the position of the object found. Just move the mouse to it..
        ClickMouse2(MOUSE_RIGHT); //menu is brought up..
        Result := WaitOptionMulti(['', '', ''], 600);
      end;
    end;
    @Brandon, I`m really glad you responded, because I`m on a very short fuse at the moment, this is driving me up the walls. I already Implemented that code as well, and it still don`t find the wheel to click on it.

    I have deleted and reinstalled simba now 3 times, Nothing I do, gets rid of this problem.

    Here is my code to setup the client. I don`t know if I`m doing something wrong here. I have now Included the 3 options for the navbar. Tested them all with the same results.

    I have looked at setbar, but I can`t for the life of me see how that will set the offset.

    As I understand it SRL_DisableNavBar; should offset the cleintarea so that it ignores the bar and starts with the clientarea right under the bar and then all coordinates is supposed to function normally. Yes?

    But is still does not find the correct coordinates, It just moves 50 pixels off the wheel and hover there.

    Is there any other setting we should set before continuing normally with our scripts. According to my understanding it should not even be necessary for me to call the SRL_DisableNavBar;. It should work now out off the box so to say.

    Here is my Code for the setup:

    Simba Code:
    procedure setupclient;
    var
    x,y: integer;
    begin
      writeln('start bot client');
      {$IFDEF SIMBAMAJOR980}
        SMART_SERVER := server;
        SMART_MEMBERS := TRUE;
        SMART_SIGNED := TRUE;
        SMART_SUPERDETAIL := FALSE;
      {$ELSE}
        SRL_SIXHOURFIX := TRUE;
        SMART_FIXSPEED := TRUE;
      {$ENDIF}

      cleardebug;
      setupsrl;
    //  SRL_EnableNavBar;
      SRL_DisableNavBar;
    //  SRL_ResetNavBar;
      objdtm_setup;
      objdtm_debug := true;
      declareplayers;
      if not (loggedin) then
      loginplayer;
      wait(4000+random(400));
      sps_setup(runescape_surface,['10_8', '10_9', '9_8', '9_9']);
        if (not SMART_DebugSetup) then
        SMART_SetupDebug();
    end;

    If you want I can Pm you the script I`m trying to write so that you can look at the complete script. It is still buggy and a real rough draft. But then you will be able to tell me if I call srl or something incorrectly. I know it must be something real simple and stupid where i make the mistake.

    I`m just starting to script so my knowledge of srl and pascal is very limited at the moment.

    I just do`nt know what to do anymore and it is frustrating the hell out of me.


    E. I have sorted the problem out. Apparently the colors of the wheel has changed.
    Also when enabling the SRL_EnableNavBar; it ignores the bar and start after the bar with the clientarea.
    Last edited by VastlySuperior; 08-01-2012 at 10:02 AM.

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
  •