Forum in READ ONLY mode! All questions and discussions on Discord official server, invite link: https://discord.gg/VxsGzJ7

i want to find item id, not type

Only working scripts
Post Reply
mixers
Neophyte
Neophyte
Posts: 49
Joined: 03.10.2013 14:11

i want to find item id, not type

Post 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.
mixers
Neophyte
Neophyte
Posts: 49
Joined: 03.10.2013 14:11

Re: i want to find item id, not type

Post by mixers »

ok , i know ,
'GetDistance' can help me.
now i want know how to find item by id?
Crome696
Novice
Novice
Posts: 67
Joined: 04.03.2012 18:57
Location: Germany
Contact:

Re: i want to find item id, not type

Post 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.
Stealth Development Team & Support
drabadan
Expert
Expert
Posts: 730
Joined: 13.12.2012 17:35
Contact:

Re: i want to find item id, not type

Post 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?
mixers
Neophyte
Neophyte
Posts: 49
Joined: 03.10.2013 14:11

Re: i want to find item id, not type

Post by mixers »

i finded 2 same type item,if i need item in backpack, so unquip all armor and equip the item.
thanks.
Crome696
Novice
Novice
Posts: 67
Joined: 04.03.2012 18:57
Location: Germany
Contact:

Re: i want to find item id, not type

Post 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
!
Stealth Development Team & Support
drabadan
Expert
Expert
Posts: 730
Joined: 13.12.2012 17:35
Contact:

Re: i want to find item id, not type

Post 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.
Post Reply