Page 1 of 1

i want to find item id, not type

Posted: 10.02.2014 13:21
by mixers

Code: Select all

Program New;
const 
pet = $0001C94A;

procedure waitpet;
begin
  repeat
  finddistance := 2;
  findtype(pet,ground);
  addtosystemjournal(inttostr(finditem));
  until finditem > 0;
end;

begin
  
  repeat
  movexy(1206,1536,true,0,false);
  waitpet
  movexy(1207,1522,true,0,false);
  waitpet
  until dead;

end.
finditem value is 0.

Re: i want to find item id, not type

Posted: 10.02.2014 13:53
by mixers
ok , i know ,
'GetDistance' can help me.
now i want know how to find item by id?

Re: i want to find item id, not type

Posted: 10.02.2014 15:29
by Crome696
mixers wrote:ok , i know ,
'GetDistance' can help me.
now i want know how to find item by id?
you cant directly Search for an ID. The possibilitys to look if the ID exist or is valid would be that you check "isObjectExist" and then check the Distance.
Finding Objects in the Objectlist for the ID wouldnt make sense, because you know already that 1 unique ID you want to use for refering.

Re: i want to find item id, not type

Posted: 10.02.2014 15:36
by drabadan
mixers wrote:ok , i know ,
'GetDistance' can help me.
now i want know how to find item by id?

Code: Select all

procedure FindSmthById(Id : Cardinal);
begin
  IgnoreReset;
  while FindType($FFFF, Ground) > 0 then
    begin
      if FindItem = Id then 
        begin
          AddToSystemJournal('Found It!')
          Break;  
       end
     else
       Ignore(FindItem);
end;
But, why do you need this?

Re: i want to find item id, not type

Posted: 11.02.2014 6:54
by mixers
i finded 2 same type item,if i need item in backpack, so unquip all armor and equip the item.
thanks.

Re: i want to find item id, not type

Posted: 13.02.2014 0:36
by Crome696
mixers wrote:i finded 2 same type item,if i need item in backpack, so unquip all armor and equip the item.
thanks.
Check if Item is Exist, then check if Parent of Item is Backpack. there you go
!

Re: i want to find item id, not type

Posted: 13.02.2014 1:33
by drabadan
Crome696 wrote:
mixers wrote:i finded 2 same type item,if i need item in backpack, so unquip all armor and equip the item.
thanks.
Check if Item is Exist, then check if Parent of Item is Backpack. there you go
!
or... you can use it directly without finding smth.