SRL Archive - OSR Help

Identifier Expected Error with functions?


RSisDead

2012-06-18 21:48:10

I get errors like this all the time, but for this one i am stumped!
Procedure Superheat;
begin
Mouse(743, 183, 2, 2, true);
Wait(1000);
Mouse(646, 328, 2, 2, true);
Wait(1000);
Mouse(710, 440, 2, 2, true);
SH_Reset:=SH_Reset+1;
Function Further_Heat :boolean;
begin
Mouse(648, 327, 2, 2, true);
Wait)Randomrange(1000, 1050));
Mouse(712, 446, 2, 2, true);
SH_Reset:=SH_Reset+1;
If SH_Reset = 27 then
begin
Banking;
SH_Reset:=SH_Reset-27;
Wait(3000);
Superheat;
end else
Further_Heat;
end;

My error is at the line Function Further_Heat :boolean; I don't know what i did wrong!

John

2012-06-18 21:54:43

From: RSisDead
I get errors like this all the time, but for this one i am stumped!
Procedure Superheat;
begin
Mouse(743, 183, 2, 2, true);
Wait(1000);
Mouse(646, 328, 2, 2, true);
Wait(1000);
Mouse(710, 440, 2, 2, true);
SH_Reset:=SH_Reset+1;
Function Further_Heat :boolean;
begin
Mouse(648, 327, 2, 2, true);
Wait)Randomrange(1000, 1050));
Mouse(712, 446, 2, 2, true);
SH_Reset:=SH_Reset+1;
If SH_Reset = 27 then
begin
Banking;
SH_Reset:=SH_Reset-27;
Wait(3000);
Superheat;
end else
Further_Heat;
end;

My error is at the line Function Further_Heat :boolean; I don't know what i did wrong!

It's best to show your whole script, i think you need an end though at the end of the first procedure.

riwu

2012-06-18 21:54:53

U did not put an "end" after ur Superheat procedure.
If u "begin" something, always end it ;)

RSisDead

2012-06-18 21:57:59

From: John
It's best to show your whole script, i think you need an end though at the end of the first procedure.


program LukesSuperHeater;
{$DEFINE SMART}
{.include SRL/SRL/Misc/Smart.simba}
{.include SRL/SRL.simba}
{.include SRL/SRL/Skill/Magic.simba}
{$i sps/sps.simba}
{$i SRL/SRL/misc/paintsmart.simba}
Var
SH_Reset :extended;
procedure DeclarePlayers;
begin

HowManyPlayers := 1; // Set this to one if you are not sure what you are doing.
NumberOfPlayers(HowManyPlayers);
CurrentPlayer := 0;
Players[0].Name := ''; // Put your username in between the ''
Players[0].Pass := '; // Put your password in between the ''
Players[0].Nick := '';
Players[0].Member := True; // Are you a member?
Players[0].Active := True;
Players[0].Pin := ''; // Put your pin in between the ''
Players[0].BoxRewards := ['Xp', 'mote', 'ostume', 'oins', 'aphire', 'ssence']
end;



Function Banking :boolean;
begin
MakeCompass('W')
SetAngle(SRL_ANGLE_HIGH);
OpenBankNPC;
Deposit(2, 28, true);
Withdraw(10, 1, 28);
CloseBank;
end;
Procedure Superheat;
begin
Mouse(743, 183, 2, 2, true);
Wait(1000);
Mouse(646, 328, 2, 2, true);
Wait(1000);
Mouse(710, 440, 2, 2, true);
SH_Reset:=SH_Reset+1;
end;
Function Further_Heat :boolean;
begin
Mouse(648, 327, 2, 2, true);
Wait)Randomrange(1000, 1050));
Mouse(712, 446, 2, 2, true);
SH_Reset:=SH_Reset+1;
If SH_Reset = 27 then
begin
Banking;
SH_Reset:=SH_Reset-27;
Wait(3000);
Superheat;
end else
Further_Heat;

end;


Function Execute :boolean;
begin
smart_server := 91;
smart_members := false;
smart_signed :=true;
smart_superdetail := false;
SetupSRL;
DeclarePlayers;
LoginPlayer;
end;
begin
Execute;
Superheat;
end.
I ended Superheat, so i added a call to the function Furtherheat to hit but since in the order that it compiles it doesnt know what Furtherheat is, so i'm moving it above Superheat. Thanks,

RSisDead

2012-06-18 22:07:47

From: riwu
U did not put an "end" after ur Superheat procedure.
If u "begin" something, always end it ;)

So, i just added an include file to it with Further_Heat that would just describe that… BUT SAME ERROR! GRRRR….

program Classes;
{$DEFINE SMART}
{.include SRL/SRL/Misc/Smart.simba}
{.include SRL/SRL.simba}
{.include SRL/SRL/Skill/Magic.simba}
{$i sps/sps.simba}
{$i SRL/SRL/misc/paintsmart.simba}
begin
Procedure Further_Heat
begin
Mouse(648, 327, 2, 2, true);
Wait(Randomrange(1000, 1050));
Mouse(712, 446, 2, 2, true);
SH_Reset:=SH_Reset+1;
If (Reset = 27) then
begin
Banking;
SH_Reset:=SH_Reset-27;
Wait(3000);
Superheat;
end else
Further_Heat;

end;
begin
end.
Identifier expected at line 9
Compiling failed.

That's the entire include file! WTF?

riwu

2012-06-18 22:25:04

From: RSisDead
So, i just added an include file to it with Further_Heat that would just describe that… BUT SAME ERROR! GRRRR….

program Classes;
{$DEFINE SMART}
{.include SRL/SRL/Misc/Smart.simba}
{.include SRL/SRL.simba}
{.include SRL/SRL/Skill/Magic.simba}
{$i sps/sps.simba}
{$i SRL/SRL/misc/paintsmart.simba}
begin
Procedure Further_Heat
begin
Mouse(648, 327, 2, 2, true);
Wait(Randomrange(1000, 1050));
Mouse(712, 446, 2, 2, true);
SH_Reset:=SH_Reset+1;
If (Reset = 27) then
begin
Banking;
SH_Reset:=SH_Reset-27;
Wait(3000);
Superheat;
end else
Further_Heat;

end;
begin
end.
Identifier expected at line 9
Compiling failed.

That's the entire include file! WTF?

Im not sure what u are trying to do now, are u attempting to create an include for urself so that u can use the function backwards? That wont work because ur include file will have unknown procedures (that are actually in ur main script)
Use
function Further_Heat: Boolean; forward;

instead.

Btw the error with ur include is that there is a begin out of nowhere above ur procedure, but even if u remove that it still wont compile. And include doesn't work like this, u wont even need the program title and include other includes in that include file, a personal include file just consist of procedures. I suggest u dont go into that before u truly understand whats it all about.

RSisDead

2012-06-18 22:31:44


program LukesSuperHeater;
{$DEFINE SMART}
{.include SRL/SRL/Misc/Smart.simba}
{.include SRL/SRL.simba}
{.include SRL/SRL/Skill/Magic.simba}
{$i sps/sps.simba}
{$i SRL/SRL/misc/paintsmart.simba}
Var
SH_Reset :extended;
procedure DeclarePlayers;
begin

HowManyPlayers := 1; // Set this to one if you are not sure what you are doing.
NumberOfPlayers(HowManyPlayers);
CurrentPlayer := 0;
Players[0].Name := 'fredbe'; // Put your username in between the ''
Players[0].Pass := ''; // Put your password in between the ''
Players[0].Nick := '';
Players[0].Member := True; // Are you a member?
Players[0].Active := True;
Players[0].Pin := ''; // Put your pin in between the ''
Players[0].BoxRewards := ['Xp', 'mote', 'ostume', 'oins', 'aphire', 'ssence']
end;



Function Banking :boolean;
begin
MakeCompass('W')
SetAngle(SRL_ANGLE_HIGH);
OpenBankNPC;
Deposit(2, 28, true);
Withdraw(10, 1, 28);
CloseBank;
end;

Procedure Superheat;
begin
Mouse(743, 183, 2, 2, true);
Wait(1000);
Mouse(646, 328, 2, 2, true);
Wait(1000);
Mouse(710, 440, 2, 2, true);
SH_Reset:=SH_Reset+1;
Further_Heat;
end;
Procedure Further_Heat; Forward;
begin
Mouse(648, 327, 2, 2, true);
Wait(Randomrange(1000, 1050));
Mouse(712, 446, 2, 2, true);
SH_Reset:=SH_Reset+1;
If (Reset = 27) then
begin
Banking;
SH_Reset:=SH_Reset-27;
Wait(3000);
Superheat;
end else
Further_Heat;

end;


Function Execute :boolean;
begin
smart_server := 91;
smart_members := false;
smart_signed :=true;
smart_superdetail := false;
SetupSRL;
DeclarePlayers;
LoginPlayer;
end;
begin
Execute;
Superheat;
end.
Ok so deleted the include file, and i added the forward but it isnt working…

riwu

2012-06-18 22:39:18

U put it before the procedure that u are going to call it..
I did not look into detail ur logic but fixed some syntax/standard, it should now compile.
program LukesSuperHeater;
{$DEFINE SMART}
{.include SRL/SRL/Misc/Smart.simba}
{.include SRL/SRL.simba}
{.include SRL/SRL/Skill/Magic.simba}
{$i sps/sps.simba}
{$i SRL/SRL/misc/paintsmart.simba}
Var
SH_Reset :extended;
procedure DeclarePlayers;
begin

HowManyPlayers := 1; // Set this to one if you are not sure what you are doing.
NumberOfPlayers(HowManyPlayers);
CurrentPlayer := 0;
Players[0].Name := ''; // Put your username in between the ''
Players[0].Pass := ''; // Put your password in between the ''
Players[0].Nick := '';
Players[0].Member := True; // Are you a member?
Players[0].Active := True;
Players[0].Pin := ''; // Put your pin in between the ''
Players[0].BoxRewards := ['Xp', 'mote', 'ostume', 'oins', 'aphire', 'ssence']
end;

Procedure Further_Heat; Forward;

Function Banking :boolean;
begin
MakeCompass('W')
SetAngle(SRL_ANGLE_HIGH);
OpenBankNPC;
Deposit(2, 28, true);
Withdraw(10, 1, 28);
CloseBank;
end;

Procedure Superheat;
begin
Mouse(743, 183, 2, 2, true);
Wait(1000);
Mouse(646, 328, 2, 2, true);
Wait(1000);
Mouse(710, 440, 2, 2, true);
SH_Reset:=SH_Reset+1;
Further_Heat;
end;

Procedure Further_Heat;
begin
Mouse(648, 327, 2, 2, true);
Wait(Randomrange(1000, 1050));
Mouse(712, 446, 2, 2, true);
SH_Reset:=SH_Reset+1;
If (SH_Reset = 27) then
begin
Banking;
SH_Reset:=SH_Reset-27;
Wait(3000);
Superheat;
end else
Further_Heat;
end;


Function Execute :boolean;
begin
smart_server := 91;
smart_members := false;
smart_signed :=true;
smart_superdetail := false;
SetupSRL;
DeclarePlayers;
LoginPlayer;
end;

begin
Execute;
Superheat;
end.

P1ng

2012-06-19 08:48:24

Idk if that's anyone's actual username and password in the script riwu just posted but just in case figured I should let you know so you can edit it out