Re: Работа с предметами в контейнере
Posted: 11.07.2012 14:08
кажется нашел проблему свою))) забыл игнор контейнера поставить аж самому смешно
Альтернативный клиент Ultima Online
https://stealth.od.ua/forum/
Code: Select all
const
containerID = $00000000;
begin
useobject(containerID);
checklag(10000);
wait(300);
while findtypeex($FFFF, $FFFF, containerID, true) > 0 do begin
ignore(finditem);
if iscontainer(finditem) then begin
useobject(finditem);
checklag(10000);
wait(300);
continue;
end;
addtosystemjournal('$' + inttohex(finditem, 8));
end;
end.
Code: Select all
procedure searching;
begin
useobject(finditem);
wait(500);
while findtype($ffff, lastcontainer) > 0 do begin
clickonobject(finditem);
wait(500);
if iscontainer(finditem) then searching;
itemname:= getname(finditem);
addtosystemjournal(getname(finditem));
ignore(finditem);
clearjournal;
ignore(lastcontainer);
end;
end;
Begin
useobject(container); //ID родительского контейнера, в котором происходит поиск
wait(500);
while findtype($ffff, $4001D20E) > 0 do begin
searching;
end;
End.
я не отбрасываю Ваш скрипт, он работает бесспорно, но не в моем случае, где подсумков более чем 2 порядка, поэтому я и нарисовал схему что в подсумках есть тоже подсумки и в тех тоже есть, их много)nepopus wrote:У вас в цикле может открываться по нескольку контейнеров, а игнор стоит лишь на последний.
Не думаю, что вы дождетесь нужного ответа, если будете, не вникнув, отбрасывать правильные решения и скрытым умыслом просить отполировать ваш костыль.
Что вы хотите получить? Названия предметов? Тогда прочтите еще раз моё прошлое сообщение.
П.С. ваши картинки меня уже достали : )
Code: Select all
Procedure OpenAll(Box:cardinal);
var
BoxID:array[0..200] of cardinal;
x,y,z,BoxIDC,fbox:integer;
List:TstringList;
begin
BoxIDC:=0;
ignorereset;
repeat
// For x:=0 to BoxIDC-1 do
// Ignore(BoxID[x]);
FindTypeEx($FFFF,$FFFF,Box,true);
List:=TStringList.Create;
GetFindedList(List);
fbox:=0;
For x:=0 to List.count-1 do
If IsContainer(StrToInt('$'+List.strings[x])) then
begin
z:=0;
For y:=0 to BoxIDC-1 do
If BoxID[y]=StrToInt('$'+List.strings[x]) then z:=1;
if z=0 then
begin
UseObject(StrToInt('$'+List.strings[x]));
BoxID[BoxIDC]:=StrToInt('$'+List.strings[x]);
BoxIDC:=BoxIDC+1;
checklag(10000);
wait(500);
fbox:=1;
AddToSystemJournal('Box ' + IntToStr(BoxIDC));
end;
end;
List.Free;
until fbox=0;
end;
Code: Select all
const
containerID = $4026416B;
var
i: integer;
procedure fi(container: cardinal);
begin
useobject(container);
checklag(10000);
wait(300);
while findtype($FFFF, container) > 0 do begin
ignore(finditem);
if iscontainer(finditem) then begin
fi(finditem);
continue;
end;
i := i+1;
addtosystemjournal(inttostr(i) + ': $' + inttohex(finditem, 8));
end;
end;
begin
ignorereset;
fi(containerID);
end.