Results 1 to 6 of 6

Thread: BEGIN expected error, help please

  1. #1
    Join Date
    Oct 2006
    Posts
    87
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default BEGIN expected error, help please

    well im trying to make my second script which is a power chopper, i scripted most of it, and i got this error, but i dont know how to fix it, i looked ath that tut about errors but i couldnt find where a begin was missing, so can someone take a look at my script and either tell me what to do or make a correction for me and repost it thanks a lot.


    SCAR Code:
    program WoodCutter;
    {.include SRL\SRL.Scar}
    var
    i,o: integer;
    DBanMe: Integer;
    const
    TreeColor=2904136;
    Procedure AntiBan;
    begin
    DBanMe:= Random(10);
     case DBanMe of

        0: RandomRClickEvery(2 + Random(13));
        1: HoverSkill('Mining', False);
        2: RandomChatEvery(10 + Random(5));
        3: RotateEvery(20 + Random(10));
        4: LeaveScreenEvery(5 + Random(5));
        5: HoverEvery(15 + Random(5), 'Attack');
        6: PickUpMouse;
        7: BoredEvery(9 + Random(24));
        8: DragItem(1, 1 + Random(18));
        9: GameTab(1 + Random(12));
        10: RotateEvery(7 + random(4));
      end;
    end;

    procedure AntiRandom;
    begin
      FindTalk; //looks for a few letters from characters name (Nick) for randoms
      FindNormalRandoms; //looks for normal randoms and solves (mime, plant, etc.)
      FindLamp('mining'); //if finds the lamp, picks the skill
       if FindFight then //if finds that you're in a fight
        begin
         RunAwayDirection('n'); //runs north (n, s, w, e)
         Wait(10000+random(2000)); //waits
         RunBack;//Runs back
        end;
    end;
    procedure FindTree;
    begin
     repeat;
      wait(1000+random(500));
      AntiBan;
      FindColorSpiral(i, o, TreeColor, 3, 3, 514, 338) then
      MMouse(i,o,1,1);
      wait(200+random(100));
      Mouse(i, o, 1, 1, true);
      AntiRandom;
     until(FullInv);
    end;

    Procedure DropLogs;
     begin
      wait(100+random(50));
      AntiBan;
      wait(2000+random(1000));
      dropto(2,28);
      wait(100+random(50));
      AntiRandom;
     end;

    begin
     SetupSRL;
      repeat
       FindTree;
       DropLogs;
       until(false)
      end.

  2. #2
    Join Date
    Feb 2006
    Location
    L.A, USA
    Posts
    1,632
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Code:
    program WoodCutter;
    {.include SRL\SRL.Scar}
    
    var
      i, o: integer;
      DBanMe: Integer;
    
    const
      TreeColor=2904136;
    
    Procedure AntiBan;
    begin
      DBanMe:= Random(10);
      case DBanMe of
        0: Wait(1); // RandomRClickEvery
        1: HoverSkill('Mining', False);
        2: Wait(1); // RandomChatEvery(10 + Random(5));
        3: Wait(1); // RotateEvery(20 + Random(10));
        4: Wait(1); // LeaveScreenEvery(5 + Random(5));
        5: Wait(1); // HoverEvery(15 + Random(5), 'Attack');
        6: PickUpMouse;
        7: Wait(1); // BoredEvery(9 + Random(24));
        8: DragItem(1, 1 + Random(18));
        9: GameTab(1 + Random(12));
        10:Wait(1); // RotateEvery(7 + random(4));
      end;
    end;
    
    procedure AntiRandom;
    begin
      FindTalk; //looks for a few letters from characters name (Nick) for randoms
      FindNormalRandoms; //looks for normal randoms and solves (mime, plant, etc.)
      FindLamp('mining'); //if finds the lamp, picks the skill
      if FindFight then //if finds that you're in a fight
      begin
        RunAwayDirection('n'); //runs north (n, s, w, e)
        Wait(10000+random(2000)); //waits
        RunBack;//Runs back
      end;
    end;
    
    procedure FindTree;
    begin
      repeat;
        wait(1000+random(500));
        AntiBan;
        if FindColorSpiral(i, o, TreeColor, 3, 3, 514, 338) then
          if (IsUpText('hop'))then // Check up text.
          begin
            MMouse(i, o, 3, 3); // more random, coord.
            wait(200+random(100));
            Mouse(i, o, 1, 1, true);
          end;
        AntiRandom;
        Wait(3000 + random(500)); // So it won't endlessly click.
      until(InvFull);
    end;
    
    Procedure DropLogs;
    begin
      wait(100+random(50));
      AntiBan;
      wait(2000+random(1000));
      dropto(2,28);
      wait(100+random(50));
      AntiRandom;
    end;
    
    begin
      SetupSRL;
      repeat
        FindTree;
        DropLogs;
      until(false)
    end.
    This compiles for me. I added some basic notes. I suspect your using an older version of SRL, the current SRL no longer has those antiban procedures, it's in xextended.

    gl with your script. "P

  3. #3
    Join Date
    Oct 2006
    Posts
    87
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    kk it compiles for me now, thanks, do i need to declare players?

  4. #4
    Join Date
    Feb 2007
    Location
    Het ademt zwaar en moedeloos vannacht.
    Posts
    7,211
    Mentioned
    26 Post(s)
    Quoted
    72 Post(s)

    Default

    Ok, there were a few more errors in your script then that begin error.
    First, I made it compatible with the newest SRL, but I had to comment some of the antiban stuff, so it compiles with SRL 3.8.
    I made comments at the places with errors I fixed, here is a version that at least compiles:
    SCAR Code:
    program WoodCutter;
    {.include SRL\SRL.Scar}
    var
    i,o: integer;
    DBanMe: Integer;
    const
    TreeColor=2904136;
    Procedure AntiBan;
    begin
    DBanMe:= Random(10);
     case DBanMe of
         //0: RandomRClickEvery(2 + Random(13));
        1: HoverSkill('Mining', False);
        //2: RandomChatEvery(10 + Random(5));   //comented out most antiban stuff to make it 3.8 compatible
        //3: RotateEvery(20 + Random(10));
        //4: LeaveScreenEvery(5 + Random(5));
        //5: HoverEvery(15 + Random(5), 'Attack');
        6: PickUpMouse;
        //7: BoredEvery(9 + Random(24));
        //8: DragItem(1, 1 + Random(18));
        9: GameTab(1 + Random(12));
        //10: RotateEvery(7 + random(4));
      end;
    end;

    procedure AntiRandom;
    begin
      FindTalk; //looks for a few letters from characters name (Nick) for randoms
      FindNormalRandoms; //looks for normal randoms and solves (mime, plant, etc.)
      FindLamp('mining'); //if finds the lamp, picks the skill
      if FindFight then //if finds that you're in a fight
      begin
        RunAwayDirection('n'); //runs north (n, s, w, e)
        Wait(10000+random(2000)); //waits
        RunBack;//Runs back
      end;
    end;
    procedure FindTree;
    begin
       repeat;
          wait(1000+random(500));
          AntiBan;
          if FindColorSpiral(i, o, TreeColor, 3, 3, 514, 338) then   //Forgot an if
          MMouse(i,o,1,1);
          wait(200+random(100));
          Mouse(i, o, 1, 1, true);
          AntiRandom;
       until(Invfull); //it is InvFull not FullInv
    end;

    Procedure DropLogs;
    begin
      wait(100+random(50));
      AntiBan;
      wait(2000+random(1000));
      dropto(2,28);
      wait(100+random(50));
      AntiRandom;
    end;

    begin
     SetupSRL;
      repeat
         FindTree;
         DropLogs;
      until(false)
    end.
    Oh, and I recommend you to read a tutorial on scripting standards.
    Good luck with your script
    Markus

    edit: Damn, beaten by WhiteShadow
    I made a new script, check it out!.

  5. #5
    Join Date
    Oct 2006
    Posts
    87
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    can u tell me where to get the new srl antibans please

    also is this decent for only 2 days scripting from reading beginner tuts to now?

  6. #6
    Join Date
    Jun 2006
    Location
    New Zealand
    Posts
    285
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    RandomRClickEvery etc.:
    SCAR Code:
    {.include SRL\SRL\Extended\xAntiBan.scar}
    PolyGlotTalk:
    SCAR Code:
    {.include SRL\SRL\Extended\xAutoTalk.scar}
    Huehuehuehuehue

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. 'Begin' expected in script?
    By Mistagnerd in forum OSR Help
    Replies: 5
    Last Post: 11-12-2007, 10:01 AM
  2. 'BEGIN' expected in script But there is one
    By MylesMadness in forum OSR Help
    Replies: 12
    Last Post: 06-27-2007, 02:09 PM
  3. Replies: 8
    Last Post: 04-09-2007, 12:21 AM

Posting Permissions

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