Auto-translated
local x, y = GetObjectPosition(MainHero);
MoveHero(hero, x+random(2), y-random(2), -1);
in an infinite loop
P.S. It can be made more complex with a check for the distance between heroes, and then the hero can be moved using MoveHeroRealTime; I think this is how it is done in the campaigns.
local x, y = GetObjectPosition("Hero2");
function Moov()
while h==1 do
MoveHeroRealTime("Hero3", x+1, y, -1);
end;
I wrote it like this, but the script doesn't work; it says something about x in the line MoveHeroRealTime("Hero3", x+1, y, -1);. As far as I understand, there should be a number there, but instead, it's a variable.