SRL Archive - OSR Help

Identyfying an object


peterpan23

2012-10-15 16:47:50

Hello,
I have the following problem

my script is supposed to right click on the water talisman. I tried identyfying it by making a DTM and using color, but none work since the other talismans get recognized as well.
Of course the noobiest method would be to just use the Mouse function, but what else could I do?

Footy

2012-10-15 16:51:06

Don't use the mouse function, you could try a bitmap, or just keep adding detail to your DTM until it only finds the water talisman. Alternatively, you could get a DTM of the water text, the move the mouse 20 pixels to the left of it.

Nebula

2012-10-15 16:52:59

I say you use the mouse function, but that's often frowned upon. Try making a dtm that includes points from not only the talisman, but also from the "water" text.

A more advanced way would be to gather all of the the green colors of the text into an tpa and then split it into an atpa and use the tpa whose length is closest to the amount of green pixels in the text "water".

Footy

2012-10-15 16:55:04

From: Nebula
I say you use the mouse function, but that's often frowned upon. Try making a dtm that includes points from not only the talisman, but also from the "water" text.

A more advanced way would be to gather all of the the green colors of the text into an tpa and then split it into an atpa and use the tpa whose length is closest to the amount of green pixels in the text "water".


Only reason I said no to mouse was because the window has a scroll bar, and it would fail miserably if it happened to be scrolled down.

@OP, Nebula's method of using points from the talisman and the text is better then my just text idea.

J J

2012-10-15 18:00:43

Make a box around it in your mind, grab the top left coordinate and the down right coordinate with the color picker tool. Substract 50 from both Y values. Make a MouseBox(X1, Y1-50, X2, Y2-50, 0); to right click on a random spot in the box. Then have a WaitOptionMulti(['all'], 500) to select buy-all or whatever option it gives.

As you are just making a private script I guess to buy water talismans from the botted tokens just have a static wait. You can easily make a script for this with no knowledge within 1-2 days :P

Sax

2012-10-15 18:05:32

your dtm's motherpoint should be the colour of talisman. in this case you should select a blue pixel in the water symbol in the talisman and then make sure its not the same colour of body and law

Enslaved

2012-10-15 18:48:07

made this DTM from your screenie
DTM := DTMFromString('m6wAAAHic42ZgYAhhZGDwA+IYII4D4gAgDgLiMCD2AWIPII5ihKhbCVS/GYi3A/FGIF4OxGuBeCkSXgHEW4BYUnYdg5T8DgYh0XqG6RMmgPkzJk1iqK+qZCjKzQXy1wLlahmkFfYzcAHVE4sZScBIAAC96Rea');
just make the dtm like this if my one doesnt work, finding the areas where the law and water talisman are different, use them as additional marking points
gives this result

riwu

2012-10-15 19:42:30

I'd say the easiest and most accurate way in this case is to just use OCR and find the text 'Water' and set x,y offset if you are supposed to click on the talisman.

litoris

2012-10-16 10:34:05

You are making the DTM wrong. I have a script that does exactly that.
Add tolerance to the point(s) inside the black outlines. 20 always works.