Sawyer
2015-06-03 21:43:54
Hey, it's Sawyer. I have just returned after a long hiatus. I am getting back into scripting, (lape is new 0.0) and I am having trouble with this function. It keeps returning an error. Where is my mistake? Thank you.
EDIT: I see a few mistakes :p Getting back into the swing of things. Thanks in advance for your help though.
EDIT: I see a few mistakes :p Getting back into the swing of things. Thanks in advance for your help though.
Procedure AttackYellowDot;
var
x, y, i, z:integer;
dot, mmdot:TPointArray;
atpa: array of Tpointarray;
box:tbox;
begin
dot := minimap.getDots(MM_DOT_NPC, minimap.getBounds());
mmdot := minimap.pointsToMainscreen(dot);
if length(mmdot) < 2 then
writeln('No NPCs Found to attack.');
for i := 0 to high(mmdot) do
begin
SortTPAFrom(mmdot[i], mainscreen.getCenterPoint());
box := GetTPABounds(mmdot[i]);
MouseBox(box, MOUSE_RIGHT);
if ChooseOption.select(['Attack', 'ttack', 'ack'], Random(200)) then
begin
writeln('Found an NPC to kill.');
Exit;
end else
Writeln('Did not find an NPC to kill.')
end;
end;