marpis
2010-08-09 07:03:56
In Objects.simba.
I hope it works well, couldn't really test it because my computer is killing me :-\
I think I'll test this tonight and put it into FindObjectsIn(), so that if you use the ClickLeft-action in FindObjectsIn, it will automatically track the object instead of just waiting for character to stop.
This way both woodcutting and mining will improve without any code changes in /skills/ :) This will make WaitWhileChopping way more reliable, because now if you're not already right next to the tree it will very likely watch some other tree to be chopped.
I hope it works well, couldn't really test it because my computer is killing me :-\
{******************************************************************************}
{ procedure MSI_TrackObject(var ObjInfo: TMSObject); }
{ By: marpis }
{ Date: 9th August 2010 }
{ Description: Follows object while moving (ObjInfo.X, ObjInfo.Y) }
{******************************************************************************}
procedure MSI_TrackObject(var ObjInfo: TMSObject);
var
TPA: TPointArray;
CTS, HalfWidth, HalfHeight: integer;
B: TBox;
begin
CTS := GetColorToleranceSpeed;
ColorToleranceSpeed(2);
SetColorSpeed2Modifiers(ObjInfo.Hue, ObjInfo.Sat);
HalfWidth := ObjInfo.W div 2;
HalfHeight := ObjInfo.H div 2;
while IsMoving do
begin
B := IntToBox(ObjInfo.X - HalfWidth, ObjInfo.Y - HalfHeight, ObjInfo.X + HalfWidth, ObjInfo.Y + HalfHeight);
if MSI_FindObjectsTPA(TPA, ObjInfo, B) then
begin
SortTPAFrom(TPA, Point(ObjInfo.X, ObjInfo.Y));
ObjInfo.X := TPA[0].X;
ObjInfo.Y := TPA[0].Y;
end;
Wait(20);
end;
SetColorSpeed2Modifiers(0.2, 0.2);
ColorToleranceSpeed(2);
end;
I think I'll test this tonight and put it into FindObjectsIn(), so that if you use the ClickLeft-action in FindObjectsIn, it will automatically track the object instead of just waiting for character to stop.
This way both woodcutting and mining will improve without any code changes in /skills/ :) This will make WaitWhileChopping way more reliable, because now if you're not already right next to the tree it will very likely watch some other tree to be chopped.