SRL Archive - Jr. Member RS3 Script Requests

Cow killer and hide/beef banker


Basic

2014-07-23 00:53:37

Thought it would be a great idea for a script. something easy and simple that can raise low levels combats also a simple money making method:cartman:

Element17

2014-07-23 02:06:38

Why don't you try and make it? I would be willing to help along the way. I don't have any use for the script.

The Mayor

2014-07-23 02:53:32

From: Basic
Thought it would be a great idea for a script. something easy and simple that can raise low levels combats also a simple money making method:cartman:


Just fill in the rest :D



program new;
{$DEFINE SMART}
{$I SRL-6/SRL.simba}
{$I SPS/lib/SPS-RS3.Simba}

const
REVISION = '1';



// settings etc







procedure declarePlayers();
begin
setLength(players, 1);
with players[0] do
begin
loginName := '';
password := '';
isActive := true;
world := 3;
isMember := false;
bankPin := '';
end
currentPlayer := 0;
end;

//////// end setup



{ Global Variables }
var
CowsKilled: integer;


procedure findRandoms();
begin
exitTreasure();
claimTicket();
end;

procedure progressReport();
begin
writeLn('-------------------------------------');
writeLn(' Basic''s Cow Molester (Rev. ' + REVISION + ')') ;
writeLn('');
writeLn('Time running: ' + timeRunning(TIME_SHORT));
writeLn('Cows Killed: ' + toStr(CowsKilled);
writeLn('-------------------------------------');
end;

procedure walkToCows();
begin
// SPS
end;

procedure killCow();
begin
//mainScreen.findObject

// if you kill cow then
inc(CowsKilled);

end;

procedure lootHideAndBeef();
begin
//mainScreen.findObject
end;

procedure walkToBank();
begin
// SPS
end;

procedure findBanker();
begin
//mainScreen.findObject OR SRL bankScreen.open( )
end;

procedure depositLoot();
begin
//SRL bank functions
end;

procedure mainLoop();
begin

if tabBackpack.isFull() then
begin
walkToBank();
findBanker();
depositLoot();
end else
begin
walkToCows();
killCow();
lootHideAndBeef();
end;

end;

begin
clearDebug();
smartPlugins := ['d3d9.dll', 'OpenGL32.dll'];
smartEnableDrawing := true;
disableSRLDebug := false;
setupSRL();

declarePlayers();

repeat
if not isLoggedIn() then
begin
players[currentPlayer].login();
wait(randomRange(4000, 6000));
mainscreen.setAngle(MS_ANGLE_HIGH);
findRandoms();
end;


mainLoop();

progressReport();
until false;

end.

Basic

2014-07-23 11:47:21

Won't it take months of learning to do so?

Basic

2014-07-23 11:51:31

Basic's Cow Molester… challenge accepted. I will get working on it right away!

Element17

2014-07-23 13:53:20

From: Basic
Basic's Cow Molester… challenge accepted. I will get working on it right away!



Good luck mate!

Basic

2014-07-23 14:57:00


begin
clearDebug();
smartPlugins := ['d3d9.dll', 'OpenGL32.dll'];
smartEnableDrawing := true;
disableSRLDebug := false;
setupSRL();
declarePlayers();
SPS.setup('COW_MAP', RUNESCAPE_OTHER)

repeat
if not isLoggedIn() then
begin
players[currentPlayer].login();
wait(randomRange(4000, 6000));
mainscreen.setAngle(MS_ANGLE_HIGH);
findRandoms();
end;


mainLoop();

progressReport();
until false;

end.
In your other guide you have the main loop at the beginning is this just style related?
I tried doing this using the SPS guide it just clicks on the minimap so bill is visible.
procedure walkToCows();
var
pathToBill: TPointArray;
begin
if not isLoggedIn() then
exit;

pathToBill := [Point(158, 280), Point(189, 279)];

if SPS.walkPath(pathToBill) then
minimap.waitPlayerMoving()
else
writeLn('Bill where are you!?');


end;

also got this error
—- 4 minute(s) have passed, client is not ready yet
—- Client is taking too long to load, terminating…

:3

The Mayor

2014-07-23 17:18:34

From: Basic

begin
clearDebug();
smartPlugins := ['d3d9.dll', 'OpenGL32.dll'];
smartEnableDrawing := true;
disableSRLDebug := false;
setupSRL();
declarePlayers();
SPS.setup('COW_MAP', RUNESCAPE_OTHER)

repeat
if not isLoggedIn() then
begin
players[currentPlayer].login();
wait(randomRange(4000, 6000));
mainscreen.setAngle(MS_ANGLE_HIGH);
findRandoms();
end;


mainLoop();

progressReport();
until false;

end.
In your other guide you have the main loop at the beginning is this just style related?


I just created a procedure called "mainLoop" and put all main procedures in it to keep the script tidy, but it doesn't make a difference how the script runs. I could easily replace the mainLoop(); line at the bottom with everything inside the mainLoop procedure, so it would like this:


begin
clearDebug();
smartPlugins := ['d3d9.dll', 'OpenGL32.dll'];
smartEnableDrawing := true;
disableSRLDebug := false;
setupSRL();

declarePlayers();

repeat
if not isLoggedIn() then
begin
players[currentPlayer].login();
wait(randomRange(4000, 6000));
mainscreen.setAngle(MS_ANGLE_HIGH);
findRandoms();
end;


if tabBackpack.isFull() then //replace mainLoop(); with this
begin
walkToBank();
findBanker();
depositLoot();
end else
begin
walkToCows();
killCow();
lootHideAndBeef();
end;

progressReport();
until false;

end.


From: Basic

I tried doing this using the SPS guide it just clicks on the minimap so bill is visible.
procedure walkToCows();
var
pathToBill: TPointArray;
begin
if not isLoggedIn() then
exit;

pathToBill := [Point(158, 280), Point(189, 279)];

if SPS.walkPath(pathToBill) then
minimap.waitPlayerMoving()
else
writeLn('Bill where are you!?');


end;

also got this error
—- 4 minute(s) have passed, client is not ready yet
—- Client is taking too long to load, terminating…

:3


That error means it cannot recognize the client has loaded. You can see right at the start it loads both openGL and directX plugins "smartPlugins := ['d3d9.dll', 'OpenGL32.dll'];". If you don't have directX just delete the d3d9.dll and make sure your on openGL graphics mode. That SPS code looks good ;)

Basic

2014-07-24 16:55:54

I got it to log in but then it wouldn't move, could it be because minimap hadn't loaded yet? I tried re-running it while I was logged in and it paired with the client and said it was unable to load >_>

I am going to work on the cow hide objects now.

Basic

2014-07-26 02:00:16

I spent a couple hours trying to figure out how to make the mouse find and npc using your guide I can't figure it out. I read your find deposit box method and kept reading to atps. I got lost needless to say i spent about 3 hours reading it and trying to figure it out.:redface: lol me dumb. I assumed the find deposit box wouldn't work because beefy bill moved around so the static coordinates wouldn't work. I thought doing a TP box or setting the proper TPA array would work.

If I wanted to have it find draw a box around beefy bill like you do in your guide would this work?
program exampleScript;
{$DEFINE SMART}
{$I SRL-6/SRL.simba}
{$I SPS/lib/SPS-RS3.Simba}
{$i srl-6/lib/misc/srlplayerform.simba}
procedure findColorz();
var
x, y: integer;
TPA: TPointArray;

begin
findColorsSpiralTolerance(x, y, TPA, 7253417, mainScreen.getBounds(), 10, colorSetting(2, 0.61, 0.64));
smartImage.debugTPA(TPA, true);
end;

begin
smartEnableDrawing := true;
setupSRL();

findColorz();
end.

This part only took me like 5 minutes though.
var
CowsKilled: integer; HideDTM: integer;

procedure loadDTMs();
begin
HideDTM := DTMFromString('mbQAAAHicY2VgYHjCxMDwCYhfAPFjKPsIIwPDHiDeDsSXgPg4EM+dPg2omgmKGcE0FwMmYMSCwQAAXqkKWA==');
BeefDTM:= DTMFromString('mrAAAAHic42BgYBBhZmAQAmIZZghbEogZgZgBiJmBeB0jA8NiIF4KxHuAeDOU3gjE64G4WUoIqJgJJ5YEkvgwIwEMAwB31weq');
end;
Thanks for your help

The Mayor

2014-07-26 02:18:32

From: Basic
I got it to log in but then it wouldn't move, could it be because minimap hadn't loaded yet? I tried re-running it while I was logged in and it paired with the client and said it was unable to load >_>

I am going to work on the cow hide objects now.


Well of course it wouldn't move, you never told it to do anything (all the procedures were blank).

From: Basic
I spent a couple hours trying to figure out how to make the mouse find and npc using your guide I can't figure it out. I read your find deposit box method and kept reading to atps. I got lost needless to say i spent about 3 hours reading it and trying to figure it out.:redface: lol me dumb. I assumed the find deposit box wouldn't work because beefy bill moved around so the static coordinates wouldn't work. I thought doing a TP box or setting the proper TPA array would work.

If I wanted to have it find draw a box around beefy bill like you do in your guide would this work?
program exampleScript;
{$DEFINE SMART}
{$I SRL-6/SRL.simba}
{$I SPS/lib/SPS-RS3.Simba}
{$i srl-6/lib/misc/srlplayerform.simba}
procedure findColorz();
var
x, y: integer;
TPA: TPointArray;

begin
findColorsSpiralTolerance(x, y, TPA, 7253417, mainScreen.getBounds(), 10, colorSetting(2, 0.61, 0.64));
smartImage.debugTPA(TPA, true);
end;

begin
smartEnableDrawing := true;
setupSRL();

findColorz();
end.


Yeah this should draw the TPA bounds on SMART. After this you would want to split TPA into an ATPA, and move your mouse to it (look at how I done the clay rocks in the tut).


From: Basic

This part only took me like 5 minutes though.
var
CowsKilled: integer; HideDTM: integer;

procedure loadDTMs();
begin
HideDTM := DTMFromString('mbQAAAHicY2VgYHjCxMDwCYhfAPFjKPsIIwPDHiDeDsSXgPg4EM+dPg2omgmKGcE0FwMmYMSCwQAAXqkKWA==');
BeefDTM:= DTMFromString('mrAAAAHic42BgYBBhZmAQAmIZZghbEogZgZgBiJmBeB0jA8NiIF4KxHuAeDOU3gjE64G4WUoIqJgJJ5YEkvgwIwEMAwB31weq');
end;
Thanks for your help


Those look good.

Basic

2014-07-26 03:43:42

How would I do it to single out bill though? His clothes are different combinations, and he is moving around. Depending on his location the TPA changes, is there a way I can make the script call out each of the positions he is in?

Or, I can just make my guy walk to bank. After the several hours I spent on bill;) Yeah, ill do the bank chest south of cows for now>_>

The Mayor

2014-07-26 06:59:32

From: Basic
How would I do it to single out bill though? His clothes are different combinations, and he is moving around. Depending on his location the TPA changes, is there a way I can make the script call out each of the positions he is in?

Or, I can just make my guy walk to bank. After the several hours I spent on bill;) Yeah, ill do the bank chest south of cows for now>_>


Anything is possible. If he roams far, it might be a bit tricky, but if he roams within a set area it should be relatively straightforward. Just choose a colour that is unique.

Have a play around with the following snippet. It just contains 1 function, findBill. If it can't find bill it rotates the compass and looks again. You can use this to find any object, such as cows, trees, bank, whatever, just change the colours and the mouseOverText. BTW the colours in there atm are just made up. I've explained what each line does


program scriptTemplate;
{$DEFINE SMART}
{$I SRL-6/SRL.simba}
{$I SPS/lib/SPS-RS3.Simba}

const
VERSION = '1';


{ Easy color update }
BILL_COLOR = 1983028;
BILL_TOL = 12;
BILL_HUE = 0.10;
BILL_SAT = 0.45;


procedure declarePlayers();
begin
setLength(players, 1);
with players[0] do
begin
loginName := '';
password := '';
isActive := true;
world := -1;
isMember := false;
end
currentPlayer := 0;
end;
{ ---------------------------- END OF SETUP -----------------------------------}



function findBill(): boolean;
var
x, y, i: integer;
TPA: TPointArray;
ATPA: T2DPointArray;
begin
// finds all bill colours and puts all matching points into an array (a TPA).
findColorsSpiralTolerance(x, y, TPA, BILL_COLOR, mainScreen.getBounds(), BILL_TOL, colorSetting(2, BILL_HUE, BILL_SAT));

if length(TPA) < 1 then // if the TPA has 0 matching points, then exit
begin
writeLn('Didn''t find any pixels that match Bill''s colour!');
exit;
end;

ATPA := TPA.cluster(10, 10); // merge all matching pixels together if they are within 10 pixels of each other
// Pixels which are further then 10px apart are put into their own TPA

ATPA.filterBetween(0, 10); // delete all TPAs with 10 matching points or less
ATPA.sortFromMidPoint(mainscreen.playerPoint); //make closest TPA to player 1st in the array

smartImage.debugATPA(ATPA); //draw the remaining TPAs in the ATPA (each TPA has it's own box)

for i := 0 to high(ATPA) do // loop from 1st box to last box (closest box to player should be first as we sorted them above)
begin
mouse(MiddleTPA(ATPA[i]), MOUSE_MOVE); // move mouse to middle of current box (middle of current TPA)

if isMouseOverText(['Bill'], 500) then
begin
fastClick(MOUSE_LEFT);
smartImage.clearArea(mainscreen.getBounds());
exit(true); // function results true and exits if clicked bill
end;
end;

end;


{ ---------------- Main Loop -------------- }
begin
clearDebug();
disableSRLDebug := false;
smartEnableDrawing := true;
smartPlugins := ['d3d9.dll'];
setupSRL();

declarePlayers();

repeat

if not isLoggedIn() then
begin
players[currentPlayer].login();
minimap.setAngle(MM_DIRECTION_NORTH);
mainScreen.setAngle(MS_ANGLE_HIGH);
mainScreen.setZoom(true)
end;

if findBill() then // if find bill then writeLn, else rotate compass
writeLn('We clicked bill')
else
randomCompass(0, 360, false);

until false;
end.


Basic

2014-07-26 16:49:27

procedure Speech1();  //Clicks the first dialouge button.
var
Speech1: TBox;
begin

Speech1:= intToBox(715, 742, 787, 755);


mouseBox(myBox, MOUSE_LEFT);
end;

I made that to click the first dialouge box.
To click through the entire dialogue Box would I do something like

Find Bill [B]If[/B] (conversationBox.__find())[B] then[/B]
Begin Speech1.
To detect the second chat box I was thinking of using
function TRSConversationBox.getOptions(onlyLength: boolean=false): TStringArray;
Ill have it check for the options available(not sure how
Then [B]if[/B] three options are available

[B]Begin Speech2[/B]
For speexh to I would simply set a tbox for the mouse to click in.

Would that be how I approach it?

The Mayor

2014-07-26 17:34:14

From: Basic
procedure Speech1();  //Clicks the first dialouge button.
var
Speech1: TBox;
begin

Speech1:= intToBox(715, 742, 787, 755);


mouseBox(myBox, MOUSE_LEFT);
end;

I made that to click the first dialouge box.
To click through the entire dialogue Box would I do something like

Find Bill [B]If[/B] (conversationBox.__find())[B] then[/B]
Begin Speech1.
To detect the second chat box I was thinking of using
function TRSConversationBox.getOptions(onlyLength: boolean=false): TStringArray;
Ill have it check for the options available(not sure how
Then [B]if[/B] three options are available

[B]Begin Speech2[/B]
For speexh to I would simply set a tbox for the mouse to click in.

Would that be how I approach it?


Something like:



function findBill(): boolean;
begin
// code here to find bill as above
end;

procedure navigateChat();
begin
if not isLoggedIn() then exit;

if conversationBox.isOpen(5000) then
begin
writeLn('Conversation box is open');
conversationBox.selectOption(1); // presses 1 to choose first option
wait(randomRange(750, 1500));
conversationBox.continue(true, true); //presses space bar continue
end;

end;

begin
tabBackpack.mouseSlot(1, MOUSE_LEFT); //left click item in backpack
if findBill() then //use it with bill
begin
writeLn('We used the hides with bill');
navigateChat();
end;

end.


Torol

2014-11-27 12:30:28

Did you make any progress with this one? I'm struggling with a cow killer now, but it's a pain in the ass. Especially the cowhide looting part.