Results 1 to 19 of 19

Thread: NPC/Items/Objects Tile to MS point buggy.

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

    Default NPC/Items/Objects Tile to MS point buggy.

    I'm running some combat scripts that involve attacking NPC's and picking up their items dropped.

    The script I have, Mouses the NPC's tile points in order to attack/locate the NPC. It does the same for picking up items.

    The problem here is that the NPC's and the items do not fully cover the tiles. So this means that the mouse will click/right click the places on the tiles where the NPC or item are not placed. I haven't botted for a couple of months, but last I was botting this was never a big of a problem. Tile click inaccuracies are a given and happen. But this is happening at a very large rate. 50% of the scripts clicks are all misclicks which slow script performance considerably.

    Here's some pictures for example:






    What is a solution to this problem? Thank you very much!
    Faith is an oasis in the heart which will never be reached by the caravan of thinking.

  2. #2
    Join Date
    Sep 2014
    Location
    C:\Simba\
    Posts
    565
    Mentioned
    9 Post(s)
    Quoted
    71 Post(s)

    Default

    Quote Originally Posted by kingarabian View Post
    What is a solution to this problem? Thank you very much!
    Using color
    Feel free to ask me any questions, I will do my best to answer them!

    Previously known as YouPee.

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

    Default

    Quote Originally Posted by Joopi View Post
    Using color
    It shouldn't be doing this. It even does it with objects.
    Faith is an oasis in the heart which will never be reached by the caravan of thinking.

  4. #4
    Join Date
    Apr 2013
    Posts
    680
    Mentioned
    13 Post(s)
    Quoted
    341 Post(s)

    Default

    Quote Originally Posted by kingarabian View Post
    It shouldn't be doing this. It even does it with objects.
    Which function are you using??? Double check zoom is default? Then test this.. as it is working fine for me... Eliminates one thing at a time

    Code:
    function R_TileOnMS(Tile : TPoint; var OutputPoint : TPoint; x : integer = 0; y : integer = 0; z : integer = 0):boolean;
    var tempB : TBox;
    begin
      OutputPoint := TReflectionTiles.TileToMS(Tile, x, y, z);
      tempB := intToBox(MSX1, MSY1, MSX2, MSY2);
      result := PointInBox(OutputPoint, tempB);
    end;
    
    procedure randomMouseInput(pnt:Tpoint; ranx, rany:integer);
    begin
      case random(3) of
        0:humanMMouse(pnt, ranx, rany);
        1:missMouse(pnt, ranx, rany);
        2:mouse(pnt, ranx, rany, mouse_move);
      end;
    end;
    
     function R_InteractTile(tile:Tpoint; action:string; x:integer = 0; y:integer = 0; z:integer = 5):boolean;
    var RSTile : TPoint;
    begin
      if R_TileOnMS(Tile, RSTile, x, y, z) then begin
        randomMouseInput(rsTile, 3, 3);
        if(Reflect.Text.IsUpText(action)) then begin
          FastClick(mouse_left);
          result := didClick(true, 1000);
        end else begin
          if TReflectionText.OptionExists(action) then begin
            FastClick(mouse_right);
            result := Reflect.Text.ChooseOption(action);
          end;
          if not result then
            randomMouseInput(Point(MSCX, MSCY), 500, 500);
        end;
      end;
    end;
    
    function checkForDrops(): Boolean;
    var
     i,id      : Integer;
     strArr    : TStringArray;
     gItems    : TReflectGroundItemArray;
    begin
    if reflectplayer.IsAnimating or reflectPlayer.IsMoving then begin exit; end;
    gItems.GetAll(20);
    if length(gItems) = 0 then Exit;
    setArrayLength(strArr, 9);
      strArr := ['Dragon defender','Rune','Bronze defender','Iron defender','Steel defender','Black defender','Mithril defender','Adamant defender','Rune defender'];
      for i:=0 to high(gItems) do
        if inStrArrEx(gItems[i].GetName, strArr, id) then
        begin
          if R_interactTile(gItems[i].GetTile, 'Take '+gItems[i].GetName) then
          begin
            waitFunc(@isPlayerWalking, 50, 500);
            while isPlayerWalking() do
            reflectPlayer.FFlag(0);
            exit(true);
          end;
        end;
    end;

    <------------------>



  5. #5
    Join Date
    Mar 2012
    Location
    127.0.0.1
    Posts
    3,383
    Mentioned
    95 Post(s)
    Quoted
    717 Post(s)

    Default

    Quote Originally Posted by AFools View Post
    Which function are you using??? Double check zoom is default? Then test this.. as it is working fine for me... Eliminates one thing at a time

    Code:
    function R_TileOnMS(Tile : TPoint; var OutputPoint : TPoint; x : integer = 0; y : integer = 0; z : integer = 0):boolean;
    var tempB : TBox;
    begin
      OutputPoint := TReflectionTiles.TileToMS(Tile, x, y, z);
      tempB := intToBox(MSX1, MSY1, MSX2, MSY2);
      result := PointInBox(OutputPoint, tempB);
    end;
    
    procedure randomMouseInput(pnt:Tpoint; ranx, rany:integer);
    begin
      case random(3) of
        0:humanMMouse(pnt, ranx, rany);
        1:missMouse(pnt, ranx, rany);
        2:mouse(pnt, ranx, rany, mouse_move);
      end;
    end;
    
     function R_InteractTile(tile:Tpoint; action:string; x:integer = 0; y:integer = 0; z:integer = 5):boolean;
    var RSTile : TPoint;
    begin
      if R_TileOnMS(Tile, RSTile, x, y, z) then begin
        randomMouseInput(rsTile, 3, 3);
        if(Reflect.Text.IsUpText(action)) then begin
          FastClick(mouse_left);
          result := didClick(true, 1000);
        end else begin
          if TReflectionText.OptionExists(action) then begin
            FastClick(mouse_right);
            result := Reflect.Text.ChooseOption(action);
          end;
          if not result then
            randomMouseInput(Point(MSCX, MSCY), 500, 500);
        end;
      end;
    end;
    
    function checkForDrops(): Boolean;
    var
     i,id      : Integer;
     strArr    : TStringArray;
     gItems    : TReflectGroundItemArray;
    begin
    if reflectplayer.IsAnimating or reflectPlayer.IsMoving then begin exit; end;
    gItems.GetAll(20);
    if length(gItems) = 0 then Exit;
    setArrayLength(strArr, 9);
      strArr := ['Dragon defender','Rune','Bronze defender','Iron defender','Steel defender','Black defender','Mithril defender','Adamant defender','Rune defender'];
      for i:=0 to high(gItems) do
        if inStrArrEx(gItems[i].GetName, strArr, id) then
        begin
          if R_interactTile(gItems[i].GetTile, 'Take '+gItems[i].GetName) then
          begin
            waitFunc(@isPlayerWalking, 50, 500);
            while isPlayerWalking() do
            reflectPlayer.FFlag(0);
            exit(true);
          end;
        end;
    end;
    Correct me if I'm wrong but that uses Aerolib and aren't we trying to not merge the two libraries together anymore?

  6. #6
    Join Date
    Apr 2013
    Posts
    680
    Mentioned
    13 Post(s)
    Quoted
    341 Post(s)

    Default

    Eh; i cut and pasted this - More so as a test. I have migrated this to strict reflection in one of my scripts i haven't migrated it to all of them yet.

    <------------------>



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

    Default

    Quote Originally Posted by AFools View Post
    Which function are you using??? Double check zoom is default? Then test this.. as it is working fine for me... Eliminates one thing at a time

    Code:
    function R_TileOnMS(Tile : TPoint; var OutputPoint : TPoint; x : integer = 0; y : integer = 0; z : integer = 0):boolean;
    var tempB : TBox;
    begin
      OutputPoint := TReflectionTiles.TileToMS(Tile, x, y, z);
      tempB := intToBox(MSX1, MSY1, MSX2, MSY2);
      result := PointInBox(OutputPoint, tempB);
    end;
    
    procedure randomMouseInput(pnt:Tpoint; ranx, rany:integer);
    begin
      case random(3) of
        0:humanMMouse(pnt, ranx, rany);
        1:missMouse(pnt, ranx, rany);
        2:mouse(pnt, ranx, rany, mouse_move);
      end;
    end;
    
     function R_InteractTile(tile:Tpoint; action:string; x:integer = 0; y:integer = 0; z:integer = 5):boolean;
    var RSTile : TPoint;
    begin
      if R_TileOnMS(Tile, RSTile, x, y, z) then begin
        randomMouseInput(rsTile, 3, 3);
        if(Reflect.Text.IsUpText(action)) then begin
          FastClick(mouse_left);
          result := didClick(true, 1000);
        end else begin
          if TReflectionText.OptionExists(action) then begin
            FastClick(mouse_right);
            result := Reflect.Text.ChooseOption(action);
          end;
          if not result then
            randomMouseInput(Point(MSCX, MSCY), 500, 500);
        end;
      end;
    end;
    
    function checkForDrops(): Boolean;
    var
     i,id      : Integer;
     strArr    : TStringArray;
     gItems    : TReflectGroundItemArray;
    begin
    if reflectplayer.IsAnimating or reflectPlayer.IsMoving then begin exit; end;
    gItems.GetAll(20);
    if length(gItems) = 0 then Exit;
    setArrayLength(strArr, 9);
      strArr := ['Dragon defender','Rune','Bronze defender','Iron defender','Steel defender','Black defender','Mithril defender','Adamant defender','Rune defender'];
      for i:=0 to high(gItems) do
        if inStrArrEx(gItems[i].GetName, strArr, id) then
        begin
          if R_interactTile(gItems[i].GetTile, 'Take '+gItems[i].GetName) then
          begin
            waitFunc(@isPlayerWalking, 50, 500);
            while isPlayerWalking() do
            reflectPlayer.FFlag(0);
            exit(true);
          end;
        end;
    end;
    Thanks. Just tried these and checked the zoom. Still misses the center of the tile consistently. The center of the tile is essential as that is when the options pop up, uptext shows etc.
    Faith is an oasis in the heart which will never be reached by the caravan of thinking.

  8. #8
    Join Date
    Apr 2013
    Posts
    680
    Mentioned
    13 Post(s)
    Quoted
    341 Post(s)

    Default

    I am currently running a agility bot flawlessly, it may be worth to delete both include AL and Reflection. Then re-install these. Though i am guessing you would have already done this... I had another suggestion of trying Fitta' script as he doesn't even use the standard includes + just need to update the prosocks in his include. (His Chicken Fighter script).

    See if the problem still exist? If not i'm guessing you will have to shoot Kyle a msg or wait.

    <------------------>



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

    Default

    Quote Originally Posted by AFools View Post
    I am currently running a agility bot flawlessly, it may be worth to delete both include AL and Reflection. Then re-install these. Though i am guessing you would have already done this... I had another suggestion of trying Fitta' script as he doesn't even use the standard includes + just need to update the prosocks in his include. (His Chicken Fighter script).

    See if the problem still exist? If not i'm guessing you will have to shoot Kyle a msg or wait.
    I'm using Fitta's scripts. But they've both been modified to use standard Al and Reflection functions. I'll try wipe out AL and Reflection and see what happens.

    Edit: Problems remain. It's accurate if I'm next to the tile. If I'm more than a tile away it struggles.
    Last edited by kingarabian; 01-12-2016 at 05:20 AM.
    Faith is an oasis in the heart which will never be reached by the caravan of thinking.

  10. #10
    Join Date
    Apr 2013
    Posts
    680
    Mentioned
    13 Post(s)
    Quoted
    341 Post(s)

    Default

    I was referring to - https://villavu.com/forum/showthread.php?t=113568 - the f-include is still there.

    I'm not sure what you guys have upstairs.. Maybe one of these days i should i apply, I so i can have a peek.

    <------------------>



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

    Default

    Quote Originally Posted by AFools View Post
    I was referring to - https://villavu.com/forum/showthread.php?t=113568 - the f-include is still there.

    I'm not sure what you guys have upstairs.. Maybe one of these days i should i apply, I so i can have a peek.
    Yup. I tried all of his.
    Faith is an oasis in the heart which will never be reached by the caravan of thinking.

  12. #12
    Join Date
    Dec 2013
    Location
    Pitcairn Island
    Posts
    288
    Mentioned
    20 Post(s)
    Quoted
    166 Post(s)

    Default

    Quote Originally Posted by kingarabian View Post
    Yup. I tried all of his.
    Simba Code:
    program new;
    {$DEFINE SMART}
    {$i Reflection/Reflection.simba}

    var
      i: Integer;
      gItems: TReflectGroundItemArray;
    begin
      Reflect.Setup();
      gItems.Get('Bones', 10);

      for i := 0 to High(gItems) do
        Reflect.Smart.Graphics.DrawCircle(Reflect.Tiles.TileToMS(gItems[i].GetTile), 3, clRed, True);
    end.

    This produces this for me (I was a bit late with the screenshot)


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

    Default

    Quote Originally Posted by The Simba Noob View Post
    Simba Code:
    program new;
    {$DEFINE SMART}
    {$i Reflection/Reflection.simba}

    var
      i: Integer;
      gItems: TReflectGroundItemArray;
    begin
      Reflect.Setup();
      gItems.Get('Bones', 10);

      for i := 0 to High(gItems) do
        Reflect.Smart.Graphics.DrawCircle(Reflect.Tiles.TileToMS(gItems[i].GetTile), 3, clRed, True);
    end.

    This produces this for me (I was a bit late with the screenshot)

    I'm going to test on another computer.
    Faith is an oasis in the heart which will never be reached by the caravan of thinking.

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

    Default

    Works perfectly fine on my other computer. Unfortunately it's my shitty laptop and not my gaming computer. I wonder what the problem could be. I uninstalled/reinstalled and deleted/downloaded everything.
    Faith is an oasis in the heart which will never be reached by the caravan of thinking.

  15. #15
    Join Date
    Apr 2013
    Posts
    680
    Mentioned
    13 Post(s)
    Quoted
    341 Post(s)

    Default

    Quote Originally Posted by kingarabian View Post
    Works perfectly fine on my other computer. Unfortunately it's my shitty laptop and not my gaming computer. I wonder what the problem could be. I uninstalled/reinstalled and deleted/downloaded everything.
    This is extremely bold - Both computer have the same hard-drives? you can try swap them over... providing you will not have hardware problems, then run the script on both, you may be able to isolate this to hardware or software / config problems. - though this is a bold suggestion.


    Which i have used for other compatibility issue (non-simba related). Are you on ubuntu or windows?

    I really have no other suggestions; as you said you used simba in the not too distant past.. im presuming on the same system.

    ** Edit.. Check your version of JAVA though i dont think this could be the case. build 1.7.0 rev 76 is what i am using atm.

    <------------------>



  16. #16
    Join Date
    Oct 2006
    Posts
    6,752
    Mentioned
    95 Post(s)
    Quoted
    532 Post(s)

    Default

    @kingarabian; Yeah I have no clue, as long as you're 100% sure the zoom is set to default it shouldn't be missing coords..
    “The long-lived and those who will die soonest lose the same thing. The present is all that they can give up, since that is all you have, and what you do not have, you cannot lose.” - Marcus Aurelius

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

    Default

    Sigh. Still can't think of anything. Deleted Java, deleted the whole OSRS cache... Redownloaded/installed... The tile coordinates are just off.
    Faith is an oasis in the heart which will never be reached by the caravan of thinking.

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

    Default

    Quote Originally Posted by AFools View Post
    This is extremely bold - Both computer have the same hard-drives? you can try swap them over... providing you will not have hardware problems, then run the script on both, you may be able to isolate this to hardware or software / config problems. - though this is a bold suggestion.


    Which i have used for other compatibility issue (non-simba related). Are you on ubuntu or windows?

    I really have no other suggestions; as you said you used simba in the not too distant past.. im presuming on the same system.

    ** Edit.. Check your version of JAVA though i dont think this could be the case. build 1.7.0 rev 76 is what i am using atm.
    I think this is more of an internal issue rather than hardware/computer software issue.
    Faith is an oasis in the heart which will never be reached by the caravan of thinking.

  19. #19
    Join Date
    Apr 2013
    Posts
    680
    Mentioned
    13 Post(s)
    Quoted
    341 Post(s)

    Default

    I was suspecting it could be a graphics hardware problem. But good luck with finding a solution.

    <------------------>



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
  •