SRL Archive - OSR Help

FindDTM And Randomisation Of Clicks, How Do You Do It?


SomeGuyFromHere

2013-02-04 10:37:17

So a lot of my old MouseBox based procedures have become very unreliable these days even when clicking big buttons, no idea why, and I have been switching to DTMs to make sure stuff works nicely. Basically it does, only I don't know how to randomize clicks now. Of course there is a variable in the "Mouse" procedure that randomly moves the clickpoint a few pixels to the left or right, but more often than not the DTM based mouse coordinates are at the very edge of the object to click which could break the procedure again.

This may be due to the fact that I like to use the borders of the objects for my DTMs. Point is, I need some way to add more randomness, like I can with MouseBox, to DTM based clicking. Is there a way to do that? Or have any of you an idea why using MouseBox results in a lot of missclicks all of a sudden?

rj

2013-02-04 17:12:00

Use the middle of the object and use something like:

MMouse(RandomRange(X - 5, X + 5), RandomRange(y - 5, y + 5), 0, 0);
// credits to DannyRS

Also to avoid it moving off the object check for uptext

SomeGuyFromHere

2013-02-04 19:25:27

Use the middle of the object and use something like:

How do I use the middle of the object; by changing the first point of the TPA to a point in the middle of the object?
Thanks!

Sjoe

2013-02-04 19:42:12

From: SomeGuyFromHere
How do I use the middle of the object; by changing the first point of the TPA to a point in the middle of the object?
Thanks!

So you're using TPA's?
then your proc/func must look something like this

for i:= 0 to high(TPA) do
begin
MiddleTPAEx(TPA[i], x, y) // Finds the middle of a tpa. (the high concentrated area)
Etc....
end;

SomeGuyFromHere

2013-02-08 20:31:44

No sorry, I was talking about DTMs alright… confused the two terms.

Awkwardsaw

2013-02-08 20:34:49

when you create your DTM make sure the mainpoint is in the center of the object.

Sjoe

2013-02-08 20:35:46

Then do what rjj said ;) and yes change the mainpoint to the middle of the object

SomeGuyFromHere

2013-02-16 16:27:40

Back to scripting! Thanks guys, will try that.