Results 1 to 3 of 3

Thread: [Error] C:\Simba\Scripts\Autofightteser.simba(31:8): 'BEGIN'

  1. #1
    Join Date
    Sep 2010
    Posts
    5,762
    Mentioned
    136 Post(s)
    Quoted
    2739 Post(s)

    Default [Error] C:\Simba\Scripts\Autofightteser.simba(31:8): 'BEGIN'

    When i try to add failsafes.. It ends up failing.
    I get this error:
    Code:
    [Error] C:\Simba\Scripts\Autofightteser.simba(31:8): 'BEGIN' expected at line 30
    Compiling failed.


    Simba Code:
    program fite;
    Var
      X, Y, charm: Integer;
    Const
    // fill out
    NPC=1122383;
    loot=14079706;
    tolerence=15;
    time=7; // in seconds
    rwait=1000;
    tleft= 41;
    tright = 44;
    bleft=426;
    bright=280;

     procedure pickup;
    Begin
    charm :=  BitmapFromString(31, 12, 'meJyTUdeWIQU5TPgPRyRpJNJkBj' +
            'CgrvnIJkNEkNnUMpwMvVN3HIMj/IZjDXOscQFxCcRMiDdxmY/scrQ' +
            'wxx8XcMPR2HiCBZmLi40ZJnAvUNdwBiSAJ9iJNxwevGiOx59mMJMl' +
            'VnHMdIvf8WjKiBGnEQIAUtQGXA==');
             WriteLn('Looking for bones . . . ');
            Wait(1700 + Random(1200));
     if FindColorTolerance(X,Y,loot,184,123,294,197,15) then
       WriteLn('Found bones');
      movemouse(x, y);
           Wait(120 + Random(80));
           ClickMouse(x, y, Mouse_right);
           End;
           else
           Begin
           clicknpc;
           End;
           Begin
           WriteLn('Looking for charm . . . ');
           wait(1100);
     if  FindBitMapToleranceIn(charm, X, Y,161, 95, 330, 205, 75) then
        movemouse(X, Y);
         WriteLn('Found charm ');
        wait(500);
        ClickMouse(X, Y, Mouse_left)
        FreeBitMap(charm);
        wait(3000);
        End;
        else
        Begin
        clicknpc;
        End;
    End;
    procedure checkcombat;
           begin
           Wait((time*500) + Random(rwait));
            WriteLn('Waiting for loot . . .');
            Wait((time*500) + Random(rwait));
           pickup;
           End;
    procedure clicknpc;
    var
      X, Y, charm: Integer;
    begin     // kill npc
     WriteLn('Attacking skeleton . . .');
            if FindColorTolerance(X,Y,NPC,tleft,tright,bleft,bright,tolerence) then
          movemouse(x, y);
          Wait(20 + Random(50));
           ClickMouse(x, y, Mouse_Left)
           checkcombat;
           End else;
           Begin
           clicknpc;
           End;
    Begin
      repeat
      clicknpc;
      until (False);
      End.
    Last edited by rj; 11-23-2012 at 07:06 PM.

  2. #2
    Join Date
    Feb 2006
    Location
    Helsinki, Finland
    Posts
    1,395
    Mentioned
    30 Post(s)
    Quoted
    107 Post(s)

    Default

    Try this:

    Simba Code:
    // fill out const's
    const
      NPC = 1122383;
      loot = 14079706;
      tolerence = 15;
      time = 7; // in seconds
      rwait = 1000;
      tleft = 41;
      tright = 44;
      bleft = 426;
      bright = 280;

    var
      charm: Integer;

    procedure PickUp;
    var
      X, Y: Integer;
    begin
      Wait(1700 + Random(1200));
      WriteLn('Looking for bones...');
      if FindColorTolerance(X, Y, loot, 184, 123, 294, 197, 15) then
      begin
        WriteLn('Found bones!');
        Movemouse(x, y);
        Wait(120 + Random(80));
        ClickMouse(x, y, mouse_Right);
      end;
      WriteLn('Looking for charm...');
      Wait(1100);
      if FindBitmapToleranceIn(charm, X, Y,161, 95, 330, 205, 75) then
      begin
        Movemouse(X, Y);
        WriteLn('Found charm!');
        Wait(500);
        ClickMouse(X, Y, mouse_Left);
        Wait(3000);
      end;
    end;

    procedure CheckCombat;
    begin
      Wait((time * 500) + Random(rwait));
      WriteLn('Waiting for loot...');
      Wait((time * 500) + Random(rwait));
      PickUp;
    end;

    procedure ClickNPC;
    var
      X, Y: Integer;
    begin     // kill npc
      WriteLn('Attacking skeleton...');
      if FindColorTolerance(X, Y, NPC, tleft, tright, bleft, bright, tolerence) then
      begin
        MoveMouse(X, Y);
        Wait(20 + Random(50));
        ClickMouse(X, Y, Mouse_Left);
        WriteLn('Attacked skeleton!');
        CheckCombat;
      end;
    end;

    begin
      charm := BitmapFromString(31, 12, 'meJyTUdeWIQU5TPgPRyRpJNJkBj' +
            'CgrvnIJkNEkNnUMpwMvVN3HIMj/IZjDXOscQFxCcRMiDdxmY/scrQ' +
            'wxx8XcMPR2HiCBZmLi40ZJnAvUNdwBiSAJ9iJNxwevGiOx59mMJMl' +
            'VnHMdIvf8WjKiBGnEQIAUtQGXA==');
      repeat
        ClearDebug;
        ClickNPC;
      until False;
      FreeBitmap(charm);
    end.

  3. #3
    Join Date
    Sep 2010
    Posts
    5,762
    Mentioned
    136 Post(s)
    Quoted
    2739 Post(s)

    Default

    Quote Originally Posted by Janilabo View Post
    Try this:

    Simba Code:
    // fill out const's
    const
      NPC = 1122383;
      loot = 14079706;
      tolerence = 15;
      time = 7; // in seconds
      rwait = 1000;
      tleft = 41;
      tright = 44;
      bleft = 426;
      bright = 280;

    var
      charm: Integer;

    procedure PickUp;
    var
      X, Y: Integer;
    begin
      Wait(1700 + Random(1200));
      WriteLn('Looking for bones...');
      if FindColorTolerance(X, Y, loot, 184, 123, 294, 197, 15) then
      begin
        WriteLn('Found bones!');
        Movemouse(x, y);
        Wait(120 + Random(80));
        ClickMouse(x, y, mouse_Right);
      end;
      WriteLn('Looking for charm...');
      Wait(1100);
      if FindBitmapToleranceIn(charm, X, Y,161, 95, 330, 205, 75) then
      begin
        Movemouse(X, Y);
        WriteLn('Found charm!');
        Wait(500);
        ClickMouse(X, Y, mouse_Left);
        Wait(3000);
      end;
    end;

    procedure CheckCombat;
    begin
      Wait((time * 500) + Random(rwait));
      WriteLn('Waiting for loot...');
      Wait((time * 500) + Random(rwait));
      PickUp;
    end;

    procedure ClickNPC;
    var
      X, Y: Integer;
    begin     // kill npc
      WriteLn('Attacking skeleton...');
      if FindColorTolerance(X, Y, NPC, tleft, tright, bleft, bright, tolerence) then
      begin
        MoveMouse(X, Y);
        Wait(20 + Random(50));
        ClickMouse(X, Y, Mouse_Left);
        WriteLn('Attacked skeleton!');
        CheckCombat;
      end;
    end;

    begin
      charm := BitmapFromString(31, 12, 'meJyTUdeWIQU5TPgPRyRpJNJkBj' +
            'CgrvnIJkNEkNnUMpwMvVN3HIMj/IZjDXOscQFxCcRMiDdxmY/scrQ' +
            'wxx8XcMPR2HiCBZmLi40ZJnAvUNdwBiSAJ9iJNxwevGiOx59mMJMl' +
            'VnHMdIvf8WjKiBGnEQIAUtQGXA==');
      repeat
        ClearDebug;
        ClickNPC;
      until False;
      FreeBitmap(charm);
    end.
    Thanks

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
  •