Cool Script for Panic Towers or Crazy Rope Races to make mines in all map.
Code:
procedure InitHooks;
begin
RegisterHook('OnInit', ON_INIT);
end;
procedure OnInit;
var
I,J, NColumns, NChecks : Integer;
ColMine : TWPobj;
LastCol : Boolean;
begin
ColMine := MakeMine(0,0);
//temprorary mine for collision checking
NColumns := MapX div 50;
//50 - distance between mines by X
NChecks := MapY div 4;
// 4 - checking resolution
LastCol := True;
for i := 0 to NColumns do begin
for j := 0 to NChecks do begin
if ColMine.IsCollidesAt(i * 50, j * 4) <> nil then begin
if not LastCol then begin
LastCol := True;
MakeMine(i * 50, (j-1) * 4);
end;
end else LastCol := False;
end;
end;
end;