I want to make one function which handles the walking with radialwalktolerance (failsafes will be added when the following gets sorted out) So I created a function which depending on what whichway:string, will walk to the trees, the shop, or simply state it couldn't find the starting location.
SCAR Code:
function WalkDetails(whichway: string): Array of integer;
var
Trees: Array[0..1] of Integer;
begin
case lowercase(whichway) of
'Trees' : Trees := Result := [1,1];//testing again, put anything in there to test
'Shop' : Trees := Result := [140, 220];
'NoWhere' : WaitR('Location cannot be found! ', 100, 150, 1, True, True, True, True);//custom function
end;
end;
function WalkToWhere: boolean;
var
MapTPA: TPointArray;
Tries: integer;
begin
if WalkDetails('Shop') then Writeln('loaded shop details');//TEMP- only to test (I'll use player loc to determine where to go later)
FindColorsSpiralTolerance(MMCX, MMCY, MapTPA, LumbyRoad, MMX1, MMY1, MMX2, MMY2, 20);
if (Length(MapTPA) = 0) then Result := False;
if (not (rs_OnMiniMap(MapTPA[i].x, MapTPA[i].y))) then Exit;
repeat
RadialWalkTolerance(LumbyRoad, Trees[0], Trees[1], 70, 2, 1, 10);
if (FlagPresent) then
begin
Flag;
Result := True;
if (Result) then exit;
end else
begin
Inc(Tries);
Continue;
end;
until(Tries = 5 or (not(LoggedIn)));
end;
[What i wanted to do]: I wanted to make a function which saved StartRadial and EndRadial and kept it for later use. I added it in WalkToWhere:boolean and then tried
SCAR Code:
RadialWalkTolerance(LumbyRoad, Trees[0], Trees[1], 70, 2, 1, 10);
So that it would search depending where the character is.
__________________________________________________ _______________
[My Error]
Well, I've tried everything xD and i still get
SCAR Code:
Line 231: [Error] (22850:27): Semicolon (';') expected in script C:\Users\-\Desktop\scarprerelease\Scripts\ScriptDirectory\MyChopper\D's Lumby Chop n Sell.scar
whenever i run/compile the script.
Would someone mind looking through the script? I'm really confused of what's happening.