Results 1 to 10 of 10

Thread: Syntax error(need help.)

  1. #1
    Join Date
    Nov 2006
    Posts
    2,369
    Mentioned
    4 Post(s)
    Quoted
    78 Post(s)

    Default Syntax error(need help.)

    SCAR Code:
    program Bandits;
    {.include SRL/SRL.scar}

    var
    TimeMark,NickNameBMP:integer;


    procedure DeclarePlayers;
    begin
      HowManyPlayers := 1;
      NumberOfPlayers(HowManyPlayers);
      CurrentPlayer := 0;

      Players[0].Name := '';
      Players[0].Pass := '';
      Players[0].Nick := 'I  P';
      Players[0].Active := True;
    end;





    Procedure PickWorld;
    var x,y,NewWorld,LastWorld,SecondLastWorld,HopCounter:integer;
    GoodWorld:string;
      Begin
       Repeat
        If FindText(x,y,'Welcome to RuneScape',UpChars,300,235,465,260) Or (FindText(x,y,'Login',UpChars,235,305,369,337)) Then
         Begin
          Mouse(10,465,90,30,True)
          Wait(1000+Random(130))
         End Else
          Wait(1000+Random(155));
       Until(FindText(x,y,'Select a world',UpChars,10,2,114,19));
       Repeat
       If FindText(x,y,'Select a world',UpChars,10,2,114,19) Then
       Repeat
        NewWorld := Random(50)+1
        If (NewWorld = LastWorld) Or (NewWorld = SecondLastWorld) Then
         Begin
          GoodWorld := 'False'
         End Else
         Begin
          GoodWorld := 'True';
         End;
       Until(GoodWorld='True');
       Begin
        Case (NewWorld) Of
        1: FindText(x,y,'44',UpChars,50,30,520,500);
        2: FindText(x,y,'45',UpChars,50,30,520,500);
        3: FindText(x,y,'46',UpChars,50,30,520,500);
        4: FindText(x,y,'48',UpChars,50,30,520,500);
        5: FindText(x,y,'53',UpChars,50,30,520,500);
        6: FindText(x,y,'54',UpChars,50,30,520,500);
        7: FindText(x,y,'56',UpChars,50,30,520,500);
        8: FindText(x,y,'58',UpChars,50,30,520,500);
        9: FindText(x,y,'59',UpChars,50,30,520,500);
        10: FindText(x,y,'64',UpChars,50,30,520,500);
        11: FindText(x,y,'65',UpChars,50,30,520,500);
        12: FindText(x,y,'66',UpChars,50,30,520,500);
        13: FindText(x,y,'69',UpChars,50,30,520,500);
        14: FindText(x,y,'70',UpChars,50,30,520,500);
        15: FindText(x,y,'71',UpChars,50,30,520,500);
        16: FindText(x,y,'76',UpChars,50,30,520,500);
        17: FindText(x,y,'77',UpChars,50,30,520,500);
        18: FindText(x,y,'78',UpChars,50,30,520,500);
        19: FindText(x,y,'79',UpChars,50,30,520,500);
        20: FindText(x,y,'82',UpChars,50,30,520,500);
        21: FindText(x,y,'83',UpChars,50,30,520,500);
        22: FindText(x,y,'84',UpChars,50,30,520,500);
        23: FindText(x,y,'88',UpChars,50,30,520,500);
        24: FindText(x,y,'89',UpChars,50,30,520,500);
        25: FindText(x,y,'91',UpChars,50,30,520,500);
        26: FindText(x,y,'92',UpChars,50,30,520,500);
        27: FindText(x,y,'97',UpChars,50,30,520,500);
        28: FindText(x,y,'98',UpChars,50,30,520,500);
        29: FindText(x,y,'99',UpChars,50,30,520,500);
        30: FindText(x,y,'100',UpChars,50,30,520,500);
        31: FindText(x,y,'103',UpChars,50,30,520,500);
        32: FindText(x,y,'104',UpChars,50,30,710,500);
        33: FindText(x,y,'110',UpChars,50,30,710,500);
        34: FindText(x,y,'111',UpChars,50,30,710,500);
        35: FindText(x,y,'112',UpChars,50,30,710,500);
        36: FindText(x,y,'114',UpChars,50,30,710,500);
        37: FindText(x,y,'115',UpChars,50,30,710,500);
        38: FindText(x,y,'116',UpChars,50,30,710,500);
        39: FindText(x,y,'120',UpChars,50,30,710,500);
        40: FindText(x,y,'121',UpChars,50,30,710,500);
        41: FindText(x,y,'124',UpChars,50,30,710,500);
        42: FindText(x,y,'129',UpChars,50,30,710,500);
        43: FindText(x,y,'130',UpChars,50,30,710,500);
        44: FindText(x,y,'131',UpChars,50,30,710,500);
        45: FindText(x,y,'132',UpChars,50,30,710,500);
        46: FindText(x,y,'137',UpChars,50,30,710,500);
        47: FindText(x,y,'138',UpChars,50,30,710,500);
        48: FindText(x,y,'143',UpChars,50,30,710,500);
        49: FindText(x,y,'144',UpChars,50,30,710,500);
        50: FindText(x,y,'42',UpChars,50,30,520,500);
       End;
        Wait(100+Random(37))
        Mouse(x+40+Random(5),y+5,1,1,True)
        Wait(1000+Random(210))
        End;
        SecondLastWorld := LastWorld
        LastWorld := NewWorld
        If FindText(x,y,'Welcome to RuneScape',UpChars,303,235,459,259) Or FindText(x,y,'username',UpChars,260,205,505,235) Or FindText(x,y,'password',UpChars,260,205,505,235) Then
         Begin
          HopCounter := HopCounter + 1
          Exit;
         End;
       Until(FindText(x,y,'Welcome to RuneScape',UpChars,303,235,459,259))
       HopCounter := HopCounter + 1
    End;
    //------------------------------------------------|||
    procedure randoms;
    begin
        Wait(200);
        FindNormalRandoms;
    end;




    procedure AntiBan;
    begin
    FTWait(1);
    MouseSpeed := 15 + Random(5);
      if(not LoggedIn)then exit;
    wait(100+random(100))
        case Random(35) of
        0:  MMouse(random(MSX2),random(MSY2),0,0);
        1:  HoverSkill('random',false);
        2:  HoverSkill('random',false);
        5:  PickupMouse;
        6:  MMouse(random(MSX2),random(MSY2),0,0);
        7:  MouseSpeed := 18 + Random(5);
        8:  MMouse(random(MSX2),random(MSY2),0,0);
        9:  FTWait(1+Random(2));
        10: begin
              GameTab(1+random(12));
              FTWait(1+Random(1));
              GameTab(4);
            end;
        11: MMouse(random(MSX2),random(MSY2),0,0);
        12: MouseSpeed := 19 + Random(5);
        13: MouseSpeed := 12 + Random(5);
        14: MMouse(random(MSX2),random(MSY2),0,0);
        15: begin
        case random(90000)of
        0:typesend('lol');
        1:typesend('<-');
        2:typesend('die');
        3:typesend('die');
        4:typesend('ww00t');
        5:typesend('wp');
        6:typesend('123456789');
        7:typesend('die monsters');
        8:typesend('my spot');
        9:typesend('Hi');
        10:typesend('x D');
        11:typesend('i own!');
        12:typesend('im noob');
        13:typesend('noob');
        14:typesend('hah');
        15:typesend('l0l');
        16:typesend('die');
        17:typesend('weeee');
        18:typesend('69');
        19:typesend('die');
        20:typesend('i hate range');
        21:typesend(' ');
        22:typesend('moo');
        23:typesend('hey');
        24:typesend('kgjdsfgh');
        25:typesend('njgsydfgy');
        26:typesend('omg');
        27:typesend('again!!');
        28:typesend('ya');
        end;
        end;
        16:  MMouse(random(MSX2),random(MSY2),0,0);
        17:  FTWait(1+Random(3));
        18:  FTWait(1+Random(2));
       
        19:  begin
        case random(3) of
        0:   begin
        KeyDown(VK_RIGHT);
        wait(700+random(1600));
        KeyUp(VK_RIGHT);
        end;
        1:    begin
        KeyDown(VK_Left);
        wait(700+random(1600));
        KeyUp(VK_Left);
        end;
        2:    begin
        case random(2) of
        0:   begin
        KeyDown(VK_RIGHT);
        wait(700+random(1600));
        KeyUp(VK_RIGHT);
       
        FTWait(1+Random(1));
       
        KeyDown(VK_Left);
        wait(700+random(1600));
        KeyUp(VK_Left);
        end;
        1:begin
        KeyDown(VK_Left);
        wait(700+random(1600));
        KeyUp(VK_Left);
       
        FTWait(1+Random(1));
       
        KeyDown(VK_RIGHT);
        wait(700+random(1600));
        KeyUp(VK_RIGHT);
        end;
        20: MouseSpeed := 22 + Random(5);
        end;
        end;





    procedure checkpoison;   //line------229-------   - - -  -
    begin
    if not IsChatBlackTextAnyLine('oisoned') then Exit;
    gametab(4);
    FTWait(1+Random(2));
    end;



    function GeetHp: Integer;
    var
      T: TPoint;
      TmpResult: string;
      i,f: Integer;
    begin
      tmpResult := GetTextAtEx(720 + 8, 29, 100, StatChars, False, True, 0,
        5, -1, 2, True, tr_Digits);
      if (Trim(tmpResult) = '') then
      begin
        for i := 1 to 5 do
        begin
          tmpResult := GetTextAtEx(720 + i + 8, 29, 100, StatChars, False,
            True, 0, 5, -1, 2, True, tr_Digits);
          if (Trim(tmpResult) <> '') then
            Exit;
        end;
      end else
        Result := StrToIntDef(Trim(GetTextAtEx(720 + 8, 29, 100, StatChars,
          False, True, 0, 5, -1, 2, True, tr_Digits)), 0);
    end;







    procedure checkhp;
    begin
    if (GeetHp > 40)then exit;
    gametab(4);
    FTWait(1+Random(2));
    end;





    begin
    MarkTime(TimeMark);//   if(TimeFromMark(TimeMark) >= 7000)) then
    activateclient;
    DeclarePlayers;
    setupsrl;
    NickNameBMP := CreateBitmapMaskFromText(Players[CurrentPlayer].Nick, UpChars);
    repeat
    MouseSpeed := 15 + Random(5);
    if not LoggedIn then LoginPlayer;
    randoms;
    checkhp;
    antiban;
    until(false);
    end.



    Failed when compiling
    Line 432: [Hint] (10376:1): Variable 'OLDMS' never used in script C:\Program Files\SCAR 3.14\includes\SRL/SRL/Core/AntiRandoms/AntiRandoms.scar
    Line 229: [Error] (12496:1): Syntax error in script C:\Program Files\SCAR 3.14\Scripts\bandits.scar


    I really dont know what's wrong

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

    Default

    In the future, please enclose script code with [*scar] and [*/scar] minus the *'s so that it makes it easier to read. The problem is in the Antiban - it has serisouly messed up begins and ends, so if you made it yourself, you need to go through it and add indents and fix it up. If it's not yours, post on the authors thread/pm the author asking them to fix it (politely).

  3. #3
    Join Date
    Nov 2006
    Posts
    2,369
    Mentioned
    4 Post(s)
    Quoted
    78 Post(s)

    Default

    Quote Originally Posted by mixster05 View Post
    In the future, please enclose script code with [*scar] and [*/scar] minus the *'s so that it makes it easier to read. The problem is in the Antiban - it has serisouly messed up begins and ends, so if you made it yourself, you need to go through it and add indents and fix it up. If it's not yours, post on the authors thread/pm the author asking them to fix it (politely).
    It's mine and I need help fixing it

  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

    Get standards and I might want to take a look at it.
    I made a new script, check it out!.

  5. #5
    Join Date
    Nov 2006
    Posts
    2,369
    Mentioned
    4 Post(s)
    Quoted
    78 Post(s)

    Default

    Quote Originally Posted by Markus View Post
    Get standards and I might want to take a look at it.
    What standars?

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

    Default

    SCAR Code:
    Procedure AntiBan;
    Begin
      FTWait(1);
      MouseSpeed := 15 + Random(5);
      If(not (LoggedIn))then
        exit;
      wait(100+random(100))
      Case Random(35) of
        0:  MMouse(random(MSX2),random(MSY2),0,0);
        1:  HoverSkill('random',false);
        2:  HoverSkill('random',false);
        5:  PickupMouse;
        6:  MMouse(random(MSX2),random(MSY2),0,0);
        7:  MouseSpeed := 18 + Random(5);
        8:  MMouse(random(MSX2),random(MSY2),0,0);
        9:  FTWait(1+Random(2));
        10:
        Begin
          GameTab(1+random(12));
          FTWait(1+Random(1));
          GameTab(4);
        End;
        11: MMouse(random(MSX2),random(MSY2),0,0);
        12: MouseSpeed := 19 + Random(5);
        13: MouseSpeed := 12 + Random(5);
        14: MMouse(random(MSX2),random(MSY2),0,0);
        15: begin
          case random(90000) of
            0:typesend('lol');
            1:typesend('<-');
            2:typesend('die');
            3:typesend('die');
            4:typesend('ww00t');
            5:typesend('wp');
            6:typesend('123456789');
            7:typesend('die monsters');
            8:typesend('my spot');
            9:typesend('Hi');
            10:typesend('x D');
            11:typesend('i own!');
            12:typesend('im noob');
            13:typesend('noob');
            14:typesend('hah');
            15:typesend('l0l');
            16:typesend('die');
            17:typesend('weeee');
            18:typesend('69');
            19:typesend('die');
            20:typesend('i hate range');
            21:typesend(' ');
            22:typesend('moo');
            23:typesend('hey');
            24:typesend('kgjdsfgh');
            25:typesend('njgsydfgy');
            26:typesend('omg');
            27:typesend('again!!');
            28:typesend('ya');
          End;
        End;
        16:  MMouse(random(MSX2),random(MSY2),0,0);
        17:  FTWait(1+Random(3));
        18:  FTWait(1+Random(2));
        19:
        begin
          case random(3) of
            0:
            begin
              KeyDown(VK_RIGHT);
              wait(700+random(1600));
              KeyUp(VK_RIGHT);
            end;
            1:
            begin
              KeyDown(VK_Left);
              wait(700+random(1600));
              KeyUp(VK_Left);
            end;
            2:
            begin
              case random(2) of
                0:
                begin
                  KeyDown(VK_RIGHT);
                  wait(700+random(1600));
                  KeyUp(VK_RIGHT);
                  FTWait(1+Random(1));
                  KeyDown(VK_Left);
                  wait(700+random(1600));
                  KeyUp(VK_Left);
                end;
                1:
                begin
                  KeyDown(VK_Left);
                  wait(700+random(1600));
                  KeyUp(VK_Left);
                  FTWait(1+Random(1));
                  KeyDown(VK_RIGHT);
                  wait(700+random(1600));
                  KeyUp(VK_RIGHT);
                end;
              end;
            end;
          end;
        end;
        20: MouseSpeed := 22 + Random(5);
      end;
    end;

    The indents have been added, so it should be much easier to go through in future. The problem was that you were missing a couple of ends for the beginning of cases.

    Indents are the most basic form of standards. Generally, it's 2 spaces after a Begin, Repeat, Case, Var or Const and -2 spaces after an End, Until() and the last variable or constant.

  7. #7
    Join Date
    Nov 2006
    Posts
    2,369
    Mentioned
    4 Post(s)
    Quoted
    78 Post(s)

    Default

    Thank so much mixter05!

  8. #8
    Join Date
    Dec 2006
    Location
    Copy pastin to my C#
    Posts
    3,788
    Mentioned
    8 Post(s)
    Quoted
    29 Post(s)

    Default

    Standards are the indenting of the lines, I think the beginner tutorials tell about them.


    Also, why do you have a three dimensional case there?

    (Case .. of... case .. of... case .. of)


    You need to add two "end;" :s to the AntiBan above the line
    SCAR Code:
    20: MouseSpeed := 22 + Random(5);


    EDIT: Meh, I was too late, also by the way, if you do not want to do the standards yourself, search for "delphi formatter".

  9. #9
    Join Date
    Nov 2006
    Posts
    2,369
    Mentioned
    4 Post(s)
    Quoted
    78 Post(s)

    Default

    Ok. I will add it to wear guthans when low hp and few other things like running away and back every 5 mins to awoid swarms. I will relase it if I get it to work

    ps.Im sorry for my bad english...

  10. #10
    Join Date
    May 2006
    Posts
    5
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    im interested in any working bandit script

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Line 135: [Error] (14845:1): Syntax error in script
    By AbsTrACt'^.| in forum OSR Help
    Replies: 16
    Last Post: 05-23-2008, 01:14 PM
  2. Replies: 5
    Last Post: 02-26-2008, 04:14 PM
  3. Syntax Error
    By me_ntal in forum OSR Help
    Replies: 1
    Last Post: 02-14-2007, 02:44 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
  •