Results 1 to 12 of 12

Thread: What's Wrong Here?

  1. #1
    Join Date
    Dec 2006
    Posts
    24
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default What's Wrong Here?

    Yeah, this is my first script ever after reading a couple of tutorials. But basically what im trying to do is make an autoshooter for this game i play. I have a cheat that makes the skins 2 different solid colors to shoot at. I looked at some more tutorials and I dont know what's wrong.

    It's giving me error "Line 7: [Error] (7:1): 'BEGIN' expected in script C:\Documents and Settings\ME\Desktop\TXT\1\SCAR 3.15\Scripts\MOHAA AutoSniper.scar"

    Here's the script:

    SCAR Code:
    program Autoshoot;
    const
    AlliedColor = 65535;
    AxisColor = 16776960;

    procedure Chill;
             Wait(1000);
             end;

    begin
    Chill;
    repeat


    procedure ReAimAxis;
              Wait(200+random(500));
              AimAxis;
    end;

    procedure ReAimAllies;
              Wait(200+random(500));
              AimAllies;
    end;

    AimAxis;
    end;

    procedure AimAxis;
             if(FindColor(x,y,AlliedColor,0,0,1024,678)) then
             begin
             ClickMouse(x,y);
             Writeln('Shot.');
             ReAimAxis;
             else
             ReAimAxis;
             end;
    procedure AimAllies;
             if(FindColor(x,y,AxisColor,0,0,1024,678)) then
             begin
             ClickMouse(x,y);
             Writeln('Shot.');
             ReAimAllies;
             end else
             ReAimAllies;
             end;


    begin
    if IsFKeyDown(2)then
    begin
         Writeln('F2 Pushed, Started Aiming Allies Side');
         ReAimAllies;
         end;

    if IsFKeyDown(3)then
    begin
         Writeln('F3 Pushed, Started Aiming Axis Side');
         ReAimAxis;
         end;
         
    if IsFKeyDown(4)then
    begin
         Writeln('F4 Pushed to Stop Script');
         Chill;
         end;

    end.

    A couple things id like to say, i used ClickMouse on purpose so it would instantly go to the color and shoot it, but i dont know if im doing it right. and the keys are for if i switched teams i could push a F button and make it aim at that color. Anyway any help would be appreciated thanks.

  2. #2
    Join Date
    May 2008
    Posts
    1,345
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Clickmouse is used like this:

    SCAR Code:
    ClickMouse(x, y, Left : Boolean);

    True for left click, False for right.

    Ps, what's the game and the cheat?

    ~Sandstorm

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

    Default

    You need a begin and end; for every procedure.

    Ex/
    SCAR Code:
    procedure Die;
    begin
      DoStuff;
    end;

    And for the mainloop, you need
    SCAR Code:
    begin
      DoStuff;
    end.

    Note the . for the mainloop's end.

  4. #4
    Join Date
    Dec 2006
    Posts
    24
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    the game is MOHAA (medal of honor allied assault) its an old skool game but fun as hell. and the cheats called chameleon skins, and it just makes the 2 team colors a solid color (like red and blue or purple and orange etc) ill try that and see what happens, thanks

  5. #5
    Join Date
    Dec 2008
    Posts
    2,813
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    and you don't need the chill procedure, just add that to the first procedure

    and for the repeat you do..

    SCAR Code:
    procedure stuff;
    begin
    repeat
      blahblah;
      Inc(blahblahed);
    until(blahblahed > 7);
    end;

  6. #6
    Join Date
    May 2008
    Posts
    1,345
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Here's one that should work:

    SCAR Code:
    program Autoshoot;
    const
      AlliedColor = 65535;
      AxisColor = 16776960;

    procedure Chill;
    Begin
      Wait(1000);
    end;

    Procedure AimAxis; Forward;
    Procedure AimAllies; Forward;

    procedure ReAimAxis;
    begin
      Wait(200+random(500));
      AimAxis;
    end;

    procedure ReAimAllies;
    begin
      Wait(200+random(500));
      AimAllies;
    end;

    procedure AimAxis;
    Var
      x, y : Integer;
    Begin
     if(FindColor(x,y,AlliedColor,0,0,1024,678)) then
     begin
       ClickMouse(x,y,true);
       Writeln('Shot.');
       ReAimAxis;
     end else
       ReAimAxis;
    end;
             
    procedure AimAllies;
    Var
      x, y : Integer;
    Begin
      if(FindColor(x,y,AxisColor,0,0,1024,678)) then
      begin
        ClickMouse(x,y,true);
        Writeln('Shot.');
        ReAimAllies;
      end else
        ReAimAllies;
    end;


    begin
      Repeat
        if IsFKeyDown(2)then
        begin
          Writeln('F2 Pushed, Started Aiming Allies Side');
          ReAimAllies;
        end;
        if IsFKeyDown(3)then
        begin
            Writeln('F3 Pushed, Started Aiming Axis Side');
            ReAimAxis;
        end;
        if IsFKeyDown(4)then
        begin
            Writeln('F4 Pushed to Stop Script');
            Chill;
        end;
      Until(IsFkeyDown(6))
    end.

    Ps, can I get a link?

    ~Sandstorm

  7. #7
    Join Date
    Dec 2006
    Posts
    24
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    I tried yours but it keeps saying BEGIN expected in script. And ill PM you link

  8. #8
    Join Date
    May 2008
    Posts
    1,345
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    That's odd, it compiles fine for me.

    ~Sandstorm

  9. #9
    Join Date
    Dec 2006
    Posts
    24
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    i think its cause i got Divi, ill get a different version and try it. thanks for the help man

  10. #10
    Join Date
    Apr 2007
    Posts
    2,593
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

  11. #11
    Join Date
    May 2008
    Posts
    1,345
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    B.

    ~Sandstorm

  12. #12
    Join Date
    Dec 2006
    Posts
    24
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    i got the script working, thanks for the help

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. what am i doing wrong ?:P
    By sjlou in forum OSR Help
    Replies: 2
    Last Post: 10-01-2007, 01:52 PM
  2. What am i doing wrong?
    By One Leeter in forum OSR Help
    Replies: 7
    Last Post: 06-15-2007, 10:33 PM
  3. Replies: 8
    Last Post: 03-23-2007, 04:20 PM

Posting Permissions

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