Results 1 to 21 of 21

Thread: Variable Expected

  1. #1
    Join Date
    Jan 2007
    Location
    Toronto.
    Posts
    150
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default Variable Expected

    Well i was planning on finishing this script up tonight when i come across this strange error:

    SCAR Code:
    Failed when compiling
    Line 2: [Error] (1:1): Variable Expected in script C:\SCAR\Scripts\Projects\VEPM.scar

    But where the error occurs at line 2 there are only comments, il post the script below i hope someone can fix this, im sure it's something to do with the top part of the script.

    SCAR Code:
    //<~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~>\\
      //                   Varrock East Powerminer & Banker.                \\
      //                                                                    \\
      //           NAME        : Varrock East Powerminer & Banker.          \\
      //           WRITER      : NinjaTerrorist.                            \\
      //           CATEGORY    : Powerminer.                                \\
      //           DESCRIPTION : Mines and banks ore.                       \\
      //           USAGE       : 31 - 96 setup.                             \\
      //           AUTOCOLOR   : Yes                                        \\
      //           NOTES       : Initial release.                           \\
      //           CONTACT     : [email]NinjaTerrorist@gmail.com[/email]                   \\
      //                                                                    \\
      //<~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~>\\

    program VarrockEastPowerminer;

    {.include SRL\SRL.scar}
    {.include SRL\SRL\SkILL\Mining.scar}

    var
      DTMPick, i, sx, sy, Trips, Gases: Integer;
      gx, gy, ax, ay, ox, oy, StartTime: Integer;
      GC: array [0..3] of Integer;
      RespondTxt: array [0..20] of string;
      OC: array [0..2] of Integer;
      Active: string;
      Responded: Integer;

    {<~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~>}
    {< Setup                                                                      >}
    {< Setup for your needs.                                                      >}
    {<~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~>}

    const
      MinAccuracy = 0.4; { Used in FindDeformedSymbol. }
      Tol         = 10;  { Tolerance used for rock finding. }
      WaitT       = 5;   { Waiting time in seconds. }
      FailSafe    = 10;  { Number of times the script can fail finding a rock. }
      MaxTime     = 15;  { Max time in minutes you can take in one load.  }
      PanicKey    = 12;  { F panic key, eg 12 = F12, 8 = F8.. }

    {<~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~>}
    {< DeclarePlayers;                                                            >}
    {< Setup your players here..                                                  >}
    {<~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~>}

    procedure DeclarePlayers;
    begin
      HowManyPlayers := 4;
      NumberOfPlayers(HowManyPlayers);
      CurrentPlayer := 0;

      Players[0].Name     := '';
      Players[0].Pass     := '';
      Players[0].Nick     := '';
      Players[0].Loc      := '';
      Players[0].Active   := True;
      Players[0].Boolean1 := False;       { Axe Equiped? }
      Players[0].String1  := 'copper';    { Ore? }

      Players[1].Name     := '';
      Players[1].Pass     := '';
      Players[1].Nick     := '';
      Players[1].Loc      := '';
      Players[1].Active   := True;
      Players[1].Boolean1 := False;
      Players[1].String1  := 'copper';

      Players[2].Name     := '';
      Players[2].Pass     := '';
      Players[2].Nick     := '';
      Players[2].Loc      := '';
      Players[2].Active   := True;
      Players[2].Boolean1 := False;
      Players[2].String1  := 'copper';

      Players[3].Name     := '';
      Players[3].Pass     := '';
      Players[3].Nick     := '';
      Players[3].Loc      := '';
      Players[3].Active   := True;
      Players[3].Boolean1 := False;
      Players[3].String1  := 'copper';
     
      WriteLn('We are using: ' + IntToStr(HowManyPlayers) + ' players.');
      WriteLn('Current players is: ' + Players[CurrentPlayer].Name);
    end;

    {<~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~>}
    {< End Setup                                                                  >}
    {< Dont want to be touching anything past here. :P                            >}
    {<~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~>}

    {<~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~>}
    {< CheckSetup;                                                                >}
    {< Makes sure setup is correct.                                               >}
    {<~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~>}

    function CheckSetup: Boolean;
      begin
        for i := 0 to HowManyPlayers -1 do
          if(Players[i].Name = '')or(Players[i].Pass = '')or(Players[i].Nick = '')or(Players[i].String1 = '')then
            begin
              Result := False;
              WriteLn('Setup incorrect.');
            end else
              begin
                Result := True;
                Status('Setup looks ok...');
              end;
      end;

    {<~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~>}
    {< ReadyScript;                                                               >}
    {< Prepares script.                                                           >}
    {<~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~>}

    procedure ReadyScript;
      begin
        if(not(LoggedIn))then
          begin
            LoginPlayer;
            WriteLn('Logged ' + Players[CurrentPlayer].Name + ' in.');
          end
        else
          begin
            Status('Checking setup..');
              if(CheckSetup)then
                begin
                  MakeCompass('N');
                  HighestAngle;
                  DisguiseSCAR('ZoneAlarm Pro');
                  WriteLn('Script started at: ' + TheTime);
                  ChatsOff;
                  FindPickHeadColor;
                  SetRun(True);
                end;
           end;
      end;


    {<~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~>}
    {< LoadDTMs;                                                                  >}
    {< Loads all DTMs used in memory.                                             >}
    {<~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~>}

    procedure LoadDTMs;
      begin
        DTMPick := DTMFromString('78DA6314626060606340011616210C3A8C0C0' +
                'C40C4F01F0818E5810C7E5435060A0A609A11CA676402121C0C68' +
                '8011550DC81E79026A048104337E3500526F05F4');
      end;

    {<~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~>}
    {< AllFalse;                                                                  >}
    {< Checks if all players are false. ( Based off TOB's AllPlayersInactive; )   >}
    {<~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~>}

    function AllFalse: Boolean;

    var
      i, Count: Integer;

      begin
        for i := 0 to HowManyPlayers - 1 do
          begin
            if(Players[i].Active = False)then
              begin
                Count := Count +1;
              end;
            if(Count >= HowManyPlayers)then
              begin
                WriteLn('All players are inactive.');
                Result := True;
              end else Result := False;
          end;
      end;

    {<~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~>}
    {< RespondText;                                                               >}
    {< Declares text used for Respond;                                            >}
    {<~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~>}

    procedure RespondText;
      begin
        RespondTxt[0]  := 'lolz';
        RespondTxt[1]  := 'lol';
        RespondTxt[2]  := 'rofl!';      // Respond to common lol, rofl ect..
        RespondTxt[3]  := 'lmao';
        RespondTxt[4]  := 'lmfao';
        RespondTxt[5]  := 'pmsl';

        RespondTxt[6]  := 'hey';
        RespondTxt[7]  := 'wasssup?';
        RespondTxt[8]  := 'howdy';      // Respond to common hi, hey ect..
        RespondTxt[9]  := 'hi';
        RespondTxt[10] := 'what?';

        RespondTxt[11] := IntToStr(GetSkillLevel('mining')) + ' my level';
        RespondTxt[12] := 'my mining lvl is ' + IntToStr(GetSkillLevel('mining')) + ' ^^';    // Respond to mining lvl?
        RespondTxt[13] := 'lolz mine is only ' + IntToStr(GetSkillLevel('mining'));
        RespondTxt[14] := IntToStr(GetSkillLevel('mining'));
        RespondTxt[15] := IntToStr(GetSkillLevel('mining')) + ' here';

        RespondTxt[16] := 'whats your mining lvl?';
        RespondTxt[17] := 'nice';
        RespondTxt[18] := 'omg someone was ranover outside my house!!';     // Just random chat. ^^
        RespondTxt[19] := 'that guy over there is autoing i can tell..';
        RespondTxt[20] := 'you like pasta';
      end;

    {<~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~>}
    {< Respond;                                                                   >}
    {< Responds to common chat messages.                                          >}
    {<~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~>}

    procedure Respond;
      begin
        OldLine := TheLine;
        TheName := lowercase(trim(GetTextAtEx(20, 415, 45, SmallChars, False, False, 0, 2, 0, 40, True, tr_NormalChars)));
        TheLine := lowercase(trim(GetTextAtEx(20, 415, 45, SmallChars, False, False, 0, 2, 16711680, 40, False, tr_NormalChars)));
        NewLine := TheLine;

        if(OldLine <> NewLine)then
          if(pos('yo', TheName) <> 0)or(pos(Players[CurrentPlayer].Nick, TheName) <> 0)then
            begin
              Wait(2000 + Random(7000));
            end else

        if(InChatMulti('hey', 'hi', 'wassup'))then
          begin
            TypeSend(RespondTxt[0 + Random(6)]);
            Responded := Responded + 1;
          end;

        if(InChatMulti('lol', 'lmao', 'rofl'))then
          begin
            TypeSend(RespondTxt[5 + Random(6)]);
            Responded := Responded + 1;
          end;

        if(InChatMulti('mining lvl', 'mining lvls', 'mine lvls'))then
          begin
            TypeSend(RespondTxt[10 + Random(6)]);
            Responded := Responded + 1;
          end;

        if(InChatMulti('what', 'wth', 'wtf'))then
          begin
            TypeSend(RespondTxt[15 + Random(6)]);
            Responded := Responded + 1;
          end;
      end;

    {<~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~>}
    {< RandomizeClick;                                                            >}
    {< Randoms between left or right click.                                       >}
    {<~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~>}

    procedure RandomizeClick(x, y: Integer);
      begin
        case Random(2) of
          0: Mouse(x, y, 1, 1, True);
          1: PopUp2(x, y, 1, 1, 'Mine');
        end;
      end;

    {<~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~>}
    {< Randoms;                                                                   >}
    {< Modifyied SRL FindNormalRandoms;                                           >}
    {<~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~>}

    function Randoms: Boolean;
      begin
        if(not(LoggedIn))then Exit;
          for i := 0 to 17 do
            begin
              case i of
                0: if FindPick then
                     Result := True;
                1: Respond;
                2: if FindTalk then
                     Result := True;
                3: if FindDead then
                     Result := True;
                4: if FindMod then
                     Result := True;
                5: if FindMime then
                     Result := True;
                6: if FindMaze then
                     Result := True;
                7: if FindQuiz then
                     Result := True;
                8: if FindDemon then
                     Result := True;
                9: if FindScapeRune then
                     Result := True;
                10: if FindTalk then
                      Result := True;
                11: if FindLamp(LampSkill) then
                      Result := True;
                12: if (FindNewBox) then
                      begin
                        Result := True;
                          if (UseBoxSolver) then
                            SolveBox
                          else
                            GambleNewBox;
                        end;
                13: if FindTrade then
                      Result := True;
                14: begin
                      if NoGameTab then
                        begin
                          Result := True;
                          Players[CurrentPlayer].Loc := 'No GameTab';
                          LogOut;
                          Exit;
                        end;
                     end;
                15: SaveToChatLog;
                16: if RC then
                      Result := True;
                17: CloseWindow;
              end;
              Wait(1);
           end;
      end;

    {<~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~>}
    {< PickBroke;                                                                 >}
    {< Checks if pickaxe is broken.                                               >}
    {<~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~>}

    function PickBroke: Boolean;
      begin
        if(not(LoggedIn))then Exit;
          case Players[CurrentPlayer].Boolean1 of
            False: GameTab(3);
            True : GameTab(4);
          end;
        if(FindDTM(DTMPick, ax, ay, 564, 212, 726, 454))then
          begin
            MMouse(ax, ay, 1, 1);
            if(IsUpText('roken'))or(IsUpText('andle'))then Result := True;
          end;
      end;

    {<~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~>}
    {< CheckGas;                                                                  >}
    {< Finds and handles gas.                                                     >}
    {<~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~>}

    function CheckGas: Boolean;
      begin
        GC[0] := 11056825;
        GC[1] := 9281445;
        GC[2] := 8492186;
        GC[3] := 7767947;

          if(not(LoggedIn))then Exit;
            for i := 0 to 3 do
              if(FindColorSpiralTolerance(gx, gy, GC[i], 3, 3, 515, 336, 10))then
                begin
                  WriteLn('Gas found!!');
                    repeat
                      Mouse(450, 12, 0, 0, True);
                      FTWait(10 + Random(30));
                    until(PickBroke)or(not(FindColorSpiralTolerance(gx, gy, GC[i], 3, 3, 515, 336, 10)))
               if(not(FindColorSpiralTolerance(gx, gy, GC[i], 3, 3, 515, 336, 10)))then
            Result := False; // No gas found..
          if(PickBroke)then
            begin
              WriteLn('Axe has been broken!!');
              Result := False;
            end else
              begin
                WriteLn('Gas found and handled.');
                Gases := Gases + 1;
                Result := True;
              end;
          end;
      end;

    {<~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~>}
    {< SetColor;                                                                  >}
    {< Setups colors.                                                             >}
    {<~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~>}

    procedure SetColors;
      begin
        case LowerCase(Players[CurrentPlayer].String1) of
          'copper' : begin
                       OC[0] := 4615059;
                       OC[1] := 2769242;     // Change if needed.
                       OC[2] := 3956354;
                       WriteLn('RockColor''s: ' + IntToStr(OC[0]) + ',' + IntToStr(OC[1]) + ',' + IntToStr(OC[2]));
                     end;
          'tin'    : begin
                       OC[0] := 8224392;
                       OC[1] := 5395032;     // Change if needed.
                       OC[2] := 6579308;
                       WriteLn('RockColor''s: ' + IntToStr(OC[0]) + ',' + IntToStr(OC[1]) + ',' + IntToStr(OC[2]));
                     end;
          'iron'   : begin
                       OC[0] := 2503250;
                       OC[1] := 2174538;     // Change if needed.
                       OC[2] := 1449776;
                       WriteLn('RockColor''s: ' + IntToStr(OC[0]) + ',' + IntToStr(OC[1]) + ',' + IntToStr(OC[2]));
                     end;
        end;
      end;

    {<~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~>}
    {< FindDeformedSymbol;                                                        >}
    {< Attempts to find covered symbols.                                          >}
    {<~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~>}

    function FindDeformedSymbol(Symbol: string; MinAcc: Extended): Boolean;
      begin
        if(not(LoggedIn))then Exit;
          if(FindSymbol(sx, sy, LowerCase(Symbol)))then
            begin
              WriteLn(UpperCase(Symbol) + ' symbol was found at: ' + IntToStr(sx) + ',' + IntToStr(sy));
              Result := True; // yay :D
            end;
          if(not(FindSymbol(sx, sy, LowerCase(Symbol))))then
            begin
              repeat
                 SendArrowSilentWait(2, 500 + Random(500));
                 Wait(5000 + Random(2000));
                 SymbolAccuracy := SymbolAccuracy - 0.1;
              until(FindSymbol(sx, sy, LowerCase(Symbol)))or(SymbolAccuracy >= MinAcc)
          if(SymbolAccuracy >= MinAcc)then
            begin
              WriteLn(UpperCase(Symbol) + ' symbol was not found.');
              Result := False; // nay :'(
            end else
              begin
                WriteLn(UpperCase(Symbol) + ' symbol was found at: ' + IntToStr(sx) + ',' + IntToStr(sy));
                Result := True; // yay :D
              end;
          end;
      end;

    {<~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~>}
    {< Report;                                                                    >}
    {< Attempts to find covered symbols.                                          >}
    {<~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~>}

    procedure Report;
      begin
        WriteLn('');
        WriteLn('{<~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~>}');
        WriteLn('{<     East Varrock Powerminer & Banker      >)');
        WriteLn('{<~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~>}');
        WriteLn('   Worked for: ' + TimeRunning                  );
        WriteLn('   Mined: ' + IntToStr(Trips * 28) + ' ore.    ');
        WriteLn('   Made: ' + IntToStr(Trips) + ' trips.        ');
        WriteLn('   Avoided gas: ' + IntToStr(Gases) + ' times. ');
        WriteLn('   Current Player: ' + Players[CurrentPlayer].Name);
        WriteLn('   Mining Level: ' + IntToStr(Players[CurrentPlayer].Level[15]));
        WriteLn('{<~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~>}');
        for i := 0 to HowManyPlayers-1 do
          begin
            if(Players[i].Active = True)then
              begin
                Active := 'True'
              end else Active := 'False';
                WriteLn(IntToStr(i) + ' : ' + Players[i].Name + ' = ' + Active + '. - Lvl : '
                + IntToStr(Players[i].Level[15]) + '. - B :' + IntToStr(Players[i].Banked)
                + ' Times.' + ' -  : ' + IntToStr(Players[i].Worked) + ' mins.' + ' - Loc: '
                + Players[i].Loc);
                WriteLn('{<~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~>}');
                WriteLn('');
                SRLRandomsReport;
           end;
      end;
     
    {<~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~>}
    {< WalkTo;                                                                    >}
    {< Raidial walks to the mine.                                                 >}
    {<~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~>}

    procedure WalkTo;
      begin
        if(not(LoggedIn))then Exit;
          FindRoadColor;
          RadialRoadWalk(TestColor, 6, 70, 70, 1, 1);
          FindRoadColor;
          RadialRoadWalk(TestColor, 90, 140, 65, 1, 1);
          FindRoadColor;                                       // ;)
          RadialRoadWalk(TestColor, 126, 220, 60, 1, 1);
          FindRoadColor;
          RadialRoadWalk(TestColor, 139, 200, 57, 1, 1);
          FindRoadColor;
          RadialRoadWalk(TestColor, 134, 200, 55, 1, 1);
          FindRoadColor;
          RadialRoadWalk(TestColor, 130, 220, 60, 1, 1);
          FindRoadColor;
          RadialRoadWalk(TestColor, 155, 220, 40, 1, 1);
            if(FindDeformedSymbol('mining spot', MinAccuracy))then
              begin
                repeat
                  Mouse(sx, sy, 1, 1, True);
                  Wait(1000 + Random(5000));
                until(not(FlagPresent))
                WriteLn('Walking to mine successfull.');
              end else
                begin
                  Players[CurrentPlayer].Loc := 'Lost';
                  WriteLn('Walking to mine unsuccessfull.');
                  NextPlayer(False);
                end;
      end;

    {<~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~>}
    {< WalkBack;                                                                  >}
    {< Radial walks to bank.                                                      >}
    {<~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~>}

    procedure WalkBack;
      begin
        if(not(LoggedIn))then Exit;
          begin
            if(InvEmpty)then
              begin
                WriteLn('Something has gone wrong during mining.');
                NextPlayer(False);
              end else
                begin
                  RadialRoadWalk(TestColor, 8, 75, 70, 1, 1);
                  FindRoadColor;
                  RadialRoadWalk(TestColor, -50, 50, 70, 1, 1);
                  FindRoadColor;
                  RadialRoadWalk(TestColor, -50, 50, 70, 1, 1);
                  FindRoadColor;
                  RadialRoadWalk(TestColor, -50, 50, 70, 1, 1);
                  FindRoadColor;
                  RadialRoadWalk(TestColor, -70, -10, 70, 1, 1);
                  FindRoadColor;
                  RadialRoadWalk(TestColor, -50, -130, 70, 1, 1);
                end;
            if(FindDeformedSymbol('bank', 0.4))then
              begin
                Wait(2000 + Random(3000));
                Mouse(sx, sy, 1, 1, True);
                WriteLn('Walking back successfull.');
              end else
                begin
                  WriteLn('Walking back unsuccessfull.');
                  NextPlayer(False);
                end;
           end;
      end;

    {<~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~>}
    {< BankTheGoods;                                                              >}
    {< Banks ores.                                                                >}
    {<~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~>}

    procedure BankTheGoods;

    var
      Att: Integer;

      begin
        if(not(LoggedIn))then Exit;
          begin
            if(InvCount <> 28)then
              begin
                WriteLn('Something has gone wrong during mining.');
                NextPlayer(False);
              end else
                begin
                  repeat
                    Att := Att + 1;
                    Wait(2000 + Random(5000));
                    OpenBank;
                  until(BankScreen)or(Att >= FailSafe)
                    case Players[CurrentPlayer].Boolean1 of
                      False : Deposit(2, 28, 2);
                      True  : Deposit(1, 28, 2);
                    end;
                    Trips := Trips + 1;
                end;
           end;
      end;

    {<~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~>}
    {< MineOre;                                                                   >}
    {< Mines ore.                                                                 >}
    {<~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~>}

    procedure MineOre;

    var
      Att: Integer;

      begin
        if(not(LoggedIn))then Exit;
          begin
            Att := 0;
            for i := 0 to 2 do
              if(FindObjOre(ox, oy, Players[CurrentPlayer].String1, OC[i], Tol, 5))then
                begin
                  MMouse(ox, oy, 1, 1);
                    if(IsUpText('ine'))then
                      begin
                        RandomizeClick(ox, oy);
                        Wait(WaitT * 6000 + Random(4000));
                      end else
                        begin
                          repeat
                            Att := Att + 1;
                            SendArrowSilentWait(2, 500 + Random(500));
                            Wait(WaitT * 6000 + Random(2000));
                          until(Att >= FailSafe)or(FindObjOre(ox, oy, Players[CurrentPlayer].String1, OC[i], Tol, 5))
                        end;
                    if(Att >= FailSafe)then
                      begin
                        WriteLn('Finding of: ' + UpperCase(Players[CurrentPlayer].String1) + ' has failed.');
                        NextPlayer(False);
                      end;
                    if(FindObjOre(ox, oy, Players[CurrentPlayer].String1, OC[i], Tol, 5))then
                      begin
                        MMouse(ox, oy, 1, 1);
                          if(IsUpText('ine'))then
                            begin
                              RandomizeClick(ox, oy);
                              Wait(WaitT * 6000 + Random(4000));
                            end else
                              begin
                                WriteLn('Finding of: ' + UpperCase(Players[CurrentPlayer].String1) + ' has failed.');
                              end;
                        end;
                  end;
            end;
      end;

    {<~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~>}
    {< Main Loop                                                                  >}
    {< Core.                                                                      >}
    {<~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~>}

    begin
      SetupSRL;
      SetupSRLMining;
      LoadDTMs;
      ReadyScript;
        repeat
          if(FindDeformedSymbol('bank', MinAccuracy))then
            begin
              Players[CurrentPlayer].Loc := 'Bank';
            end
          if(FindDeformedSymbol('mining spot', MinAccuracy))then
              begin
                Players[CurrentPlayer].Loc := 'Mine';
              end;
          if(Players[CurrentPlayer].Loc = 'Mine')then
            begin
              WriteLn('We are already at the mine!');
            end;
          if(Players[CurrentPlayer].Loc = 'Bank')then
            begin
              WalkTo;
            end else
              begin
                NextPlayer(False);
            begin
              MarkTime(StartTime);
                repeat
                  if(not(LoggedIn))then Break;
                    MineOre;
                    CheckGas;
                    Randoms;
                    RandomMovement;
                    Report;
                until(InvFull)or(TimeFromMark(StartTime * 60000) >= MaxTime * 60000))
              WalkBack;
              BankTheGoods;
            end;
        until(AllFalse)or(IsFKeyDown(PanicKey))
    end.

  2. #2
    Join Date
    Feb 2007
    Location
    USA
    Posts
    667
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    I dunno if this matters but I always do my includes with the slashes going the other way.

  3. #3
    Join Date
    Jan 2007
    Location
    Toronto.
    Posts
    150
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Thanks for the reply but that didn't make a difference. :'(

  4. #4
    Join Date
    Jun 2006
    Location
    Tennessee, USA
    Posts
    2,603
    Mentioned
    1 Post(s)
    Quoted
    46 Post(s)

    Default

    Quote Originally Posted by omgh4x0rz View Post
    I dunno if this matters but I always do my includes with the slashes going the other way.
    yeah that doesnt matter. and i dont know whats wrong, cause i ran the script and it said error on line 1 so i dont know where to look.

  5. #5
    Join Date
    Jan 2007
    Location
    Toronto.
    Posts
    150
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Quote Originally Posted by mjordan View Post
    yeah that doesnt matter. and i dont know whats wrong, cause i ran the script and it said error on line 1 so i dont know where to look.
    Yeah is should say something like this:

    SCAR Code:
    The real line number: [Error] (1:1): Variable Expected in script C:\SCAR\Scripts\Projects\VEPM.scar


  6. #6
    Join Date
    Jun 2006
    Location
    Tennessee, USA
    Posts
    2,603
    Mentioned
    1 Post(s)
    Quoted
    46 Post(s)

    Default

    @ninjaterrorist, yeah it said the error was on line one.....

  7. #7
    Join Date
    Jan 2007
    Location
    Toronto.
    Posts
    150
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Yeah but i mean there is nothing on line 1 so that can't be the error. :S

  8. #8
    Join Date
    Jun 2006
    Posts
    3,861
    Mentioned
    3 Post(s)
    Quoted
    1 Post(s)

    Default

    That's weird! Well it has something to do with including the Mining.scar. If you take that out, it gets an error later on (because you don't have it included), but there's no error on line 1.

  9. #9
    Join Date
    Jun 2006
    Location
    Tennessee, USA
    Posts
    2,603
    Mentioned
    1 Post(s)
    Quoted
    46 Post(s)

    Default

    Quote Originally Posted by NinjaTerrorist View Post
    Yeah but i mean there is nothing on line 1 so that can't be the error. :S
    ywah thats why i couldnt figure it out, cause there is nothing on line one

  10. #10
    Join Date
    Jun 2006
    Posts
    3,861
    Mentioned
    3 Post(s)
    Quoted
    1 Post(s)

    Default

    Didn't you read my post?

    It has something to do with including Mining.scar.

  11. #11
    Join Date
    Jun 2006
    Location
    Tennessee, USA
    Posts
    2,603
    Mentioned
    1 Post(s)
    Quoted
    46 Post(s)

    Default

    Quote Originally Posted by bullzeye95 View Post
    Didn't you read my post?

    It has something to do with including Mining.scar.
    oh sorry lol. well what happens when you take that out and run it?

  12. #12
    Join Date
    Jun 2006
    Posts
    3,861
    Mentioned
    3 Post(s)
    Quoted
    1 Post(s)

    Default

    Oh you get some kind of error like "Unknown identifier (insert some kind of pickaxe thing here)".

  13. #13
    Join Date
    Jun 2006
    Location
    Tennessee, USA
    Posts
    2,603
    Mentioned
    1 Post(s)
    Quoted
    46 Post(s)

    Default

    ok well remove Mining.scar and you get unknown identifier FindPickHeadColor. so you need to declare that as a variable then run it and it says it needs an assignment or something. so it looks like to me you just put FindPickHeadColor in there and its not even a procedure or function

  14. #14
    Join Date
    Oct 2006
    Location
    New Zealand
    Posts
    423
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Quote Originally Posted by mjordan View Post
    ok well remove Mining.scar and you get unknown identifier FindPickHeadColor. so you need to declare that as a variable then run it and it says it needs an assignment or something. so it looks like to me you just put FindPickHeadColor in there and its not even a procedure or function
    it is a function in mining.scar. i just went through it and copyed the stuff you use in mining.scar to the script and rearranged it but got stuck with 'if nopick then...' because i couldnt find where it sets 'nopick'. I think if you use someone elses procedure or see what sumillion or wizzup did for pick finding etc in there scripts and copy it. actually, you just need to put SetupSRLMining; in your script, unless you have already....

    Edit: oh, you did :P

  15. #15
    Join Date
    Jun 2006
    Location
    Tennessee, USA
    Posts
    2,603
    Mentioned
    1 Post(s)
    Quoted
    46 Post(s)

    Default

    yeah he already has setupSRLmining in there

  16. #16
    Join Date
    Jan 2007
    Location
    Toronto.
    Posts
    150
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Quote Originally Posted by meanage View Post
    it is a function in mining.scar. i just went through it and copyed the stuff you use in mining.scar to the script and rearranged it but got stuck with 'if nopick then...' because i couldnt find where it sets 'nopick'. I think if you use someone elses procedure or see what sumillion or wizzup did for pick finding etc in there scripts and copy it. actually, you just need to put SetupSRLMining; in your script, unless you have already....

    Edit: oh, you did :P
    Yeh i put SetupSRLMining; and i'd prefer to have my own stuff in there and the PickBroke; function just searches for the pick with a DTM and checks if it's broken, maybe if i move it up.

  17. #17
    Join Date
    Jan 2007
    Location
    Toronto.
    Posts
    150
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Bumped because I still haven't found a solution to this problem at all. :'(

  18. #18
    Join Date
    Jan 2007
    Location
    USA
    Posts
    1,782
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    this happened to me too in my door opening function so yeah its not in mining.scar

    Join the fastest growing merchanting clan on the the net!

  19. #19
    Join Date
    Jan 2007
    Location
    Toronto.
    Posts
    150
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    I know its a real pain in the arse, i can't even test to see how efficient my script really is. =/

  20. #20
    Join Date
    Sep 2006
    Location
    In Finland
    Posts
    124
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Quote Originally Posted by NinjaTerrorist View Post
    I know its a real pain in the arse, i can't even test to see how efficient my script really is. =/
    yeah...happened on my Varrock East Autominer/Banker too...it has something to do with symbols and +-randoms...i hope this helped...!

    when i had this:
    SCAR Code:
    FindSymbol(x+20+random(5),y-20+random(4),'Mining Spot')
    Mouse(x+random(1),y+random(5),1,1,true)
    i got the:
    SCAR Code:
    Failed when compiling
    Line 1: [Error] (1:1): Variable Expected in script

    I really hope you get it solved...!

    Here's how i fixed this problem...:
    SCAR Code:
    FindSymbol(x,y,'Mining Spot')
    Mouse(x+20+random(4),y-20+random(5),1,1,true)

  21. #21
    Join Date
    Jun 2006
    Location
    USA
    Posts
    1,828
    Mentioned
    1 Post(s)
    Quoted
    0 Post(s)

    Default

    It is because you didn't set a value to variable. And it is somewhere in your script, not in include....

    Look at this:
    SCAR Code:
    {.include srl/srl.scar}
    procedure New;
    begin
    MarkTime(x)
    if(TimeFromMark((X)/1000) 1)then
    Writeln('A')
    end;

    begin
    New;
    end.
    And what error does it give?

    It can be solved with this:
    SCAR Code:
    {.include srl/SRL.scar}
    procedure New;
    begin
    MarkTime(x)
    if(TimeFromMark(X)/1000>=1)then
    Writeln('A')
    end;

    begin
    New;
    end.

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Variable Expected
    By Laur€ns in forum OSR Help
    Replies: 9
    Last Post: 07-24-2008, 01:05 PM
  2. Variable expected?
    By stampede10343 in forum OSR Help
    Replies: 2
    Last Post: 03-01-2008, 11:43 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
  •