SRL Archive - RS3 Help

Result := _______ - how do I do these?


Wu-Tang Clan

2014-01-25 20:59:20

function WhereAreWe(): Boolean;
var
p: Tpoint;
begin
if (minimap.findSymbol(p, MM_SYMBOL_BANK, minimap.getBounds)) or (minimap.findSymbol(p, MM_SYMBOL_MINIGAME, minimap.getBounds)) then
begin
Result := Lobby;
end;
if not (minimap.findSymbol(p, MM_SYMBOL_BANK, minimap.getBounds)) or not (minimap.findSymbol(p, MM_SYMBOL_MINIGAME, minimap.getBounds)) then
begin
Result := Cave;
end;
end;

Exception in Script: Unknown declaration "Result" at line 52, column 7
Exception in Script: Unknown declaration "Cave" at line 56, column 17

how do I declare these so they compile/properly declare?

Sjoe

2014-01-25 21:04:49


function WhereAreWe(): String;
var
p: Tpoint;
begin
if (minimap.findSymbol(p, MM_SYMBOL_BANK, minimap.getBounds)) or (minimap.findSymbol(p, MM_SYMBOL_MINIGAME, minimap.getBounds)) then
Result := 'Lobby';

if not (minimap.findSymbol(p, MM_SYMBOL_BANK, minimap.getBounds)) or not (minimap.findSymbol(p, MM_SYMBOL_MINIGAME, minimap.getBounds)) then
Result := 'Cave';
end;

Wu-Tang Clan

2014-01-25 21:24:28

From: Sjoe

function WhereAreWe(): String;
var
p: Tpoint;
begin
if (minimap.findSymbol(p, MM_SYMBOL_BANK, minimap.getBounds)) or (minimap.findSymbol(p, MM_SYMBOL_MINIGAME, minimap.getBounds)) then
Result := 'Lobby';

if not (minimap.findSymbol(p, MM_SYMBOL_BANK, minimap.getBounds)) or not (minimap.findSymbol(p, MM_SYMBOL_MINIGAME, minimap.getBounds)) then
Result := 'Cave';
end;


Then how do I call the result in another procedure?

if (WhereAreWe = Lobby) then...

doesn't work…

Clarity

2014-01-25 21:30:25

From: Wu-Tang Clan
Then how do I call the result in another procedure?

if (WhereAreWe = Lobby) then...

doesn't work…



if (WhereAreWe = 'Lobby') then...


Justin

2014-01-25 21:30:57

From: Wu-Tang Clan
Then how do I call the result in another procedure?

if (WhereAreWe = Lobby) then...

doesn't work…


if (WhereAreWe = 'Lobby') then...

E: Ninja'd by @acredelta;

AliveDrive

2014-02-14 17:05:53

Thanks this is just what I was looking for.

Let's say I want to tell if it's in one of two locations, and if not there, then another check determines if I am in a cave or not.

function GPS(): String;
var
p: Tpoint;
begin
if (minimap.findSymbol(p, MM_SYMBOL_BANK, minimap.getBounds)) then
Result := 'Bank';

if (minimap.findSymbol(p, MM_SYMBOL_SHOP_MAGIC, minimap.getBounds)) then
Result := 'Shop';

if not (minimap.findSymbol(p, MM_SYMBOL_BANK, minimap.getBounds)) or not (minimap.findSymbol(p, MM_SYMBOL_SHOP_MAGIC, minimap.getBounds)) then
Result := 'Cave';
end;