Results 1 to 10 of 10

Thread: Question on how to fix error at line 69

  1. #1
    Join Date
    Mar 2012
    Posts
    139
    Mentioned
    0 Post(s)
    Quoted
    26 Post(s)

    Default Question on how to fix error at line 69

    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[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;
    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,177 6925,2039840,], 15);
    WriteLn('We Found The Rock')
    end;

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

  2. #2
    Join Date
    Sep 2012
    Location
    Here.
    Posts
    2,007
    Mentioned
    88 Post(s)
    Quoted
    1014 Post(s)

    Default

    Please post your script in [simba] [/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?

  3. #3
    Join Date
    Jul 2012
    Posts
    437
    Mentioned
    10 Post(s)
    Quoted
    165 Post(s)

    Default

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

  4. #4
    Join Date
    Mar 2012
    Posts
    139
    Mentioned
    0 Post(s)
    Quoted
    26 Post(s)

    Default

    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[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;
    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,177 6925,2039840,2040354,1250324,1052945,3027506,20398 40], 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;
    Last edited by cradlefatal; 02-25-2013 at 10:27 PM.

  5. #5
    Join Date
    Mar 2012
    Posts
    139
    Mentioned
    0 Post(s)
    Quoted
    26 Post(s)

    Default

    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
    Last edited by cradlefatal; 02-25-2013 at 10:30 PM.

  6. #6
    Join Date
    Sep 2012
    Location
    Here.
    Posts
    2,007
    Mentioned
    88 Post(s)
    Quoted
    1014 Post(s)

    Default

    You add [simba] Before all the code and [/simba[ after all the code. (although the second '[' should be ']'
    Simba Code:
    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.

  7. #7
    Join Date
    Mar 2012
    Posts
    139
    Mentioned
    0 Post(s)
    Quoted
    26 Post(s)

    Default

    Simba Code:
    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

  8. #8
    Join Date
    Mar 2006
    Location
    Belgium
    Posts
    3,564
    Mentioned
    111 Post(s)
    Quoted
    1475 Post(s)

    Default

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

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

    Easier

    Creds to DannyRS for this wonderful sig!

  9. #9
    Join Date
    Mar 2012
    Posts
    139
    Mentioned
    0 Post(s)
    Quoted
    26 Post(s)

    Default

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

  10. #10
    Join Date
    Mar 2012
    Posts
    139
    Mentioned
    0 Post(s)
    Quoted
    26 Post(s)

    Default

    now its giving me this error [Error] C:\Simba\Scripts\newminer.simba(112:10): Duplicate identifier 'MINE' at line 111
    Compiling failed
    Simba Code:
    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

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •