SRL Archive - Help

Unknown identifier?


girboy

2013-01-12 03:31:04

So at the moment I'm attempting to learn how to script in simba and I'm running into a few problems with my scripts, I'm not really sure about everything I'm doing so I figured I'd ask the community since you all seem pretty helpful.

What I'm attempting to do with my script at the moment is make it find logs in the bank using a DTM but am getting an error with
If FindDTM(Log, X, Y, MSX1, MSY1, MSX2, MSY2); 
Saying X is an unknown identifier, though in YoHoJo's videos it worked perfectly.

Full script is, if I'm doing something wrong earlier on please let me know.

program dtmtest;
{$i srl/srl.simba}

var
Log: Integer;


begin

SetupSRL;

Log := DTMFromString('mlwAAAHicY2dgYJBkZGBQAWJuIJYGYg0g5gdieSDmAmIOIBYCYjEgFgRiTiBmAOKSED0IAwsWYcANsOuAYCgAAO5kAjo=');

If FindDTM(Log, X, Y, MSX1, MSY1, MSX2, MSY2);
Begin
WriteIn('Found Logs');
MMouse(x, y, 7, 7);
If IsUpText('Logs') Then
Mouse(x, y, 0, 0, True);
End;


FreeDTM(Log);

end.

riwu

2013-01-12 03:33:23

Since Pascal is a strongly typed language, x and y remain 'unknown' to the compiler until they are declared.
So include them in your var declaration:

var
Log, x, y: Integer;

Prometheus

2013-01-12 03:34:40

Be sure to add "x, y" under the "var"

var
Log: Integer;

to

var
x, y, Log: Integer;

girboy

2013-01-12 03:38:04

Thank you both very much.