SRL Archive - OSR Help

Problems with creating a location test that moves on


theachiever

2013-05-08 15:37:45

Hello there! Thanks for spending a little time to see if you can help me. I'm in the process of creating a flaxing script and I wanted to create a procedure that checks the location (either bank or flax field) and starts from either spot. The goal is to allow the user to start at either the flax field or the bank. The problem I have is that when I want to make the script continue to it's locations objective (if it's at the bank it will walk to field or bank, if it's at the field it will walk to bank or start picking). Here's the script

Procedure CheckLocationFlax;
var x, y : integer;

begin
Writeln('CheckLocationField');
SetAngle(SRL_ANGLE_HIGH);
MakeCompass('N');
if FindColorSpiralTolerance(x, y, 15065490, 1, 1, 520, 329, 20) then
begin
MMouse(x, y, 5, 5);
if IsUpText('ick') then
writeln('Flax found...Location Set to Field!');
PickFlax; //////Here is where it gives me an error*
end else
begin
MakeCompass('E');
if FindColorSpiralTolerance(x, y, 15065490, 1, 1, 520, 329, 20) then
begin
MMouse(x, y, 5, 5);
if IsUpText('ick') then
writeln('Flax found...Location Set to Field!')
end else
begin
writeln('unable to find flax. Attempting again. [2]');
MakeCompass('S');
if FindColorSpiralTolerance(x, y, 15065490, 1, 1, 520, 329, 20) then
begin
MMouse(x, y, 5, 5);
if IsUpText('ick') then
writeln('Flax found...Location Set to Field!');
end else
begin
writeln('unable to find flax. Attempting again. [3]');
MakeCompass('W');
if FindColorSpiralTolerance(x, y, 15065490, 1, 1, 520, 329, 20) then
begin
MMouse(x, y, 5, 5);
if IsUpText('ick') then
writeln('Flax found...Location Set to Field!');
end else
begin
writeln('unable to find flax. Must be at bank!');
end;
end;
end;
end;
end;

It gives me the error:

Unknown identifier 'PickFlax' at line 31
Compiling failed.

However I can use this PickFlax; line elsewhere and it continues no problem. What am I missing? Please help and thanks!

Ian

2013-05-08 19:07:52

Could you post then entire script? You probably have this procedure above your PickFlax procedure so Simba doesn't see it, put this under your PickFlax procedure and it should work :)

theachiever

2013-05-09 13:20:34

From: BMWxi
Could you post then entire script? You probably have this procedure above your PickFlax procedure so Simba doesn't see it, put this under your PickFlax procedure and it should work :)


Thanks BMWxi! That worked perfectly! What a silly silly little error.