Page 1 of 1

Another 'my code is optimized?' thread.

Posted: 25.06.2016 7:39
by nyce
Hello, its me again :roll: with another question :lol:

What i plan with this script is drop 1 item for each tile around the character, using max distance allowed (2). 5x5, 25 tiles.

I feel it's taking a bit long to drop all 25, anything i can do to make it faster?

The server i play theres no delay to drop itens into ground.

Code: Select all

Procedure drop;
var x, y, myx, myy, myz : Integer;

begin
  myx := GetX(self);
  myy := GetY(self);
  myz := GetZ(self);
  DropDelay := 0; 
  for x := -2 to 2 do
  begin
    for y := -2 to 2 do
    begin
      FindType($1EBB,Backpack);
      MoveItem(FindItem,1,ground,myx+x,myy+y,myz);
    end;
  end;
end;

begin
  drop;
end.

Re: Another 'my code is optimized?' thread.

Posted: 28.06.2016 6:51
by nyce
any faster way to do this?

need advice.

Re: Another 'my code is optimized?' thread.

Posted: 29.06.2016 20:12
by Vizit0r
nyce wrote:I feel it's taking a bit long to drop all 20, anything i can do to make it faster?
No.