Results 1 to 9 of 9

Thread: Identifier Expected Error with functions?

  1. #1
    Join Date
    Jun 2012
    Posts
    42
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default Identifier Expected Error with functions?

    I get errors like this all the time, but for this one i am stumped!
    Simba Code:
    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!

  2. #2
    Join Date
    Oct 2011
    Location
    Australia, Vic
    Posts
    1,517
    Mentioned
    2 Post(s)
    Quoted
    120 Post(s)

    Default

    Quote Originally Posted by RSisDead View Post
    I get errors like this all the time, but for this one i am stumped!
    Simba Code:
    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.

  3. #3
    Join Date
    Jan 2012
    Posts
    2,568
    Mentioned
    35 Post(s)
    Quoted
    356 Post(s)

    Default

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

  4. #4
    Join Date
    Jun 2012
    Posts
    42
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Quote Originally Posted by John View Post
    It's best to show your whole script, i think you need an end though at the end of the first procedure.
    Simba Code:
    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,
    Last edited by RSisDead; 06-19-2012 at 02:35 AM.

  5. #5
    Join Date
    Jun 2012
    Posts
    42
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Quote Originally Posted by riwu View Post
    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....
    Simba Code:
    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?

  6. #6
    Join Date
    Jan 2012
    Posts
    2,568
    Mentioned
    35 Post(s)
    Quoted
    356 Post(s)

    Default

    Quote Originally Posted by RSisDead View Post
    So, i just added an include file to it with Further_Heat that would just describe that... BUT SAME ERROR! GRRRR....
    Simba Code:
    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
    Simba Code:
    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.

  7. #7
    Join Date
    Jun 2012
    Posts
    42
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Simba Code:
    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...
    Last edited by RSisDead; 06-19-2012 at 02:35 AM.

  8. #8
    Join Date
    Jan 2012
    Posts
    2,568
    Mentioned
    35 Post(s)
    Quoted
    356 Post(s)

    Default

    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.
    Simba Code:
    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.
    Last edited by riwu; 06-19-2012 at 01:10 PM.

  9. #9
    Join Date
    Apr 2012
    Location
    Australia
    Posts
    1,252
    Mentioned
    1 Post(s)
    Quoted
    22 Post(s)

    Default

    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

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
  •