Скрипт на скорую руку, но работает.
Code: Select all
Program killbird;
const
chestID = $4018D2CE; // Сундук для складывания.
buyBird = true; // true - покупать птичек у вендора и резать их. false - искать птичек вокруг.
vendorID = $0003773C; // ИД вендора для скупки птиц.
corpseType = $2006;
featherType = $1BD1;
shopBirdType = $211D;
runebooktype = $0EFA;
runebookcolor = $0510;
var
birdType: array of word;
d: integer;
corpseID: cardinal;
i: integer;
procedure init;
begin
if buyBird then begin
setlength(birdType, 1);
birdType[0] := $0005;
finddistance := 10;
end else begin
setlength(birdType, 1);
birdType[0] := $0006;
finddistance := 30;
end;
setarstatus(true);
setpausescriptondisconnectstatus(true);
moveopendoor := true;
movethroughnpc := dex;
setrunmounttimer(100);
setwalkmounttimer(200);
setrununmounttimer(200);
setwalkunmounttimer(400);
setautobuydelay(3);
autobuy(shopBirdType, $0000, 1);
end;
function kill: boolean;
begin
result := false;
for i := 0 to high(birdType) do
if findtype(birdType[i], ground) > 0 then begin
while gethp(finditem) > 0 do begin
newmovexy(getx(finditem), gety(finditem), false, 1, false);
attack(finditem);
wait(1000);
end;
result := true;
exit;
end;
end;
procedure recall(g: integer);
var
cx, cy: word;
recTime: tdatetime;
begin
repeat
cx := getx(self);
cy := gety(self);
useobject(backpack);
checklag(70000);
wait(200);
while isgump do
closesimplegump(getgumpscount-1);
repeat
recTime := now;
usetype(runebooktype, runebookcolor);
checklag(70000);
wait(200);
until numgumpbutton(getgumpscount-1, g) OR (recTime+(1.0/(24*60*30)) < now);
repeat
wait(200);
until ((cx <> getx(self)) AND (cy <> gety(self)) OR (recTime+(1.0/(24*60*5)) < now));
until (cx <> getx(self)) AND (cy <> gety(self));
end;
procedure unload;
begin
while NOT newmovexy(getx(chestID), gety(chestID), false, 1, false) do
wait(1000);
while findtype(featherType, backpack) > 0 do begin
moveitem(finditem, 0, chestID, 0, 0, 0);
checklag(70000);
wait(500);
end;
end;
begin
init;
while NOT dead do begin
if weight > str*2 then begin
recall(21);
unload;
recall(33);
end;
if findtype(corpseType, ground) > 0 then begin
newmovexy(getx(finditem), gety(finditem), false, 1, false);
d := getdistance(finditem);
if (d >= 0) AND (d <= 1) then begin
corpseID := finditem;
useobject(corpseID);
checklag(70000);
wait(500);
waittargetobject(corpseID);
useobject(objatlayer(rhandlayer));
wait(500);
if findtype(featherType, finditem) > 0 then begin
moveitem(finditem, 0, backpack, 0, 0, 0);
checklag(70000);
wait(500);
useobject(backpack);
checklag(70000);
wait(500);
findtype(featherType, backpack);
addtosystemjournal('У меня ' + inttostr(findfullquantity) + ' перьев.');
end;
ignore(corpseID);
end;
continue;
end;
if kill then
continue;
if buyBird then begin
newmovexy(getx(vendorID), gety(vendorID), false, 1, false);
d := getdistance(vendorID);
if (d >= 0) AND (d <= 1) then begin
wait(30000);
uosay(getname(vendorID) + ' buy guards');
checklag(70000);
wait(5000);
end;
end;
end;
end.