SRL Archive - Help and Support

Help with my new Procedure;


Cheesehunk

2006-05-20 00:41:22

How can I fix this compiling error:
Line 7: [Error] (12129:19): Syntax error in script

Here is the Procedure:
[PHP]Procedure FollowPlayerToBank(WhichBank : string);
var TheBank: String;
begin
case WhichBank of
'feb': TheBank := if Random(2) = 1 then 'falador east' else 'fally east';
'fwb': TheBank := if Random(2) = 1 then 'falador west' else 'fally west';
'vwb': TheBank := 'varrock west';
'veb': TheBank := 'varrock east';
'akb': TheBank := 'al kharid';
'db' : TheBank := 'draynor';
'eb' : TheBank := if Random(2) = 1 then 'edgy' else 'edgeville';
end;

begin
SetupSRL;
FollowPlayerToBank('feb');
end.[/PHP]

Of course, this Procedure isn't nearly done, it will be a last desperation attempt to get to the desired bank when your script is lost!

Thanks for the help in advance,
Cheesehunk.

Bebe

2006-05-20 00:43:46

It should be
'TheBank'
because you have TheBank as a string :)

Cheesehunk

2006-05-20 00:44:36

Rofl, oops, I forgot that was a String, thanks Bebe.

WhiteShadow

2006-05-20 00:46:11

Why do you need TheBank anyways? why not just 'w/e' : if()then

Cheesehunk

2006-05-20 00:50:42

From: WhiteShadow
Why do you need TheBank anyways? why not just 'w/e' : if()then


Because later in the script int will use
TypeSend('Can anyone take me to'TheBank' bank please?'

Or something like that..

I might just use
if WhichBank = 'feb' then TypeSend('etc..'

My bad..


Edit: got it completely figured out, thanks.

WhiteShadow

2006-05-20 00:53:09

:p , it was just a question, do it your way if you want.

Also very good idea Chuck! ;)

phantombmx

2006-05-20 01:13:39

you also CLEARLY left out an end; ;)

WhiteShadow

2006-05-20 01:17:55

From: phantombmx
you also CLEARLY left out an end; ;)


I forgot case of's need an end. Meh, he would of found out later.

Cheesehunk

2006-05-20 01:19:34

From: WhiteShadow
I forgot case of's need an end. Meh, he would of found out later.


I already found out, boy, do I make a lot of simple mistakes or what?

WhiteShadow

2006-05-20 01:32:51

From: Cheesehunk
I already found out, boy, do I make a lot of simple mistakes or what?


No problemo happens to everyone. I commonly forget to add a ")".