Results 1 to 19 of 19

Thread: why my bot wont att a bear?

  1. #1
    Join Date
    Nov 2008
    Posts
    40
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default why my bot wont att a bear?

    heres the code :
    Code:
    program new;
    {$Define Smart}
    {$i srl/srl.scar}
    
    Procedure DeclarePlayers;
    begin
      HowManyPlayers := 1;
      NumberOfPlayers(HowManyPlayers);
      CurrentPlayer := 0;
    
      Players[0].Name :='ojd67';
      Players[0].Pass :='';
      Players[0].Nick :='jd67';
      Players[0].Active:=True;
    end;
    
    
    function BearColor: Integer;
    var
      arP: TPointArray;
      arC: TIntegerArray;
      tmpCTS, i, arL: Integer;
      H, S, L: Extended;
      X, Y, Z: Extended;
    begin
      tmpCTS := GetColorToleranceSpeed;
      ColorToleranceSpeed(1);
    
      FindColorsSpiralTolerance(MMCX, MMCY, arP, 3290164, MMX1, MMY1, MMX2, MMY2, 3);
      if (Length(arP) = 0) then
      begin
        Writeln('Failed to find the color, no result.');
        ColorToleranceSpeed(tmpCTS);
        Exit;
      end;
    
      arC := GetColors(arP);
      ClearSameIntegers(arC);
      arL := High(arC);
    
      for i := 0 to arL do
      begin
        ColorToHSL(arC[i], H, S, L);
    
        if (H >= 16.65) and (H <= 16.69) and (S >= 1.90) and (S <= 3.05) and (L >= 19.39) and (L <= 20.41) then
        begin
          ColorToXYZ(arC[i], X, Y, Z);
    
          if (X >= 3.06) and (X <= 3.36) and (Y >= 3.26) and (Y <= 3.56) and (Z >= 3.25) and (Z <= 3.66) then
          begin
            Result := arC[i];
            Writeln('AutoColor = ' + IntToStr(arC[i]));
            Break;
          end;
        end;
      end;
    
      ColorToleranceSpeed(tmpCTS);
    
      if (i = arL + 1) then
        Writeln('AutoColor failed in finding the color.');
    end;
    
    procedure Bearkiller;
    var x, y: integer;
    begin
     if FindObj(x, y, 'ttack', Bearcolor, 35) then
      begin
        Mouse(x, y, 2, 2, false);
        ChooseOption('ttack');
      end;
    
    end;
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    begin
     Smart_Server:= 11;
      Smart_Members:= False;
      Smart_Signed:= True;
      ClearDebug();
      SetupSRL();
      DeclarePlayers;
      LoginPlayer;
      bearkiller;
    
    end.
    please help : l

  2. #2
    Join Date
    Apr 2007
    Posts
    581
    Mentioned
    1 Post(s)
    Quoted
    2 Post(s)

    Default

    To be honest it could be any number of things. I can't help since I don't have Simba, but you need to debug your script. For example, put "writeln('GOT HERE');" inside an "IF" statement to make sure its actually getting inside that IF statement like its supposed to. That will narrow down your problem.

  3. #3
    Join Date
    Sep 2010
    Location
    Azeroth
    Posts
    395
    Mentioned
    0 Post(s)
    Quoted
    17 Post(s)

    Wink

    "Bearcolor" Really? i hope you did not actually use this.... nvm would not compile anyways. no but seriously check your colors and make sure you have enough. Run Escape changes colors slightly after each log in so your going to have to compensate!

  4. #4
    Join Date
    Nov 2008
    Posts
    40
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Quote Originally Posted by wantonman View Post
    "Bearcolor" Really? i hope you did not actually use this.... nvm would not compile anyways. no but seriously check your colors and make sure you have enough. Run Escape changes colors slightly after each log in so your going to have to compensate!
    lmao it compiles fine! i just used that color thing becAUSE i first tested it with sheeps by removing their wool with shears and it worked perfectly... but then i changed those things to ''ttack'' etc.. idk why it wont on bear lol

  5. #5
    Join Date
    Nov 2008
    Posts
    40
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    bumb need help

  6. #6
    Join Date
    Mar 2007
    Location
    Mars, I thought all men were from Mars.
    Posts
    513
    Mentioned
    7 Post(s)
    Quoted
    124 Post(s)

    Default

    I finally found a black bear took a color from it (3487543). Click play and it found it no problem.

    Simba Code:
    FindColorsSpiralTolerance(MMCX, MMCY, arP, 3487543 , MMX1, MMY1, MMX2, MMY2, 3);

  7. #7
    Join Date
    Nov 2008
    Posts
    40
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    oh it must change dif color coz had to restart smart everytime i tested that code : l is there a way that i dont need restart the client? i mean it would just start the script from client witch is already open? and how can i make it to right click then choose attack?

  8. #8
    Join Date
    Nov 2011
    Posts
    1,589
    Mentioned
    9 Post(s)
    Quoted
    17 Post(s)

    Default

    Simba Code:
    FindColorsSpiralTolerance(MMCX, MMCY, arP, 3487543 , {MMX1, MMY1, MMX2, MMY2}, 3);
    In blue your saying if it finds the colour in the Mini Map.
    Try this:
    Simba Code:
    program new;
    {$Define Smart}
    {$i srl/srl.scar}

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

      Players[0].Name :='ojd67';
      Players[0].Pass :='';
      Players[0].Nick :='jd67';
      Players[0].Active:=True;
    end;


    function BearColor: Integer;
    var
      arP: TPointArray;
      arC: TIntegerArray;
      tmpCTS, i, arL: Integer;
      H, S, L: Extended;
      X, Y, Z: Extended;
    begin
      tmpCTS := GetColorToleranceSpeed;
      ColorToleranceSpeed(1);

      FindColorsSpiralTolerance(MMCX, MMCY, arP, 3290164, MSX1, MSY1, MSX2, MSY2, 3);
      if (Length(arP) = 0) then
      begin
        Writeln('Failed to find the color, no result.');
        ColorToleranceSpeed(tmpCTS);
        Exit;
      end;

      arC := GetColors(arP);
      ClearSameIntegers(arC);
      arL := High(arC);

      for i := 0 to arL do
      begin
        ColorToHSL(arC[i], H, S, L);

        if (H >= 16.65) and (H <= 16.69) and (S >= 1.90) and (S <= 3.05) and (L >= 19.39) and (L <= 20.41) then
        begin
          ColorToXYZ(arC[i], X, Y, Z);

          if (X >= 3.06) and (X <= 3.36) and (Y >= 3.26) and (Y <= 3.56) and (Z >= 3.25) and (Z <= 3.66) then
          begin
            Result := arC[i];
            Writeln('AutoColor = ' + IntToStr(arC[i]));
            Break;
          end;
        end;
      end;

      ColorToleranceSpeed(tmpCTS);

      if (i = arL + 1) then
        Writeln('AutoColor failed in finding the color.');
    end;

    procedure Bearkiller;
    var x, y: integer;
    begin
     if FindObj(x, y, 'ttack', Bearcolor, 35) then
      begin
        Mouse(x, y, 2, 2, false);
        ChooseOption('ttack');
      end;

    end;














    begin
     Smart_Server:= 11;
      Smart_Members:= False;
      Smart_Signed:= True;
      ClearDebug();
      SetupSRL();
      DeclarePlayers;
      LoginPlayer;
      bearkiller;

    end.
    Mat
    Last edited by Mat; 01-06-2012 at 05:10 PM.



    ^^

  9. #9
    Join Date
    Dec 2011
    Location
    Toronto, Ontario
    Posts
    6,424
    Mentioned
    84 Post(s)
    Quoted
    863 Post(s)

    Default

    Mat found your problem, you know what to do now

  10. #10
    Join Date
    Nov 2011
    Posts
    1,589
    Mentioned
    9 Post(s)
    Quoted
    17 Post(s)

    Default

    Tip for the Future when using the Program to make the ACA there's a option at the bottom when you go to create the function Select Main Screen, as its default on MiniMap.
    Mat



    ^^

  11. #11
    Join Date
    Nov 2008
    Posts
    40
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    lol i tought i changed that lol but i probs forgot to change it: l

  12. #12
    Join Date
    Nov 2008
    Posts
    40
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    and how about that right click ? how can i get it to right click and then choose attack?

  13. #13
    Join Date
    Mar 2007
    Location
    Alberta, Canada
    Posts
    1,780
    Mentioned
    0 Post(s)
    Quoted
    11 Post(s)

    Default

    Quote Originally Posted by sibeliina View Post
    and how about that right click ? how can i get it to right click and then choose attack?
    Like Align did a few posts up,

    Simba Code:
    Mouse(x, y, 2, 2, false);
    ChooseOption('ttack');

    (True in Mouse is left click, false is right)

  14. #14
    Join Date
    Nov 2008
    Posts
    40
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    oh it must change dif color coz had to restart smart everytime i tested that code : l is there a way that i dont need restart the client?
    how about that?
    Last edited by sibeliina; 01-06-2012 at 07:14 PM.

  15. #15
    Join Date
    Jan 2009
    Location
    Turlock/LA, California
    Posts
    1,494
    Mentioned
    3 Post(s)
    Quoted
    66 Post(s)

    Default

    add:

    Smart_Server := 10; // change 10 to whatever u want

    add this before setupsrl;
    the issue is that u keep connecting to different servers, thus having to completely restart smart every time

  16. #16
    Join Date
    Nov 2008
    Posts
    40
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    does this mean that it wont find that color? or what is it?:
    Code:
    AutoColor = 10926783
    Warning! You passed a wrong ys to a finder function: -5. That is below 0, thus out of bounds. Setting the value to 0 for now.
    Warning! You passed a wrong ys to a finder function: -5. That is below 0, thus out of bounds. Setting the value to 0 for now.
    Warning! You passed a wrong ys to a finder function: -5. That is below 0, thus out of bounds. Setting the value to 0 for now.
    Warning! You passed a wrong ys to a finder function: -5. That is below 0, thus out of bounds. Setting the value to 0 for now.
    Warning! You passed a wrong ys to a finder function: -5. That is below 0, thus out of bounds. Setting the value to 0 for now.
    Warning! You passed a wrong ys to a finder function: -5. That is below 0, thus out of bounds. Setting the value to 0 for now.
    Warning! You passed a wrong ys to a finder function: -5. That is below 0, thus out of bounds. Setting the value to 0 for now.
    Warning! You passed a wrong ys to a finder function: -5. That is below 0, thus out of bounds. Setting the value to 0 for now.
    Warning! You passed a wrong ys to a finder function: -5. That is below 0, thus out of bounds. Setting the value to 0 for now.
    Warning! You passed a wrong xs to a finder function: -16. That is below 0, thus out of bounds. Setting the value to 0 for now.
    Warning! You passed a wrong ys to a finder function: -5. That is below 0, thus out of bounds. Setting the value to 0 for now.
    Warning! You passed a wrong xs to a finder function: -16. That is below 0, thus out of bounds. Setting the value to 0 for now.
    Warning! You passed a wrong xs to a finder function: -16. That is below 0, thus out of bounds. Setting the value to 0 for now.
    Warning! You passed a wrong xs to a finder function: -16. That is below 0, thus out of bounds. Setting the value to 0 for now.
    Warning! You passed a wrong xs to a finder function: -16. That is below 0, thus out of bounds. Setting the value to 0 for now.
    Warning! You passed a wrong xs to a finder function: -16. That is below 0, thus out of bounds. Setting the value to 0 for now.
    Warning! You passed a wrong xs to a finder function: -16. That is below 0, thus out of bounds. Setting the value to 0 for now.
    Warning! You passed a wrong ys to a finder function: -5. That is below 0, thus out of bounds. Setting the value to 0 for now.
    Successfully executed.

  17. #17
    Join Date
    Sep 2010
    Location
    Azeroth
    Posts
    395
    Mentioned
    0 Post(s)
    Quoted
    17 Post(s)

    Wink

    when using color you should always use the different colors they switch out every so often in my opinion, and also yohojo has a decent tutorial on youtube for find objTPA you might find that handy... its under the tree choping tut either 1 or 2 im not sure...



    by the way
    You passed a wrong ys to a finder function: -5. That is below 0, thus out of bounds. Setting the value to 0 for now.
    this hast to do with coordinates... it doesnt necessarily mean it cant run but basically your client runs from (0, 0) till iono around (2000 , 2000 ) and if you put X - 5 or something the script thinks you go negative five... that's all...
    Last edited by wantonman; 01-06-2012 at 08:16 PM.

  18. #18
    Join Date
    Nov 2008
    Posts
    40
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    i got this working ;P next need to learn sps walking :P

  19. #19
    Join Date
    Nov 2008
    Posts
    40
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    ok 1 more question... how can i set bot to notice when npc like guard dies? and then waits like 2 secs?

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
  •