Results 1 to 7 of 7

Thread: Yet another one of aps900's late night blunders

  1. #1
    Join Date
    Oct 2006
    Location
    H0M3
    Posts
    142
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default Yet another one of aps900's late night blunders

    what wrong with this procedure?
    the error i get while compiling is : Line 208: [Error] (17156:6): Assignment expected in script


    SCAR Code:
    Procedure ChooseArray;
    begin
      tree := Random(5);
      case tree of
      0: begin
           tree = WillowTree[0];// this is line 208
         end;
      1: begin
           tree = WillowTree[1];
         end;
      2: begin
           tree = WillowTree[3];
         end;
      3: begin
           tree = WillowTree[4];
         end;
      4: begin
           tree = WillowTree[5];
         end;
      5: begin
           tree = WillowTree[2];
         end;
      end;
    end;

  2. #2
    Join Date
    Feb 2007
    Posts
    3,616
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    the = should be ":=" without the quote. Just add a colon before all equals when assigning values.

    Code:
    Procedure ChooseArray;
    begin
      tree := Random(5);
      case tree of
      0: begin
           tree := WillowTree[0];// this is line 208
         end;
      1: begin
           tree := WillowTree[1];
         end;
      2: begin
           tree := WillowTree[3];
         end;
      3: begin
           tree := WillowTree[4];
         end;
      4: begin
           tree := WillowTree[5];
         end;
      5: begin
           tree := WillowTree[2];
         end;
      end;
    end;
    When comparing values you use the regular "=" sign. Example: if(tree = WillowTree[2])then. If you are assigning a value like above, you use the colon equals sign ":=".

  3. #3
    Join Date
    Jan 2008
    Location
    NC, USA.
    Posts
    4,429
    Mentioned
    0 Post(s)
    Quoted
    4 Post(s)

    Default

    = is used for comparing while := is used for declaring

    SCAR Code:
    i := 4;
      if i = 4 then
        writeln(inttostr(i));
    Quote Originally Posted by irc
    [00:55:29] < Guest3097> I lol at how BenLand100 has become noidea
    [01:07:40] <@BenLand100> i'm not noidea i'm
    [01:07:44] -!- BenLand100 is now known as BenLand42-
    [01:07:46] <@BenLand42-> shit
    [01:07:49] -!- BenLand42- is now known as BenLand420
    [01:07:50] <@BenLand420> YEA

  4. #4
    Join Date
    Oct 2006
    Location
    H0M3
    Posts
    142
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    i see now i got another blunder
    Failed when compiling
    [Error] (17216:4): Identifier expected

    i'm confused no line number?


    SCAR Code:
    program DraynorWillBanker;
    {.Include SRL\SRL.SCAR}
    {.Include SRL\SRL\skill\WoodCutting.scar}


    var
      x,y,tree:integer;
      WillowTree: array [0..6] of integer;

    procedure DeclarePlayers;
    begin
      HowManyPlayers := 1;                 //How many players?
      NumberOfPlayers(HowManyPlayers);
      CurrentPlayer := 0;
      Players[0].Name         := '';       //username
      Players[0].Pass         := '';       //password
      Players[0].Nick         := '';       //3-4 letters of name
      Players[0].Pin          := '';       //bank Pin
      Players[0].Booleans[0]  := true;     //true if weilding an axe
      Players[0].Booleans[1]  := true;     //true if using sleep
      Players[0].Integers[1]  := 10;       //Switch players/relog after how many loads?
      Players[0].Active := True;
    end;

    Procedure IntroText;
    begin
      ClearDebug;
      WriteLn('#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#');
      Wait(150);
      WriteLn(' ____                          ');
      Wait(150);
      WriteLn('|    \ ___ ___ _ _ ___ ___ ___ ');
      Wait(150);
      WriteLn('|  |  |  _| . | | |   | . |  _|');
      Wait(150);
      WriteLn('|____/|_| |__,|_  |_|_|___|_|  ');
      Wait(150);
      WriteLn('              |___|            ');
      Wait(150);
      WriteLn('#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#');
      Wait(150);
      WriteLn('                               ');
      Wait(150);
      WriteLn('#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#');
      Wait(150);
      WriteLn('| | | |_| | |___ _ _ _         ');
      Wait(150);
      WriteLn('| | | | | | | . | | | |        ');
      Wait(150);
      WriteLn('|_____|_|_|_|___|_____|        ');
      Wait(150);
      WriteLn('#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#');
      Wait(150);
      WriteLn('                               ');
      Wait(150);
      WriteLn('#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#');
      Wait(150);
      WriteLn(' _____         _               ');
      Wait(150);
      WriteLn('| __  |___ ___| |_ ___ ___     ');
      Wait(150);
      WriteLn('| __ -| . |   |  _| -_|  _|    ');
      Wait(150);
      WriteLn('|_____|__,|_|_|_,_|___|_|      ');
      Wait(150);
      WriteLn('#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#');
      Wait(150);
    end;

    function FindAxeBool: Boolean;
    var
      Ix, Iy: Integer;
      I, InvAxe, WieldAxe, FoundAxe: Byte;

    begin
      if not LoggedIn then exit;
      srl_LoadBitmaps([47, 48, 49, 50, 51, 52, 53, 54]);
      I := 0;

      repeat
        case GetCurrentTab of
          5: begin
               for WieldAxe := 0 to 7 do
                 if FindBitmapToleranceIn(srl_GetBitmap(54-WieldAxe),Ix, Iy, 566, 285, 606, 327, 10) then
                   Break;
               if I = 0 then
                 if not GameTab(4) then exit;
               Inc(I);
             end;

          4: begin
               for InvAxe := 0 to 7 do
                 if FindBitmapToleranceIn(srl_GetBitmap(54 - InvAxe), Ix, Iy, MIX1, MIY1, MIX2, MIY2, 10) then
                   Break;
               if I = 0 then
                 if not GameTab(5) then exit;
               Inc(I);
             end;
        else
          if not GameTab(5) then exit;
        end;
      until I = 2;

      if (InvAxe = 8) and (WieldAxe = 8) then
      begin
        Writeln('No axe was found.');
        Result := False;
        srl_FreeBitmaps;
        Exit;
      end;

      FoundAxe := Min(WieldAxe, InvAxe);

      Result := True;
      srl_FreeBitmaps;
    end;

    procedure ApxCustomAntiban;
    begin
      if(not(LoggedIn))then
      Exit;
      case Random(13) of
        0: RandomRClick;
        1: begin
             HoverSkill('woodcutting', false);
             wait(4000+random(1000));
             GameTab(4);
           end;
        2: begin
             HoverSkill('fishing', false);
             wait(4000+random(1000));
             GameTab(4);
           end;
        3: begin
             MakeCompass(Random(300));
             Wait(random(3000));
             MakeCompass('N');
           end;
        4: begin
             PickUpMouse;
             BoredHuman;
           end;
        5: SayCurrentLevels('woodcutting');
        6: PickUpMouse;
        7: WriteLn('No Antiban this round');
        8: begin
             GameTab(1 + Random(12));
             wait(4000+random(4000));
             GameTab(4);
           end;
        9: begin
             case random(8) of
               0: TypeSend('Fishing lvls?');
               1: TypeSend('Fishing levels');
               2: TypeSend('Woodcutting lvls');
               3: TypeSend('Wc levels');
               4: TypeSend('Exp till next level');
             end;
           end;
        10: MouseBox(MSX1,MMY1,MMX2,MMY2,3);
        11: WriteLn('No Antiban this round');
        12: SleepAndMoveMouse(400000+random(200000));
      end;
    end;

    procedure LoadTreeArray;
    begin
      WriteLn('Willow Tree Array 1 loading...');
      WillowTree[0] := 1979698
      wait(500);
      WriteLn('Sucessfull!!');

      WriteLn('Willow Tree Array 2 loading...');
      WillowTree[1] := 2637622
      wait(500);
      WriteLn('Sucessfull!!');

      WriteLn('Willow Tree Array 3 loading...');
      WillowTree[2] := 1518369
      wait(500);
      WriteLn('Sucessfull!!');

      WriteLn('Willow Tree Array 4 loading...');
      WillowTree[3] := 1780784
      wait(500);
      WriteLn('Sucessfull!!');

      WriteLn('Willow Tree Array 5 loading...');
      WillowTree[4] := 3165781
      wait(500);
      WriteLn('Sucessfull!!');

      WriteLn('Willow Tree Array 6 loading...');
      WillowTree[5] := 2110778
      wait(500);
      WriteLn('Sucessfull!!');
    end;

    Procedure ChooseArray;
    begin
      tree := Random(5);
      case tree of
      0: begin
           tree := WillowTree[0];// this is line 208
         end;
      1: begin
           tree := WillowTree[1];
         end;
      2: begin
           tree := WillowTree[3];
         end;
      3: begin
           tree := WillowTree[4];
         end;
      4: begin
           tree := WillowTree[5];
         end;
      5: begin
           tree := WillowTree[2];
         end;
      end;
    end;


    Procedure Equipmentcheck;
    begin
      If(FindAxeBool)Then
      begin
        WriteLn('Hatchet Found');
      end;
      If not(FindAxeBool)Then
      begin
        WriteLn('Hatchet Not Found')
        exit;
      end;
    end;

    Procedure ChopTheTree1;
    begin
      repeat
       FindObjCustom(x,y,['Willow','illow','will'],[tree],20)
       mouse(x,y,4,4,false);
      until ChooseOption('Cage');
    end;
    Procedure ChopTheTree2;
    begin
      FindObjCustom(x,y,['Willow','illow','will'],[tree],20)
      mouse(x,y,4,4,true);
    end;


    Procedure ChopTree;
    begin
      case random(1) of
      0: begin
           ChopTheTree1;
         end;
      1: begin
           ChopTheTree2;
         end;
      end;
     
    begin
      SetupSRL;
      DeclarePlayers;
      SetAutoingDefaults;
      LoginPlayer;
    end.

  5. #5
    Join Date
    Jan 2008
    Location
    NC, USA.
    Posts
    4,429
    Mentioned
    0 Post(s)
    Quoted
    4 Post(s)

    Default

    Chop Tree needs another end;
    Quote Originally Posted by irc
    [00:55:29] < Guest3097> I lol at how BenLand100 has become noidea
    [01:07:40] <@BenLand100> i'm not noidea i'm
    [01:07:44] -!- BenLand100 is now known as BenLand42-
    [01:07:46] <@BenLand42-> shit
    [01:07:49] -!- BenLand42- is now known as BenLand420
    [01:07:50] <@BenLand420> YEA

  6. #6
    Join Date
    May 2007
    Location
    Some where fun.
    Posts
    2,891
    Mentioned
    1 Post(s)
    Quoted
    5 Post(s)

    Default

    when you get identifier expected, its cause its the begins and ends.

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

    Default

    Lol, I'm not on my computer. No scar :'(.
    But,
    SCAR Code:
    program DraynorWillBanker;
    {.Include SRL\SRL.SCAR}
    {.Include SRL\SRL\skill\WoodCutting.scar}


    var
      x,y,tree:integer;
      WillowTree: array [0..6] of integer;

    procedure DeclarePlayers;
    begin
      HowManyPlayers := 1;                 //How many players?
      NumberOfPlayers(HowManyPlayers);
      CurrentPlayer := 0;
      Players[0].Name         := '';       //username
      Players[0].Pass         := '';       //password
      Players[0].Nick         := '';       //3-4 letters of name
      Players[0].Pin          := '';       //bank Pin
      Players[0].Booleans[0]  := true;     //true if weilding an axe
      Players[0].Booleans[1]  := true;     //true if using sleep
      Players[0].Integers[1]  := 10;       //Switch players/relog after how many loads?
      Players[0].Active := True;
    end;

    Procedure IntroText;
    begin
      ClearDebug;
      WriteLn('#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#');
      Wait(150);
      WriteLn(' ____                          ');
      Wait(150);
      WriteLn('|    \ ___ ___ _ _ ___ ___ ___ ');
      Wait(150);
      WriteLn('|  |  |  _| . | | |   | . |  _|');
      Wait(150);
      WriteLn('|____/|_| |__,|_  |_|_|___|_|  ');
      Wait(150);
      WriteLn('              |___|            ');
      Wait(150);
      WriteLn('#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#');
      Wait(150);
      WriteLn('                               ');
      Wait(150);
      WriteLn('#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#');
      Wait(150);
      WriteLn('| | | |_| | |___ _ _ _         ');
      Wait(150);
      WriteLn('| | | | | | | . | | | |        ');
      Wait(150);
      WriteLn('|_____|_|_|_|___|_____|        ');
      Wait(150);
      WriteLn('#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#');
      Wait(150);
      WriteLn('                               ');
      Wait(150);
      WriteLn('#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#');
      Wait(150);
      WriteLn(' _____         _               ');
      Wait(150);
      WriteLn('| __  |___ ___| |_ ___ ___     ');
      Wait(150);
      WriteLn('| __ -| . |   |  _| -_|  _|    ');
      Wait(150);
      WriteLn('|_____|__,|_|_|_,_|___|_|      ');
      Wait(150);
      WriteLn('#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#');
      Wait(150);
    end;

    function FindAxeBool: Boolean;
    var
      Ix, Iy: Integer;
      I, InvAxe, WieldAxe, FoundAxe: Byte;

    begin
      if not LoggedIn then exit;
      srl_LoadBitmaps([47, 48, 49, 50, 51, 52, 53, 54]);
      I := 0;

      repeat
        case GetCurrentTab of
          5: begin
               for WieldAxe := 0 to 7 do
                 if FindBitmapToleranceIn(srl_GetBitmap(54-WieldAxe),Ix, Iy, 566, 285, 606, 327, 10) then
                   Break;
               if I = 0 then
                 if not GameTab(4) then exit;
               Inc(I);
             end;

          4: begin
               for InvAxe := 0 to 7 do
                 if FindBitmapToleranceIn(srl_GetBitmap(54 - InvAxe), Ix, Iy, MIX1, MIY1, MIX2, MIY2, 10) then
                   Break;
               if I = 0 then
                 if not GameTab(5) then exit;
               Inc(I);
             end;
        else
          if not GameTab(5) then exit;
        end;
      until I = 2;

      if (InvAxe = 8) and (WieldAxe = 8) then
      begin
        Writeln('No axe was found.');
        Result := False;
        srl_FreeBitmaps;
        Exit;
      end;

      FoundAxe := Min(WieldAxe, InvAxe);

      Result := True;
      srl_FreeBitmaps;
    end;

    procedure ApxCustomAntiban;
    begin
      if(not(LoggedIn))then
      Exit;
      case Random(13) of
        0: RandomRClick;
        1: begin
             HoverSkill('woodcutting', false);
             wait(4000+random(1000));
             GameTab(4);
           end;
        2: begin
             HoverSkill('fishing', false);
             wait(4000+random(1000));
             GameTab(4);
           end;
        3: begin
             MakeCompass(Random(300));
             Wait(random(3000));
             MakeCompass('N');
           end;
        4: begin
             PickUpMouse;
             BoredHuman;
           end;
        5: SayCurrentLevels('woodcutting');
        6: PickUpMouse;
        7: WriteLn('No Antiban this round');
        8: begin
             GameTab(1 + Random(12));
             wait(4000+random(4000));
             GameTab(4);
           end;
        9: begin
             case random(8) of
               0: TypeSend('Fishing lvls?');
               1: TypeSend('Fishing levels');
               2: TypeSend('Woodcutting lvls');
               3: TypeSend('Wc levels');
               4: TypeSend('Exp till next level');
             end;
           end;
        10: MouseBox(MSX1,MMY1,MMX2,MMY2,3);
        11: WriteLn('No Antiban this round');
        12: SleepAndMoveMouse(400000+random(200000));
      end;
    end;

    procedure LoadTreeArray;
    begin
      WriteLn('Willow Tree Array 1 loading...');
      WillowTree[0] := 1979698
      wait(500);
      WriteLn('Sucessfull!!');

      WriteLn('Willow Tree Array 2 loading...');
      WillowTree[1] := 2637622
      wait(500);
      WriteLn('Sucessfull!!');

      WriteLn('Willow Tree Array 3 loading...');
      WillowTree[2] := 1518369
      wait(500);
      WriteLn('Sucessfull!!');

      WriteLn('Willow Tree Array 4 loading...');
      WillowTree[3] := 1780784
      wait(500);
      WriteLn('Sucessfull!!');

      WriteLn('Willow Tree Array 5 loading...');
      WillowTree[4] := 3165781
      wait(500);
      WriteLn('Sucessfull!!');

      WriteLn('Willow Tree Array 6 loading...');
      WillowTree[5] := 2110778
      wait(500);
      WriteLn('Sucessfull!!');
    end;

    Procedure ChooseArray;
    begin
      tree := Random(5);
      case tree of
      0: begin
           tree := WillowTree[0];// this is line 208
         end;
      1: begin
           tree := WillowTree[1];
         end;
      2: begin
           tree := WillowTree[3];
         end;
      3: begin
           tree := WillowTree[4];
         end;
      4: begin
           tree := WillowTree[5];
         end;
      5: begin
           tree := WillowTree[2];
         end;
      end;
    end;


    procedure Equipmentcheck;
    begin
      If(FindAxeBool)Then
      begin
        WriteLn('Hatchet Found');
      end;
      If not(FindAxeBool)Then
      begin
        WriteLn('Hatchet Not Found')
        exit;
      end;
    end;

    procedure ChopTheTree1;
    begin
      repeat
       FindObjCustom(x, y, ['Willow', 'illow', 'will'], [tree], 20)
       mouse(x, y, 4, 4, false);
      until(ChooseOption('Cage'));
    end;

    procedure ChopTheTree2;
    begin
      FindObjCustom(x,y,['Willow','illow','will'],[tree],20)
      mouse(x,y,4,4,true);
    end;


    Procedure ChopTree;
    begin
      case random(1) of
      0: begin
           ChopTheTree1;
          end;
      1: begin
           ChopTheTree2;
         end;
      end;
    end;
     
    begin
      SetupSRL;
      DeclarePlayers;
      SetAutoingDefaults;
      LoginPlayer;
    end.

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
  •