Results 1 to 2 of 2

Thread: Line 1 error... never heard of this o.O

  1. #1
    Join Date
    Feb 2009
    Location
    Irvine, CA
    Posts
    2,873
    Mentioned
    8 Post(s)
    Quoted
    138 Post(s)

    Default Line 1 error... never heard of this o.O

    EDIT:
    MORE INFO HERE: http://villavu.com/forum/showthread.php?t=58824

    so when i attempt to compile my script i get this...

    [Error] (1:1): Variable Expected at line 0
    Compiling failed.

    i just made a few changes (primarily in the WithDrawTheFood procedure), it compiled before this... this is just such an odd error o.O

    heres the script:

    Progress Report:
    program AKC;
    
    {=========================================================================]
    [                                                                         ]
    [                                                                         ]
    [           NAME        : AKC                                             ]
    [           WRITER      : TomTuff                                         ]
    [           CATEGORY    : Cooking                                         ]
    [           DESCRIPTION : Cooks fish (currently trout only) in al-kharid  ]
    [           NOTES       : Start with player in bank.                      ]
    [                                                                         ]
    [                                                                         ]
    [=========================================================================]
    [                              Instructions                               ]
    [=========================================================================]
    [ 1. Have your display settings set to 32 bit TRUE color.                 ]
    [ 2. Fill out DeclarePlayers.                                             ]
    [ (For further instructions on how to fill it out, visit this thread:     ]
    [   http://www.villavu.com/forum/showthread.php?t=5410)                   ]
    [ 3. If you want to use S.M.A.R.T., uncomment line 24, otherwise          ]
    [    drag the crosshair over the RS client window.                        ]
    [ 4. Start script!                                                        ]
    [=========================================================================}
    //{.include SRL/SRL/misc/smart.scar}
    {.include SRL/SRL.scar}
    {.include SRL/SRL/misc/BuySell.scar}
    
    
    var
    {prog}
      C,StartTime,LD: integer;
    
    const
      RangeRoomCol = 6717344;   {edit these if walking does not work}
      BankCol = 7113911;        {take colors from minimap           }
    
    procedure DeclarePlayers;
    begin
      HowManyPlayers := 1;
      NumberOfPlayers(HowManyPlayers);
      CurrentPlayer := 0;
    
      With players[0] do
      begin
        Name := ''; //character name
        Pass := ''; //character pass
        Nick := ''; //3 consecutive non capital letters of username
        Active := True; //Use this player?
        Pin := '';//Bank pin.  Leave blank if you don't have one.
        BoxRewards := ['Xp', 'mote', 'ostume', 'oins', 'aphire', 'ssence'];
      end;
    
      {
      With players[1] do
      begin
        Name := ''; //character name
        Pass := ''; //character pass
        Nick := ''; //3 consecutive non capital letters of username
        Active := True; //Use this player?
        Pin := '';//Bank pin.  Leave blank if you don't have one.
        BoxRewards := ['Xp', 'mote', 'ostume', 'oins', 'aphire', 'ssence'];
      end;}   {uncomment and copy this ass neccesary to add more players}
    end;
    
    procedure Antiban(I: integer);
    var
      ABChance: integer;
    
    begin
      case I of
        0: ABChance := 60;
        1: ABChance := 300;
        2: ABChance := 600;
      end;
      case Random(ABChance) of
        0: RandomRClick;
        1: HoverSkill('cooking', false);
        2: PickUpMouse;
        4: RandomMovement;
        5: BoredHuman;
        6: ExamineInv;
      end;
      GameTab(tab_Inv);
    end;
    
    
    procedure antirandom;
    begin
      FindNormalRandoms;
      LampSkill := 'cooking';
    end;
    
    
    procedure logo;
    begin
      ClearDebug;
      WriteLn('A script by...');
      Wait(1000);
      WriteLn('_________ _______  _______ _________          _______  _______  ');
      Wait(10);
      WriteLn('\__   __/(  ___  )(       )\__   __/|\     /|(  ____ \(  ____ \ ');
      Wait(10);
      WriteLn('   ) (   | (   ) || () () |   ) (   | )   ( || (    \/| (    \/ ');
      Wait(10);
      WriteLn('   | |   | |   | || || || |   | |   | |   | || (__    | (__     ');
      Wait(10);
      WriteLn('   | |   | |   | || |(_)| |   | |   | |   | ||  __)   |  __)    ');
      Wait(10);
      WriteLn('   | |   | |   | || |   | |   | |   | |   | || (      | (       ');
      Wait(10);
      WriteLn('   | |   | (___) || )   ( |   | |   | (___) || )      | )       ');
      Wait(10);
      WriteLn('   )_(   (_______)|/     \|   )_(   (_______)|/       |/        ');
      Wait(1100);
      WriteLn('presenting...');
      Wait(1000);
      WriteLn(' _______  _        _______  ');
      Wait(10);
      WriteLn('(  ___  )| \    /\(  ____ \ ');
      Wait(10);
      WriteLn('| (   ) ||  \  / /| (    \/ ');
      Wait(10);
      WriteLn('| (___) ||  (_/ / | |       ');
      Wait(10);
      WriteLn('|  ___  ||   _ (  | |       ');
      WriteLn('| (   ) ||  ( \ \ | |       ');
      Wait(10);
      WriteLn('| )   ( ||  /  \ \| (____/\ ');
      Wait(10);
      WriteLn('|/     \||_/    \/(_______/ ');
      Wait(1000);
      WriteLn('Al Kharid Cooker');
      Wait(1100);
      ClearDebug;
    end;
    
    
    function CountInvFish: integer;
    var
      NumFish,Fish: integer;
    begin
      Fish := DTMFromString('mbQAAAHicY2VgYDABYjMg1gRiUyB2BuIcIE4B4jIgLgHiNCBurK4GkkwMB3bsYFg4axZDR1MTAz9QBB0zomE4AACYawqK');
      NumFish := CountItems('dtm',Fish,[]);
      FreeDTM(Fish);
      Result := NumFish;
      WriteLn(IntToStr(NumFish));
    end;
    
    
    procedure setcamera;
    begin
      MakeCompass('n');
      SetAngle(true);
    end;
    
    
    procedure OpenTheBank;   //i luffs yew (over msn), slightly modified
    begin
      if(not (Loggedin)) then exit;
      if BankScreen then exit;
      setcamera;
      if( not (OpenBankNPC)) then
        if(not (OpenBankFast('akb'))) then
          if(not (OpenBank('akb',false,false))) then
            if(not (OpenBankGlass('akb',false,false))) then
            begin
              WriteLn('banking failed, logging out');
              Logout;
            end;
      Antiban(2);
    end;
    
    
    procedure WithdrawTheFood;
    var
      Fish,x,y,i,a: integer;
      TP: TPointArray;
    begin
      if(not (Loggedin)) then exit;
      if(not (BankScreen)) then OpenTheBank;
      DepositAll;
      FixBank;
      FixBankTab;
      Wait(100+random(25));
      Fish := DTMFromString('mbQAAAHicY2VgYDABYjMg1gRiUyB2BuIcIE4B4jIgLgHiNCBurK4GkkwMB3bsYFg4axZDR1MTAz9QBB0zomE4AACYawqK');
      if FindDTM(Fish, x, y, MSX1, MSY1, MSX2, MSY2) then
      begin
        WriteLn('found du fishy');
        Mouse(x,y,5,5,false);
        ChooseOption('draw-All');
      end else
      begin
        TP := FindItems(10526888, 6, 'aw trout', 28);
        repeat
          MMouse(TP[i].x, TP[i].y,4,4);
          Mouse(x,y,0,0,false);
          ChooseOption('All');
          inc(a+1);
        until(CountInvFish > 0) or (a>4);
      end;
      CloseBank;
      if CountInvFish = 0 then logout;
      FreeDTM(Fish);
    end;
    
    
    procedure WalkToRange;
    var x, y: integer;
    begin
      if not LoggedIn then Exit;
      setcamera;
      antirandom;
      antiban(1);
      if( not( RadialWalkTolerance(RangeRoomCol, 4, 30, 55,1,1,10))) then
        if( not( FindSymbol(x,y, 'cook'))) then
        begin
          WriteLn('both walking functions failed, logging out...');
          logout;
        end else Mouse(x,y,2,2,true);
      Wait(1000+random(200));
    end;
    
    procedure WalkToBank;
    begin
      if not LoggedIn then Exit;
      setcamera;
      antirandom;
      antiban(1);
      if( not( RadialWalkTolerance(BankCol, 195, 205, 53,1,1,10))) then
        if( not( FindSymbol(x,y, 'bank'))) then
        begin
          WriteLn('both walking functions failed, logging out...');
          logout;
        end else Mouse(x,y,2,2,true);
      Wait(1000+random(200));
    end;
    
    
    function FindTheRange: Boolean; //credits: Coh3n's guide, slightly modified/parts taken out
    var
      x, y, i: integer;
      TPA: TPointArray;
      ATPA : T2DPointArray;
    begin
      if not LoggedIn then Exit;
      ColorToleranceSpeed(2);
      SetColorSpeed2Modifiers(0.04, 0.85);
      FindColorsSpiralTolerance(x,y,TPA,1648046,MSX1, MSY1, MSX2, MSY2,10);
      ATPA := SplitTPAEX(TPA,5,5);
      if(Length(ATPA) = 0) then
      begin
        Writeln('Couldnt find range color. Update Range color?');
        Exit;
      end;
      SortATPAFromFirstPoint(ATPA, Point(MSCX,MSCY));
      for i := 0 to 0 do
      begin
        WriteLn('Length: ' + IntToStr(Length(ATPA[i])));
        MiddleTPAEx(ATPA[i],x,y);
        MMouse(x,y,4,4);
        Mouse(x,y,0,0,true);
        Result := True;
        end;
      Wait(4000+Random(1000));
    end;
    
    procedure ClickFishInInv;
    var
      x,y,Fish,i: integer;
    begin
      antiban(0);
      antirandom;
      Fish := DTMFromString('mbQAAAHicY2VgYDABYjMg1gRiUyB2BuIcIE4B4jIgLgHiNCBurK4GkkwMB3bsYFg4axZDR1MTAz9QBB0zomE4AACYawqK');
      if FindDTM(Fish, x, y, MIX1, MIY1, MIX2, MIY2) then
      begin
        WriteLn('found du fishy');
        Mouse(x,y,5,5,true);
      end else
      begin
        WriteLn('Fish Not Found in inventory, exiting');
        FreeDTM(Fish);
        Exit;
      end;
      FreeDTM(Fish);
    end;
    
    
    procedure cook;
    var
      i: integer;
    begin
      Mouse(257,414,5,5,false);
      ChooseOption('All');
      C := C + CountInvFish;
      LD := LD + 1;
    end;
    
    procedure CWait;
    var time, WT: integer;
    begin
      MarkTime(time);
      while TimeFromMark(time) < (CountInvFish + (random(10)) * 2500) do
      begin
        WriteLn('Waiting for fish to cook...');
        antirandom;
        antiban(2);
      end;
    end;
    
    procedure prog;
    begin
      WriteLn('Fish Cooked: ' + IntToStr(C));
      WriteLn('Loads Done: ' + IntTostr(LD));
      WriteLn('Exp Gained: ' + IntToStr(C*70));
    end;
    
    procedure MainLoop;
    begin
      Logo;
      SetUpSRL;
      DeclarePlayers;
      LoginPlayer;
      repeat
        repeat
          OpenTheBank;
          WithdrawTheFood;
          WalkToRange;
          cook;
          CWait;
          WalkToBank;
        until (not LoggedIn);
        NextPlayer(Players[CurrentPlayer].Active);
      until(AllPlayersInactive);
      prog;
    end;
    
    
    begin
      MainLoop;
    end.


    EDIT 2:
    after reading the thread at the first link i provided in my first edit, i looked through and found out that i misused the 'inc' command, and replace inc(a+1) with a := a +1. then i got another error, and in my 2nd walking procedure i didnt declare the variables x and y :P silly me!
    Last edited by TomTuff; 09-06-2010 at 09:00 AM.

  2. #2
    Join Date
    Jul 2007
    Location
    Right now? Chair.
    Posts
    8,488
    Mentioned
    3 Post(s)
    Quoted
    12 Post(s)

    Default

    Remove the 'program' line. If your lucky, that'll solve the problem.

    ~RM

    I & I know Zion. It is in the spirit, body and mind of every one of us
    RMouse(obj: TMSIObject): boolean;

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
  •