SRL Archive - OSR Help

Dtm Finding but not clicking


dayto123

2013-03-25 00:21:02

I am trying to make it so when i reach X amount of health it will click and at a trout. but instead it just goes over it and continues fighting.
[CODE]Procedure eatFood;
begin
If FindDTM(Trout, X, Y, MIX1, MIY1, MIX2, MIY2) Then
WriteLn( 'Eat food');
MMouse(x, y, 7, 7);
if isUpText('rout') Then
Mouse(x, y, 0, 0, true);
end; [/CODE]

The debug is showing up.

King

2013-03-25 00:25:11

Procedure eatFood;
begin
If FindDTM(Trout, X, Y, MIX1, MIY1, MIX2, MIY2) Then
begin// use this for multiple steps after a then statement
WriteLn( 'Eat food');
MMouse(x, y, 7, 7);
if isUpText('rout') Then
ClickMouse(true);//Mouse will move the mouse as well, we dont want to move it twice
end
else
begin
Writeln('Could not find trout, exiting for safety'); //In case we dont find the trout we tell it what to
TerminateScript; //to do, this case, logout because we have no food.
end;
end;

dayto123

2013-03-25 00:28:27

ClickMouse(true) INVALID NUMBER OF parameters. Not sure whats wrong with it

StickToTheScript

2013-03-25 00:30:41

Try writing it like this:

Procedure eatFood;
begin
Trout := DTMFromString('');
writeln('DTM');
If FindDTM(Trout, X, Y, MIX1, MIY1, MIX2, MIY2) Then
WriteLn( 'Eat food');
MMouse(x, y, 7, 7);
writeln('Moved Mouse');
if isUpText('rout') Then
writeln('Clicking.');
Mouse(x, y, 0, 0, true);
end;


If you do it like this, it should locate the place where the error is by the text in the debug.

And just in case, You could also just use my DTM for trout, which seems to work 100% of the time for me.. Which is:
Trout := DTMFromString('mrAAAAHichcrBCkBAFIXhf2SkeWimZCGzk9eUNRt/yRK3vtPpdFvgiJAaqHXad23x7rhNAQZ1yipatWjWmHsfq1fJ/BJ+PHcBzDoLSw==');