Results 1 to 6 of 6

Thread: Using colours; can you use this colour reference trick?

  1. #1
    Join Date
    May 2012
    Posts
    70
    Mentioned
    0 Post(s)
    Quoted
    14 Post(s)

    Default Using colours; can you use this colour reference trick?

    Was just wondering (while making a bot), if it's possible to do this (I will try it anyway, but as this forum is also about learning, so I thought I'd ask). If there's an object with similar colours to a few others on the page, but one very distinct point with a very different colour, can you use the find function to get the distinct point, get the width (x) and height (y) of the screen, set the compass to a set point, and then use that distinct point as a reference and move your mouse from there to the object (so obviously will only work on stationary objects).

    Cheers advance.

  2. #2
    Join Date
    Feb 2012
    Location
    Wonderland
    Posts
    1,988
    Mentioned
    41 Post(s)
    Quoted
    272 Post(s)

    Default

    Quote Originally Posted by Word View Post
    Was just wondering (while making a bot), if it's possible to do this (I will try it anyway, but as this forum is also about learning, so I thought I'd ask). If there's an object with similar colours to a few others on the page, but one very distinct point with a very different colour, can you use the find function to get the distinct point, get the width (x) and height (y) of the screen, set the compass to a set point, and then use that distinct point as a reference and move your mouse from there to the object (so obviously will only work on stationary objects).

    Cheers advance.
    If I understand you correctly, this would only be useful for interface, or static (hence interface) colors. There's always x given degree of change on the MS/MM so I wouldn't suggest offsetting/static clicks via objects found on the MS

  3. #3
    Join Date
    May 2012
    Posts
    70
    Mentioned
    0 Post(s)
    Quoted
    14 Post(s)

    Default

    Quote Originally Posted by Le Jingle View Post
    If I understand you correctly, this would only be useful for interface, or static (hence interface) colors. There's always x given degree of change on the MS/MM so I wouldn't suggest offsetting/static clicks via objects found on the MS
    Yeah, I agree with the change, but practically, surely a very bright red (random example) colour will be found correctly a larger percentage of the time, and if I know that the crate I need to search (random example again) is 100 pixels to the left when facing north, why not use the red colour as reference point?

    Maybe I didn't understand your post, though - thanks for the reply. Will play around with it, as that's the best way to learn regardless!

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

    Default

    You mean.. a DTM?

  5. #5
    Join Date
    Nov 2012
    Posts
    141
    Mentioned
    0 Post(s)
    Quoted
    43 Post(s)

    Default

    Quote Originally Posted by Word View Post
    Yeah, I agree with the change, but practically, surely a very bright red (random example) colour will be found correctly a larger percentage of the time, and if I know that the crate I need to search (random example again) is 100 pixels to the left when facing north, why not use the red colour as reference point?

    Maybe I didn't understand your post, though - thanks for the reply. Will play around with it, as that's the best way to learn regardless!
    I'm sure you've come up with something from the last few hours but:
    Jingle is saying because the main screen and minimap rotate, your reference point won't always yield your object at the shifted point.

    Even if "FindPoint()" is 100% accurate, shifting left 100 pixels won't always give you the object you want. Depending on the angle, the object could be 50 pixels from the reference point, or 150 pixels from the reference point (I'm just throwing out numbers here).

    Though, if you make sure that you are always facing north when doing this check, it should work. However, it's not very efficient.

    Something you can do differently is to get a group of colors and use FindTPACluster() (I think that's the name of the function), or use RemoveDistTPointArray().

  6. #6
    Join Date
    May 2012
    Posts
    70
    Mentioned
    0 Post(s)
    Quoted
    14 Post(s)

    Default

    Quote Originally Posted by rjj95 View Post
    You mean.. a DTM?
    No, not directly. Reread what I said, please.

    Quote Originally Posted by Neodymium View Post
    I'm sure you've come up with something from the last few hours but:
    Jingle is saying because the main screen and minimap rotate, your reference point won't always yield your object at the shifted point.

    Even if "FindPoint()" is 100% accurate, shifting left 100 pixels won't always give you the object you want. Depending on the angle, the object could be 50 pixels from the reference point, or 150 pixels from the reference point (I'm just throwing out numbers here).

    Though, if you make sure that you are always facing north when doing this check, it should work. However, it's not very efficient.

    Something you can do differently is to get a group of colors and use FindTPACluster() (I think that's the name of the function), or use RemoveDistTPointArray().
    FindTPACluster() seems interesting - I'll have to play around with it. Yeah, efficiency isn't such a problem, for me, to be fair - it's effectiveness. If the script won't mess up, then it's more important (not at the moment, to be fair, due to randoms, but if an official include comes out or something, then it will be more useful).

    Thanks for the information, only started with pascal 2 days ago, but it's very interesting (though I still prefer java, haha).
    Last edited by Word; 02-28-2013 at 09:30 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
  •