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

better way to do that

Ask for help
Post Reply
01101011
Neophyte
Neophyte
Posts: 21
Joined: 17.01.2019 0:19

better way to do that

Post by 01101011 »

hi guys, i have a problem with FindType, FindTypeEx and FindTypesArrayEx. I want that function got the first item found in ground, but "finditem" got the last item found, i did that for solve:

Code: Select all

procedure Test;
begin
	while (FindTypesArrayEx(TestType, [$0000], [Ground], false) > 0) do 
	begin  
		if FindTypesArrayEx(TestType, [$0000], [Ground], false) > 0 then
		begin      
			TestList := TStringList.Create;
			GetFindedList(TestList);
			UseObject(StrToInt('$' + TestList.Strings[0]));
			wait(100);
			ignore(StrToInt('$' + TestList.Strings[0]));
			TestList.Free;
		end;
		wait(100);  
	end;
end;
when i use the object, he dissapear. don´t worry about IF =]]]

have any other easy method to do that? for use less processing??? =]]]

ty for atention
User avatar
Vizit0r
Developer
Developer
Posts: 3958
Joined: 24.03.2005 17:05
Contact:

Re: better way to do that

Post by Vizit0r »

no, thats normal mechanics of work in FindType.
"Пишите код так, как будто сопровождать его будет склонный к насилию психопат, который знает, где вы живете". (с) Макконнелл, "Совершенный код".
Post Reply