Results 1 to 7 of 7

Thread: A tiny problem...

  1. #1
    Join Date
    May 2007
    Location
    in a pineapple under the sea
    Posts
    1,040
    Mentioned
    0 Post(s)
    Quoted
    1 Post(s)

    A tiny problem...

    SCAR Code:
    program Fighter;
    {.include SRL\SRL.scar}
    {.include SRL\SRL\misc\trade.scar}

    const
      Minutes          = 60000; // in ms how many ms do you want to wait before logging back in
      Montol           = 10;  // tolerance  (LINE WITH ERROR!!!)
      waittime         = 1000; // Time to wait in between monsters (in ms)1000ms/sec.
      TheMinCount      = 4;  // Leave this!
      Monster1         = 'Attack Chicken'; // Monster to fight (Put attack in front
      Monster2         = 'Attack Chicken'; // Monster to fight
      Pickup           = True; // Pickup Items? (true or false)
      Pickup1          = 'Take Feather'; // item to pick up with take in front
      Pickup2          = 'Take Feather'; // item to pick up with take in front
      BoneColor        = 12764106; // DO NOT EDIT!
      Boneinvcolor     = 12895692; // DO NOT EDIT!
      Bones            = True; // pick up and bury bones? (true or false)
      Eat              = False; // Want it to eat??
      Hitpoints        = 8; // Below what hitpoint do you want it to eat?
      Food             = 1; // How many types of food are you using? up to 3 types
      Food1            = 'Trout'; // What type of food are you using?
      Food2            = 'Trout'; // What type of food are you using? If only using 1 type leave blank
      Food3            = 'Trout'; // What type of food are you using? If only using 1 or 2 types leave blank
      Forever          = True; // run script forever until u stop it?
      number           = 5; // number of monsters to kill

    //==============DO NOT EDIT BELOW THIS POINT!!!===============//

    const
      Chicken1Color =9089479;
      Chicken2Color =2774388;
      Cow1Color     =9089479; //wrong for now change later
      Cow2Color     =9089479; //wrong for now change later
      FeatherColor  =9728;
      ShrimpColor   =0; //wrong for now il change later
      TroutColor    =0; //wrong for now il change later


    var
      Mon1Color,Mon2Color,Food1Color,Food2Color,Food3Color,Pick1,Pick2,Items,Buried,killed:Integer;



    //===========DO NOT TOUCH!!!===============//
    Procedure setup;

    Begin

      Case LowerCase(Monster1) Of
        'attack chicken' :  Mon1Color:=Chicken1Color;
        'attack cow'     :  Mon1Color:=Cow1Color;
    End;
      Case LowerCase(Monster2) Of
        'attack chicken' :  Mon2Color:=Chicken2Color;
        'attack cow'     :  Mon2Color:=Cow2Color;
    End;
      Case LowerCase(Pickup1) Of
        'take feather' :  Pick1:=FeatherColor;
    End;
      Case LowerCase(Pickup2) Of
        'take feather' :  Pick2:=FeatherColor;
    End;
      Case Lowercase(Food1) Of
        'Shrimp'  :  Food1Color:=ShrimpColor
        'Trout'   :  Food1Color:=TroutColor
    End;
      Case Lowercase(Food2) Of
        'Shrimp'  :  Food2Color:=ShrimpColor
        'Trout'   :  Food2Color:=TroutColor
    End;
      Case Lowercase(Food3) Of
        'Shrimp'  :  Food3Color:=ShrimpColor
        'Trout'   :  Food3Color:=TroutColor
    End;
    end;

    //==========================================================//

    Procedure DeclarePlayers;

      Begin
         NumberOfPlayers( 1 );
         CurrentPlayer :=( 0 );

         Players[0].Name :='user';
         Players[0].Pass :='pass';
      End;

    // Antirandoms //

    Function FindFastRandoms: Boolean;    // By WT-Fakawi.

    Var
      i: Integer;

    Begin
      For I := 1 To 11 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';
                   Logout;
                   Exit;
                 End;
               End;

           8: If RC Then
                 Result := True;

           9: If FindTalk Then
                 Result := True;

           10: If HandleTrade Then
                 Result := True;

           11: If FindFight Then
                  Begin
                    Result := True;
                  End;
        End;
        Wait(1);
      End;
    End;

    // Sets chats //

    Procedure DoChats;

    Begin
      SetChat('On', 1);
      SetChat('On', 1);
      SetChat('Friends', 2);
      SetChat('Friends', 2);
      SetChat('On', 3);
      SetChat('On', 3);
    End;

    // Fighting //
    procedure Fight;

    Var
       Dx,Dy: Integer;

    Begin
    If (FindObj(Dx, Dy, Monster1, Mon1Color, MonTol)) or
       (FindObj(Dx, Dy, Monster2, Mon2Color, MonTol)) Then
       begin
         killed:= killed + 1; //You forgot "="
         Mouse(Dx,Dy,4,4,true)
       end else
       begin
         writeln('Could not find it')
       end;
     Flag;
     wait(waittime+random(2000)); //You forgot the second ")"
     FindFastRandoms;
    end;

    // Pickup Items //
    procedure Pickupitem;     //I EDITED THIS PROCEDURE JUST LIKE THE ONE ABOVE.
    Var
       Dx,Dy: Integer;

    Begin
    If Pickup then
      begin
        If(FindObj(Dx, Dy, Pickup1, Pick1, MonTol))or
          (FindObj(Dx, Dy, Pickup2, Pick2, MonTol))Then
          begin
            Items:= Items + 1;
            wait(waittime+random(2500)); //You forgot the second ")"
            Mouse(Dx,Dy,4,4,true)
          end else
          begin
            Writeln('Not found');
          end;
        Flag;
        FindFastRandoms;
      end;
    end;


    // Pickup and Bury Bones //
    procedure BuryBones;

    Var
       Dx,Dy: Integer;
    Begin

      If Bones then
      begin
        If (FindObj(Dx, Dy, 'Take', Bonecolor, MonTol)) Then
        begin
          Mouse(Dx,Dy,4,4,true);
          Writeln('Bones Found')
        end else
        begin
          Writeln('Bones Not Found')
        end;

     {   If(FindObj(dx, dy, 'ury', Boneinvcolor, MonTol))Then
          Mouse(Dx,Dy,4,4,true);
          wait(500+random(250));
          Buried:= Buried + 1;
        end;
        If (FindObj(785, 437, 'ury', Boneinvcolor, MonTol)) Then
          Mouse(Dx,Dy,4,4,true);
          wait(500+random(250);
          Buried:= Buried + 1;
        end;
        If (FindObj(829, 437, 'ury', Boneinvcolor, MonTol)) Then
          Mouse(Dx,Dy,4,4,true);
          wait(500+random(250);
          Buried:= Buried + 1;
        end;
        If (FindObj(702, 475, 'ury', Boneinvcolor, MonTol)) Then
          Mouse(Dx,Dy,4,4,true);
          wait(500+random(250);
          Buried:= Buried + 1;
        end;
        If (FindObj(744, 475, 'ury', Boneinvcolor, MonTol)) Then
          Mouse(Dx,Dy,4,4,true);
          wait(500+random(250);
          Buried:= Buried + 1;
        end; }


      end else exit;
    end;

    // Eating //  NOT DONE YET I NEED SOMETHING THAT WILL DETECT HITPOINT COUNT
    procedure eatup;

    Begin
    end;


    // Progress Report //
    procedure proggy;

    Begin
      Writeln('=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=')
      Writeln('')
      Writeln('Thank you for using TFighter Created by Timothegreat.')
      Writeln('Version: 1.1')
      Writeln('')
      Writeln('Items picked up:'+IntToStr(items)+'(May be more for feathers)')  //You must put in IntToStr
      Writeln('Bones picked up and buried:'+IntToStr(buried));
      Writeln('Monsters killed:'+IntToStr(killed));
      Writeln('')
      Writeln('=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=')
    end;

    // Main Loop //

    begin
    Setupsrl;
    setup;
    DeclarePlayers;

    Repeat
      repeat
      If Not LoggedIn Then
        Begin
          loginplayer;
          DoChats;
        end;
        If Not FindFight Then
          Begin
            Fight;
            Eatup;
            Pickupitem;
            BuryBones;
          end else     //Above is a begin so you need END else
          begin
            Writeln('Already in fight.')
          end;
       // If Foodnum < 1 then Begin Logout; Proggy; break; end;  //I DONT KNOW WHAT FOODNUM IS...
       If FindDead then begin logout; proggy; break; end;
       until(killed > number); // stops the script when it kills the set number of monsters
    Logout;
    Proggy;
    wait(Minutes); // waits before it logs back in again
    until(not(forever) // does this whole thing forever til you stop the script
    end.

    Failed when compiling
    Line 7: [Error] (15463:1): Duplicate identifier '' in script C:\Program Files\SCAR 3.06\Scripts\TFighter1.2.scar
    Can anybody help with this error??
    [SIZE="4"][CENTER][URL="http://www.youtube.com/watch?v=5YsGJz3j4os"]LOL u mad bro?[/URL][/CENTER][/SIZE]

  2. #2
    Join Date
    Feb 2007
    Location
    USA
    Posts
    667
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    'Minutes' is already used as a variable somewhere (probs in SRL itself). Just change it to MyMinutes, and then make sure to change all other references to it as well.

  3. #3
    Join Date
    Aug 2006
    Posts
    408
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    I'm pretty sure you wouldn't get the error if you use SCAR 2.03 and SRL 3.6.

  4. #4
    Join Date
    Feb 2007
    Location
    USA
    Posts
    667
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    you do, because that is what I use. He just needs to rename the variable.

  5. #5
    Join Date
    Feb 2006
    Location
    Tracy/Davis, California
    Posts
    12,631
    Mentioned
    135 Post(s)
    Quoted
    418 Post(s)

  6. #6
    Join Date
    May 2007
    Location
    in a pineapple under the sea
    Posts
    1,040
    Mentioned
    0 Post(s)
    Quoted
    1 Post(s)

    help

    New error!

    SCAR Code:
    program Fighter;
    {.include SRL\SRL.scar}
    {.include SRL\SRL\skill\Fighting.scar}
    {.include SRL\SRL\misc\trade.scar}

    const
      Montol           = 9;  // tolerance
      settrips         = 5; // number of trips will do
      killnum          = 20; // number of monsters to kill per trip
      totalkill        = 100; // total monsters to kill
      waittime         = 5000; // Time to wait in between monsters (in ms)1000ms/sec.
      waitlogtime      = 720000; // Time to wait before it logs back in (in ms)
      TheMinCount      = 4;  // Leave this!
      Monster1         = 'Attack Chicken'; // Monster to fight put Attack in front
      Monster2         = 'Attack Chicken'; // Monster to fight put Attack in front
      Pickup           = True; // Pickup Items? (true or false)
      Pickup1          = 'Take Feather'; // item to pick up put take in front
      Pickup2          = 'Take Feather'; // item to pick up put take in front
      Bones            = True; // pick up and bury bones? (true or false)
      Eat              = False; // Want it to eat??
      eathp            = 8; // Below what hitpoint do you want it to eat?
      Food             = 1; // How many types of food are you using? up to 2 types
      Food1            = 'Trout'; // What type of food are you using?
      Food2            = 'Trout'; // What type of food are you using? If only using 1 type leave blank

    //==============DO NOT EDIT BELOW THIS POINT!!!===============//

    const
      reset         =0; // DO NOT EDIT!
      TimBoneColor  =12764106; // DO NOT EDIT!
      Chicken1Color =8365499;
      Chicken2Color =2774388;
      Cow1Color     =9089479; //wrong for now change later
      Cow2Color     =9089479; //wrong for now change later
      FeatherColor  =12764106;
      ShrimpColor   =0; //wrong for now il change later
      TroutColor    =0; //wrong for now il change later


    var
      Mon1Color,Mon2Color,Food1Color,Food2Color,Food3Color,Pick1,Pick2,trips,Items,Buried,kills:Integer;



    //===========DO NOT TOUCH!!!===============//
    Procedure setup;

    Begin

      Case LowerCase(Monster1) Of
        'attack chicken' :  Mon1Color:=Chicken1Color;
        'attack cow'     :  Mon1Color:=Cow1Color;
    End;
      Case LowerCase(Monster2) Of
        'attack chicken' :  Mon2Color:=Chicken2Color;
        'attack cow'     :  Mon2Color:=Cow2Color;
    End;
      Case LowerCase(Pickup1) Of
        'take feather' :  Pick1:=FeatherColor;
    End;
      Case LowerCase(Pickup2) Of
        'take feather' :  Pick2:=FeatherColor;
    End;
      Case Lowercase(Food1) Of
        'Shrimp'  :  Food1Color:=ShrimpColor
        'Trout'   :  Food1Color:=TroutColor
    End;
      Case Lowercase(Food2) Of
        'Shrimp'  :  Food2Color:=ShrimpColor
        'Trout'   :  Food2Color:=TroutColor
    End;
    end;

    //==========================================================//

    Procedure DeclarePlayers;

      Begin
         NumberOfPlayers( 1 );
         CurrentPlayer :=( 0 );

         Players[0].Name :='user';
         Players[0].Pass :='pass';
      End;

    // Antirandoms //

    Function FindFastRandoms: Boolean;    // By WT-Fakawi.

    Var
      i: Integer;

    Begin
      For I := 1 To 11 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';
                   Logout;
                   Exit;
                 End;
               End;

           8: If RC Then
                 Result := True;

           9: If FindTalk Then
                 Result := True;

           10: If HandleTrade Then
                 Result := True;

           11: If FindFight Then
                  Begin
                    Result := True;
                  End;
        End;
        Wait(1);
      End;
    End;

    // Sets chats //

    Procedure DoChats;

    Begin
      SetChat('On', 1);
      SetChat('On', 1);
      SetChat('Friends', 2);
      SetChat('Friends', 2);
      SetChat('On', 3);
      SetChat('On', 3);
    End;

    //////////////
    procedure OutFightO;
    var
      i: integer;
    begin
      Flag;
      for i:= 1 to 5 do
     begin
        if(InFight)then
       begin
         repeat
           wait(50);
         until(not(InFight));
        exit;
       end else
      wait(300);
     end;
    end;

    // Fighting //
    procedure Fight;

    Var
       Dx,Dy: Integer;

    Begin
    If (FindObj(Dx, Dy, Monster1, Mon1Color, MonTol)) or
       (FindObj(Dx, Dy, Monster2, Mon2Color, MonTol)) Then
       begin
         kills:= kills + 1; //You forgot "="
         Mouse(Dx,Dy,4,4,true)
       end else
       begin
         writeln('Could not find it')
       end;
     Flag;
     OutFightO; //You forgot the second ")"
     FindFastRandoms;
    end;

    // Pickup Items //
    procedure Pickupitem;     //I EDITED THIS PROCEDURE JUST LIKE THE ONE ABOVE.
    Var
       Dx,Dy: Integer;

    Begin
    If Pickup then
      begin
        If(FindObj(Dx, Dy, Pickup1, Pick1, MonTol))or
          (FindObj(Dx, Dy, Pickup2, Pick2, MonTol))Then
          begin
            Items:= Items + 1;
            Mouse(Dx,Dy,4,4,true);
            wait(waittime+random(2750))
          end else
          begin
            Writeln('Not found');
          end;
        Flag;
        FindFastRandoms;
      end;
    end;


    // Pickup and Bury Bones //
    procedure BuryBones;

    Var
       Dx,Dy: Integer;
    Begin

      If Bones then
      begin
        If (FindObj(Dx, Dy, 'ake Bones', TimBonecolor, MonTol)) Then
        begin
          Mouse(Dx,Dy,4,4,true);
          wait(3000+random(250));
          Mouse(627,227,4,4,true);
          Writeln('Bones Found and buried')
          Buried:= Buried + 1;
        end else
        begin
          Writeln('Bones Not Found')
        end;

        {If (FindObj(785, 437, 'ury', Boneinvcolor, MonTol)) Then
        Begin
          Mouse(Dx,Dy,4,4,true);
          wait(500+random(250);
          Buried:= Buried + 1;
        end;
        If (FindObj(829, 437, 'ury', Boneinvcolor, MonTol)) Then
        Begin
          Mouse(Dx,Dy,4,4,true);
          wait(500+random(250);
          Buried:= Buried + 1;
        end;
        If (FindObj(702, 475, 'ury', Boneinvcolor, MonTol)) Then
        Begin
          Mouse(Dx,Dy,4,4,true);
          wait(500+random(250);
          Buried:= Buried + 1;
        end;
        If (FindObj(744, 475, 'ury', Boneinvcolor, MonTol)) Then
        Begin
          Mouse(Dx,Dy,4,4,true);
          wait(500+random(250);
          Buried:= Buried + 1;
        end;}


      end else exit;
    end;

    // Eating //  NOT DONE YET
    procedure eatup;
    begin
    if eat then
      begin
      if (GetHp <= EatHp) and (Food1Color >= 0) then
      begin
        GameTab(4);
        Wait(10 + Random(20));
        if (FindColorSpiralTolerance(x, y, food1color, 560, 210, 730, 460, 2))or
           (FindColorSpiralTolerance(x, y, food2color, 560, 210, 730, 460, 2))then
        begin
          MMouse(x + 2, y - 2, 6, 5)
            if (IsUpText('Eat')) then
          begin
            GetMousePos(x, y);
            Mouse(x, y, 3, 2, True);
          end;
        end;
      end;
    end;

    // Progress Report //
    procedure proggy;

    Begin // LINE WITH THE ERROR!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
      Writeln('=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=')
      Writeln('')
      Writeln('Thank you for using TFighter Created by Timothegreat.')
      Writeln('Version: 1.1')
      Writeln('')
      Writeln('Items picked up:'+IntToStr(items)+'(Will be more for feathers)')  //You must put in IntToStr
      Writeln('Bones picked up and buried:'+IntToStr(buried));
      Writeln('Monsters killed:'+IntToStr(Totalkill));
      Writeln('')
      Writeln('=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=')
    end;

    // Main Loop //

    begin
    Setupsrl;
    setup;
    DeclarePlayers;

    Repeat
      repeat
      If Not LoggedIn Then
        Begin
          loginplayer;
          DoChats;
          HighestAngle;
          setrun(true);
        end;
        If Not FindFight Then
          Begin
            Fight;
            Eatup;
            Pickupitem;
            BuryBones;
          end else     //Above is a begin so you need END else
          begin
            Writeln('Already in fight.')
          end;
       // If Foodnum < 1 then Begin Logout; Proggy; break; end;  //I DONT KNOW WHAT FOODNUM IS...
          until(kills = killnum);
    typesend('bye everyone');
    kills:= reset;
    trips:= trips + 1;
    wait(18500+random(750));
    Logout;
    wait(waitlogtime)
    until(trips = settrips)
    Proggy;
    end.

    Failed when compiling
    Line 293: [Error] (16154:1): Identifier expected in script C:\Program Files\SCAR 3.06\Scripts\TFighter1.1bury.scar
    error is in or near the proggy procedure
    [SIZE="4"][CENTER][URL="http://www.youtube.com/watch?v=5YsGJz3j4os"]LOL u mad bro?[/URL][/CENTER][/SIZE]

  7. #7
    Join Date
    Jun 2006
    Location
    New Zealand
    Posts
    285
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Missing an end in EatUp. Use correct standards and you can find these easily
    SCAR Code:
    procedure eatup;
    begin
      if eat then
      begin
        if (GetHp <= EatHp) and (Food1Color >= 0) then
        begin
          GameTab(4);
          Wait(10 + Random(20));
          if (FindColorSpiralTolerance(x, y, food1color, 560, 210, 730, 460, 2)or
          (FindColorSpiralTolerance(x, y, food2color, 560, 210, 730, 460, 2)))then
          begin
            MMouse(x + 2, y - 2, 6, 5)
            if (IsUpText('Eat')) then
            begin
              GetMousePos(x, y);
              Mouse(x, y, 3, 2, True);
            end;
          end;
        end;
      end;
    end;
    Huehuehuehuehue

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. ISO for tiny xp
    By kingarabian in forum General
    Replies: 8
    Last Post: 10-23-2007, 10:16 PM
  2. TIny Mistake
    By TheGodfather in forum OSR Help
    Replies: 2
    Last Post: 02-15-2007, 11:33 AM
  3. Tiny Mistake
    By TheGodfather in forum OSR Help
    Replies: 5
    Last Post: 02-13-2007, 07:00 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
  •