SCAR Code:
function AmountOfRunes(WhatIndex: integer): integer;
var
ThePoint: TPoint;
a, b: integer;
Box: TBox;
begin
if not LoggedIn then Exit;
if not GetCurrentTab = 5 then
GameTab(5);
GetInvItemBounds(WhatIndex, Box);
if FindColorSpiralTolerance(a, b, 10987695, Box.x1, Box.y1, Box.x2, Box.y2, 5) then
begin
ThePoint := ItemCoords(WhatIndex);
Result := GetAmount(ThePoint.x, ThePoint.y);
Exit;
end;
Writeln('That index contains no runes.');
end;
So here is my function.
Then I get...
Code:
[Runtime Error] : Exception: Canvas does not allow drawing in line 119 in script C:\Program Files\SCAR 3.22\Includes\SRL\SRL\Core\Amount.scar
Sometimes when i restart scar it works once, but then it fails again! Please help.