SRL Archive - RS3 Outdated / Broken Scripts

Sheep Shearer


caused

2009-08-23 20:47:50

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

ian.

2009-08-23 20:48:39

*Reads*

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


repeat
wait(1000);
until(RsReady);

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


If not Loggedin then
LoginPlayer;

LoginPlayer has a check. :)

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


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

Umm.. what? :p Why not just..


if(ChooseOption('Open'))then
OpenGateAndDoorGoIn;

? =X


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

Same thing there.

It could mess up in DeliverWoolToFred, I think.


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! ^^

caused

2009-08-23 21:15:30

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 :D.

~caused

Sabzi

2009-08-23 21:21:34

Just for ian.

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.

ian.

2009-08-23 21:24:59

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

Sabzi

2009-08-23 21:26:06

From: ian.
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:

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;

ian.

2009-08-23 21:28:49

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.. :p I just wanna make sure I tell people the right stuff when I tell them stuff.. :) So thanks.

Sabzi

2009-08-23 21:32:13

From: ian.
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.. :p 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 :().

caused

2009-08-23 22:28:17

Updated :).

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

Sabzi

2009-08-24 14:22:29

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)

caused

2009-08-24 14:33:48

From: Sabzi
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 =).

rogeruk

2009-08-24 14:34:30

Looks good, whats with all the blank lines?

Sabzi

2009-08-24 14:50:12

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.

caused

2009-08-24 14:57:22

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

Sabzi

2009-08-24 15:10:27

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 :D
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 :(

caused

2009-08-24 15:14:21

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