Results 1 to 11 of 11

Thread: first script help "indentifier expected..."

  1. #1
    Join Date
    Oct 2007
    Location
    #srl
    Posts
    6,102
    Mentioned
    39 Post(s)
    Quoted
    62 Post(s)

    Default first script help "indentifier expected..."

    alright well this isnt meant to be a real cool big super helpful script, just something to get me into it. but it wont compile.
    this is the error i get.

    "Line 90: [Error] (16304:1): Identifier expected in script"

    this is the script so far:

    program talk;

    const
    TimeForPlayer = 10; // time each player spams everyone (+ random 5)
    World = 'world1'; // world you want to play on
    Message1 = 'your text here';
    Message2 = 'your text here';
    Message3 = 'your text here';
    Time1 = 2000; //time between each message sent
    Time2 = 1500; // random time added


    procedure DeclarePlayers;
    begin
    CurrentPlayer := 0;
    NumberOfPlayers(1); // Must be correct .

    Players[0].Name := ''; //your username between ''
    Players[0].Pass := ''; //your password between''
    Players[0].Nick := ''; //put 3 to 4 letters from you username between the ' ' (no caps or numbers)
    Players[0].Active := True; //active->True or False.

    end;
    procedure lolz;
    begin
    ClearDeBug;
    Writeln('Ayyeee!');
    Wait(1000 + random(500));
    Writeln('Thank you very much for trying my script');
    Writeln('and for supporting srl-forums.com');
    Wait(1000 + random(500));
    Writeln('be sure to post suggestion for this or');
    Writeln('anyother script back on the forums');
    Wait(1000 + random(500));
    Writeln('thanks again');
    Writeln('enjoy!');
    Wait(4000 + random(500));
    ClearDebug;
    end;

    procedure TellDemHoes;
    begin
    SetAngle(true);
    MakeCompass('n');
    Setrun(True);
    Wait (1000);
    if (not (LoggedIn)) then Exit;
    case Random(3) of
    0: Typesend(Message1);
    1: Typesend(Message2);
    2: Typesend(Message3);
    end;
    end;

    procedure DontGetBanned;
    begin
    Wait(Time1 + random(Time2));
    end;

    procedure StayLoggedIn;
    begin
    case Random(6) of
    0: RandomMovement;
    1: BoredHuman;
    2: HoverSkill('crafting', False);
    3: HoverSkill('random', False);
    4: MMouse(50 + random(25), 40 + random(30), 5, 5);
    5: RandomRClick;
    end;

    procedure MainLoop;
    begin
    SmartSetup(World, False, True, False);
    SetTargetDC(SmartGetDC);
    SetupSRL;
    DeclarePlayers;
    lolz;
    repeat;
    TellDemHoes;
    DontGetBanned;
    StayLoggedIn;
    until(false);
    end;
    end.



    help is much appreciated if you can do it pleasse.
    i also want to make this so it can auto trade if anyone wants to help with that!

  2. #2
    Join Date
    Aug 2008
    Location
    Serdia, Isla Prima
    Posts
    68
    Mentioned
    0 Post(s)
    Quoted
    1 Post(s)

    Default

    I don't think that the repeat should have the ; next to it.

    Using standards will also make it more readable

  3. #3
    Join Date
    Sep 2008
    Location
    New Zealand
    Posts
    157
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    There's a nice little bag of errors in that script!
    For starters you need a begin (to match the end.) which points to your MainLoop procedure. Then you need to include srl and smart if you want to use them as you do. Equally important is your lack of standars, these make a script MUCH more readable.

    I could fix all your problems (upwards of 15) but really you need to stop and start again, you have copy pasted chunks from lots of scripts and tried to get it all going at once. Firstly read some tutorials and then read details on standards.

    When you are done you should start with a simple script, then add smart and all the extra fancy features one by one. Good luck.

  4. #4
    Join Date
    Jan 2008
    Location
    NC, USA.
    Posts
    4,429
    Mentioned
    0 Post(s)
    Quoted
    4 Post(s)

    Default

    This version compiles and it should work. I fixed it up in two minutes, study it
    Btw, what all of those spaces are, they are called standards. They make it easier to read the script.

    SCAR Code:
    Program Talker;
    {.include srl/srl.scar}

    const
      TimeForPlayer = 10; // time each player spams everyone (+ random 5)
      World = 'world1'; // world you want to play on
      Message1 = 'your text here';
      Message2 = 'your text here';
      Message3 = 'your text here';
      Time1 = 2000; //time between each message sent
      Time2 = 1500; // random time added


    procedure DeclarePlayers;
    begin
      CurrentPlayer := 0;
      NumberOfPlayers(1); // Must be correct .

      Players[0].Name := ''; //your username between ''
      Players[0].Pass := ''; //your password between''
      Players[0].Nick := ''; //put 3 to 4 letters from you username between the ' ' (no caps or numbers)
      Players[0].Active := True; //active->True or False.
    end;



    procedure lolz;
    begin
      ClearDeBug;
      Writeln('Ayyeee!');
      Wait(1000 + random(500));
      Writeln('Thank you very much for trying my script');
      Writeln('and for supporting srl-forums.com');
      Wait(1000 + random(500));
      Writeln('be sure to post suggestion for this or');
      Writeln('anyother script back on the forums');
      Wait(1000 + random(500));
      Writeln('thanks again');
      Writeln('enjoy!');
      Wait(4000 + random(500));
      ClearDebug;
    end;

    procedure TellDemHoes;
    begin
      SetAngle(true);
      MakeCompass('n');
      Setrun(True);
      Wait (1000);
      if (not (LoggedIn)) then Exit;
      case Random(3) of
           0: Typesend(Message1);
           1: Typesend(Message2);
           2: Typesend(Message3);
      end;
    end;

    procedure DontGetBanned;
    begin
    Wait(Time1 + random(Time2));
    end;

    procedure StayLoggedIn;
    begin
      case Random(6) of
           0: RandomMovement;
           1: BoredHuman;
           2: HoverSkill('crafting', False);
           3: HoverSkill('random', False);
           4: MMouse(50 + random(25), 40 + random(30), 5, 5);
           5: RandomRClick;
      end;
    end;


    begin
      setupsrl;
      SmartSetup(World, False, True, False);
      SetTargetDC(SmartGetDC);
      SetupSRL;
      DeclarePlayers;
      lolz;
      repeat;
        TellDemHoes;
        DontGetBanned;
        StayLoggedIn;
      until(false);
    end.
    Quote Originally Posted by irc
    [00:55:29] < Guest3097> I lol at how BenLand100 has become noidea
    [01:07:40] <@BenLand100> i'm not noidea i'm
    [01:07:44] -!- BenLand100 is now known as BenLand42-
    [01:07:46] <@BenLand42-> shit
    [01:07:49] -!- BenLand42- is now known as BenLand420
    [01:07:50] <@BenLand420> YEA

  5. #5
    Join Date
    Oct 2007
    Location
    #srl
    Posts
    6,102
    Mentioned
    39 Post(s)
    Quoted
    62 Post(s)

    Default

    thank you guys.
    i already had srl and smart includes on there i just didnt copy and paste them to here.

    @noidead
    thank you but what did you change?

  6. #6
    Join Date
    Jan 2008
    Location
    NC, USA.
    Posts
    4,429
    Mentioned
    0 Post(s)
    Quoted
    4 Post(s)

    Default

    You had no main loop, missed a few 'end;' and I put in standards for you
    Quote Originally Posted by irc
    [00:55:29] < Guest3097> I lol at how BenLand100 has become noidea
    [01:07:40] <@BenLand100> i'm not noidea i'm
    [01:07:44] -!- BenLand100 is now known as BenLand42-
    [01:07:46] <@BenLand42-> shit
    [01:07:49] -!- BenLand42- is now known as BenLand420
    [01:07:50] <@BenLand420> YEA

  7. #7
    Join Date
    May 2007
    Location
    England
    Posts
    4,140
    Mentioned
    11 Post(s)
    Quoted
    266 Post(s)

    Default

    Jst so you know, "Identifier Expected" means that you haven't completed a statement properly. Examples:

    You use
    SCAR Code:
    begin
      case Random (3) of
        //bla
        //bla
        //bla
      end;

    There I only used one "end;". "Case" acts like a "begin", meaning that it needs an "end;" to itself.

    Another example is having an "if...then...else" statement, without the "then".

    Hope I helped,
    Richard
    <3

    Quote Originally Posted by Eminem
    I don't care if you're black, white, straight, bisexual, gay, lesbian, short, tall, fat, skinny, rich or poor. If you're nice to me, I'll be nice to you. Simple as that.

  8. #8
    Join Date
    Oct 2007
    Location
    #srl
    Posts
    6,102
    Mentioned
    39 Post(s)
    Quoted
    62 Post(s)

    Default

    yes you both have helped alot, thank you very much!

    how about the auto trading part?
    anyone know how to do that?

  9. #9
    Join Date
    May 2007
    Location
    England
    Posts
    4,140
    Mentioned
    11 Post(s)
    Quoted
    266 Post(s)

    Default

    I believe there are some functions to do with trading. Have a look in the SRL folder, I'm sure they'll be in there.
    <3

    Quote Originally Posted by Eminem
    I don't care if you're black, white, straight, bisexual, gay, lesbian, short, tall, fat, skinny, rich or poor. If you're nice to me, I'll be nice to you. Simple as that.

  10. #10
    Join Date
    Jan 2008
    Location
    NC, USA.
    Posts
    4,429
    Mentioned
    0 Post(s)
    Quoted
    4 Post(s)

    Default

    Its in the misc folder of SRL.
    Quote Originally Posted by irc
    [00:55:29] < Guest3097> I lol at how BenLand100 has become noidea
    [01:07:40] <@BenLand100> i'm not noidea i'm
    [01:07:44] -!- BenLand100 is now known as BenLand42-
    [01:07:46] <@BenLand42-> shit
    [01:07:49] -!- BenLand42- is now known as BenLand420
    [01:07:50] <@BenLand420> YEA

  11. #11
    Join Date
    Oct 2007
    Location
    #srl
    Posts
    6,102
    Mentioned
    39 Post(s)
    Quoted
    62 Post(s)

    Default

    ah thank you guys very much!

    both will be credited for your services!

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Replies: 5
    Last Post: 05-17-2008, 12:48 PM
  2. "Variable Expected In Script"
    By jlbmc in forum OSR Help
    Replies: 1
    Last Post: 01-19-2008, 04:21 PM
  3. Replies: 17
    Last Post: 11-14-2007, 07:43 AM

Posting Permissions

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