So I have a function that gets the players position:
Simba Code:
function GetMyPos():string;
begin
if FindIconDist(7394286, 13, 15, 0.03, 0.88) and FindIconDist(3174424, 8, 60, 0.20, 2.20) then
begin
result := 'bank';
exit;
end;
if (FindIconDist(8602720, 6, 25, 0.06, 0.41) and FindIconDist(16206088, 6, 27, 0.12, 0.02)) then
begin
result := 'Stone';
exit;
end;
if (FindIconDist(229374, 3, 25, 2.11, 0.42) and seeWater) then
begin
result := 'Alter';
exit;
end else
Result := 'Unknown';
end;
(takes 16 ms and works fine tyvm)
And to find out were I am I do:
And it outputs the correct spot
BUT When ever I try to do this:
Simba Code:
if (GetMyPos = 'Alter') then secretprocedure;
if (GetMyPos = 'Bank') then LocateBank;
If im at the alter it will do secret procedure, but if i'm at the bank it won't do locatebank (and yes it can find the bank)
Any reason why I can't use the function returning a string for more then 1 if statements? Do I have to use a global variable?