I've been trying to make a script to automatically farm this quest. Basically, I need my char to farm mobs until 300 items (quest goes to stage 2), then he has to turn quest in and reopen it and restart the farming.
Here's what I've done this far:
var
item: TL2Item;
function deadCheck: Boolean;
begin
Result := false;
if User.Dead then begin
Print('Dead. Pressing to clanhall.');
Delay(1000);
Engine.FaceControl(0,false);
Engine.GoHome(rtClanHall);
Delay(10000);
end;
end;
procedure script1;
begin
engine.settarget('Tunatun');
delay(1000);
engine.dlgopen;
delay(1000);
engine.dlgsel('Quest');
delay(1000);
engine.dlgsel('Home Security');
delay(1000);
engine.dlgsel('Listen to his concern');
delay(1000);
engine.dlgsel('Offer to help');
delay(5000);
end;
procedure script2;
begin
while true do begin
delay(150);
if User.Dead then begin
deadCheck;
end;
Engine.MoveTo(53131,-84124,-2720);
Delay(500);
Engine.MoveTo(53736,-87114,-2456);
Delay(500);
if Engine.QuestStatus(278, 1) then begin
Engine.FaceControl(0,true);
Engine.LoadZone('BeastFarm');
end;
if Engine.QuestStatus(278, 2) then begin
script3
end;
end;
end;
procedure script3;
begin
while true do begin
delay(150);
if User.Dead then begin
deadCheck;
end;
if Engine.QuestStatus(278, 2) then begin
Engine.FaceControl(0,false);
Engine.MoveTo(53736,-87114,-2456);
Delay(500);
Engine.MoveTo(53131,-84124,-2720);
Delay(500);
Engine.MoveTo(53658, -83826, -2720);
Delay(500);
engine.settarget('Tunatun');
delay(500);
engine.dlgopen;
delay(500);
engine.dlgsel('Quest');
delay(500);
engine.dlgsel('Home Security');
delay(500);
engine.dlgsel('Accept Reward');
delay(1000);
if Engine.QuestStatus(278, 0) then begin
script1
end;
end;
end;
end;
begin
Script.NewThread(@script1);
Script.NewThread(@script2);
Script.NewThread(@script3);
end.
I'm encountering 2 issues with this: first, while farming mobs sometimes my char seems to try to go to the next point, then he resumes kiling mobs, he goes a little batshit crazy, so I gues it's an indicator of something going wrong.
The main issue though, is that it seems I can't make the procedures go into a loop, after he turns the quest in he doesn't restart from the beginning. I'm really not good at programmin, I've just been using the guide found on this forum and went for trial and errors, but at this point it seems I can't make it right.
Any help, pleaaaase?