SRL Archive - Help and Support

Centering Clicks?


HDKilla

2006-06-18 17:54:53

I was just wondering what function I would use to deposit all items in inv. starting with the second item, but when the mouse clicks the second item, how do I make it click relatively in the center.

I bet this is simple, but I really am just starting to script, so it would be appreciated if flaming was kept to a minimum :o


Ill try to make this more clear….

Picture the second inv. item, then picture a tiny square inside the middle of the item, then, each time the procedure is called upon to click the item, it will click on a different coord within that tiny square, and select deposit all.

Thannks to anyone that can help.

realrune

2006-06-18 18:19:46

How 'bout something like this… (you'll have to change xs, ys, xe, ye to actual coords).

Mouse box picks a random location in the box of xs, ys, xe, ye.

The Deposit(2, 28, 0); is just a backup incase ur whole inv. didn't have the same item.


MouseBox(xs, ys, xe, ye, 2);
ChooseOption(x, y, 'Deposit All');
Wait(1000 + random(500));
Deposit(2, 28, 0);

Ares

2006-06-18 18:35:36

use bitmaps maybe :S, i dunno, always a try

Pyro

2006-06-18 23:53:13

Use a dtm with the starting point at center. And have it like this

if(finddtm(dtm etc……then
mouse(x,y,3,3,true)

WhiteShadow

2006-06-19 00:21:55

From: HDKilla
I was just wondering what function I would use to deposit all items in inv. starting with the second item, but when the mouse clicks the second item, how do I make it click relatively in the center.

I bet this is simple, but I really am just starting to script, so it would be appreciated if flaming was kept to a minimum :o


Ill try to make this more clear….

Picture the second inv. item, then picture a tiny square inside the middle of the item, then, each time the procedure is called upon to click the item, it will click on a different coord within that tiny square, and select deposit all.

Thannks to anyone that can help.


Interesting what do you need it for?

tarajunky

2006-06-19 09:46:43

If you can find ANY point on the item reliably you can make it click anywhere you want.

So, let's say you find the black point at the very upper left of the item, then you just add some number to that, like Mouse(x+14,y+13,2,2,true). This will only click in a 2x2 square, but it will click pretty far away from the original pixel you found.

The key is to use a method that will reliably find the same pixel. Whether that is a DTM or a findcolor, or a bitmap or whatever is up to your personal preference.

HDKilla

2006-06-20 21:19:33

I was going to use this idea to replace a function in a fletcher script that im using, just to make it more reliable.

And thanks for all the help everyone :D