Basic example of fishing. In the script you need to specify the coordinates of the character and the place where to cast the fishing rod. The script will check for the presence of worms, check death, and move to a needed point if it was pushed away.
uses SysUtils, Classes;
const
FISHING_SKILL_ID = 21571; // Fishing [id: 21571]
FISH_X = 19854.20;
FISH_Y = 26818.14;
FISH_Z = 198.57;
Z_FIX = -1;
USER_X = 19864.11;
USER_Y = 26825.05;
USER_Z = 202.28;
procedure SimpleFishingThread();
begin
Print('SimpleFishingThread started ...');
while Delay(500) do begin
if (Status = lsOnline) then begin
if (Inv.ItemCount(27142) = 0) then begin
Engine.Print('Out of worms, stop script', 128);
Script.Stop;
end;
if (User.Dead) then begin
Engine.Print('Dead, stop script', 128);
Script.Stop;
end;
if (User.DistTo(USER_X, USER_Y, USER_Z) >= 5)
and (User.DistTo(USER_X, USER_Y, USER_Z) <= 20) then begin
Engine.Print('Seems char was moved, return to position...', 0);
if Engine.MoveTo(USER_X, USER_Y, USER_Z) then Delay(500);
end;
if (User.DistTo(USER_X, USER_Y, USER_Z) >= 20) then begin
Engine.Print('Seems char was moved too far from position, stop script', 128);
Script.Stop;
end;
if (User.DistTo(USER_X, USER_Y, USER_Z) <= 6) then begin
Engine.Print('Use fishing...');
Engine.TurnTo(FISH_X, FISH_Y, 3);
if Engine.UsePointSkill(FISHING_SKILL_ID, FISH_X-2+Random(5), FISH_Y-2+Random(5), FISH_Z+Z_FIX) then begin
while (User.Cast.EndTime <> 0) or (User.GlobalCoolDown <> 0) do Delay(500);
end;
end;
end;
end;
end;
begin
Engine.SetGameWindow(True);
Script.NewThread(@SimpleFishingThread);
//...
Delay(-1);
end.