Log in

View Full Version : How would you open this gate?



sickle
10-07-2012, 01:20 AM
I am trying to open the gate to the cow field in Lumbridge. The door randomly closes and the script would need to see if the door is not opening and if necessary open it before entering.

The color is non specific (blends with the surrounding fence) and I have a really really hard time getting it to work. What would you do?

P1ng
10-07-2012, 01:28 AM
I would use MMToMS and GetTPABounds to initially find the area on the minimap that is red(indicating the gates location). Then after converting this to the mainscreen I would search within that TBox for the brown fence colour using CTS2.

After I have searched for the brown colour I would then check the length of that TPA and if it is greater than a certain amount the fence is closed. If it is larger, then the fence must be open :)

sickle
10-07-2012, 01:35 AM
I would use MMToMS and GetTPABounds to initially find the area on the minimap that is red(indicating the gates location). Then after converting this to the mainscreen I would search within that TBox for the brown fence colour using CTS2.

After I have searched for the brown colour I would then check the length of that TPA and if it is greater than a certain amount the fence is closed. If it is larger, then the fence must be open :)

Thanks!! I am a noob, however, and only understood a half of what you said. Is there a link to tutorial of what you suggested I do? Sounds like more learning tonight. :)

P1ng
10-07-2012, 01:41 AM
Look up and read through all of the TPA tutorials, you only really need the basics of TPA usage for this function, but you will also need knowledge of other SRL functions and a good amount of logic ;)

litoris
10-07-2012, 04:45 AM
Use the minimap. If the minimap shows whether the gate is open, you can just search for a DTM.

P1ng
10-07-2012, 05:07 AM
How do you mean if the minimap shows whether the gate is open? It doesn't consistently change when the gate is opened and closed (sometimes it shows its open when it's closed and visa versa).

litoris
10-07-2012, 05:12 AM
How do you mean if the minimap shows whether the gate is open? It doesn't consistently change when the gate is opened and closed (sometimes it shows its open when it's closed and visa versa).

Well then you need to search for the red gate's DTM on the minimap(it's unique so it should be easy to find) and move close to it, and then understand your orientation wrt to the gate and click the fence on your correct side.

NKN
10-07-2012, 05:13 AM
Make a box of where the fence would be.

Get average color count of the brownish color when it's closed.
Plug this in, then if the color count is lower by a lot, it's open, if it's roughly the same, it's closed?