Количество удочек в контейнерах определяется аналогично - иногда правильно, иногда косячит. Вот кусок скрипта, который проверяет наличие удочек:10:32:33:608 [Fishermann]: Character Ololo Connected.
10:32:34:596 [Fishermann]: Compiling
10:32:34:611 [Fishermann]: Compiled succesfully
10:32:35:756 [Fishermann]: UseObject error: Object not found.
10:32:59:929 [Fishermann]: Взял удочку с бэкпака, осталось 0, а всего 57
10:33:29:424 [Fishermann]: Compiling
10:33:29:435 [Fishermann]: Compiled succesfully
10:57:04:512 [Fishermann]: Осталось еды: 416
11:03:27:668 [Fishermann]: Character Ololo Disconnected.
11:03:49:834 [Fishermann]: Character Ololo Connected.
11:03:49:896 [Fishermann]: Взял удочку с бэкпака, осталось 3, а всего 7
11:27:40:951 [Fishermann]: Осталось еды: 415
Code: Select all
Procedure Change;
var
chb, chg, chcont : integer;
begin
if not dead then
begin
CheckSave;
finddistance:=2;
chg:=CountGround($0DBF);
chb:=Count($0DBF);
chcont:=CountEX($0DBF,$FFFF,PoleBag);
//AddToSystemJournal('В паке '+inttostr(chb)+' удочек!');
//AddToSystemJournal('На полу '+inttostr(chg)+' удочек!');
//AddToSystemJournal('В контейнере '+inttostr(chcont)+' удочек!');
{CountEx(ObjType,Color: Word; Container: Cardinal): Integer}
if (chb> 0) and (ObjAtLayer(LhandLayer) <= 0) then
begin
findtype ($0DBF, backpack); {$0DBF - удочка рыболовная}
Equip(LhandLayer,finditem);
AddToSystemJournal('Взял удочку с бэкпака, осталось '+inttostr(chb-1)+', а всего '+inttostr(chg+chb+chcont-1));
wait (1000);
end;
if (chg> 0) and (ObjAtLayer(LhandLayer) <= 0) then
begin
findtype ($0DBF, ground); {$0DBF - удочка рыболовная}
Equip(LhandLayer,finditem)
AddToSystemJournal('Взял удочку с пола, осталось '+inttostr(chg-1)+', а всего '+inttostr(chg+chb+chcont-1));
wait (1000);
end;
if (chcont> 0) and (ObjAtLayer(LhandLayer) <= 0) then
begin
findtype ($0DBF, PoleBag); {$0DBF - удочка рыболовная}
Equip(LhandLayer,finditem);
AddToSystemJournal('Взял удочку с контейнера, осталось '+inttostr(chcont-1)+', а всего '+inttostr(chg+chb+chcont-1));
wait (1000);
end;
if (chb+chg+chcont)<1 then
begin
AddToSystemJournal('Не нашел удочек! Выхожу... ');
checksave;
end;
end;
Wait(1000);
end;