SRL Archive - OSR Help

Another Indentifier Expected.


TwoClover

2012-02-16 03:56:29

I'm working on finishing up my first script. I keep on running into errors but I've got it down for the most part. But this one though is frustrating the hell out of me.



procedure BankToMuseum;
var
x, y, i: Integer;
WalkPathToMuseum: TPointArray;
begin
if (LoggedIn) then
begin
if not FindNormalRandoms then
begin
MakeCompass('n');
Writeln('Walking to Museum...');
BankToMuseum := [Point(51, 175), Point(52, 139), //give me the error at this line, if i comment it out give me an error
Point(23, 136), Point(20, 106), //at this line and the next one as well.
Point(21, 80), Point(24, 55)];
if SPS_WalkPath(BankToMuseum) then
Writeln('At the Museum!');
end else
Writeln('found Random!');
end;
end;

I know i probably will have to add a ";" somewhere to it but i have no idea where. any help is greatly appreciated. :)

It highlights this instance when I set the SPS path for walking. before all the "Points"

Nataurs

2012-02-16 05:00:37

Based on that procedure, you have declared 'WalkPathToMuseum' as a TPointArray and you have set 'BankToMuseum' (the name of the procedure) as the co-ordinates for the SPS. Try swapping those around and see if it works :D.


procedure BankToMuseum;
var
x, y, i: Integer;
WalkPathToMuseum: TPointArray;
begin
if (LoggedIn) then
begin
if not FindNormalRandoms then
begin
MakeCompass('n');
Writeln('Walking to Museum...');
WalkPathToMuseum := [Point(51, 175), Point(52, 139), //give me the error at this line, if i comment it out give me an error
Point(23, 136), Point(20, 106), //at this line and the next one as well.
Point(21, 80), Point(24, 55)];
if SPS_WalkPath(WalkPathToMuseum) then
Writeln('At the Museum!');
end else
Writeln('found Random!');
end;
end;

TwoClover

2012-02-16 06:01:20

From: Nataurs
Based on that procedure, you have declared 'WalkPathToMuseum' as a TPointArray and you have set 'BankToMuseum' (the name of the procedure) as the co-ordinates for the SPS. Try swapping those around and see if it works :D.


procedure BankToMuseum;
var
x, y, i: Integer;
WalkPathToMuseum: TPointArray;
begin
if (LoggedIn) then
begin
if not FindNormalRandoms then
begin
MakeCompass('n');
Writeln('Walking to Museum...');
WalkPathToMuseum := [Point(51, 175), Point(52, 139), //give me the error at this line, if i comment it out give me an error
Point(23, 136), Point(20, 106), //at this line and the next one as well.
Point(21, 80), Point(24, 55)];
if SPS_WalkPath(WalkPathToMuseum) then
Writeln('At the Museum!');
end else
Writeln('found Random!');
end;
end;


Yes thanks, I ended up figuring it out by just messing around with it a little. I went through my whole scirpt and fixed every compiling issue. Now i just have an issue when I run the script. After I log in it opens the bank, closes it, then logs out. :(

Nataurs

2012-02-16 07:55:59

Hmm, paste your banking method so we can try and fix it for you :D

TwoClover

2012-02-17 06:03:37

From: Nataurs
Hmm, paste your banking method so we can try and fix it for you :D


function Banking: Boolean;
var
p, t: Integer;

begin
if not LoggedIn then
Exit;
Result:= false;
t := 0; //Tries starts at zero
repeat
Inc(t);
SetAngle(SRL_ANGLE_HIGH);
Writeln('Trying to open the bank: ' + IntToStr(t) + ' out of 6');
OpenBankFast('veb');
Wait(Random(700));
until BankScreen or PinScreen or (t > 5);

if PinScreen then
begin
p := 0;
repeat
InPin(Players[0].Pin);
Inc(p)
until BankScreen or (p > 0) or not (LoggedIn);
end;

if BankScreen then
begin
Writeln('Opened the bank...');
DepositAll;
if Players[0].Booleans[1] then
begin;
CloseBank;
Result:= true;
end else
begin
Exit;
end;
end;
end;

You can look at my whole code if you want. I have it under the First Scripts section as TC's VEB Yew Chop and Bank.