Hi, I've been working on some scripts over the last few months and after updating OGL yesterday I've been having nightmares trying to get things up and running again.
I've fixed quite a few errors so far but am stuck on one with this IconWalk function.
Is there an easy fix I'm missing or should I update all my walking to use inDirection/TileWalk (or something else)?
Thanks a lot.
Code:
Error: Can't assign "record [0]Int32; [4]Int32; [8]Int32; [12]Int32; [16]Int32; [20]record [0]Int32; [4]Int32; [8]Int32; [12]Int32; end; end" to "record [0]Int32; [4]Int32; end" at line 526
Code:
function iconWalk(randomization: integer; icon: glTextureArray; offSetTiles: TPoint; maxWait : Integer = 15000): boolean;
var
rx, ry :integer;
closestIcon, pPoint : TPoint;
begin
rx := randomrange(-(randomization), randomization);
ry := randomrange(-(randomization), randomization);
if icon.isEmpty() then
result:=false
else
begin
pPoint := minimap.getScreenPosition(minimap.getLocalPosition());
closestIcon := icon.closestTo(pPoint)[0];
mouse.click(minimap.getScreenPosition(minimap.getLocalPosition(closestIcon).adjustposition(offsetTiles.x+rx, offsetTiles.y+ry)), 1);
if ((offSetTiles.y > 20) or (offSetTiles.y < -20)) or ((offSetTiles.x > 15) or (offSetTiles.x < -15)) then
wait(3500)
else
wait(1000);
waitFlag(maxWait);
exit(true);
end;
exit(false);
end;