Results 1 to 5 of 5

Thread: The noob and the darn semicolon error

  1. #1
    Join Date
    Dec 2008
    Posts
    4
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default The noob and the darn semicolon error

    Ty for all ur help! My new script wuz good until I added wait time. Ill try to figure it out, but here is the script so u can try too. Line 4: [Error] (4:25): comma (',')
    SCAR Code:
    program RandomTalker;
    begin
    repeat
    wait(20000+Random(10562);
      case(Random(5))of
        0: SendKeysWait ('I wish I could play XBox at the same time :(', 500, 100);
        1: begin
             SendKeysWait ('Man, this is soo borinh', 500, 100));
             Wait (500);
             SendKeysWait ('boring*', 500, 100));
           end;
        2: SendKeysWait ('Dang Ive been on sooo long', 500, 100));
        3: SendKeysWait('...', 500, 100));
        4: SendKeysWait ('I LIKE CHEESE OK?!', 500, 100));
      end;
      until(false)
    end.

  2. #2
    Join Date
    Feb 2007
    Location
    Alberta,Canada
    Posts
    2,358
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    your missing semicolons lol

    SCAR Code:
    program RandomTalker;
    var
    ran:integer;
     
    begin
    ran=(ran+Random(5));
    end;
    begin;
    ran=1;
    WriteLn ('I wish I could play XBox at the same time :(');
    end;
    begin
    ran=2;
    WriteLn ('Man, this is soo borinh');
    Wait (500);
    WriteLn ('boring*');
    end;
    begin
    ran=3;
    WriteLn ('Dang Ive been on sooo long');
    end;
    begin
    ran=4;
    WriteLn ('...');
    end;
    begin
    ran=5;
    WriteLn ('I LIKE CHEESE OK?!');
    end.

    try that :/
    “Ignorance, the root and the stem of every evil.”

  3. #3
    Join Date
    Jun 2007
    Location
    La Mirada, CA
    Posts
    2,484
    Mentioned
    1 Post(s)
    Quoted
    3 Post(s)

    Default

    SCAR Code:
    program RandomTalker;
    var
    ran:integer;
     
    begin
      ran := (Random(5) + 1);
      if (ran=1) then
        WriteLn ('I wish I could play XBox at the same time :(');
      if (ran=2) then
      begin
        WriteLn ('Man, this is soo borinh');
        Wait (500);
        WriteLn ('boring*');
      end;
      if (ran=3) then
        WriteLn ('Dang Ive been on sooo long');
      if (ran=4) then
        WriteLn ('...');
      if (ran=5) then
        WriteLn ('I LIKE CHEESE OK?!');
    end.

    You need to put semicolons after pretty much every line, first off(look at code). Second, Random(5) is 0,1,2,3,4 so you either needed to add Random(5) + 1 to get to 5 or start counting at 0 (I added +1). Third The begin and ends weren't needed because they just weren't (you will learn). If Then statements compare the statement so, if ran = 3 then do this...
    ( := ) set a variable, ( = ) compares them. You could also you a case statement.

    "Failure is the opportunity to begin again more intelligently" (Henry Ford)


  4. #4
    Join Date
    Dec 2008
    Posts
    4
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default Lol

    wow... i figured it out somewut and another error came up. and then another. But u figured it out really fast. I looked away from my forum ten minutes ago i think. And u already have an answer? Howd u know i even posted?

  5. #5
    Join Date
    Dec 2007
    Location
    Wizzup?'s boat
    Posts
    1,013
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    SCAR Code:
    program RandomTalker;

    begin
      case(Random(5))of
        0: WriteLn ('I wish I could play XBox at the same time :(');
        1: begin
             WriteLn ('Man, this is soo borinh');
             Wait (500);
             WriteLn ('boring*');
           end;
        2: WriteLn ('Dang Ive been on sooo long');
        3: Writeln('...');
        4: WriteLn ('I LIKE CHEESE OK?!');
      end;
    end.
    Project: Welcome To Rainbow

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Oh darn =[
    By Camaro' in forum News and General
    Replies: 7
    Last Post: 07-24-2008, 06:01 PM
  2. semicolon error
    By opposite in forum OSR Help
    Replies: 7
    Last Post: 04-12-2008, 06:25 AM
  3. [Error] (16682:4): Semicolon (';') expected
    By skilld u in forum OSR Help
    Replies: 3
    Last Post: 03-24-2008, 12:12 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
  •