SRL Archive - OSR Help

Help with Clicking DTMS


Thief

2013-04-27 02:56:36

Hey, so I was wondering how to keep trying to click a DTM until it successfully sees the uptext (rightclick).
Basically I'm trying to climb an obstacle, and it often recognises it, but misclicks so it doesn't bring up the option to climb.
I have a backup DTM, but it won't use it if it actually see the first DTM and misclicks.

Any help would be greatly appreciated :)

Here's what I have so far:

procedure ClickObstacle2;

var
x, y, Obstacle2DTM, Obstacle2Backup :Integer;

begin
Wait(RandomRange(1200, 500));
Obstacle2DTM := DTMFromString('mVAEAAHicE2BgYHgGxD+AmI2RgeErkP4FxO+B+DcQqwDFNIBYFYhvA/nXgZgLyGYBYgFGiDw7EM8Gis8B4rlAPA+IZwHxdCB+BTVDkRHCBtHbgPQOIN4HxPeB+Mm9owztrY1Y8Z1r++D4/s2DDPdu7GdYtXQSw+rlUxjWrpjK8OrxKQZJoBmUYEYKMToAAF+NMyk=');
Obstacle2Backup :=DTMFromString('mVAEAAHicE2BgYHgLxOyMDAzmQKwFxD+AfAEg/RdICwFpXiB+BGRfAeKHQMwI5PMD8RcgWxRIvwDSDUDMBmSfAdKNUFwNxHOBeA4QnwViVqA8JxBLALEkEIsBsRQQP7l3lKG9tZHh3o39YAxiw/DaFVMZVi+fwnD/5kGw3ItHJ1DkQfg/0GxJCjAjhRgdAACvVy8l');
If FindDTM(Obstacle2DTM, x, y, MSX1, MSY1, MSX2, MSY2) then
begin
Mouse(x, y, 1, 1, false);
WaitOption('Climb', 1000);
StatsGuise('Found Obstacle 2');
end else
If FindDTM(Obstacle2Backup, x, y, MSX1, MSY1, MSX2, MSY2) then
begin
Mouse(x, y, 1, 1, false);
WaitOption('Climb', 1000);
StatsGuise('Found O2 Backup');
end else
begin
WriteLn('couldnt climb obstacle');
TerminateScript;
end;
FreeDTM(Obstacle2DTM);
FreeDTM(Obstacle2Backup);
end;

Flight

2013-04-27 03:15:11

Try this:

procedure ClickObstacle2;
var
T,x,y,Obstacle2DTM,Obstacle2Backup: Integer;
begin
Wait(RandomRange(1200, 500));
Obstacle2DTM := DTMFromString('mVAEAAHicE2BgYHgGxD+AmI2RgeErkP4FxO+B+DcQqwDFNIBYFYhvA/nXgZgLyGYBYgFGiDw7EM8Gis8B4rlAPA+IZwHxdCB+BTVDkRHCBtHbgPQOIN4HxPeB+Mm9owztrY1Y8Z1r++D4/s2DDPdu7GdYtXQSw+rlUxjWrpjK8OrxKQZJoBmUYEYKMToAAF+NMyk=');
Obstacle2Backup :=DTMFromString('mVAEAAHicE2BgYHgLxOyMDAzmQKwFxD+AfAEg/RdICwFpXiB+BGRfAeKHQMwI5PMD8RcgWxRIvwDSDUDMBmSfAdKNUFwNxHOBeA4QnwViVqA8JxBLALEkEIsBsRQQP7l3lKG9tZHh3o39YAxiw/DaFVMZVi+fwnD/5kGw3ItHJ1DkQfg/0GxJCjAjhRgdAACvVy8l');

if not FindDTM(Obstacle2DTM, x, y, MSX1, MSY1, MSX2, MSY2) then
if not FindDTM(Obstacle2Backup, x, y, MSX1, MSY1, MSX2, MSY2) then
begin
WriteLn('couldnt climb obstacle');
FreeDTM(Obstacle2DTM);
FreeDTM(Obstacle2Backup);
TerminateScript;
end;

MarkTime(T);
repeat
FindNormalRandoms;
MMouse(X, Y, 10, 10);
if WaitUpText('UPTEXT OF THE OBJECT', 300) then
break;
until(TimeFromMark(T) > 2000)

if IsUpText('UPTEXT OF THE OBJECT') then
WaitOption('Climb', 1000);

FreeDTM(Obstacle2DTM);
FreeDTM(Obstacle2Backup);
end;

This will search for your first DTM, if not found then search for the second; if both are not found your script will terminate. Now if either of your two DTMs are found you will your mouse to the X/Y coordinate that it's found at with a randomness of 10 in both X & Y. It will do this for a maximum of 2 seconds while searching for the UpText of the obstacle (you must supply this), if the UpText is found it will right-click and choose the option "Climb".

Edit:
Forgot to add the 'MarkTime(T)' :p.

Thief

2013-04-27 03:31:26

Thanks for the reply. I tested it out. It hovers over the DTM for a few seconds, and the uptext coems up, but it doesn't click it :S

Chris!

2013-04-27 03:36:38

If Flight's doesn't work, check if you've installed the correct fonts. I'm going to assume this is for 07, so follow this guide: http://villavu.com/forum/showthread.php?t=99992. You want the font part of that. :)

Thief

2013-04-27 03:38:18

Nah it's for EOC. I'll recheck it with the full uptext.

Flight

2013-04-27 03:41:25

From: pure_thief
Thanks for the reply. I tested it out. It hovers over the DTM for a few seconds, and the uptext coems up, but it doesn't click it :S


Oh my mistake, I forgot to add the right-click.


procedure ClickObstacle2;
var
T,x,y,Obstacle2DTM,Obstacle2Backup: Integer;
begin
Wait(RandomRange(1200, 500));
Obstacle2DTM := DTMFromString('mVAEAAHicE2BgYHgGxD+AmI2RgeErkP4FxO+B+DcQqwDFNIBYFYhvA/nXgZgLyGYBYgFGiDw7EM8Gis8B4rlAPA+IZwHxdCB+BTVDkRHCBtHbgPQOIN4HxPeB+Mm9owztrY1Y8Z1r++D4/s2DDPdu7GdYtXQSw+rlUxjWrpjK8OrxKQZJoBmUYEYKMToAAF+NMyk=');
Obstacle2Backup :=DTMFromString('mVAEAAHicE2BgYHgLxOyMDAzmQKwFxD+AfAEg/RdICwFpXiB+BGRfAeKHQMwI5PMD8RcgWxRIvwDSDUDMBmSfAdKNUFwNxHOBeA4QnwViVqA8JxBLALEkEIsBsRQQP7l3lKG9tZHh3o39YAxiw/DaFVMZVi+fwnD/5kGw3ItHJ1DkQfg/0GxJCjAjhRgdAACvVy8l');

if not FindDTM(Obstacle2DTM, x, y, MSX1, MSY1, MSX2, MSY2) then
if not FindDTM(Obstacle2Backup, x, y, MSX1, MSY1, MSX2, MSY2) then
begin
WriteLn('couldnt climb obstacle');
FreeDTM(Obstacle2DTM);
FreeDTM(Obstacle2Backup);
TerminateScript;
end;

MarkTime(T);
repeat
FindNormalRandoms;
MMouse(X, Y, 10, 10);
if WaitUpText('UPTEXT OF THE OBJECT', 300) then
break;
until(TimeFromMark(T) > 2000)

if IsUpText('UPTEXT OF THE OBJECT') then
begin
ClickMouse2(mouse_right);
WaitOption('Climb', 1000);
end else
Writeln('Never found the uptext!');

FreeDTM(Obstacle2DTM);
FreeDTM(Obstacle2Backup);
end;

t4q

2013-04-27 03:44:56

yep right_click was missing, I was just posting it… :)

Thief

2013-04-27 03:53:20

Cool thanks! That seems to be working pretty well.