SRL Archive - OSR Help

Detecting a shop screen.


ssshhhaaa

2012-04-29 04:47:52

I've reached a block in my script atm and cant think (or find ) anything to solve it.

I basically want to detect if a shop screen (or something similar) is open.

Right now i have a messy fail safe instead of a way to detect the screen, right now i have it check if it can find the trader after every 5 seconds when the shop screen is open so if it is not open it will trade the trader and continue with the script. This is very buggy and adds 30 seconds to the trading.

I need something that can detect if the shop screen is open, if it is then it just does nothing, if it isn't then it trades the shop and continues.

So to sum it up i need help creating something that can detect a shop screen, if found does nothing, if not it trades again.

Any help is appreciated :)

YoHoJo

2012-04-29 04:51:30

Check out the colors of the outlines of the name of the shop or the items in the shop.
They black outline of the letter/items will be either 0 or the color of the outline of every item which is constant.

Then just use a simple if getcolor(X,Y)=0 (or whatever color) then bla.

Get me? Super fast, super easy! It's how I do it!

tieyob

2012-04-29 04:52:14

I use a find a color at coord x,y command in an if/then statement in my pizza base maker. it theres any color that wouldn't normally appear at a certain point on the screen unless your in the shop screen then this should be successful.

ssshhhaaa

2012-04-29 04:56:27

i did something like this for detecting if my teleport failed or not but i instead used findobjcustom, tried using the same thing for the trader but couldn't find a unique enough colour.

So how would i use the getcolor(X,Y)=0 ? where does the colour go?

ssshhhaaa

2012-04-29 04:57:46

From: tieyob
I use a find a color at coord x,y command in an if/then statement in my pizza base maker. it theres any color that wouldn't normally appear at a certain point on the screen unless your in the shop screen then this should be successful.


Yeah the thing i don't know how to do with that is how to find the x and y coordinates of a point on smart, how did you do it?

Kyle Undefined

2012-04-29 05:04:36

I read text off of the screen, much better ;)

ssshhhaaa

2012-04-29 05:14:46

From: Kyle Undefined
I read text off of the screen, much better ;)


I tried doing this with ACA to read the shop's name, but it couldnt ever find it =p

YoHoJo

2012-04-29 05:18:49

From: ssshhhaaa
Yeah the thing i don't know how to do with that is how to find the x and y coordinates of a point on smart, how did you do it?


You drag the cross-hairs to smart, click the color picker/dropper tool, and click on the point of interest. Then in the debug box it will tell you X, Y coordinate and the color picked!

Kyle Undefined

2012-04-29 05:22:22

Take a look at this, http://villavu.com/forum/showthread.php?t=80544