Page 1 of 1

FindType()

Posted: 2004-08-17 21:46:19
by Dmitrij
exists some way to get every object which i found with findtype??

(findtype returns first (or last) object of this type, but i need get every object in sequence)

Posted: 2004-08-18 00:47:25
by 333333
Use uo.ignore('finditem') in cycle.

Posted: 2004-08-18 16:30:33
by Dmitrij
thanks, this is result of my reserch:

Code: Select all

sub FindSequence(type,color,container)
   UO.FindType(type,color,container);
   if (UO.FindCount() > 0) then
      UO.Ignore("finditem");
      return UO.GetSerial("finditem");
   else
      UO.IgnoreReset();
      UO.FindType(type,color,container);
      UO.Ignore("finditem");
      return UO.GetSerial("finditem");
   endif
end sub


calling this function in sequence returns ID (serial) every object of assigned type / color / container...

after minor repair get same set of serials, but last call of function returns serial "0x00000000" (empty result -> e.g. for finishing cycles):

Code: Select all

sub FindSequence(type,color,container)
   UO.FindType(type,color,container);
   if (UO.FindCount() > 0) then
      UO.Ignore("finditem");
      return UO.GetSerial("finditem");
   else
      UO.IgnoreReset();
      return UO.GetSerial("finditem");
   endif
end sub