SRL Archive - OSR Help

Comparing two function...


Element17

2013-03-05 23:13:41

Why does this work? This one moves the other doesn't.

I call them like this.


setupsrl;
paths;
sps_setup(runescape_other,['DuelAR']);
writeln(sps_getmypos);
LetsGo;
That works but this doesn't

setupsrl;
path;
sps_setup(runescape_other['DuelAr']);
writeln(sps_getmypos);
Walking('Area');

Procedure LetsGo;
begin

if sps_walkpath(toarea) then
writeln('moving')
else
writeln('not moving');

end;

and this doesn't:


Function Walking(Which: String): Boolean;
begin
If(Not(LoggedIn)) Then Exit;
Result := False;
case Lowercase(Which) of
'Area':
begin
if SPS_WalkPath(ToArea) then
status := 'walking to the portal'
else begin
status := 'failed walking to the portal';
writeln(status + ' time running:' +timerunning);
end;
writeln(status + 'time running:' +timerunning);
end;

'Portal':
begin
if SPS_WalkPath(ToPort) then
status := 'walking to the portal'
else begin
status := 'failed walking to portal';
Writeln(status + 'time running:' +timerunning);
end;
Writeln(status + 'time running:' +timerunning);
begin
Writeln('Walking to '+Which);
FFlag(0);
end;
end;
end;
end;

Ashaman88

2013-03-05 23:15:08

Area and portal should be lowercase

Runehack123

2013-03-05 23:16:39

From: Ashaman88
Area and portal should be lowercase


Just when I thought SimbaPascal wasn't case sensitive whatsoever! :o

Element17

2013-03-06 04:04:39

:duh: thank you.

i luffs yeww

2013-03-06 04:22:28

From: Runehack123
Just when I thought SimbaPascal wasn't case sensitive whatsoever! :o


First, SimbaPascal isn't a thing. It's PascalScript. Second, strings are case sensitive because 'A' is much different from 'a'. And OP is doing case Lowercase(Which) and comparing it to 'Area' and 'Portal,' which means it will never happen, as it's comparing Which in lowercase.

Also, in some other languages, string comparison will only be true if the strings are pointing to the same objects, so a = 'hi'; b = 'hi'; print(a = b); could print false.

The more you know!