Results 1 to 16 of 16

Thread: Sheep Shearer

  1. #1
    Join Date
    May 2009
    Posts
    799
    Mentioned
    2 Post(s)
    Quoted
    16 Post(s)

    Default Sheep Shearer

    Sheep Shearer - Quest solver

    Introduction
    This script was supposed to finish the sheep schearer Quest for my whole army.
    My army is through and the script seems to run really smooth now .

    The last 3 chars from my army went through without any problems at all (may i place an "!" here ?).

    The Script is fully color-based and does not require Reflection or smart.

    Setup
    1. Place your Players in front of Lumbridge castle. (Remember that the script will need to Lumby Tele later, so better walk there, or tele there and wait till its reloaded...).

    2. Start logged in or Setup your army from line 26 on....

    3. Crosshair und Runescape.

    4. Press Play

    5. Tell me how it was performing .

    Info: Your Inventory should be empty. Select a world thats not too crowded for best performance. Give it some time, it does not always detect anything with the first try.

    __
    Update, Version 0.2
    - Fixed Bugs
    - A new failsafe, dunno if more are really required.

    ~caused
    Last edited by caused; 08-24-2009 at 08:51 PM.

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

    Default

    *Reads*

    (No SRL at the moment, so it's all from memory )

    SCAR Code:
    repeat
        wait(1000);
      until(RsReady);

    I'm pretty sure RSReady has a wait with a break for a potential infinite loop.

    SCAR Code:
    If not Loggedin then
         LoginPlayer;

    LoginPlayer has a check.

    Your GoToFred procedure scares me. D: Not really any fail safes..

    SCAR Code:
    If not ChooseOption('Open') then
          OpenGateAndDoorGoIn
      end else
          OpenGateAndDoorGoIn;

    Umm.. what? Why not just..

    SCAR Code:
    if(ChooseOption('Open'))then
      OpenGateAndDoorGoIn;

    ? =X

    SCAR Code:
    If not ChooseOption('alk-to') then
         GetQuestFromFred
      end else
        GetQuestFromFred;

    Same thing there.

    It could mess up in DeliverWoolToFred, I think.

    SCAR Code:
    x:= MMX1+(MMX2 - MMX1) / 2;

    instead of '/ 2' you could do 'shr 1', I think.

    And.. I don't really like how the main loop is all.. kinda boring.. haha I think you could add fail safes in there.

    I didn't look TOO carefully.. no SRL + I didn't sleep last night.. :/ But yay for the script from me! ^^
    Last edited by ian.; 08-24-2009 at 01:08 AM.

  3. #3
    Join Date
    May 2009
    Posts
    799
    Mentioned
    2 Post(s)
    Quoted
    16 Post(s)

    Default

    If not ChooseOption('Open') then
    OpenGateAndDoorGoIn
    end else
    OpenGateAndDoorGoIn;

    The end-else here is from the if above that :P. I'll add a quickfix in a moment anyways =).
    Oh yeah and 1-2 more failsafes :3...

    Thanks for the other suggestions .

    ~caused

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

    Default

    Just for ian.

    SCAR Code:
    function RSReady: Boolean;
    begin
      Result := (LoggedIn) or (GetColor(520, 146) = 4038981);
    end;

    function LoggedIn: Boolean;
    var
      cx, cy: Integer;
    begin
      Result := FindColor(cx, cy, 16777215, 439, 491, 440, 492);
    end;

    But still very nice. I can't recall things like that from SRL. Well, maybe, I haven't tried.
    Last edited by Sabzi; 08-24-2009 at 01:24 AM.

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

    Default

    Sabzi, LoginPlayer has a check for LoggedIn though, doesn't it? =X

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

    Default

    Quote Originally Posted by ian. View Post
    Sabzi, LoginPlayer has a check for LoggedIn though, doesn't it? =X
    Yes, that's right. I haven't bothered that. I posted that because of RsReady. It doesn't got any loop.

    But if you don't trust me that you were right with LoginPlayer, then:

    SCAR Code:
    procedure LoginPlayer;
    var
      Mark, Attempts: Integer;
      Actions: TVariantArray;
      RetryLogin: Boolean;
    label
      ProcStart;
    begin
      ActivateClient;
      Wait(100);
      TypeByte(vk_Escape);

      if (GetColor(207, 409) = 238301) then //At Welcome Screen
      begin
        Wait(500 + Random(1000));
        MouseBox(249, 419, 521, 445, 1);
        MarkTime(Mark);
        while (TimeFromMark(Mark) < 30000) and (not(LoggedIn)) do
          Wait(1000 + Random(1000));
      end;
      if (not(RSReady)) then
      begin
        MarkTime(Mark);
        while (not(RSReady)) do
        begin
          Wait(100);
          if (TimeFromMark(Mark) > 180000) then
          begin
            WriteLn('It has been 3 minutes and Runescape is not yet ready... Terminating.');
            TerminateScript;
          end;
        end;
        WriteLn('Welcome to Runescape.');
      end;

      LoginScreenMusic(True);
      if (not(GraphicsSet)) then
      begin
        SetAutoingDefaults;
        GraphicsSet := True;
      end;
      ProcStart:

      if (not(LoggedIn)) then
      begin
        if (not(Players[CurrentPlayer].Active)) then
        begin
          WriteLn('Player is not Active...');
          NextPlayer(False);
          Exit;
        end;
        Wait(900 + random(60));

        //Click 'Log In' on main menu
        while (GetColor(343, 175) <> 7750) do
        begin
          MouseBox(360, 184, 400, 190, 1);
          Wait(100 + Random(100));
        end;

        //Type Username
        Mouse(315, 272, 10, 5, True);
        while (CountColor(7750, 311, 269, 452, 284) > 0) do
        begin
          TypeByte(VK_BACK);
          Wait(50 + Random(50));
        end;
        Wait(100 + Random(200));
        WriteLn(Capitalize(Players[CurrentPlayer].Name));
        TypeSend(Players[CurrentPlayer].Name);
        Wait(100+random(50));

        //Type Password
        Mouse(315, 334, 10, 5, True);
        while (CountColor(7750, 311, 337, 452, 352) > 0) do
        begin
          TypeByte(VK_BACK);
          Wait(50 + Random(50));
        end;
        Wait(100 + Random(200));
        TypeSend(Players[CurrentPlayer].Pass);
        Wait(500 + Random(300));

        if (GetColor(315, 239) = 197552) then //Check for pvp warning and click
          if AllowPVP then
            MouseBox(434, 416, 481, 425, 1)
          else
          begin
            SRL_Warn('LoginPlayer', 'Attempted to log into PVP World when AllowPVP was false. Terminating.', Warn_AllVersions);
            TerminateScript;
          end;


        MarkTime(Mark);
        repeat
          SetLength(Actions, 0);

          if (TimeFromMark(Mark) > 60000) then
            Actions := ['One minute has passed...', 0, 2, 'NextPlayer', 'Login Failed']
          else
          case (CountColor(12509695, 288, 205, 475, 247)) of   //Number of text colour points
            //   Actions := ['WriteLn Text', TimeToWait, NumberOfRetries, 'FinalAction', 'PlayerStatus'];
            760: Actions := ['Too many incorrect logins.', 5 * 60000, 2, 'NextPlayer', ''];
            536: Actions := ['Login limit exceeded. Please wait 1 minute and try again.', 60000, 2, 'NextPlayer', ''];
            711: If (CountColor(16711680, 341, 219, 391, 233) = 128) then
                   Actions := ['Your account has been disabled', 0, 0, 'NextPlayer', 'Acc Disabled'];
            598: Actions := ['Invalid Username / Password', 0, 2, 'NextPlayer', 'Wrong User/Pass'];
            787: Actions := ['Not a Members Account', 0, 0, 'NextPlayer', 'Non-member'];
            408: Actions := ['World is full.', 5000, 20, 'RandomNextPlayer', ''];
            669: Actions := ['Your account is already logged in', 5000, 0, 'RandomNextPlayer', ''];
            555: Actions := ['The Server is being updated.', 60000, 4, 'Terminate', 'Server Updating'];
            218: Actions := ['Error Connecting.', 20000, 9, 'Terminate', 'Error Connecting'];
            335: Actions := ['Unable to connect Login Server offline.',(20000) + Random(6000), 4, 'Terminate', 'Login Server Offline'];
            512: Actions := ['RuneScape has been updated. Script Terminated.', 0, 0, 'Terminate', 'RS Updated'];
            489: Actions := ['Connection timed out.', 0, 4, 'Terminate', 'Connection Timed Out'];
            737: Actions := ['You are standing in a members-only area.', 0, 0, 'NextPlayer', 'In Mems-Only Area'];
          end;

          if (Length(Actions) > 0) then
          begin
            WriteLn(Actions[0]);
            Wait(Actions[1] + Random(100));
            if (Actions[2] <> 0) then
              if (Attempts < Actions[2]) or (Actions[2] = -1) then
              begin
                RetryLogin := True;
                Break;
              end;
            if (Actions[4] <> '') then
              Players[CurrentPlayer].Loc := Actions[4];
            case Actions[3] of
              'NextPlayer': NextPlayer(False);
              'RandomNextPlayer': RandomNextPlayer(True);
              'Terminate': TerminateScript;
            end;
            Exit;
          end;
          Wait(100);
        until (GetColor(207, 409) = 238301) or (LoggedIn);

        if (RetryLogin) then
        begin
          RetryLogin := False;
          Inc(Attempts);
          goto ProcStart;
        end;

        if (GetColor(207, 409) = 238301) then
        begin
          Wait(500 + Random(1000));
          MouseBox(249, 419, 521, 445, 1);
        end;
        MarkTime(Mark);
        while (TimeFromMark(Mark) < 30000) and (not(LoggedIn)) do
          Wait(1000 + Random(1000));
      end;

      if (LoggedIn) then
      begin
        PlayerStartTime := (GetSystemTime div 1000); // PlayerStartTime
        if Length(Players[CurrentPlayer].NickTPA) < 2 then
        begin;
          Writeln('Creating the NickTPA.');
          if Players[CurrentPlayer].Nick <> '' then
            Players[CurrentPlayer].NickTPA := CreateTPAFromText(Players[CurrentPlayer].Nick, UpChars)
          else
          if (Players[CurrentPlayer].Name <> '') then
            Players[CurrentPlayer].NickTPA := CreateTPAFromText(Players[CurrentPlayer].Name, UpChars);
        end;
        AddToSRLLog('Current player: ' + Capitalize(Players[CurrentPlayer].Name));
        ClickText('here to con', UpChars, MCX1, MCY1, MCX2, MCY2, True);
      end;
    end;

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

    Default

    Haha yeah, I got that, but I said that LoginPlayer has a check for LoggedIn, and you posted LoggedIn which I'm not too interested in right now.. I just wanna make sure I tell people the right stuff when I tell them stuff.. So thanks.

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

    Default

    Quote Originally Posted by ian. View Post
    Haha yeah, I got that, but I said that LoginPlayer has a check for LoggedIn, and you posted LoggedIn which I'm not too interested in right now.. I just wanna make sure I tell people the right stuff when I tell them stuff.. So thanks.
    I wanted to make that as clear as I can. That's why I posted LoggedIn too. RsReady got that.
    Sorry if I were confusing. That's my bad habit(I don't want to be that ).

  9. #9
    Join Date
    May 2009
    Posts
    799
    Mentioned
    2 Post(s)
    Quoted
    16 Post(s)

    Default

    Updated .

    Feel Free to Beta Test :'D.. all my accounts are done already =)...

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

    Default

    Okay, my army is finally in Lumbridge. From the chickenrange ... Hey I hate walking!
    Well, part of my army :P
    Starting the script now! Wish luck!(not in post, I will edit this with results)

  11. #11
    Join Date
    May 2009
    Posts
    799
    Mentioned
    2 Post(s)
    Quoted
    16 Post(s)

    Default

    Quote Originally Posted by Sabzi View Post
    Okay, my army is finally in Lumbridge. From the chickenrange ... Hey I hate walking!
    Well, part of my army :P
    Starting the script now! Wish luck!(not in post, I will edit this with results)
    Good Luck =).
    And use the latest version (0.3).

    I'd love to know how it performed :'D.. So feel free to post suggestions and where it's getting stuck and so on =).

  12. #12
    Join Date
    Apr 2007
    Location
    UK
    Posts
    2,295
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Looks good, whats with all the blank lines?

    Rogeruk's Al-Kharid Tanner V1.1 [Released]
    Rogeruk's Barbarian Crafter [Coming Soon]
    Rogeruk's Guild Fisher [Coming Soon]
    !! - Taking Requests - !!

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

    Default

    First account finished. Although from the start of the searing I done that.
    But it was my mistake. I am used to SMART and I messed it up. Still got 5 other man in lumbridge to do it.
    I have added SMART.
    And RunTo is not in the latest revision I changed that to:
    RunAway('S', False, 2, RandomRange(700, 1400));
    Before I messed it up the job was getting done but not very effectively.
    It often done things that it shouldn't. But who cares? I think nobody will use this on mains :P
    Let's see the other five.

    EDIT: Stucked when it arrived to the gate. Because it was the baaaad gate. You know the one before the one we want. It's under the mill. You should make a ddtm or something to arrive at the right gate. I walked back to lumbridge. Hope it will be better next time.
    Last edited by Sabzi; 08-24-2009 at 06:57 PM.

  14. #14
    Join Date
    May 2009
    Posts
    799
    Mentioned
    2 Post(s)
    Quoted
    16 Post(s)

    Default

    The multiple opening of the doors @ fred is a wanted feature btw . It's a really tough part, and basicly it should open both doors 99% of the time, even if players mess around with doors and stuff. I took some thought on that part and couldnt find a better way to solve it =).

    Feel free to improve those functions though ( its "OpenGateAndDoorGoOut;" and "OpenGateAndDoorGoIn",);

    I dont think that this will get anyone banned, cause its not running long enough to track it down as bot.

    ~caused

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

    Default

    Yeah I have realized it when I was running it that not too many choices with color.
    I was trying to think a better way, but that's the best way
    Now it stucked at the right gate after get the quest. It opened it, exit from there, gone back, closed it, opened it, exit, back, close, open, exit, etc, etc.
    Also, fred was out now and it still wanted to open/close the door. But we were already outside. No idea how to check if we are out or not XD, I leave it to you.
    And it seemed like a GetMousePos needed somewhere but I can't find it now.
    After we talked with fred and wanted to get outside(although we were there).
    It found the door with the uptext but that it suddenly right clicked far away from the door so it tried it again. Then it gave up and the gate part begun.
    Sorry but I move from testing to writing. My AirCrafter is unstable now

  16. #16
    Join Date
    May 2009
    Posts
    799
    Mentioned
    2 Post(s)
    Quoted
    16 Post(s)

    Default

    The right gate?

    You mean it opened the gate to the field with the green vegetables ?.

    I'm having another account ready to debug now =).


    Version 0.4 Ready.

    I hope i fixed all the mentioned bugs, and also added some failsaves for things that could happen in theory :x..

    ~caused
    Last edited by caused; 08-24-2009 at 07:44 PM.

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
  •