The Little
2009-06-23 19:09:24
Hey all,
I just started on my first Reflection project, a barbarian outpost agility course runner :P. Since this is my first script using Reflection I have no idea what it should look like. So would someone please review this procedure? Its for finding the first obstacle of the barbarian outpost course (the rope).
The variables I'm using for object location and ID are declared outside the procedure. There are no failsafes for failing the obstacle yet, I just want to know if I'm heading in the right direction :).
Thanks :)
I just started on my first Reflection project, a barbarian outpost agility course runner :P. Since this is my first script using Reflection I have no idea what it should look like. So would someone please review this procedure? Its for finding the first obstacle of the barbarian outpost course (the rope).
procedure RopeSwing;
var
MyPosition, MSPoint : TPoint;
begin
MyPosition := GetMyPos;
if not ((MyPosition.x = RopeFront.x) and (MyPosition.y = RopeFront.y)) then
Exit;
if not FindObjectEx(RopePoint, RopeID, 2) then
Exit;
MSPoint := TileToMS(RopePoint, 260);
MMouse(MSPoint.x, MSPoint.y, 10, 5);
if IsUpText('ing') then
begin
WriteLn('Clicking rope using Reflection');
GetMousePos(MSPoint.x, MSPoint.y);
Mouse(MSPoint.x, MSPoint.y, 0, 0, False);
R_ChooseOption('Swing-on');
end else
begin
WriteLn('Rope not found, switching to color');
if FindColorTolerance(MSPoint.x, MSPoint.y, 470838, 255, 210, 290, 230, 10) then
begin
MMouse(MSPoint.x, MSPoint.y, 3, 15);
if IsUpText('ing') then
begin
WriteLn('Clicking rope using Color');
GetMousePos(MSPoint.x, MSPoint.y);
Mouse(MSPoint.x, MSPoint.y, 0, 0, False);
R_ChooseOption('Swing-on');
end else
begin
WriteLn('Did not click because uptext did not match.')
Exit;
end
end else
begin
WriteLn('Object color not found either. Exiting.');
Exit;
end;
end;
end;The variables I'm using for object location and ID are declared outside the procedure. There are no failsafes for failing the obstacle yet, I just want to know if I'm heading in the right direction :).
Thanks :)