Results 1 to 10 of 10

Thread: Best way to make camera see object

  1. #1
    Join Date
    Aug 2013
    Posts
    230
    Mentioned
    1 Post(s)
    Quoted
    114 Post(s)

    Default Best way to make camera see object

    Hey, i'm using reflection to click on an object. However, it is clicking on an object even when it can't see the object (i don't want to get banned).

    What's the best way to move the camera but in a way so it sees the object. Objects are show at any angle :/

  2. #2
    Join Date
    Jun 2014
    Location
    Lithuania
    Posts
    475
    Mentioned
    27 Post(s)
    Quoted
    200 Post(s)

    Default

    If its only 1 object you can try orient camera according to dot in minimap. But if its for example much more red dots then goodfight, this method doesnt work. (Or actually do, you just need to sort tpa from minimap middle maybe). You can try roughly divine minimap angles every 60 degrees or so and then rotate it accordingly. Have tried it somewhere in my first scrips. but tpas and walking worked for me better, probably deleted, cant find the example.
    Last edited by cosmasjdz; 06-29-2014 at 01:52 PM.

  3. #3
    Join Date
    Feb 2012
    Location
    Portugal
    Posts
    91
    Mentioned
    3 Post(s)
    Quoted
    41 Post(s)

    Default

    This method is from powerbot, it gets the angle that the camera should have given the object tile/location

    Code:
    public int mobileAngle(final Locatable mobile) {
            final Tile t = mobile.tile();
            final Tile me = ctx.players.local().tile();
            int angle = ((int) Math.toDegrees(Math.atan2(t.y() - me.y(), t.x() - me.x()))) - 90;
            if (angle < 0) {
                angle = 360 + angle;
            }
            return angle % 360;
     }
    Try to convert it to simba, Im sure that its not impossible, you just need to have the tile of the object using reflection.

  4. #4
    Join Date
    Feb 2006
    Location
    Australia
    Posts
    628
    Mentioned
    15 Post(s)
    Quoted
    105 Post(s)

    Default

    If you're using reflection, you can get the compass angle with R_GetMinimapAngleDeg, if you want to move the compass to a certain angle you can use R_MakeCompass.
    Edit: I just converted that function to work in simba with reflection. We now have a new function: R_RotateCameraToTile(Tile: Tpoint);
    Thanks for the paste, Patriq.
    Last edited by Krazy_Meerkat; 06-30-2014 at 04:02 AM.

  5. #5
    Join Date
    Aug 2007
    Location
    Colorado
    Posts
    7,421
    Mentioned
    268 Post(s)
    Quoted
    1442 Post(s)

    Default

    Oh yeah, I did this a while back, I used it for my fisher. You can check out the thread here:
    https://villavu.com/forum/showthread.php?t=87714

    Current projects:
    [ AeroGuardians (GotR minigame), Motherlode Miner, Blast furnace ]

    "I won't fall in your gravity. Open your eyes,
    you're the Earth and I'm the sky..."


  6. #6
    Join Date
    Feb 2012
    Location
    Portugal
    Posts
    91
    Mentioned
    3 Post(s)
    Quoted
    41 Post(s)

    Default

    By the way can we use reflection with the Runescape 3 client?
    I tried it, and I got some values but they never changed ;(
    Are there multipliers for runescape 3?
    Last edited by Patriq; 06-30-2014 at 07:08 AM.

  7. #7
    Join Date
    Feb 2006
    Location
    Australia
    Posts
    628
    Mentioned
    15 Post(s)
    Quoted
    105 Post(s)

    Default

    Quote Originally Posted by PatriqDesigns View Post
    By the way can we use reflection with the Runescape 3 client?
    I tried it, and I got some values but they never changed ;(
    Are there multipliers for runescape 3?
    I'm not quite sure how much you're asking here.. The old school reflection include won't work with rs3. Here's the rs3 logs http://javahacking.org/forum/index.php?/topic/731-811/ if you want to try some stuff on your own.. I didn't see any multipliers, but sometimes people just don't like to share.

  8. #8
    Join Date
    Feb 2012
    Location
    Portugal
    Posts
    91
    Mentioned
    3 Post(s)
    Quoted
    41 Post(s)

    Default

    Yes I went to ask about them, and they say I have to finde them myself :P
    Ohh well its ok, I wish I could do some reflection support for runescape 3 :3

  9. #9
    Join Date
    Mar 2014
    Posts
    21
    Mentioned
    2 Post(s)
    Quoted
    6 Post(s)

    Default

    When I was dabbling in reflection and using it to click on an object, I always used color to backup the reflection to get the best of both.

    To do this, first you use R_TileToMS to get the point in the center of the tile you're looking for, which I'm guessing you're already doing.

    Then I turned that point into a box and drew it in Smart by using something like this:

    Simba Code:
    BoxTopLeft     := IntToPoint((ReflectionTileCenterPoint.x - 14), (ReflectionTileCenterPointCenterPoint.y - 14));//Takes that center point and goes up and to the left 14px and makes a point there.
    BoxBottomRight := IntToPoint((ReflectionTileCenterPoint.x + 22), (ReflectionTileCenterPoint.y + 22));//takes the center point and goes down and to the right 22px and makes a point there.

    Box := PointToBox(BoxTopLeft, BoxBottomRight);//takes those 2 points you just created and turns them into a box
    SMART_DrawBox(Box);

    You'll need to play with those values a little bit to ensure that the object you're looking for is completely within that box at just about every angle.

    Then it's just a matter of looking in that box for the colors you need.

    This will in ensure that no matter what, you're only clicking on objects you can actually see.

    Then you can work out how to move the camera angle until said colors are found within "box" by using repeat until to repeat camera angle movements until you find the colors you're looking for in the box you just made using FindColorsTolerance.
    Last edited by MysteryMuffin; 07-05-2014 at 03:12 PM.

  10. #10
    Join Date
    Nov 2007
    Location
    46696E6C616E64
    Posts
    3,069
    Mentioned
    44 Post(s)
    Quoted
    302 Post(s)

    Default

    Quote Originally Posted by MysteryMuffin View Post
    When I was dabbling in reflection and using it to click on an object, I always used color to backup the reflection to get the best of both.

    To do this, first you use R_TileToMS to get the point in the center of the tile you're looking for, which I'm guessing you're already doing.

    Then I turned that point into a box and drew it in Smart by using something like this:

    Simba Code:
    BoxTopLeft     := IntToPoint((ReflectionTileCenterPoint.x - 14), (ReflectionTileCenterPointCenterPoint.y - 14));//Takes that center point and goes up and to the left 14px and makes a point there.
    BoxBottomRight := IntToPoint((ReflectionTileCenterPoint.x + 22), (ReflectionTileCenterPoint.y + 22));//takes the center point and goes down and to the right 22px and makes a point there.

    Box := PointToBox(BoxTopLeft, BoxBottomRight);//takes those 2 points you just created and turns them into a box
    SMART_DrawBox(Box);

    You'll need to play with those values a little bit to ensure that the object you're looking for is completely within that box at just about every angle.

    Then it's just a matter of looking in that box for the colors you need.

    This will in ensure that no matter what, you're only clicking on objects you can actually see.

    Then you can work out how to move the camera angle until said colors are found within "box" by using repeat until to repeat camera angle movements until you find the colors you're looking for in the box you just made using FindColorsTolerance.
    You can do -64, -64 to the tile you are looking at to get the top-left corner when turning into screen coordinates (R_TileOffsetToMS I think).
    There used to be something meaningful here.

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
  •