Athylus
2013-08-20 09:18:07
I'm nearly done with my script, I just have to add some failsafes. I can't think of anything to failsafe opening this gate though. I've looked at tutorials. This is what I could come up with.
I'd like some advice. Here's what I came up with it. Still gotta test.
Even so, what if it can't find the gate, still? I'll have to add in a repeat function… but repeat.. until(?)? Some insight would be greatly appreciated.
procedure FindGate;
var
x, y: integer;
aFound: Extended;
begin
if FindDTMRotated(Gate, x, y, MSX1, MSY1, MSX2, MSY2, -Pi/4, Pi/4, Pi/60, aFound) then
begin
MakeCompass('n');
writeln('We found the gate');
MMouse(x, y, 3, 3);
Mouse(x, y, 0, 0, true);
end else
begin
writeln('The gate is already open');
Exit;
end;
end;
I'd like some advice. Here's what I came up with it. Still gotta test.
procedure FindGate;
var
x, y: integer;
aFound: Extended;
begin
if FindDTMRotated(Gate, x, y, MSX1, MSY1, MSX2, MSY2, -Pi/4, Pi/4, Pi/60, aFound) then
begin
MakeCompass('n');
writeln('We found the gate');
MMouse(x, y, 3, 3);
Mouse(x, y, 0, 0, true);
end else
begin
if FindObjCustom(x, y, ['pen', 'ate'], 123, 15) then
begin
writeln('We found the gate');
MMouse(x, y, 3, 3);
ClickMouse(x, y, mouse_Left);
end;
end;
end;
Even so, what if it can't find the gate, still? I'll have to add in a repeat function… but repeat.. until(?)? Some insight would be greatly appreciated.