PDA

View Full Version : Compiling Failed



afastngr
05-16-2012, 08:01 AM
[Error] C:\Simba\Includes\SRL/SRL/core/simba.simba(4:24): Semicolon (';') expected at line 3
Compiling failed.

Also [Error] (4:15): period ('.') expected at line 3
Compiling failed.

program PowerChopper
{$i srl/srl.simba};
Const


It opens up Simba

//-----------------------------------------------------------------//
//-- Scar Standard Resource Library --//
//-- Simba.simba --//
//-----------------------------------------------------------------//

Simba.Simba is highlighted any help, first time trying to code, thanks in advance


================ F U L L S C R I P T, N O T F I N I S H E D =========================================
program PowerChopper
{$i srl/srl.simba}
begin
SetUpSRL;
ActivateClient;
end.

begin
end.

Const

//SRL Stats
SRLStats_Username = '';
SRLStats_Password = '';

//General settings
DebugMode = True; //On-screen debugging?
SwitchWorlds = True; //Switch worlds after a break?

//Break settings
BreakIn = 302; //How long before we take a break? (minutes)
BreakFor = 4; //How long will we break for? (minutes)

Procedure DeclarePlayers;
begin
HowManyPlayers := 1;
NumberOfPlayers(HowManyPlayers);
CurrentPlayer := 0;
with Players[0] do
begin
Name := '';
Pass := '';
BoxRewards := ['XP','xp','lamp'];
LampSkill := Skill_Agility;
Active := True;
end;
end;
Function CheckAndClick(X,Y:Integer):Boolean;
Begin
MMouse(x, y, 5, 5);
{Wait(100 + Random(50));
If CountUpColor('B', 41, 5, 86, 24, 70, 140) Then}
If WaitUpTextMulti(['Chop','hop'], 150) Then
Begin
Result:=True;
GetMousePos(x, y);
Mouse(x, y, 0, 0,True);
Wait(100+Random(50));
FFlag(0);
End;
End;
Procedure Antiban;
Begin
Case Random(192) Of
0: HoverSkill('Woodcutting', False);
1: Begin PickUpMouse; SleepAndMoveMouse(3000 + Random(500)); End;
2: ExamineInv;
3: RandomAngle(1);
4: Begin GameTab(Tab_Stats); Wait(3000 + Random(500)); GameTab(Tab_Inv); End;
5: HoverSkill('random', False);
End;
End;

Procedure StatsGuise(wat:String);
Begin
Status(wat);
Disguise(wat);
End;
Procedure Failsafe
Begin
Players(CurrentPlayer).Lnc:-Reason;
Logout;
Stats_Commit
//ProgressReport;
TerminateScript;
End;



Function IvyChop:Boolean;

var
x, y, PlusOne: Integer;
Begin
If FindObjCustom(var x, y ['Chop', 'Ivy', '2','C I'] ['4223833','10001823 ','4149077 ' ,'11186098 ' ,'3695950 ' ,'8291204 ' ,'3233860'],30 ): Then
GetMousePos(x, y);
Case Random(2)
0: Mouse(x, y, 6, 6, True);
1: Begin
Mouse(X, Y, 6, 6, False);
WaitOption('Chop',500)
ChooseOption('Chop')
End;
End;

End.


Begin
setup SRL;
DeclarePlayers;
Repeat
IvyChop;
Until(false);

End.

afastngr
05-16-2012, 08:28 AM
Anyone?

Abu
05-16-2012, 08:16 PM
Wow, there were definitely a lot of things wrong with this script... read the following carefully.

Ok, remember that you need to put a semi colon ; after ever line unless the line ends with a bold letter such as begin and then. The only exception of course is end;

Furthermore, you can only use one fullstop (.) after an end in the entire script - and this full stop goes after final end

Moreover, when using any function with more than one parameter, you must always put a comma between each parameter. For example:
GetMousePos(x y); // will not compile, it needs the comma between x and y
GetMousePos(x, y); // will compile

Another thing I noticed is that when you used a case, you only used case, it is always a case of something - not just case. For example:

Case Random(2)
0: Mouse(x, y, 6, 6, True);
end;
// the above will not compile - YOU ARE MISSING OF!!

Case Random(2) of // off is put here
0: Mouse(x, y, 6, 6, True);
end;
// The above will compile

Also, for some weird reason you have two weird procedures at the start which aren't needed.

Finally, the function is not called 'setup SRL' it is called 'SetUpSRL'



This should now compile for you, it looks different but all I did was what I said above and improved the layout:
program PowerChopper;
{$i srl\srl.simba}


Const
//SRL Stats
SRLStats_Username = '';
SRLStats_Password = '';

//General settings
DebugMode = True; //On-screen debugging?
SwitchWorlds = True; //Switch worlds after a break?

//Break settings
BreakIn = 302; //How long before we take a break? (minutes)
BreakFor = 4; //How long will we break for? (minutes)

Procedure DeclarePlayers;
begin
HowManyPlayers := 1;
NumberOfPlayers(HowManyPlayers);
CurrentPlayer := 0;
with Players[0] do
begin
Name := '';
Pass := '';
BoxRewards := ['XP','xp','lamp'];
LampSkill := Skill_Agility;
Active := True;
end;
end;


Function CheckAndClick(X,Y:Integer):Boolean;
Begin
MMouse(x, y, 5, 5);
{Wait(100 + Random(50));
If CountUpColor('B', 41, 5, 86, 24, 70, 140) Then}
If WaitUpTextMulti(['Chop','hop'], 150) Then
Begin
Result:=True;
GetMousePos(x, y);
Mouse(x, y, 0, 0,True);
Wait(100+Random(50));
FFlag(0);
End;
End;


Procedure Antiban;
Begin
Case Random(192) Of
0: HoverSkill('Woodcutting', False);
1: Begin
PickUpMouse;
SleepAndMoveMouse(3000 + Random(500));
End;
2: ExamineInv;
3: RandomAngle(1);
4: Begin
GameTab(Tab_Stats);
Wait(3000 + Random(500));
GameTab(Tab_Inv);
End;
5: HoverSkill('random', False);
End;
End;


Procedure StatsGuise(wat:String);
Begin
Status(wat);
Disguise(wat);
End;


Procedure Failsafe;
Begin
Logout;
Stats_Commit
//ProgressReport;
TerminateScript;
End;


Function IvyChop:Boolean;
var
x, y, PlusOne: Integer;
Begin
If FindObjCustom(x, y, ['Chop', 'Ivy', '2','C I'], ['4223833','10001823','4149077 ' ,'11186098 ' ,'3695950 ' ,'8291204 ' ,'3233860'],30 ) Then
GetMousePos(x, y);
Case Random(2) of
0: Mouse(x, y, 6, 6, True);
1: Begin
Mouse(X, Y, 6, 6, False);
WaitOption('Chop',500)
ChooseOption('Chop')
End;
End;
End;


Begin
SetUpSRL;
DeclarePlayers;

Repeat
IvyChop;
Until(false);

End.