Results 1 to 8 of 8

Thread: autofighter problem

  1. #1
    Join Date
    Nov 2007
    Location
    Chile
    Posts
    1,901
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default autofighter problem

    yay finally ive done another script "BarbarianKiller" is the name the problem is Line 14: [Error] (13084:1): Duplicate identifier 'MSX1' in script. yes i know the problem
    Quote Originally Posted by JAD
    Now, if there's a variable or a procedure in SRL and you have SRL included in your script, if you try to call a procedure/function something which's name is already used in SRL, you will get a duplicated identifier with that. So you can't make a procedure named this in your script if you're including SRL.
    but if i dont include SRL it comes with another error : unknown 'GameTab' identifier in the script .

    what should i do?
    SCAR Code:
    {.Script Info:
    # ScriptName  = BarbarianKiller
    # Author      = Cazax
    # Description = Kills barbarians in barb house
    # Version     = 0.5
    # Date        = 2008
    # Comments    = my second script   :)
    /Script Info}

    program BarbKiller;
    {.include srl/srl.scar}
    {.include srl/srl/skill/fighting.scar}
    var
    HowManyKills,x,y : Integer;
    MSX1, MSY1, MSX2, MSY2 : Integer;
    foodlogout : boolean;
    const
    BarbarianColor = 1846843;
    BarbariansToKill = 10;
    EatFoodIfLowerHp = 6; // hp before eat
    foodcolor = ; // fill in the food color if u are going to eat
    procedure DeclarePlayers;
    begin
    HowManyPlayers := 1;
      NumberOfPlayers(HowManyPlayers);
      CurrentPlayer := 0;

    Players[0].Name := '';
      Players[0].Pass := '';
      Players[0].Nick := '';
      Players[0].Active := True;
      Players[0].Booleans[0] := False; // are you going to eat food?

    end;
    procedure Starting;
    begin
    MakeCompass('S');
    SetAngle(Low:Boolean);
    GameTab(4)
    end;
    Procedure AniBann;
    var
    i : Integer;
    begin
    for i := 1 to 2 do
    begin
    case i of
    1: PickUpMouse;
    2: BoredHuman;
    end;
    end;
    procedure AutoResponce;
    begin
    if (FindChatText('Hi'))then
    begin
    TypeSend('Ik spreek geen Engels')
    if (FindChatText('Reported')then
    begin
    TypeSend('why?')
    wait(3000+random(251))
    DoEmote(1+random(17))
    wait(1000+random(529))
    TypeSend('Str lvl?')
    end;
    end;
    end;
    function FindFastRandoms: Boolean;
    var
      i: Integer;
    begin
      for i:=1 to 10 do
      begin
        case I of
         1:  If FindDead then
               Result := True;
         2:  If FindMod then
               Result := True;
         3:  If FindMime then
               Result := True;
         4:  If FindMaze then
               Result := True;
         5:  If FindQuiz then
               Result := True;
         6:  If FindDemon then
               Result := True;
         7: begin
               if NoGameTab then
               begin
                 Result := True;
                 Players[CurrentPlayer].loc := 'No GameTab';
               end;
             end;
         8: begin
               if InBlack then
               begin
                 Result := True;
                 Players[CurrentPlayer].loc := 'InBlack';
               end;
             end;
           9: RC;
           10: Respond;
        end;
        wait(1);
      end;
    end;
    procedure FindForBarbarian;
    begin
    repeat
    FindNormalRandoms;
    if (FindColor(x,y,BarbarianColor,MSX1, MSY1, MSX2, MSY2)then
    begin
    if (IsUpText('barian'))then
    begin
    Mouse(x,y,1,1,true);
    RealEatIfNeeded(foodcolor, eathp : integer; foodlogout);
    OutFight;
    until ( HowManyKills >= BarbariansToKill )
    end;
    end;
    end;
    begin
    ActivateClient;
    SetupSRL;
    if (Not(LoggedIn)) then loginplayer;
    Starting;
    repeat
    AntiBann;
    AutoResponce;
    FindFastRandoms;
    FindForBarbarian;
    until (false)
    end.


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

    Default

    At the beginning, you did 'MSX1, MSY1, MSX2, MSY2 : Integer;'. You don't need to do that as the srl include already sets it as a variable and gives it a value. Just take out the line and you should be ok.

  3. #3
    Join Date
    Feb 2007
    Location
    EST (US East Coast)
    Posts
    250
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Read the globals include of SRL if you want some more information, but yeah basically it does the same thing with variables or constants. MSX1 etc are predefined constants in the Globals.scar include. You can use them without defining them in each script, assuming you have SRL included.
    Temporarily inactive.

  4. #4
    Join Date
    Nov 2007
    Location
    Chile
    Posts
    1,901
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    thx guys this helped but when it run it open the EvilBob.scar
    and it comes up with an error : Line 57: [Error] (8909:24): Type mismatch in script


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

    Default

    Random stuff not working like that happens every now and then. Make sure you have the latest SRL first. If you do or you update it and it still doesn't work, try re-installing SRL and it should be fixed.

  6. #6
    Join Date
    Nov 2007
    Location
    Chile
    Posts
    1,901
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Quote Originally Posted by mixster05 View Post
    Random stuff not working like that happens every now and then. Make sure you have the latest SRL first. If you do or you update it and it still doesn't work, try re-installing SRL and it should be fixed.
    i was using rev 10 i re-installed SRL and it works fine but now i have to wait until SRL 5 come out cuz the new compass, logout, etc...


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

    Default

    I'm pretty sure rev 10 was to fix most of the latest updates, but I could be wrong. Otherwise, check the script test area as there are quite a few temporary fixes there if you want to continue debuging etc. of your script.

  8. #8
    Join Date
    Jun 2007
    Location
    La Mirada, CA
    Posts
    2,484
    Mentioned
    1 Post(s)
    Quoted
    3 Post(s)

    Default

    Rev #10 should have all fixes to the new interface, logout, compass, ect...it should all be up to date for the most part

    "Failure is the opportunity to begin again more intelligently" (Henry Ford)


Thread Information

Users Browsing this Thread

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

Similar Threads

  1. autofighter.......
    By dicklick in forum OSR Help
    Replies: 5
    Last Post: 10-30-2008, 11:44 PM
  2. My autofighter
    By Vandalf in forum First Scripts
    Replies: 3
    Last Post: 10-19-2008, 05:46 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
  •