Results 1 to 2 of 2

Thread: Help With My Script Please!!!

  1. #1
    Join Date
    Oct 2007
    Posts
    742
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default Help With My Script Please!!!

    Ok i am currently making an battleon.com script, i made one but, it has an error when i run it, somone please help me!

    Error .
    SCAR Code:
    Failed when compiling
    Line 34: [Error] (14713:1): Identifier expected in script C:\Program Files\SCAR 3.13\Scripts\AQ.scar

    Script .
    SCAR Code:
    Program AQ;
    {.Include SRL/SRL.Scar}

    //The Instructions.
    //1.Log In, And Start In The Town of Battle-On.
    //2.Set Up Const.
    //3.Click Run And Make Sure The Script Kills At Least One Monster.
    //The Instructions.

    Var
    Killed, Died, CuteMoglins, Chests: Integer;
    x, y: Integer;

    Const
    ToFight = 1000;//How many monsters to try and kill.
    MoglinHeal = True;//True if you want twilly the moglin to heal you after each fight.

    {---------------------------- END OF SETUP ------------------------------------}

    ////////////////////////////////////////////////////////////////////////////////
    VersionNumber = '0.1';{DO NOT TOUCH}////////////////////////////////////////////
    ////////////////////////////////////////////////////////////////////////////////

    Procedure GoToFight;
    Begin
    If(FindColor(x, y, 2835929, 657, 459, 659, 461))Or(FindColor(x, y, 2045101, 577, 446, 579, 449))Then
    Mouse(x, y, 1, 1, True);
    Begin
    Repeat
    Wait(500+random(500));
    Until(FindColor(x, y, 5013375, 384, 221, 388, 225));
    End;

    Procedure Heal;
    Begin
    If(Heal = True)Then
    Begin
    If(FindColor(x, y, 16862, 383, 389, 385, 391))Then
    Mouse(x, y, 1, 1, True);
    Wait(500+random(500));
    Mouse(582, 229, 1, 1, True);
    Wait(5000);
    Mouse(696, 546, 1, 1, True);
    End;
    End;

    Procedure SolveCuteMoglin;
    Begin
    If(FindColor(x, y, 8224255, 654, 336, 658, 340))Then
    Begin
    Mouse(587, 250, 1, 1, True);
    End;
    End;

    Procedure SolveChest;
    Begin
    If(GetColor(407, 90)=12510454)And(GetColor(424, 285) = 13434879)Then
    Mouse(416, 286, 1, 1, True);
    Repeat
    Wait(100);
    Until(FindColor(x, y, 10931946, 395, 322, 399, 326));
    If(FindColor(x, y, 10931946, 395, 322, 399, 326))Then
    Begin
    If(FindColor(x, y, 16777215, 396, 371, 400, 375))Then
    Begin
    Mouse(x, y, 1, 1, True);
    Begin
    Repeat
    Wait(100);
    Until(FindColor(x, y, 2835929, 657, 459, 659, 461))Or(FindColor(x, y, 2045101, 577, 446, 579, 449));
    If(FindColor(x, y, 2835929, 657, 459, 659, 461))Or(FindColor(x, y, 2045101, 577, 446, 579, 449))Then
    Chests:=Chests+1;
    End;
    End;
    End;
    End;

    Procedure SolveTokens;
    Begin
    If(FindColor(x, y, 4242146, 401, 326, 403, 327))Then
    Begin
    Mouse(402, 404, 1, 1,True);
    End;
    End;

    Procedure SolveWin;
    Begin
    Repeat
    If(FindColor(x, y, 10931946, 395, 322, 399, 326))Then
    Wait(500+random(500));
    Until(FindColor(x, y, 16777215, 396, 371, 400, 375));
    If(FindColor(x, y, 16777215, 396, 371, 400, 375))Then
    Begin
    Mouse(x, y, 1, 1, True);
    Wait(5000+random(1000));
    Killed:=Killed+1;
    End;
    End;

    Procedure SolveDeath;
    Begin
    If(FindColor(x, y, 16777215, 403, 321, 407, 325))Then
    Mouse(x, y, 1, 1, True);
    Begin
    Repeat
    Wait(1000);
    Until(FindColor(x, y, 1315860, 461, 193, 465, 197));
    If(FindColor(x, y, 1315860, 461, 193,465, 197))Then
    Begin
    Mouse(311, 273, 2, 2, True);
    Wait(500+random(500));
    Mouse(311, 273, 2, 2, True);
    Wait(2000+random(3000));
    Mouse(656, 448, 2, 2, True);
    Died:=Died+1;
    End;
    End;
    End;

    Procedure Attack;
    Begin
    Repeat
    If(FindColor(x, y, 5013375, 384, 221, 388, 225))Then
    Mouse(x, y, 2, 2, True);
    Wait(500);
    Until(FindColor(x, y, 16777215, 403, 321, 407, 325))Or(FindColor(x, y, 10931946, 395, 322, 399, 326))Or(FindColor(x, y, 16777215, 396, 371, 400, 375));
    If(FindColor(x, y, 16777215, 403, 321, 407, 325))Or(FindColor(x, y, 10931946, 395, 322, 399, 326))Or(FindColor(x, y, 16777215, 396, 371, 400, 375))Then
    Begin
    SolveDeath;
    SolveWin;
    SolveTokens;
    End;
    End;

    Procedure Report;
    Begin
    ClearDebug;
    WriteLn('AQ Version ' + VersionNumber + '.');
    WriteLn('Made By U L T R A.');
    WriteLn('--------------------------------------------------------------------');
    WriteLn('Fought ' + IntToStr(Killed) + ' Monsters.');
    WriteLn('Died ' + IntToStr(Died) +  ' Times.');
    WriteLn('Solved ' + IntToStr(CuteMoglins) + ' Cute Moglins.');
    WriteLn('Solved ' + IntToStr(Chests) + ' Chests');
    WriteLn('--------------------------------------------------------------------');
    End;

    Begin
    SetUpSRL;
    Begin
    Repeat
    Heal;
    GoToFight;
    SolveCuteMoglin;
    SolveChest;
    Attack;
    Report;
    Until(Killed = ToFight);
    If(Killed = ToFight)Then
    Begin
    TerminateScript;
    End;
    End;
    End.
    Woot woot.

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

    Default

    You forgot a end;.
    SCAR Code:
    Program AQ;
    {.Include SRL/SRL.Scar}

    //The Instructions.
    //1.Log In, And Start In The Town of Battle-On.
    //2.Set Up Const.
    //3.Click Run And Make Sure The Script Kills At Least One Monster.
    //The Instructions.

    Var
    Killed, Died, CuteMoglins, Chests: Integer;
    x, y: Integer;

    Const
    ToFight = 1000;//How many monsters to try and kill.
    MoglinHeal = True;//True if you want twilly the moglin to heal you after each fight.

    {---------------------------- END OF SETUP ------------------------------------}

    ////////////////////////////////////////////////////////////////////////////////
    VersionNumber = '0.1';{DO NOT TOUCH}////////////////////////////////////////////
    ////////////////////////////////////////////////////////////////////////////////

    Procedure GoToFight;
    Begin
    If(FindColor(x, y, 2835929, 657, 459, 659, 461))Or(FindColor(x, y, 2045101, 577, 446, 579, 449))Then
    Mouse(x, y, 1, 1, True);
    Begin
    Repeat
    Wait(500+random(500));
    Until(FindColor(x, y, 5013375, 384, 221, 388, 225));
    End;
    End;

    Procedure HealMe;
    Begin
    If(MoglinHeal = True)Then
    Begin
    If(FindColor(x, y, 16862, 383, 389, 385, 391))Then
    Mouse(x, y, 1, 1, True);
    Wait(500+random(500));
    Mouse(582, 229, 1, 1, True);
    Wait(5000);
    Mouse(696, 546, 1, 1, True);
    End;
    End;

    Procedure SolveCuteMoglin;
    Begin
    If(FindColor(x, y, 8224255, 654, 336, 658, 340))Then
    Begin
    Mouse(587, 250, 1, 1, True);
    End;
    End;

    Procedure SolveChest;
    Begin
    If(GetColor(407, 90)=12510454)And(GetColor(424, 285) = 13434879)Then
    Mouse(416, 286, 1, 1, True);
    Repeat
    Wait(100);
    Until(FindColor(x, y, 10931946, 395, 322, 399, 326));
    If(FindColor(x, y, 10931946, 395, 322, 399, 326))Then
    Begin
    If(FindColor(x, y, 16777215, 396, 371, 400, 375))Then
    Begin
    Mouse(x, y, 1, 1, True);
    Begin
    Repeat
    Wait(100);
    Until(FindColor(x, y, 2835929, 657, 459, 659, 461))Or(FindColor(x, y, 2045101, 577, 446, 579, 449));
    If(FindColor(x, y, 2835929, 657, 459, 659, 461))Or(FindColor(x, y, 2045101, 577, 446, 579, 449))Then
    Chests:=Chests+1;
    End;
    End;
    End;
    End;

    Procedure SolveTokens;
    Begin
    If(FindColor(x, y, 4242146, 401, 326, 403, 327))Then
    Begin
    Mouse(402, 404, 1, 1,True);
    End;
    End;

    Procedure SolveWin;
    Begin
    Repeat
    If(FindColor(x, y, 10931946, 395, 322, 399, 326))Then
    Wait(500+random(500));
    Until(FindColor(x, y, 16777215, 396, 371, 400, 375));
    If(FindColor(x, y, 16777215, 396, 371, 400, 375))Then
    Begin
    Mouse(x, y, 1, 1, True);
    Wait(5000+random(1000));
    Killed:=Killed+1;
    End;
    End;

    Procedure SolveDeath;
    Begin
    If(FindColor(x, y, 16777215, 403, 321, 407, 325))Then
    Mouse(x, y, 1, 1, True);
    Begin
    Repeat
    Wait(1000);
    Until(FindColor(x, y, 1315860, 461, 193, 465, 197));
    If(FindColor(x, y, 1315860, 461, 193,465, 197))Then
    Begin
    Mouse(311, 273, 2, 2, True);
    Wait(500+random(500));
    Mouse(311, 273, 2, 2, True);
    Wait(2000+random(3000));
    Mouse(656, 448, 2, 2, True);
    Died:=Died+1;
    End;
    End;
    End;

    Procedure Attack;
    Begin
    Repeat
    If(FindColor(x, y, 5013375, 384, 221, 388, 225))Then
    Mouse(x, y, 2, 2, True);
    Wait(500);
    Until(FindColor(x, y, 16777215, 403, 321, 407, 325))Or(FindColor(x, y, 10931946, 395, 322, 399, 326))Or(FindColor(x, y, 16777215, 396, 371, 400, 375));
    If(FindColor(x, y, 16777215, 403, 321, 407, 325))Or(FindColor(x, y, 10931946, 395, 322, 399, 326))Or(FindColor(x, y, 16777215, 396, 371, 400, 375))Then
    Begin
    SolveDeath;
    SolveWin;
    SolveTokens;
    End;
    End;

    Procedure Report;
    Begin
    ClearDebug;
    WriteLn('AQ Version ' + VersionNumber + '.');
    WriteLn('Made By U L T R A.');
    WriteLn('--------------------------------------------------------------------');
    WriteLn('Fought ' + IntToStr(Killed) + ' Monsters.');
    WriteLn('Died ' + IntToStr(Died) +  ' Times.');
    WriteLn('Solved ' + IntToStr(CuteMoglins) + ' Cute Moglins.');
    WriteLn('Solved ' + IntToStr(Chests) + ' Chests');
    WriteLn('--------------------------------------------------------------------');
    End;

    Begin
    SetUpSRL;
    Begin
    Repeat
    HealMe;
    GoToFight;
    SolveCuteMoglin;
    SolveChest;
    Attack;
    Report;
    Until(Killed = ToFight);
    If(Killed = ToFight)Then
    Begin
    TerminateScript;
    End;
    End;
    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
  •