Results 1 to 4 of 4

Thread: Syntax Error - not a simple one.

  1. #1
    Join Date
    Jul 2007
    Location
    America
    Posts
    421
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default Syntax Error - not a simple one.

    Well, I just finished my basic script, an iron miner and banker for east varrock, but when I compiled it I got a Syntax error. I know that I didn't type something wrong, because when I put the procedure that had an error in {comments}, another syntax error came up again. The error started on both of the 'procedure blah;' lines - I know I spelled procedure correctly. Could somebody look over my script please? Sorry if the standards are bad, I haven't gotten around to fixing them yet. The error started on line 222, 'Procedure ProgReport'.

    SCAR Code:
    program new;
    {.include SRL\SRL.scar}
    {.include SRL\SRL\skill\Mining.scar}
    var LoadI, LoadstoDo, OreI, IronOre, Ahg, RandomN: Integer;
    const
    /////////////DO NOT EQUIP PICKAXE///////////////////////
      IronColor = 2503507;  //Color of iron
    procedure DeclarePlayers;
    begin
      HowManyPlayers:= 8;  //Number of players to use
      NumberOfPlayers(HowManyPlayers);
      CurrentPlayer:= 0;  //The player to start the script at

    ////////////Directions//////////////
    //FILL IN SETUP                   //
    //DO NOT EQUIP PICKAXE            //
    //START AT VARROCK EAST BANK      //
    // YOU'D BETTER ENJOY IT!         //
    ////////////////////////////////////

      Players[0].Name      := 'Megatron'; //Username
      Players[0].Pass      := 'optimusrules'; //Password
      Players[0].Nick      := 'atr'; //3 to 4 characters from Username. Ex:Optimus ->tim
      Players[0].Integer1  :=  5; //Number of Loads to do
      Players[0].Integer2  :=  5000; //Time to wait between Ores (In milliseconds, 1 second = 1000 milliseconds)
      Players[0].Active    := True;

      Players[1].Name      := 'Megatron'; //Username
      Players[1].Pass      := 'optimusrules'; //Password
      Players[1].Nick      := 'atr'; //3 to 4 characters from Username. Ex:Optimus ->tim
      Players[1].Integer1  :=  5; //Number of Loads to do
      Players[1].Integer2  :=  5000; //Time to wait between Ores (In milliseconds, 1 second = 1000 milliseconds)
      Players[1].Active    := True;

      Players[2].Name      := 'Megatron'; //Username
      Players[2].Pass      := 'optimusrules'; //Password
      Players[2].Nick      := 'atr'; //3 to 4 characters from Username. Ex:Optimus ->tim
      Players[2].Integer1  :=  5; //Number of Loads to do
      Players[2].Integer2  :=  5000; //Time to wait between Ores (In milliseconds, 1 second = 1000 milliseconds)
      Players[2].Active    := True;

      Players[3].Name      := 'Megatron'; //Username
      Players[3].Pass      := 'optimusrules'; //Password
      Players[3].Nick      := 'atr'; //3 to 4 characters from Username. Ex:Optimus ->tim
      Players[3].Integer1  :=  5; //Number of Loads to do
      Players[3].Integer2  :=  5000; //Time to wait between Ores (In milliseconds, 1 second = 1000 milliseconds)
      Players[3].Active    := True;

      Players[4].Name      := 'Megatron'; //Username
      Players[4].Pass      := 'optimusrules'; //Password
      Players[4].Nick      := 'atr'; //3 to 4 characters from Username. Ex:Optimus ->tim
      Players[4].Integer1  :=  5; //Number of Loads to do
      Players[4].Integer2  :=  5000; //Time to wait between Ores (In milliseconds, 1 second = 1000 milliseconds)
      Players[4].Active    := True;

      Players[5].Name      := 'Megatron'; //Username
      Players[5].Pass      := 'optimusrules'; //Password
      Players[5].Nick      := 'atr'; //3 to 4 characters from Username. Ex:Optimus ->tim
      Players[5].Integer1  :=  5; //Number of Loads to do
      Players[5].Integer2  :=  5000; //Time to wait between Ores (In milliseconds, 1 second = 1000 milliseconds)
      Players[5].Active    := True;

      Players[6].Name      := 'Megatron'; //Username
      Players[6].Pass      := 'optimusrules'; //Password
      Players[6].Nick      := 'atr'; //3 to 4 characters from Username. Ex:Optimus ->tim
      Players[6].Integer1  :=  5; //Number of Loads to do
      Players[6].Integer2  :=  5000; //Time to wait between Ores (In milliseconds, 1 second = 1000 milliseconds)
      Players[6].Active    := True;

      Players[7].Name      := 'Megatron'; //Username
      Players[7].Pass      := 'optimusrules'; //Password
      Players[7].Nick      := 'atr'; //3 to 4 characters from Username. Ex:Optimus ->tim
      Players[7].Integer1  :=  5; //Number of Loads to do
      Players[7].Integer2  :=  5000; //Time to wait between Ores (In milliseconds, 1 second = 1000 milliseconds)
      Players[7].Active    := True;

      NickNameBMP:= CreateBitmapMaskFromText(Players[CurrentPlayer].Nick, UpChars);
    end;

    Function FindFastRandoms: Boolean;  //By Wt-Fakawi
    var
      i: Integer;
    begin
      for i:=1 to 13 do
      begin
        case I of
        1:If FindDead then
            Result := True;
        2:If FindMod then
            Result := True;
        3:If FindMime then
            Result := True;
        4:If FindMaze then
            Result := True;
        5:If FindQuiz then
            Result := True;
        6:If FindDemon then
            Result := True;
        7:begin
            If NoGameTab then
            begin
              RandomN:=RandomN + 1;
              Result := True;
              Logout;
              Exit;
            end;
          end;
        8:begin
            if InBlack then
            begin
              RandomN:=RandomN + 1;
              Result := True;
              Logout;
              Exit;
            end;
          end;
        9:begin
            if(DetectFrogCave) then
            RandomN:=RandomN + 1;
            SolveFrogSwamp;
          end;
        10:begin
             if(FindFight) then
             begin
               RunAwayDirection('S');
               RandomN:=RandomN + 1;
               Wait(22000 + Random(2000));
               RunBack;
             end;
           end;
        11:begin
             FindLamp('Mining');
           end;
        12:begin
             if findname or findtalk then
             begin
              FindNormalRandoms;
             end;
           end;
        13:begin
             if(GasColors(x,y))then
             begin
               wait(20000+random(2000));
               RandomN:= RandomN + 1;
             end;
           end;
         end;
      end;
    end;

    procedure StartupScript;
    begin
      ClearDebug;
      Writeln('|-----------------------------|');
      Writeln('|Thanks for Using Kiks Iron   |');
      Writeln('|East Varrock Miner and Banker|');
      Writeln('|          Enjoy!             |');
      Writeln('|-----------------------------|');
      wait(750);
      SetupSRL;
      DeclarePlayers;
      Wait(100);
      ActivateClient;
      Wait(250);
      if(not(LoggedIn))then
      begin
        LoginPlayer;
      end;
      Wait(340+random(100));
    end;

    procedure RandomsFailSafes;
    begin
      FindFastRandoms;
      wait(1);
      FindNormalRandoms;
      if(not(loggedin))then exit;
    end;

    procedure NoBan;
    begin
      case random (8) of

        0:begin
            HoverSkill('Mining', false);
            Wait(2300+random(475));
            GameTab(4);
          end;

        1:begin
            HoverSkill('Strength', false);
            Wait(3300+random(475));
            GameTab(4);
          end;

        2:begin
            HoverSkill('Smithing', false);
            Wait(400+random(2475));
            GameTab(4);
          end;

        3:PickupMouse;

        4:AlmostLogout;

        5:case random(3) of

            0:  TypeSend('Mining lvls?');

            1:  TypeSend('Smithing lvls?');

            2:  TypeSend('Fishing levels?');

        6:  SleepandMoveMouse(5000+random(2000));

        7:begin
            DoEmote(1+random(37));
            GameTab(4);
          end;
    end;

    procedure ProgReport;
    begin
      ClearDebug;
      Writeln('|--------------------------------------------------------|');
      Writeln('|Thanks for Using Kiks East Varrock Iron Miner and Banker');
      Writeln('|Worked for: ' + ScriptTime2(2));
      Writeln('|Mined ' + IntToStr((LoadI) * 27) + ' Ores');
      Writeln('|Banked ' + InttoStr(LoadI) + ' Loads');
      Writeln('|Encountered ' + InttoStr(RandomN) + ' Fights/Gasses');
      Writeln('|--------------------------------------------------------|');
    end;

    procedure WalkFlag;
    begin
      Flag;
      RandomsFailSafes;
      Wait(50+random(250));
    end;

      procedure LoadDTM;
      begin
        IronOre := DTMFromString('78DA6314606060E06540019EBA0A0C3F81342' +
           '310FF07024669204384010D302291405A0E48701150C309242408' +
           'A8610512A204D4B0030976026A048104137E350058D40670');
      end;

      procedure BanktoMine;
      var i: integer;
      begin
        SetRun(True);
        RadialRoadWalk(FindVarrockRoadColor, 40, 72, 67, 2, 2);
        WalkFlag;
        RadialRoadWalk(FindVarrockRoadColor, 85, 126, 66, 0, 0);  //Elbow
        WalkFlag;
        for i:= 1 to 4 do
        begin
          RadialRoadWalk(FindVarrockRoadColor, 120, 190, 58, 0, 0); //North to South
          WalkFlag;
        end;
        RadialRoadWalk(FindVarrockRoadColor, 150, 255, 30, 0, 0);
        WalkFlag;
        if(FindSymbol(x, y, 'mining spot')) then
        begin
          Mouse(x, y, 2, 2, true);
          WalkFlag;
          Mouse(200, 60, 5, 5, true);
        end;
      end;
                                        //KIK WIT
      procedure MinetoBank;
      begin
        SetRun(True);
        RadialRoadWalk(FindVarrockRoadColor, 25, 95, 43, 2, 2);
        WalkFlag;
        RadialRoadWalk(FindVarrockRoadColor, 341, 390, 70, 0, 0);
        WalkFlag;
        RadialRoadWalk(FindVarrockRoadColor, 340, 410, 58, 0, 0);
        WalkFlag;
        RadialRoadWalk(FindVarrockRoadColor, 320, 420, 58, 0, 0);
        WalkFlag;
        RadialRoadWalk(FindVarrockRoadColor, 340, 410, 55, 0, 0);
        WalkFlag;
        RadialRoadWalk(FindVarrockRoadColor, 238, 289, 68, 0, 0);
        WalkFlag;
        RadialRoadWalk(FindVarrockRoadColor, 265, 295, 60, 0, 0);
        MakeCompass('S');
        LowestAngle;
        WalkFlag;
      end;

    procedure BankOre;
    begin
      RadialRoadWalk(FindVarrockRoadColor, 345, 391, 30, 2, 2);
      WalkFlag;
      OpenBank3;
      if(BankScreen)then
      begin
        LoadDTM;
        if FindDTM(IronOre, x, y, 540, 180, 750, 480)then
        begin
          Mouse(x, y, 1, 1, false);
          wait(50+random(25));
          ChooseOption(x, y, 'All');
          Wait(100+random(300));
          FreeDTM(IronOre);
          CloseBank;
        end;
      end;
    end;

    procedure MineOre;  //Mines, by KikWit
    begin
      SetRun(True);
      OreI:= 0;
      repeat
        if(FindColorTolerance(x,y,IronColor,1,1,500,400,4))then
        begin
          Wait(10);
          MMouse(x,y,1,1,True);
          wait(5);
          if(isuptext('ine'))then
          begin
            Wait(10);
            Mouse(x,y,2,2,True);
            RandomsFailSafes;
            Wait((Players[CurrentPlayer].Integer2 - 300)+random(200));
          end;
          RandomsFailSafes;
          OreI:= OreI + 1;
          Wait(10);
          wait(200);  //Decrease lag, by KW
          if(OreI:= 1+random(28))then
          begin
            NoBan;
          end;
        end;
      until(InvFull);
    end;

    procedure AllinOne;
    begin
      MakeCompass('N');
      HighestAngle;
      BanktoMine;
      MineOre;
      MinetoBank;
      BankOre;
      ProgReport;
      LoadI:=LoadI + 1;
      LoadstoDo:= LoadstoDo + 1;
      if(LoadsToDo:= Players[CurrentPlayer].integer1) then
      begin
        NextPlayer(True);
        LoadsToDo:= 0;
        exit;
      end;
    end;

    begin
      SetupSRL;
      DisguiseScar('Timmah!');
      LoadI:= 0;
      RandomN:= 0;
      LoadstoDo:= 0;
      repeat  // Main loop
        if(not(LoggedIn))then
        begin
          NextPlayer(False);
        end;
        AllinOne;
      until(false)
    end.
    ///////////By KikWit
    I dunno, those asians are pretty difficult to out-auto, legend has it they don't need sleep or food...~tim0suprem0
    Activity is on the decline - school's got me
    Check out my tutorial[s] on Color Finding!||Procedures and Functions!

  2. #2
    Join Date
    May 2006
    Posts
    1,230
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    your NoBan procedure has 2 cases, cases need a 'end' at the end of them.

    SCAR Code:
    procedure NoBan;
    begin
      case random (8) of
        0:begin
            HoverSkill('Mining', false);
            Wait(2300+random(475));
            GameTab(4);
          end;
        1:begin
            HoverSkill('Strength', false);
            Wait(3300+random(475));
            GameTab(4);
          end;
        2:begin
            HoverSkill('Smithing', false);
            Wait(400+random(2475));
            GameTab(4);
          end;
        3:PickupMouse;
        4:AlmostLogout;
        5:case random(3) of
            0:  TypeSend('Mining lvls?');
            1:  TypeSend('Smithing lvls?');
            2:  TypeSend('Fishing levels?');
         end;//here
        6:  SleepandMoveMouse(5000+random(2000));
        7:begin
            DoEmote(1+random(37));
            GameTab(4);
          end;
       end;//and here
    end;

    in your mine ore procedure 7th line, needs to be
    SCAR Code:
    MMouse(x,y,1,1);
    instead of MMouse(x,y,1,1,True);

    the last if then statement of your Mineore procedure needs to be
    SCAR Code:
    if(OreI = 1+random(28))then

    same goes as the 10nth line of your AllInOne procedure

    SCAR Code:
    if(LoadsToDo = Players[CurrentPlayer].integer1) then

    you don't need assignments before the equal in if statements (:=)

    it compiles for me now after this stuff is fixed

  3. #3
    Join Date
    Jul 2007
    Location
    America
    Posts
    421
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Omg! Thank you so much! This is sort of my first (useful) script; sorry about all the errors.



    +rep
    I dunno, those asians are pretty difficult to out-auto, legend has it they don't need sleep or food...~tim0suprem0
    Activity is on the decline - school's got me
    Check out my tutorial[s] on Color Finding!||Procedures and Functions!

  4. #4
    Join Date
    Jul 2007
    Location
    UK
    Posts
    307
    Mentioned
    0 Post(s)
    Quoted
    5 Post(s)

    Default

    Just remember that syntax errors are usally stupid mistakes eg not ending a procedure ect

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Line 135: [Error] (14845:1): Syntax error in script
    By AbsTrACt'^.| in forum OSR Help
    Replies: 16
    Last Post: 05-23-2008, 01:14 PM
  2. Replies: 5
    Last Post: 02-26-2008, 04:14 PM
  3. if, then, else syntax error?
    By kissdemon in forum OSR Help
    Replies: 4
    Last Post: 09-13-2007, 09:49 PM

Posting Permissions

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