Results 1 to 4 of 4

Thread: Line 186: [Error] (27752:31): Semicolon (';') expected in script

  1. #1
    Join Date
    Feb 2009
    Posts
    2,155
    Mentioned
    4 Post(s)
    Quoted
    42 Post(s)

    Default Line 186: [Error] (27752:31): Semicolon (';') expected in script

    Code:
    program tanner;
    {.include srl/srl/misc/smart.scar}
    {.include srl/srl.scar}
    {.include srl/srl/reflection/reflection.scar}
    var
      x, y : integer;
    
    procedure DeclarePlayers;//add more if needed
    begin
      HowManyPlayers := 1;
      NumberOfPlayers(HowManyPlayers);
      CurrentPlayer := 0;
      Players[0].Name       := '';
      Players[0].Pass       := '';
      Players[0].Nick       := '';
      Players[0].Active     := True;    // Use this account?
      Players[0].strings[0] := 'soft'; // soft or hard leather
      Players[0].Pin        := ''// bank pin lave if none
      Players[0].BoxRewards := ['XP', 'ostume', 'mote', 'Gem', 'ithril', 'oal'];
    end;
    
    procedure findtanner; forward;
    
    function InMenu : boolean;
    var
      hidedtm : integer;
    begin
      Hidedtm:= DTMFromString('78DA638C60606048624001FBB66E611004D28' +
           'C40FC1F08182B808C7854351B972D05D38C503E632E90A84155B3' +
           '7DCD1A54357E40A21A55CDA9C38750D5B802894854358776EE445' +
           '5930824BC50D5AC9A3717554D3190084455B361C91214350093D2' +
           '17FE');
      result := finddtm(hidedtm, x, y, MSX1, MSy1, MSX2, MSY2);
      freedtm(hidedtm);
    end;
    
    procedure InTanMenu;
    begin
      wait(1000 + random (20));
      if InMenu then
      begin
        case Lowercase(Players[CurrentPlayer].Strings[0]) of
          'soft' : begin
                     x := 94;
                     y := 103;
                   end;
          'hard' : begin
                     x := 206;
                     y := 105;
                   end;
        end;
        writeln('Clicking Hides');
        mouse(x, y, 13, 13, false);
        WaitForOption('Tan', 5000);
        wait(10 + random (2));
        chooseoption('All');
      end else
      writeln('Tring To Find Tanner Again');
      Findtanner;
    end;
    
    procedure FindTanner;
    var
      NPCC: TNPC;
      TanPoint: TPoint;
    begin
      If(FindNPC('Ellis',NPCC))then
      begin
        writeln('Found the Tanner! Attempting to click');
        TanPoint := TileToMS(NPCC.Tile, Random(5));
        mouse(TanPoint.x,TanPoint.y,2,2,false);
        WaitForOption('rade', 5000);
        wait(10 + random (2));
        chooseoption('rade');
        InTanMenu;
      end;
    end;
    
    {*******************************************************************************
    procedure R_Withdraw(Item : Variant; Amount : Integer);
    By: Infantry001
    Description: Withdraw Amount of Item. Item can be either ID or Name.
    *******************************************************************************}
    procedure R_Withdraw(Item : Variant; Amount : Integer);
    var
      I, BankSlot : Integer;
      BBox : TBox;
      Items : TBankSlotArray;
    begin
      if not R_BankScreen then exit;
      Items := GetBankArray;
      case VarType(Item) of
        3:   for I := 0 to High(Items) do
             begin
               if (Items[i].ID = Integer(Item)) then
               begin
                 BankSlot := Items[i].Index + 1;
                 break;
               end;
             end;
        256: for I := 0 to High(Items) do
             begin
               if (Items[i].Name = Item) then
               begin
                 BankSlot := Items[i].Index + 1;
                 break;
               end;
             end;
      end;
      BBox := BankIndexToMSBox(BankSlot);
      If Amount = 1 Then
      Begin
        MouseBox(BBox.X1 + 5, BBox.Y1 + 5, BBox.X2 - 5, BBox.Y2 - 5, 1);
        Wait(RandomRange(50, 150));
      End
      Else
      Begin
        MouseBox(BBox.X1 + 5, BBox.Y1 + 5, BBox.X2 - 5, BBox.Y2 - 5, 2);
        if (Amount = 5) or (Amount = 10) then
          R_ChooseOption('Withdraw-' +IntToStr(Amount))
        else if Amount = 0 then
          R_ChooseOption('Withdraw-All')
        else
        if not R_ChooseOption('Withdraw-'+IntToStr(Amount)+' ') then
        begin
          MouseBox(BBox.X1 + 5, BBox.Y1 + 5, BBox.X2 - 5, BBox.Y2 - 5, 2);
          if (R_ChooseOption('Withdraw-X')) then
          begin
            Wait(1000 + Random(100));
            TypeSend(IntToStr(Amount));
          end;
        end;
      end;
    end;
    
    procedure banking;
    begin
      R_OpenBankBooth('akb');
      repeat
        wait(1)
        findnormalrandoms;
      until (R_Bankscreen) or (R_Pinscreen);
      if R_Pinscreen then Inpin(Players[CurrentPlayer].Pin);
      R_MouseItemID(1742,  'All');
      R_Withdraw(1739, 27);
    end;
    
    procedure writepos;
    var
      myposition: TPoint;
    begin
      MyPosition := GetMyPos;
      writeln('Our tile is: '+inttostr(MyPosition.x)+','+inttostr(MyPosition.y));
    end;
    
    function TanneryWalkPath:TPointArray;
    begin
      setlength(result,3);
      result[0] := point(3277,3174);
      result[1] := point(3282,3184);
      result[2] := point(3275,3191);
    end;
    
    // lets say 1010,2020 = top left and 3030,4040 = bottom right.
    function InBank: boolean;
    var
      PlayerPosition : Tpoint;
    begin
      writeln('in bank?');
      PlayerPosition := GetMyPos;
      if PointInBox(PlayerPosition , IntToBox(3269,3165, 3271,3170)) then
      begin
      result := true;
        writeln('You are in the bank!');
      end;
    end;
    
    Procedure TanneryWalk;
    var
      i :integer;
    begin
      If(Not(Inbank))then
        exit;
      For I := 0 to High(TanneryWalkPath) do
      Begin
        If (WalkToTile(TanneryWalkPath[i], 2, 1)) Then //  error line
        R_Flag;
        R_FindRandoms;
        FindNormalRandoms;
        Wait(550+Random(300));
      end;
    end;
    
               
    
    begin
      smart_server := 101;
      smart_signed := true;
      setupsrl;
      setupreflection;
      declareplayers;
      loginplayer;
      banking;
      Tannerywalk;
      findtanner;
    end.
    got this error but i thought that if then dont need semicolins

  2. #2
    Join Date
    Jan 2008
    Location
    California, US
    Posts
    2,765
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    SCAR Code:
    program tanner;
    {.include srl/srl/misc/smart.scar}
    {.include srl/srl.scar}
    {.include srl/srl/reflection/reflection.scar}
    var
      x, y : integer;

    procedure DeclarePlayers;//add more if needed
    begin
      HowManyPlayers := 1;
      NumberOfPlayers(HowManyPlayers);
      CurrentPlayer := 0;
      Players[0].Name       := '';
      Players[0].Pass       := '';
      Players[0].Nick       := '';
      Players[0].Active     := True;    // Use this account?
      Players[0].strings[0] := 'soft'; // soft or hard leather
      Players[0].Pin        := ''// bank pin lave if none
      Players[0].BoxRewards := ['XP', 'ostume', 'mote', 'Gem', 'ithril', 'oal'];
    end;

    procedure findtanner; forward;

    function InMenu : boolean;
    var
      hidedtm : integer;
    begin
      Hidedtm:= DTMFromString('78DA638C60606048624001FBB66E611004D28' +
           'C40FC1F08182B808C7854351B972D05D38C503E632E90A84155B3' +
           '7DCD1A54357E40A21A55CDA9C38750D5B802894854358776EE445' +
           '5930824BC50D5AC9A3717554D3190084455B361C91214350093D2' +
           '17FE');
      result := finddtm(hidedtm, x, y, MSX1, MSy1, MSX2, MSY2);
      freedtm(hidedtm);
    end;

    procedure InTanMenu;
    begin
      wait(1000 + random (20));
      if InMenu then
      begin
        case Lowercase(Players[CurrentPlayer].Strings[0]) of
          'soft' : begin
                     x := 94;
                     y := 103;
                   end;
          'hard' : begin
                     x := 206;
                     y := 105;
                   end;
        end;
        writeln('Clicking Hides');
        mouse(x, y, 13, 13, false);
        WaitForOption('Tan', 5000);
        wait(10 + random (2));
        chooseoption('All');
      end else
      writeln('Tring To Find Tanner Again');
      Findtanner;
    end;

    procedure FindTanner;
    var
      NPCC: TNPC;
      TanPoint: TPoint;
    begin
      If(FindNPC('Ellis',NPCC))then
      begin
        writeln('Found the Tanner! Attempting to click');
        TanPoint := TileToMS(NPCC.Tile, Random(5));
        mouse(TanPoint.x,TanPoint.y,2,2,false);
        WaitForOption('rade', 5000);
        wait(10 + random (2));
        chooseoption('rade');
        InTanMenu;
      end;
    end;

    {*******************************************************************************
    procedure R_Withdraw(Item : Variant; Amount : Integer);
    By: Infantry001
    Description: Withdraw Amount of Item. Item can be either ID or Name.
    *******************************************************************************}

    procedure R_Withdraw(Item : Variant; Amount : Integer);
    var
      I, BankSlot : Integer;
      BBox : TBox;
      Items : TBankSlotArray;
    begin
      if not R_BankScreen then exit;
      Items := GetBankArray;
      case VarType(Item) of
        3:   for I := 0 to High(Items) do
             begin
               if (Items[i].ID = Integer(Item)) then
               begin
                 BankSlot := Items[i].Index + 1;
                 break;
               end;
             end;
        256: for I := 0 to High(Items) do
             begin
               if (Items[i].Name = Item) then
               begin
                 BankSlot := Items[i].Index + 1;
                 break;
               end;
             end;
      end;
      BBox := BankIndexToMSBox(BankSlot);
      If Amount = 1 Then
      Begin
        MouseBox(BBox.X1 + 5, BBox.Y1 + 5, BBox.X2 - 5, BBox.Y2 - 5, 1);
        Wait(RandomRange(50, 150));
      End
      Else
      Begin
        MouseBox(BBox.X1 + 5, BBox.Y1 + 5, BBox.X2 - 5, BBox.Y2 - 5, 2);
        if (Amount = 5) or (Amount = 10) then
          R_ChooseOption('Withdraw-' +IntToStr(Amount))
        else if Amount = 0 then
          R_ChooseOption('Withdraw-All')
        else
        if not R_ChooseOption('Withdraw-'+IntToStr(Amount)+' ') then
        begin
          MouseBox(BBox.X1 + 5, BBox.Y1 + 5, BBox.X2 - 5, BBox.Y2 - 5, 2);
          if (R_ChooseOption('Withdraw-X')) then
          begin
            Wait(1000 + Random(100));
            TypeSend(IntToStr(Amount));
          end;
        end;
      end;
    end;

    procedure banking;
    begin
      R_OpenBankBooth('akb');
      repeat
        wait(1)
        findnormalrandoms;
      until (R_Bankscreen) or (R_Pinscreen);
      if R_Pinscreen then Inpin(Players[CurrentPlayer].Pin);
      R_MouseItemID(1742,  'All');
      R_Withdraw(1739, 27);
    end;

    procedure writepos;
    var
      myposition: TPoint;
    begin
      MyPosition := GetMyPos;
      writeln('Our tile is: '+inttostr(MyPosition.x)+','+inttostr(MyPosition.y));
    end;

    function TanneryWalkPath:TPointArray;
    begin
      setlength(result,3);
      result[0] := point(3277,3174);
      result[1] := point(3282,3184);
      result[2] := point(3275,3191);
    end;

    // lets say 1010,2020 = top left and 3030,4040 = bottom right.
    function InBank: boolean;
    var
      PlayerPosition : Tpoint;
    begin
      writeln('in bank?');
      PlayerPosition := GetMyPos;
      if PointInBox(PlayerPosition , IntToBox(3269,3165, 3271,3170)) then
      begin
      result := true;
        writeln('You are in the bank!');
      end;
    end;

    Procedure TanneryWalk;
    var
      i :integer;
      path : tpointarray;
    begin
      If(Not(Inbank))then
        exit;
      path := tannerywalkpath;
      For I := 0 to High(path) do
      Begin
        If (WalkToTile(path[i], 2, 1)) Then //  error line
        R_Flag;
        R_FindRandoms;
        FindNormalRandoms;
        Wait(550+Random(300));
      end;
    end;



    begin
      smart_server := 101;
      smart_signed := true;
      setupsrl;
      setupreflection;
      declareplayers;
      loginplayer;
      banking;
      Tannerywalk;
      findtanner;
    end.

  3. #3
    Join Date
    Jun 2007
    Location
    Wednesday
    Posts
    2,446
    Mentioned
    3 Post(s)
    Quoted
    1 Post(s)

    Default

    It always helps to say what you did.
    The function returns a TPA, but you can't try to access an index of a return value, so you have to assign the result to a variable and access the index on that. The stuff that Da 0wner altered was:
    SCAR Code:
    For I := 0 to High(TanneryWalkPath) do
      Begin
        If (WalkToTile(TanneryWalkPath[i], 2, 1)) Then //  error line
    to
    SCAR Code:
    path := TanneryWalkPath;
      For I := 0 to High(path) do
      Begin
        If (WalkToTile(path[i], 2, 1)) Then //  error line
    with path being a TPA that was added to TanneryWalk's variables.
    By reading this signature you agree that mixster is superior to you in each and every way except the bad ways but including the really bad ways.

  4. #4
    Join Date
    Jan 2008
    Location
    California, US
    Posts
    2,765
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Mhm, you can't directly access the array result of a function. You must first set it to a variable, then use the indices of that variable.

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
  •