SRL Archive - First Scripts

Need help on my first script


JNCR

2007-09-17 01:07:47

Hey its JNCR and I am just learning scripting. I decided to make a camelot teleporting script and i am getting the following error message:

Failed when compiling
Line 30: [Error] (12983:1): Identifier expected in script G:\JUSTIN\SCAR 3.11\Scripts\[SRL4] JNCR CammyTelly 1.0.scar

This is my first script so if I am making a stupid noob error please don't hit me too hard :p.

its really simple and lacks antirandoms and yes i will put them in later but first i just need to solve this dumb error. also any other feedback would be greatly appreciated. thanks.

Here's the script:
program CammyTelly;
{.include SRL/SRL.scar}
{.include SRL/SRL/skill/Magic.scar}

Procedure Telly;
var
I : Integer;
begin
I := 0
repeat
wait(2000 + random(2000));
cast('Camelot Teleport');
I := I + 1;
until(I = 10)
Writeln('Completed Teleporting');
Logout;
end;

Procedure DeclarePlayers;
begin

HowManyPlayers := 1;
NumberOfPlayers(HowManyPlayers);
CurrentPlayer := 0;

Players[0].Name :='user';
Players[0].Pass :='pass';
Players[0].Integers[2] := 50; //Loads To Do

Procedure Login;
begin
if not Loggedin then LoginPlayer;
end;

begin
SetupSRL;
DeclarePlayers;
GetSelf.WindowState := wsMinimized;
MouseSpeed := 15 + random(3);
Login;
Telly;
end.

Thanks for future feedback,
~JNCR

HairyDuncan2

2007-09-17 01:36:30

Good work on learning to script!
Identifer expected simply means you started something (procedure) but did not end it.
In your DeclarePlayers procedure you put Begin, the information but did not end it. All you have to do is put an end at the end of your declare players procedure.

Here is your updated script:
program CammyTelly;
{.include SRL/SRL.scar}
{.include SRL/SRL/skill/Magic.scar}

Procedure Telly;
var
I : Integer;
begin
I := 0
repeat
wait(2000 + random(2000));
cast('Camelot Teleport');
I := I + 1;
until(I = 10)
Writeln('Completed Teleporting');
Logout;
end;

Procedure DeclarePlayers;
begin

HowManyPlayers := 1;
NumberOfPlayers(HowManyPlayers);
CurrentPlayer := 0;

Players[0].Name :='';
Players[0].Pass :='';
Players[0].Integers[2] := 50; //Loads To Do
end;

Procedure Login;
begin
if not Loggedin then LoginPlayer;
end;

begin
SetupSRL;
DeclarePlayers;
GetSelf.WindowState := wsMinimized;
MouseSpeed := 15 + random(3);
Login;
Telly;
end.

Keep up the good work!

EDIT: By the way, if your not sure how to fix your errors, I suggest JAD's tutorial. It tell's you what most of the errors mean and how to fix them.
http://www.villavu.com/forum/showthread.php?t=6413

Also you left your username and password in there. I reccomend making two files: one for you and one for the public. Every time you update your script save another copy into the public file.
By the time you get this someone will probably have taken it. Hope it wasn't too valuable. Anyway persist with scripting and in no time you should be a great scripter. If you ever need a hand add me on msn: [email]duncan_bennie@hotmail.com[/email].
Grats on first script.
Good luck scripting!

JNCR

2007-09-17 21:07:32

i forgot the minor detail of hiding my account details :p

got my lvl 30 mining pure with 180k worth of soft clay and essence stolen.:fiery:

oh well that only took 2 nights of autoing to get there :sasmokin:

i can just make another one.

:duh: ,
~JNCR

ammo2006

2007-09-17 21:43:12

Im sorry about that, I sent you a PM about it.
I was thinking about taking it and PMing u about it to get it back. But i decided not to.

SORRY :(

JNCR

2007-09-17 23:20:14

From: ammo2006
Im sorry about that, I sent you a PM about it.
I was thinking about taking it and PMing u about it to get it back. But i decided not to.

SORRY :(


oh that would have been great but thats ok.
it was my fault after all.
dont take the blame for it lol :)

its ok anyway. tonight i will run wizzup? ess miner all night on a new account.

TO ANYBODY WHO WISHES TO HELP:
speaking of wizzup?, is it ok to just use his abyss random solver procedure and credit him? or do i have to ask him first.

dont want to do something that will ban me from forums :p

thanks,
~JNCR

JNCR

2007-09-17 23:32:01

hi couldnt find a fix to error in tut

Line 45: [Error] (12998:45): Type mismatch in script E:\JUSTIN\SCAR 3.11\Scripts\[SRL4] JNCR CammyTelly 1.0.scar

can anyone help?

{<><><><><><><><><><><><><><><><><><><><><><><><>)
{ [SRL4]AutoTelly 1.0 By JNCR }
{ }
{ }
{<><><><><><><><><><><><><><><><><><><><><><><><>}
program CammyTelly;
{.include SRL/SRL.scar}
{.include SRL/SRL/skill/Magic.scar}

Procedure Telly;
var
I : Integer;
begin
if not(LoggedIn) then LoginPlayer;
I := 0
repeat
if not(LoggedIn) then LoginPlayer;
wait(2000 + random(2000));
cast(Players[CurrentPlayer].Integers[2]);
I := I + 1;
until(I = Players[CurrentPlayer].Integers[1])
Writeln('Completed Teleporting');
Logout;
exit;
end;

Procedure DeclarePlayers;
begin
HowManyPlayers := 1;
NumberOfPlayers(HowManyPlayers);
CurrentPlayer := 0;

// For the TeleportToDo you can put any of the following:
// Home Teleport
// Varrock Teleport
// Lumbridge Teleport
// Falador Teleport
// Camelot Teleport
// Ardougne teleport
// Trollheim Teleport

Players[0].Name :='user';
Players[0].Pass :='pass';
Players[0].Integers[1] := 50; //Teleports To Do
Players[0].Integers[2] := 'Camelot Teleport';
Players[0].Active := True;
{
Players[1].Name :='user'; // In the case that you
Players[1].Pass :='pass'; // have more than 1 account
Players[1].Integers[1] := 50; //Teleports To Do // then remove brackets
Players[1].Integers[2] := 'Camelot Teleport'; // surrounding unused
Players[1].Active := True; // players.

Players[2].Name :='user';
Players[2].Pass :='pass';
Players[2].Integers[1] := 50; //Teleports To Do
Players[2].Integers[2] := 'Camelot Teleport';
Players[2].Active := True;

Players[3].Name :='user';
Players[3].Pass :='pass';
Players[3].Integers[1] := 50; //Teleports To Do
Players[3].Integers[2] := 'Camelot Teleport';
Players[3].Active := True;
}
NickNameBMP := CreateBitmapMaskFromText(Players[CurrentPlayer].Nick, UpChars);
end;

begin
SetupSRL;
DeclarePlayers;
GetSelf.WindowState := wsMinimized;
MouseSpeed := 15 + random(3);
Telly;
end.

oh and yes the script is not completed

zenma

2007-09-17 23:39:29

From: JNCR
hi couldnt find a fix to error in tut

Line 45: [Error] (12998:45): Type mismatch in script E:\JUSTIN\SCAR 3.11\Scripts\[SRL4] JNCR CammyTelly 1.0.scar

can anyone help?

{<><><><><><><><><><><><><><><><><><><><><><><><>)
{ [SRL4]AutoTelly 1.0 By JNCR }
{ }
{ }
{<><><><><><><><><><><><><><><><><><><><><><><><>}
program CammyTelly;
{.include SRL/SRL.scar}
{.include SRL/SRL/skill/Magic.scar}

Procedure Telly;
var
I : Integer;
begin
if not(LoggedIn) then LoginPlayer;
I := 0
repeat
if not(LoggedIn) then LoginPlayer;
wait(2000 + random(2000));
cast(Players[CurrentPlayer].Integers[2]);
I := I + 1;
until(I = Players[CurrentPlayer].Integers[1])
Writeln('Completed Teleporting');
Logout;
exit;
end;

Procedure DeclarePlayers;
begin
HowManyPlayers := 1;
NumberOfPlayers(HowManyPlayers);
CurrentPlayer := 0;

// For the TeleportToDo you can put any of the following:
// Home Teleport
// Varrock Teleport
// Lumbridge Teleport
// Falador Teleport
// Camelot Teleport
// Ardougne teleport
// Trollheim Teleport

Players[0].Name :='user';
Players[0].Pass :='pass';
Players[0].Integers[1] := 50; //Teleports To Do
Players[0].Integers[2] := 'Camelot Teleport';
Players[0].Active := True;
{
Players[1].Name :='user'; // In the case that you
Players[1].Pass :='pass'; // have more than 1 account
Players[1].Integers[1] := 50; //Teleports To Do // then remove brackets
Players[1].Integers[2] := 'Camelot Teleport'; // surrounding unused
Players[1].Active := True; // players.

Players[2].Name :='user';
Players[2].Pass :='pass';
Players[2].Integers[1] := 50; //Teleports To Do
Players[2].Integers[2] := 'Camelot Teleport';
Players[2].Active := True;

Players[3].Name :='user';
Players[3].Pass :='pass';
Players[3].Integers[1] := 50; //Teleports To Do
Players[3].Integers[2] := 'Camelot Teleport';
Players[3].Active := True;
}
NickNameBMP := CreateBitmapMaskFromText(Players[CurrentPlayer].Nick, UpChars);
end;

begin
SetupSRL;
DeclarePlayers;
GetSelf.WindowState := wsMinimized;
MouseSpeed := 15 + random(3);
Telly;
end.

oh and yes the script is not completed

you are trying to make an integer equal a string.
Edit: notice the line read what it says Players[0].Integers[2] thats why it doenst work.

JNCR

2007-09-17 23:59:06

From: zenma
you are trying to make an integer equal a string.
Edit: notice the line read what it says Players[0].Integers[2] thats why it doenst work.


so how do i fix this? do i make it Players[0].Strings[0]?

Method

2007-09-18 00:08:22

Yes, that should work.

JNCR

2007-09-18 00:30:16

yes thanks it does

also, for player 1, should it be

Players[1].Strings[1]
instead of
Players[1].Strings[0]

Method

2007-09-18 00:52:43

Players[1].Strings[0] is what it should be, but I don't think it matters much.