rj
2014-03-11 17:20:23
I'm using waitFunc:
When I try to use
I get a access violation at line 120, which is the waitFunc, more specifically, this line:
I have tried doing it as
and
with the same results (no pun intended)
The function I am trying to use to wait:
[spoiler=interface.simba if needed]
Not sure what it is :/ Probably something stupid
function WaitFunc(Func: function: Boolean; WaitPerLoop, MaxTime: Integer): Boolean;
var
T: Integer;
begin
T := GetSystemTime + MaxTime;
while (GetSystemTime < T) do
begin
if (Func()) then
exit(true);
Wait(WaitPerLoop);
end;
end; When I try to use
if waitFunc(@smithingScreen, 40, 4000) thenI get a access violation at line 120, which is the waitFunc, more specifically, this line:
if (Func()) thenI have tried doing it as
if (Func) thenand
if (Func = true) thenwith the same results (no pun intended)
The function I am trying to use to wait:
function smithingScreen():boolean;
begin
result := (_317_getInterfaceName = 'What would you like to make?');
end; [spoiler=interface.simba if needed]
(*
Author: Officer Barbrady
Description: Gets interface TPA
*)
function _317_getInterfaceTPA:TPointArray;
begin
findColorsTolerance(result, 3358536, mainscreen.bounds, 3);
end;
(*
Author: Officer Barbrady
Description: Gets open interface bounds
*)
function _317_getInterfaceBounds:TBox;
begin
result := getTPABounds(_317_getInterfaceTPA);
end;
(*
Author: Officer Barbrady
Description: Returns true if interface is open
*)
function _317_interfaceOpen:boolean;
begin
result := (length(_317_getInterfaceTPA) > 1000);
end;
(*
Author: Officer Barbrady
Description: Gets name of interface
*)
function _317_getInterfaceName:string;
var
b:TBox;
begin
if (not _317_interfaceOpen) then
exit;
b := _317_getInterfaceBounds();
b.y2 := b.y1 + 40;
result := getSimpleText([2070783, 37375, 65535], b.x1, b.y1, b.x2, b.y2, 'upchars07');
end; [/spoiler] Not sure what it is :/ Probably something stupid