SRL Archive - OSR Help

Question on how to fix error at line 69


cradlefatal

2013-02-25 14:56:59

I am following a tutorial vid for scripting I am making a Ardougne coal miner and I keep getting this error at line 69


[Error] C:\Simba\Scripts\newminer.simba(70:1): Identifier expected at line 69
Compiling failed.

this is what I have written so far


program new;
//{$DEFINE SMART8}
{$i SRL\SRL.simba}
{$i SRL\SRL\Misc\Debug.simba}


Const


SRLStats_Username = '';// Your SRL Stats Username
SRLStats_Password = ''; // Your SRL Stats Password
LoadsTotal = 9999; //
PaintEvery = 5; //Update leve paint every this many seconds
Version = '1.00'; //

procedure DeclarePlayers;
var i:integer;
begin
NumberOfPlayers(1);
CurrentPlayer := 0;
for i := 0 to 1-1 do
Players.BoxRewards := ['Mining'];

with Players[0] do
begin
Name := ''; //Player username.
Pass := ''; //Player password.
Active := True;
Integers[1] := 4; //1=BrightCopper,2=DarkCopper,3=Tin,4=Iron.
Integers[2] := 4; //Seconds to try mining rock before clicking another.
End;
End;
Procedure StatsGuise(wat:String);
Begin
Status(wat);
Disguise(wat);
End;
Procedure Antiban;
Begin
Case Random(100) Of
1: HoverSkill('mining', False); //replace 'magic' with 'skill'
2: HoverSkill('mining', False);
3: Boredhuman;
4: Wait(2500 + random(4500));
5: HoverSkill('mining', False); // replace 'smithing' with 'skill', or delete.
6: PickUpMouse;
7: RandomMovement;
8: RandomRClick;
End;
End;
Procedure FailSafe(Reason:String);
Begin
Players [CurrentPlayer].Loc:=Reason;
Logout;
Stats_Commit;
//ProgressReport;
TerminateScript;
End;

Function CheckAndClick(UpText:String; X,Y:Integer; RClick:String):Boolean;
Begin
MMouse(x, y, 5, 5);
If WaitUptext(UpText, 5) Then
Begin
Result:=True;
GetMousePos(x, y);
End;

Procedure Failsafe Mine:Boolean;
Var
x,y: Integer;
Begin
If FindObjCustom(x, y, ['Mine', 'Coal', 'rocks', 'e l s',], [2039840,7437940,2961199,2763820,789773,2237219,1776925,2039840,], 15);
WriteLn('We Found The Rock')
end;

Begin
SetupSRL;
DeclarePlayers'
//Repeat
Mine;
//Until(False);
end;

Kevin

2013-02-25 16:53:21

Please post your script in
 [/simba[ tags so it's far easier to read.

Also, as opposed to making us count all the lines, could you do something to highlight line 69?

tealc

2013-02-25 17:04:52


Procedure Failsafe Mine:Boolean;
Look at procedure and function syntax

cradlefatal

2013-02-25 17:23:21

How do I put it in /simba and I fixed that error now I am getting a new error


[Error] C:\Simba\Scripts\newminer.simba(65:10): Duplicate identifier 'MINE' at line 64
Compiling failed.

this is what I've changed and sorry

program new;
{$DEFINE SMART8}
{$I SRL/SRL.Simba}
{$I SRL/SRL/Misc/Debug.Simba}
{$I SRL/SRL/Misc/SmartGraphics.Simba}





Const

//Credits to YoHoJo for an understandable tutorial video, and Solidone4 for the antiban
SRLStats_Username = '';// Your SRL Stats Username
SRLStats_Password = ''; // Your SRL Stats Password
LoadsTotal = 9999; //
PaintEvery = 5; //Update leve paint every this many seconds
Version = '1.00'; //

procedure DeclarePlayers;
var i:integer;
begin
NumberOfPlayers(1);
CurrentPlayer := 0;
for i := 0 to 1-1 do
Players.BoxRewards := ['Mining'];

with Players[0] do
begin
Name := ''; //Player username.
Pass := ''; //Player password.
Active := True;
Integers[1] := 4; //1=BrightCopper,2=DarkCopper,3=Tin,4=Iron.
Integers[2] := 4; //Seconds to try mining rock before clicking another.
End;
End;
Procedure StatsGuise(wat:String);
Begin
Status(wat);
Disguise(wat);
End;
Procedure Antiban;
Begin
Case Random(100) Of
1: HoverSkill('mining', False); //replace 'magic' with 'skill'
2: HoverSkill('mining', False);
3: Boredhuman;
4: Wait(2500 + random(4500));
5: HoverSkill('mining', False); // replace 'smithing' with 'skill', or delete.
6: PickUpMouse;
7: RandomMovement;
8: RandomRClick;
End;
End;
Procedure FailSafe(Reason:String);
Begin
Players [CurrentPlayer].Loc:=Reason;
Logout;
Stats_Commit;
//ProgressReport;
TerminateScript;
End;

Function Mine:Boolean; Line64
Var
x,y: Integer;
If FindObjCustom(x, y, ['Mine', 'Coal', 'rocks', 'e l s',], [2039840,7437940,2961199,2763820,789773,2237219,1776925,2039840,2040354,1250324,1052945,3027506,2039840], 15);
WriteLn('We Found The Rock')
GetMousePos (x,y);
Case Random(2) of
end;



Function CheckAndClick(UpText:String; X,Y:Integer; RClick:String):Boolean;
Begin
MMouse(x, y, 5, 5);
If WaitUptext(UpText, 5) Then
Begin
Result:=True;
GetMousePos(x, y);
End;


Begin
SetupSRL;
DeclarePlayers'
//Repeat;
//Until(False);
end;

cradlefatal

2013-02-25 17:27:51

line 64 is noted in blue at the end of the function i tried changing the If FindObjCustom(x,y ['Mine'] to Min so it wouldn't be a duplicate but still gives me same error

Kevin

2013-02-25 17:43:29

You add
 Before all the code and [/simba[ after all the code. (although the second '[' should be ']'
[simba]
Function Mine:Boolean; Line64
Var
x,y: Integer;
If FindObjCustom(x, y, ['Mine', 'Coal', 'rocks', 'e l s',], [2039840,7437940,2961199,2763820,789773,2237219,177 6925,2039840,2040354,1250324,1052945,3027506,20398 40], 15);
WriteLn('We Found The Rock')
GetMousePos (x,y);
Case Random(2) of
end;
It doesn't have a begin to start the function after your variables.

cradlefatal

2013-02-25 18:02:26

program new;
{$DEFINE SMART8}
{$I SRL/SRL.Simba}
{$I SRL/SRL/Misc/Debug.Simba}
{$I SRL/SRL/Misc/SmartGraphics.Simba}





Const

//Credits to YoHoJo for an understandable tutorial video, and Solidone4 for the antiban
SRLStats_Username = '';// Your SRL Stats Username
SRLStats_Password = ''; // Your SRL Stats Password
LoadsTotal = 9999; //
PaintEvery = 5; //Update leve paint every this many seconds
Version = '1.00'; //

procedure DeclarePlayers;
var i:integer;
begin
NumberOfPlayers(1);
CurrentPlayer := 0;
for i := 0 to 1-1 do
Players[i].BoxRewards := ['Mining'];

with Players[0] do
begin
Name := ''; //Player username.
Pass := ''; //Player password.
Active := True;
Integers[1] := 4; //1=BrightCopper,2=DarkCopper,3=Tin,4=Iron.
Integers[2] := 4; //Seconds to try mining rock before clicking another.
End;
End;
Procedure StatsGuise(wat:String);
Begin
Status(wat);
Disguise(wat);
End;



Function CheckAndClick(UpText:String; X,Y:Integer; RClick:String):Boolean;
Begin
MMouse(x, y, 5, 5);
If WaitUptext(UpText, 5) Then
Begin
Result:=True;
GetMousePos(x, y);
End;
End;

Procedure DebugXP;
Var
Sec, XPRate:integer;
Begin
Sec:= (1+((Getsystemtime-StartTime)/1000));
XPRate:=(3600*(TExperiance))/(Sec);
StatsGuise(GroupDigits(XPRate, ',') + ' xp/h');
End;




Procedure Antiban;
Begin
Case Random(20000) Of

0:
Begin
HoverSkill('Mining', False);
GameTab(Tab_Inv);
End;
1:
Begin
PickUpMouse;
SleepAndMoveMouse(3000 + Random(500));
PickUpMouse;
End;
2: ExamineInv;
3:
Begin
RandomAngle(SRL_ANGLE_HIGH);
SetAngle(SRL_ANGLE_HIGH);
End;
4:
Begin
GameTab(Tab_Stats);
Wait(3000 + Random(500));
GameTab(Tab_Inv);
End;
5:
Begin
HoverSkill('random', False);
GameTab(Tab_Inv);
End;

End;
End;

Procedure FailSafe(Reason:String);
Begin
Players [CurrentPlayer].Loc:=Reason;
Logout;
Stats_Commit;
//ProgressReport;
TerminateScript;
End;

Function Mine:Boolean;
Var
x,y: Integer;
Begin
If FindObjCustom(x, y, ['Mine', 'Coal', 'rocks', 'e l s',], [2039840,7437940,2961199,2763820,789773,2237219,1776925,2039840,2040354,1250324,1052945,3027506,2039840], 15);
WriteLn('We Found The Rock')
GetMousePos (x,y);
Case Random(2) of
end;

Begin
SetupSRL;
DeclarePlayers'
//Repeat;
//Until(False);
end;









thank you!!! woop woop now I have an

[Error] C:\Simba\Scripts\newminer.simba(60:28): Unknown identifier 'StartTime' at line 59
I'll try and figure it out if I absolutly can't then I will make a pst thank you for the help

Sjoe

2013-02-25 18:14:28

Instead of
Sec:= (1+((Getsystemtime-StartTime)/1000));

try
Sec := (GetTimeRunning / 1000);
XPRate:=((3600*TExperiance)/(Sec));

Easier

cradlefatal

2013-02-25 18:18:04

it gives me this [Error] C:\Simba\Scripts\newminer.simba(61:18): Unknown identifier 'TExperience' at line 60 for the XPRATE

cradlefatal

2013-02-25 18:48:11

now its giving me this error [Error] C:\Simba\Scripts\newminer.simba(112:10): Duplicate identifier 'MINE' at line 111
Compiling failed
program new;
{$DEFINE SMART8}
{$I SRL/SRL.Simba}
{$I SRL/SRL/Misc/Debug.Simba}
{$I SRL/SRL/Misc/SmartGraphics.Simba}





Const

//Credits to YoHoJo for an understandable tutorial video, and Solidone4 for the antiban
SRLStats_Username = '';// Your SRL Stats Username
SRLStats_Password = ''; // Your SRL Stats Password
LoadsTotal = 9999; //
PaintEvery = 5; //Update leve paint every this many seconds
Version = '1.00'; //

procedure DeclarePlayers;
var i:integer;
begin
NumberOfPlayers(1);
CurrentPlayer := 0;
for i := 0 to 1-1 do
Players[i].BoxRewards := ['Mining'];

with Players[0] do
begin
Name := ''; //Player username.
Pass := ''; //Player password.
Active := True;
Integers[1] := 4; //1=BrightCopper,2=DarkCopper,3=Tin,4=Iron.
Integers[2] := 4; //Seconds to try mining rock before clicking another.
End;
End;
Procedure StatsGuise(wat:String);
Begin
Status(wat);
Disguise(wat);
End;



Function CheckAndClick(UpText:String; X,Y:Integer; RClick:String):Boolean;
Begin
MMouse(x, y, 5, 5);
If WaitUptext(UpText, 5) Then
Begin
Result:=True;
GetMousePos(x, y);
End;
End;

Procedure DebugXP;
Var
Sec,XPRate:integer;
Begin
Sec := (GetTimeRunning / 1000);
XPRate :=((3600)/(Sec));
StatsGuise(GroupDigits(XPRate, ',') + ' xp/h');
End;



Procedure Antiban;
Begin
Case Random(20000) Of

0:
Begin
HoverSkill('Mining', False);
GameTab(Tab_Inv);
End;
1:
Begin
PickUpMouse;
SleepAndMoveMouse(3000 + Random(500));
PickUpMouse;
End;
2: ExamineInv;
3:
Begin
RandomAngle(SRL_ANGLE_HIGH);
SetAngle(SRL_ANGLE_HIGH);
End;
4:
Begin
GameTab(Tab_Stats);
Wait(3000 + Random(500));
GameTab(Tab_Inv);
End;
5:
Begin
HoverSkill('random', False);
GameTab(Tab_Inv);
End;

End;
End;

Procedure FailSafe(Reason:String);
Begin
Players [CurrentPlayer].Loc:=Reason;
Logout;
Stats_Commit;
//ProgressReport;
TerminateScript;
End;

Function Mine:Boolean;
Var
Begin
x,y: Integer;
Begin
If FindObjCustom(x, y, ['Mine', 'Coal', 'rocks', 'e l s',], [2039840,7437940,2961199,2763820,789773,2237219,1776925,2039840,2040354,1250324,1052945,3027506,2039840], 15);
StatsGuise('We Found The Rock')
Begin
GetMousePos (x,y);
Case Random(1) of
0: Mouse (x,y);
1: WaitOption ('Mine', 200);
end;
end;
end;
end;

Begin
SetupSRL;
DeclarePlayers'
//Repeat;
//Until(False);
End;
End;
End;
End