SRL Archive - OSR Help

Need help with a script


Sax

2013-02-20 13:25:06


So I have this procedure.

But the problem is that it keeps finding the DTM in the upper left corner of smart, and it moves mouse at there. First it clicked like as if it was a log but then I added the Uptext failsafe. But it still moves mouse which is not very human-like.

Can someone please help me with this situation?

procedure ErrorSafe;
var
TPA: TPointArray;
G, H, x, y: Integer;

begin
repeat
begin
if FindDTMs(MLogs, TPA, MIX1, MIY1, MIX2, MIY2) then
begin
Writeln('We left one or more logs behind');
SortTPAByY(TPA, true);
H := High(TPA);
for G := 0 to H do
begin
MMouse(x, y, 3, 3);
if not IsUpText('hogany') then
Continue;
Wait(200);
SendKeys('d', 50 + Random(40), 30 + Random(30));
Wait(500 + Random(200));
ClickMouse2(true);
Wait(1000 + Random(100));
end;
end else
WriteLn('didnt find any logs left');
end;
until (not FindDTMs(MLogs, TPA, MIX1, MIY1, MIX2, MIY2));
end;

Le Jingle

2013-02-20 14:03:31

maybe replace your current MMouse line with,

MMouse(TPA[G].x, TPA[G].y, 3, 3);

Sax

2013-02-20 14:09:06

wtf? I just noticed. What are the x and y? I wonder why this still works. will try using MiddleTPAEx(TPA, x, y) thanks :D

Le Jingle

2013-02-20 14:14:55

TPA[index].x is the x data member in the TPointArray object at the given index. Each TPoint type has an x and y value. So at the index of a TPA greater than length 0, you'll have a TPoint at an index with an X and Y value.

Sax

2013-02-20 14:17:17

Yeah nevermind I was so confused. MiddleTPAEx wont work because each log has one TPoint. So Ill just do TPA[G].x as you said.