SRL Archive - RS3 Help

Thieving script help


Roko

2014-02-08 12:40:37

Hi there, this is not my script, it's actually Wu-Tang Clan's script from his thread http://villavu.com/forum/showthread.php?t=107844 and I'm trying to fix it since I can't get help on his thread.

program Cosher;
{$Define SMART}
{$I SRL-6/SRL.simba}

procedure DeclarePlayers;
// I stole this off some random script... logs you in and stuff.
begin
setLength(players, 1);
currentPlayer := 0;

with players[0] do
begin
loginName := '';
password := '';
isMember := True;
isActive := true;
world := -1;
end;
end;

function FindVolunteer: Boolean;
var
i, h: Integer;
TPA: TPointArray;
ATPA: T2DPointArray;
t: TTimeMarker;
p: Tpoint;
begin

//FindColorsTolerance(TPA, 6192020, IntToBox(mainscreen.playerpoint.x - 140, mainscreen.playerpoint.y, mainscreen.playerpoint.x + 110, mainscreen.y2), 5, ColorSetting(2, 0.12, 0.31));
FindColorsTolerance(TPA, 3415911, IntToBox(mainscreen.playerpoint.x - 140, mainscreen.playerpoint.y - 70, mainscreen.playerpoint.x + 200, mainscreen.y2), 7, ColorSetting(2, 0.05, 0.18));
if (Length(TPA) < 1) then
begin
Writeln('nope');
Exit;
end;

ATPA := TPA.ToATPA(20, 20);
SortATPAFromMidPoint(ATPA, Point(randomRange(mainscreen.playerpoint.x - 100, mainscreen.playerpoint.x + 100), mainscreen.playerpoint.y));

h := High(ATPA);

for i := 0 to h do
//writeln(length(atpa[i]));
begin
if (Length(ATPA[i]) < 50) then
Continue;

Mouse(ATPA[i][random(High(ATPA[i]))], MOUSE_MOVE, MOUSE_HUMAN);
if IsMouseOverText(['alk', '-to', 'vance', 'dvance', 'ickpock'], 500) then
begin
//mouse(p, mouse_Right, MOUSE_ACCURATE);
fastclick(mouse_right);
Wait(500);
chooseOption._select(['ure', 'Lure'], MOUSE_LEFT, true, 1.00, 300);
//if (not DidClick(false)) then
begin
t.Start;
Wait(300 + Random(50));
if (t.getTime > 10000) then
begin
Exit;
end;

Wait(RandomRange(1100, 1300));
Exit(True);
end;
end else
Exit;
end;
end;

procedure GoThruChat;
begin
if (conversationBox.areTalking()) then
conversationBox.continue(true, true);
Wait(200+Random(100));
conversationBox.continue(true, true);
Wait(500+Random(100));
end;

function KnockKnock: Boolean;
var
i, h: Integer;
TPA: TPointArray;
ATPA: T2DPointArray;
t: TTimeMarker;
begin

//FindColorsTolerance(TPA, 6192020, IntToBox(mainscreen.playerpoint.x - 140, mainscreen.playerpoint.y, mainscreen.playerpoint.x + 110, mainscreen.y2), 5, ColorSetting(2, 0.12, 0.31));
FindColorsTolerance(TPA, 4138878, IntToBox(mainscreen.playerpoint.x - 140, mainscreen.playerpoint.y - 70, mainscreen.playerpoint.x + 200, mainscreen.y2), 7, ColorSetting(2, 0.05, 0.18));
if (Length(TPA) < 1) then
begin
Exit;
end;

ATPA := TPA.ToATPA(20, 20);
SortATPAFromMidPoint(ATPA, Point(randomRange(mainscreen.playerpoint.x - 100, mainscreen.playerpoint.x + 100), mainscreen.playerpoint.y));

h := High(ATPA);

for i := 0 to h do
//writeln(length(atpa[i]));
begin
if (Length(ATPA[i]) < 50) then
Continue;

Mouse(ATPA[i][random(High(ATPA[i]))], MOUSE_MOVE, MOUSE_HUMAN);
if IsMouseOverText(['alk', '-to', 'vance', 'dvance', 'ickpock'], 500) then
fastclick(mouse_right);
Wait(500);
chooseOption._select(['nock', '-out'], MOUSE_LEFT, true, 1.00, 300);
begin
//if (not DidClick(false)) then
begin
t.Start;
if (t.getTime > 6000) then
WriteLn('No good');
Exit(True);
end;
end;
end;
end;

procedure TripleLoot;
begin
mouseBox(inttobox(345,203,399,237), MOUSE_RIGHT);
chooseOption.select(['oot'], randomRange(400, 500));
mouseBox(inttobox(345,203,399,237), MOUSE_RIGHT);
chooseOption.select(['oot'], randomRange(300, 500));
mouseBox(inttobox(345,203,399,237), MOUSE_RIGHT);
chooseOption.select(['oot'], randomRange(200, 500));
until (False);
end;

begin
//smartPlugins := ['d3d9.dll']; // Only for DirectX
SetupSRL();
DeclarePlayers;
If Not Players[CurrentPlayer].Login Then
Players[CurrentPlayer].Login;
repeat
FindVolunteer;
Wait(750+Random(100));
GoThruChat;
Wait(350+Random(250));
KnockKnock;
TripleLoot;
Wait(750+Random(100));
until (False);
sixHourFix(); // Not tested, probably won't work
end.

The script SHOULD works like this: Lure > Knock > Loot > Loot > Loot (then repeat)
BUT at the moment it's working like this: Lure > Knock > Loot > Loot > Loot (pause) > Knock > Loot > Loot > Loot (repeat)

I'm not sure what's wrong in the script because I'm trying to make it stop after the third loot then re-do the normal cycle of Lure > Knock… but instead of that it just Knock instead of luring first.

Thanks in advance!

The Mayor

2014-02-08 16:02:25

By the looks of things, he does tell it to lure each loop, in the 'FindVolunteer' function, so this must be failing. As far as I can see, it will fail if:

  • There is less then 50 pixels of color matching
  • The mouseOverText doesn't match

Seeing as it worked the first time, I think it could be trying to lure him before he stands up again, so it obviously fails? In the main loop you could try adding a bigger wait after the tripleLoot to test this theory:


repeat
FindVolunteer;
Wait(750+Random(100));
GoThruChat;
Wait(350+Random(250));
KnockKnock;
TripleLoot;
Wait(2500); // big wait here
until (False);