FrÕzÑ_§ÕµL
2008-01-09 03:58:39
Greetings!
I am creating… well attempting anyway, probably out of my league… a procedure that moves the mouse a certain amount depending on the distance and direction of the flag when an object is clicked, this is in order to keep the mouse on a tree. I have used InTriangle, and split the minimap into 4 segments. However there are two things I would like to know:
1. When you use FlagDistance, does it get the flag from its top or where? Because I need the bottom, so I have put it as x - 12.
2. It takes too long for SCAR to complete :p anyone got some ideas of how to speed the following up? (I am up for using point in box, anything, just need it to complete lol)
As you can see, most of the InTriangle's are the same, the only difference is the +'s and -'s… so a case might be possible… but I'm not sure how to do a case of InTriangle lol?
I am creating… well attempting anyway, probably out of my league… a procedure that moves the mouse a certain amount depending on the distance and direction of the flag when an object is clicked, this is in order to keep the mouse on a tree. I have used InTriangle, and split the minimap into 4 segments. However there are two things I would like to know:
1. When you use FlagDistance, does it get the flag from its top or where? Because I need the bottom, so I have put it as x - 12.
2. It takes too long for SCAR to complete :p anyone got some ideas of how to speed the following up? (I am up for using point in box, anything, just need it to complete lol)
//minimap travels 4 pixels per second - probably useless.
//x dist per mm pixel is 7.6 ?
//y dist per mm pixel is 17.3 ?
//Replaced both of the above with 1.5 for testing as they went massive lol. Still trying to find the right number.
Procedure FixMouse;
var
Dist : Integer;
Begin
if (FindColor(x, y, 255, 559, 0, 735, 166)) then //FlagDistance, needed to use the x and y from FindColor.
Begin
DecEx(x, 12);
Dist := Distance(x, y, MMCX, MMCY);
end;
//Clicked n-e
if InTriangle(x, y, MMCX, MMCY, (MMX1 + MMX2)/2, MMY1, (MMY1 + MMY2)/2, MMX2) then
Begin
GetMousePos(x, y);
MMouse(x - Round(Dist*1.5), y + Round(Dist*1.5), 0, 0);
Flag;
Exit;
end;
//Clicked e-s
if InTriangle(x, y, MMCX, MMCY, (MMY1 + MMY2)/2, MMX2, (MMX1 + MMX2)/2, MMY2) then
Begin
GetMousePos(x, y);
MMouse(x - Round(Dist*1.5), y - Round(Dist*1.5), 0, 0);
Flag;
Exit;
end;
//Clicked s-w
if InTriangle(x, y, MMCX, MMCY, (MMX1 + MMX2)/2, MMY2, (MMY1 + MMY2)/2, MMX1) then
Begin
GetMousePos(x, y);
MMouse(x + Round(Dist*1.5), y - Round(Dist*1.5), 0, 0);
Flag;
Exit;
end;
//Clicked w-n
if InTriangle(x, y, MMCX, MMCY, (MMY1 + MMY2)/2, MMX1, (MMX1 + MMX2)/2, MMY1) then
Begin
GetMousePos(x, y);
MMouse(x + Round(Dist*1.5), y + Round(Dist*1.5), 0, 0);
Flag;
Exit;
end;
Flag;
end;As you can see, most of the InTriangle's are the same, the only difference is the +'s and -'s… so a case might be possible… but I'm not sure how to do a case of InTriangle lol?