Results 1 to 20 of 20

Thread: Want a basic eating script.

  1. #1
    Join Date
    Jul 2009
    Posts
    53
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default Want a basic eating script.

    Basicly I want a script that just eats, Ive looked at the auto fighters and I am sure all the stuff in the script is slowing it down if all i want is something that eats. Im looking at the zombies in stronghold.

    What I want;
    Smart
    Eats at low hp (the food I use are swordies or lobbies)
    Has some antibans,
    and maybe 'sometimes' clicks monsters, just as an extra antiban.
    Breaks would be nice but not needed.

    Oh and maybe but it may be a bit more advance, when only have 1/2 food left log out? (thing is you would have to make it go through the door to log out or you'll be in combat most of the time)

    Pretty basic really.

  2. #2
    Join Date
    Oct 2007
    Location
    #srl
    Posts
    6,102
    Mentioned
    39 Post(s)
    Quoted
    62 Post(s)

    Default

    I did this quick a while ago for someone else.

    All it is is AntiBan and eating really. You just need to fill out const and declareplayers.

    It may be what your looking for.

    SCAR Code:
    program Czepa;
    {.include SRL/SRL/misc/SMART.scar}
    {.include srl/srl.scar}

    const
      HPToEat = 30; // Percentage of HP you want to eat at.
      dir = 'n'; // Direction to run away to. Valid arguments: n,e,s,w.

    procedure DeclarePlayers;
    var i: Integer;
    begin
      HowManyPlayers := 1;
      NumberOfPlayers(HowManyPlayers);
      CurrentPlayer := 0;

      with Players[0] do
      begin
        Name := '';
        Pass := '';
        Nick := '';
        Active := True;

        for i := 0 to HowManyPlayers-1 do
          Players[i].Active := True;
        SetPlayerNameTPAs;
      end;
    end;

    procedure StayLoggedIn;
    var x, y: Integer;
    begin
      case Random(150) of
        1, 33, 56 : HoverSkill('random', False);
        16, 24, 88 : begin
                       GetMousePos(x, y);
                       MoveMouseSmoothEx(x + Random(65),y + Random(120), 1,
                         3, 45, 20, 10);
                     end;
        53, 44, 122 : ExamineInv;
        97, 133, 146 : BoredHuman;
        94, 95, 149 : PickUpMouse;
      end;
    end;

    function HPCheck(HP: Integer): Boolean;
    begin
      Writeln('HP Check...');
      if (not (LoggedIn)) then Exit;

      Result := HPPercent < HP;
      if Result then
        Writeln('Health is less than '+IntToStr(HP)+'%!');
      Status('');
    end;

    procedure StayAlive;
    var i, x, y, lobster: Integer; iBox: TBox; Find: Boolean;
    begin
      if not HPCheck(HPToEat) then Exit;
     
      lobster := BitmapFromString(4, 3, 'beNoLFrlXLvs/VeJ/huR/UdF' +
           'XdfLfWhQYGBg7vYQgjF5voVkAD4YNJQ==');

      for i := 1 to 28 do
      begin
        iBox := InvBox(i);
       
        if FindBitmapToleranceIn(lobster, x, y, iBox.x1, iBox.y1, iBox.x2,
           iBox.y2, 5) then
        begin
          Find := True;
          Mouse(x, y, 5, 1 + Random(2), True);
          Wait(RandomRange(800, 1600));
         
          if not HPCheck(HPToEat) then
            Exit;
        end;
       
        if i = 28 then
          if not Find then
        begin
          RunTo(dir, True);
          NextPlayer(False);
        end;
      end;
    end;

    begin
      SetUpSRL;
      ClearDebug;
      Writeln('Author := NCDS;');
      ActivateClient;
      DeclarePlayers;
      LogInPlayer;
      SetAngle(True);
      FindNormalRandoms;
     
      while Players[CurrentPlayer].Active = True do
      begin
        StayAlive;
        StayLoggedIn;
        Wait(RandomRange(5000, 15000));
      end;
    end.

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

    Default

    btw, that script uses lobsters. ^^

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


  4. #4
    Join Date
    Jul 2009
    Posts
    53
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    ah thanks alot, ill give it a go


    Line 70: [Error] (19954:1): Unknown identifier 'RunTo' in script

    Just took it out, testing now.

    Doesnt seem to eat, might be a bitmap problem (looks a little short to be a bitmap to me)

    Ill try putting a new bitmap in.
    Last edited by vinnievinboy; 08-20-2009 at 05:17 AM.

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

    Default

    Quote Originally Posted by vinnievinboy View Post
    ah thanks alot, ill give it a go


    Line 70: [Error] (19954:1): Unknown identifier 'RunTo' in script

    Just took it out, testing now.

    Doesnt seem to eat, might be a bitmap problem (looks a little short to be a bitmap to me)

    Ill try putting a new bitmap in.

    It is the smart way of doing a bitmap . You don't need a huge bitmap you just need a small portion of the bitmap you want instead of the whole thing...

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


  6. #6
    Join Date
    Oct 2007
    Location
    #srl
    Posts
    6,102
    Mentioned
    39 Post(s)
    Quoted
    62 Post(s)

    Default

    Quote Originally Posted by HyperSecret View Post
    It is the smart way of doing a bitmap . You don't need a huge bitmap you just need a small portion of the bitmap you want instead of the whole thing...
    Thank you (h)


    Quote Originally Posted by vinnievinboy View Post
    ah thanks alot, ill give it a go


    Line 70: [Error] (19954:1): Unknown identifier 'RunTo' in script

    Just took it out, testing now.

    Doesnt seem to eat, might be a bitmap problem (looks a little short to be a bitmap to me)

    Ill try putting a new bitmap in.
    I'll fix it real quick.

  7. #7
    Join Date
    Jul 2009
    Posts
    53
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    For some reason I cant get it to eat. It detects the health and everything, just wont eat just logs out.


    Ah thanks, (wasnt refreshing the page inbetween the editing my post :P)

    But yeah can't get it to eat, ill try again after you update it.

    Thanks alot.

    Btw any easier way to copy the code instead of line by line? (copying it all and pasting into scar just puts it all in one line -.-)
    Last edited by vinnievinboy; 08-20-2009 at 05:47 AM.

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

    Default

    Ermm.. I still don't get why people get that issue.. But possibly try quoting the post, and copying everything between the [SCAR] tags?

  9. #9
    Join Date
    Jul 2009
    Posts
    53
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Ah that works, thanks alot! Feel like I wasted them 5minutes doing it line by line :P

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

    Default

    By the way, did you try marpis's tut?

  11. #11
    Join Date
    Jul 2009
    Posts
    53
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    ah I'll give it ago at fixing it myself. Thanks for that link.

  12. #12
    Join Date
    Jul 2009
    Posts
    53
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Ive got it to kinda work I think.
    It eats, but sometimes it doesnt work...

    Think it would be hard to make it run out of a door when it has a few food left and log out?

  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 vinnievinboy View Post
    Ive got it to kinda work I think.
    It eats, but sometimes it doesnt work...

    Think it would be hard to make it run out of a door when it has a few food left and log out?
    No, with you could either count the items in the inventory for the nest part to execute, or count how much food you eat, and make it run out after you eat 24-25.

  14. #14
    Join Date
    Oct 2007
    Location
    #srl
    Posts
    6,102
    Mentioned
    39 Post(s)
    Quoted
    62 Post(s)

    Default

    There you go.

    Works perfect with lobsters. Just fill in what ever direction you want it to run .

    SCAR Code:
    program Czepa;
    //{.include SRL/SRL/misc/SMART.scar}
    {.include srl/srl.scar}

    const
      HPToEat = 100; // Percentage of HP you want to eat at.
      dir = 'n'; // Direction to run away to. Valid arguments: n,e,s,w.

    procedure DeclarePlayers;
    var i: Integer;
    begin
      HowManyPlayers := 1;
      NumberOfPlayers(HowManyPlayers);
      CurrentPlayer := 0;

      with Players[0] do
      begin
        Name := '';
        Pass := '';
        Nick := '';
        Active := True;

        for i := 0 to HowManyPlayers-1 do
          Players[i].Active := True;
        SetPlayerNameTPAs;
      end;
    end;

    procedure StayLoggedIn;
    var x, y: Integer;
    begin
      case Random(150) of
        1, 33, 56 : HoverSkill('random', False);
        16, 24, 88 : begin
                       GetMousePos(x, y);
                       MoveMouseSmoothEx(x + Random(65),y + Random(120), 1,
                         3, 45, 20, 10);
                     end;
        53, 44, 122 : ExamineInv;
        97, 133, 146 : BoredHuman;
        94, 95, 149 : PickUpMouse;
      end;
    end;

    function HPCheck(HP: Integer): Boolean;
    begin
      Writeln('HP Check...');
      if (not (LoggedIn)) then Exit;

      Result := HPPercent < HP;
      if Result then
        Writeln('Health is less than '+IntToStr(HP)+'%!');
      Status('');
    end;

    function GetColorPoints(x, y, Color, bp1, bp2, bp3, bp4, Width, Height, Tol: Integer): TPointArray;
    var tpa: array of TPoint; i, o: SmallInt; atpa: T2DPointArray;
    begin
      FindColorsSpiralTolerance(x, y, tpa, Color, bp1, bp2, bp3, bp4, Tol);
      atpa := TPAtoATPAEx(tpa, Width, Height);

      for i := 0 to High(atpa) do
      begin
        o := GetArrayLength(Result);
        SetArrayLength(Result, o + 1);
        Result[o] := MiddleTPA(atpa[i]);
      end;

      if Length(Result) > 1 then
        WriteLn('Length(Array): '+IntToStr(o)+';');
    end;

    procedure StayAlive;
    var i, x, y: Integer; iBox: TBox; Find: Boolean; Arr: array of TPoint;
      P: TPoint;
    begin
      if not HPCheck(HPToEat) then Exit;
      if GetCurrentTab <> tab_Inv then
        GameTab(tab_Inv);

      for i := 1 to 28 do
      begin
        iBox := InvBox(i);
       
        Arr := GetColorPoints(x, y, 1533377, iBox.x1, iBox.y1, iBox.x2, iBox.y2, 5, 5, 20);
        if Length(Arr) > 4 then
        begin
          Find := True;
          P := MiddleTpa(Arr);
          Writeln('Found Lobster At ('+IntToStr(x)+', '+IntToStr(y)+');');
          MMouse(P.x, P.y, 3, 3);
          Wait(120 + Random(50));
          if Pos('obster', Rs_GetUpText) > 0 then
            Mouse(P.x, P.y, 5, 3 + Random(2), True);
          Wait(RandomRange(800, 1600));

          if not HPCheck(HPToEat) then
            Exit;
        end;
       
        if i = 28 then
          if not Find then
        begin
          RunTo(dir, True);
          NextPlayer(False);
        end;
      end;
    end;

    begin
      SetUpSRL;
      ClearDebug;
      Writeln('Author := NCDS;');
      ActivateClient;
      DeclarePlayers;
      LogInPlayer;
      SetAngle(True);
      FindNormalRandoms;
     
      while Players[CurrentPlayer].Active = True do
      begin
        StayAlive;
        StayLoggedIn;
        Wait(RandomRange(5000, 15000));
      end;
    end.

  15. #15
    Join Date
    Jul 2009
    Posts
    53
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Thanks alot!

    Its a shame that the monsters actually stop attacking you after a while :P
    could leave it there all night.

  16. #16
    Join Date
    Oct 2007
    Location
    #srl
    Posts
    6,102
    Mentioned
    39 Post(s)
    Quoted
    62 Post(s)

    Default

    Quote Originally Posted by vinnievinboy View Post
    Thanks alot!

    Its a shame that the monsters actually stop attacking you after a while :P
    could leave it there all night.
    Would they attack you again if you Logged out, then back in?

  17. #17
    Join Date
    Feb 2009
    Location
    Hungary (GMT + 1)
    Posts
    1,774
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    As far as I remember logging in right after you logged out won't work. But it's not sure.
    What is sure: The time after they stop attacking is constant. 10 mins or 20? I think 20 but not sure about the time. Maybe not in the wildy, I haven't afk-d there.
    And to make them attack again it's enough to go out from their "area" then enter again.
    So measuring the time and then using
    procedure RunAway(dir: string; RunFar: Boolean; Action, WaitTime: Integer);
    would be good I think. (we would use that twice, once we runaway, twice we runback http://freddy1990.com/srlmanual/SRL/...k.html#RunAway)

    EDIT:Lol afking is against the rules? Haha
    http://runescape.wikia.com/wiki/Afk_training
    Last edited by Sabzi; 08-21-2009 at 01:43 AM.

  18. #18
    Join Date
    Jul 2009
    Posts
    53
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Yeah but a problem with that in stronghold is that there are doors (double doors) so you would need it to open them.

    I might play around with it, might make it randomly click a mob here and there. Would be good also if you can get it to run from one set of zombies to the higher level zombies after like 10-20 minutes.
    Last edited by vinnievinboy; 08-22-2009 at 07:45 PM.

  19. #19
    Join Date
    Oct 2007
    Location
    #srl
    Posts
    6,102
    Mentioned
    39 Post(s)
    Quoted
    62 Post(s)

    Default

    if I'm going to do that though I really might as well just make a stronghold script, honestly.

    Let me finish this flax spinner then i'll see about it.

  20. #20
    Join Date
    Jul 2009
    Posts
    53
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Haha that is true
    If you do, i'll be more than willing to help test for bugs and stuff (Although I am not on much)

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
  •