SRL Archive - OSR Help

Using colours; can you use this colour reference trick?


Word

2013-02-27 14:07:00

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.

Le Jingle

2013-02-27 14:12:35

From: Word
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

Word

2013-02-27 14:16:52

From: Le Jingle
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!

rj

2013-02-27 19:38:51

You mean.. a DTM?

Neodymium

2013-02-27 19:50:40

From: Word
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().

Word

2013-02-28 04:27:49

From: rjj95
You mean.. a DTM?


No, not directly. Reread what I said, please.

From: Neodymium
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).