SRL Archive - Scripting Help

speeding up steppingstone method.


Sjoe

2014-01-04 05:30:26

Hi :)


i was wondering if you guys had some cool ideas to speeden up my steppingstone function.

At this moment it clicks the steppingstone, wait till players stops moving, then clicks on the next one.
But this is rather slow, I'm losing like 10 seconds this way I think.

i'd rather have it click a stone, and instantly the one that follows up.
Resulting better speeds ;)




this is my nooby function (using srl5 here :o) :


function steppingStone: Boolean;
var
x, y, i, h, tt: Integer;
r, P: TPoint;
PlayerTPA, TPA: TPointArray;
ATPA: T2DPointArray;

begin
MarkTime(tt);
repeat
if (not LoggedIn) or noStones then
exit;

ColorToleranceSpeed(2);
SetColorSpeed2Modifiers(0.26, 0.16);
findColorsTolerance(TPA, 5528417, MSCX - 200, MSY1, MSCX + 200, MSCY + 30, 7);
ColorToleranceSpeed(1);
SetColorSpeed2Modifiers(0.02, 0.02);

if (length(TPA) < 20) then
begin
debugS('Did not find steppingstone colors: TPA');
exit;
end;

TPAFromBoxWrap(inttoBox(MSCX - 30, MSCY - 30, MSCX + 30, MSCY + 30), playerTPA);
clearTPAFromTPAWrap(TPA, playerTPA, TPA);

splitTPAWrap(TPA, 25, ATPA);
sortATPAFromFirstPointY(ATPA, point(MSCX, MSCY));

if smartDebug then
Smart_DebugATPA(False, ATPA);

h := High(ATPA);

for i := 0 to h do
//writeln(length(ATPA[i]));
begin
if (length(ATPA[I]) < 150) then
continue;

P := MiddleTPA(ATPA[i]);
if pointInBox(P, intToBox(195, 171, 252, 222)) or pointInBox(P, intToBox(312, 30, 403, 171)) then
continue;

HumanMMouse(P.x, P.y, 0, 0);
if WaitReadmouseovertext(16711168, 10, 400) then
begin
fastClick(mouse_left);
if (not didYellowClick) then
begin
AntiBan;

wait(1000);
while isMoving do
wait(10);

MarkTime(LastAction1);
MarkTime(LastAction2);
Break;
end;
end else
begin
wait(randomRange(100, 200));
break;
end;
end;

wait(100);
until(noStones or (TimeFromMark(tt) > 25000));
end;

Ashaman88

2014-01-04 07:19:58

have you tried sps?

Hoodz

2014-01-04 08:49:25

this is how i would have done it. not the best way but it is simple and fast.

make a box north and east of your player and let it search in those 2 boxes for the stepping stones. if it finds the stepping stone it will spam click it. you dont have to really check if you are moving since you are checking in a small box. as a human player i would have spam click the stepping stones rather than click, wait, click, wait etc.


Sjoe

2014-01-04 14:24:55

From: Ashaman88
have you tried sps?


I don't know what you mean lol

From: hoodz
this is how i would have done it. not the best way but it is simple and fast.

make a box north and east of your player and let it search in those 2 boxes for the stepping stones. if it finds the stepping stone it will spam click it. you dont have to really check if you are moving since you are checking in a small box. as a human player i would have spam click the stepping stones rather than click, wait, click, wait etc.



yeh possible, what should I use to detect that I'm on the first steppingstone though?
Since the first steppingstone click could be from further away

Ashaman88

2014-01-04 14:28:53

Just have an sps map of it… when you change sps positions go for the next stone? Obv should be more involved with that but it worked great for ape atoll

Hoodz

2014-01-04 14:51:53

From: Sjoe
I don't know what you mean lol



yeh possible, what should I use to detect that I'm on the first steppingstone though?
Since the first steppingstone click could be from further away


you can make a procedure to find the first stepping stone (or a big box north of your player) and in the other procedure you do what i said in my previous post.

what ashaman says works also but i dont like sps :P

Ashaman88

2014-01-04 14:52:42

From: hoodz
you can make a procedure to find the first stepping stone (or a big box north of your player) and in the other procedure you do what i said in my previous post.

what ashaman says works also but i dont like sps :P


Come to RS3 sps works much better than with OSR :)

Sjoe

2014-01-04 14:54:03

From: Ashaman88
Come to RS3 sps works much better than with OSR :)


example of your sps usage in my case?

From: hoodz
you can make a procedure to find the first stepping stone (or a big box north of your player) and in the other procedure you do what i said in my previous post.

what ashaman says works also but i dont like sps :P


yeh true, gonna try that, looking in 2 small boxes should be significantly faster.


ty guys btw:)

Hoodz

2014-01-04 14:55:31

From: Ashaman88
Come to RS3 sps works much better than with OSR :)


wow are you a ninja or something?

umh rs3 is…. well it ruined everything for me, im a pker and you cant pk in rs3.

Ashaman88

2014-01-04 14:59:55

From: Sjoe
example of your sps usage in my case?



yeh true, gonna try that, looking in 2 small boxes should be significantly faster.


ty guys btw:)


P:=spsgetplayerpos

if pointinbox(p,1ststepbox) then
jump1ststep;

p:=spsgetplayerpos
while p=spsgetplayerpos do
wait;

p:=spsgetplayerpos
if pointinbox(p,2ndstepbox) then
jump2ndstep


basically something like that

From: hoodz
wow are you a ninja or something?

umh rs3 is…. well it ruined everything for me, im a pker and you cant pk in rs3.



touche ;)

rj

2014-01-04 15:08:11

Use the green color of the minimap and convert it to a box and get your position in that box like I used here: http://villavu.com/forum/showthread.php?t=105596

function getMap:TBox;
var
TPA:TPointArray;
ATPA:T2DPointArray;
begin
if (not t_loggedin) then //edit this to whatever srl6 needs
exit;
ColorToleranceSpeed(2);
SetColorSpeed2Modifiers(hue, sat); //edit the hmod and smod
FindColorsTolerance(TPA, greencolor, 549, 9, 710, 158, tol); // edit the colors
ColorToleranceSpeed(1);
SetColorSpeed2Modifiers(0.02, 0.02);
if (Length(TPA) > 0) then
begin
ATPA := clusterTPA(TPA, 3);
filterTPAsBetween(ATPA, 1, 200); // filter out small ones
if (debug = true) then
DebugATPABounds(ATPA);
result := GetATPABounds(ATPA);
end;
end;

function getPosition:TPoint;
var
b:Tbox;
begin
b := getMap;
result := Point((X - b.X1), (Y - b.Y1)); //edit X to center of MM(x), same for Y
end;


Would be tons faster then SPS :d

Sjoe

2014-01-05 06:55:29

if someone wants to write this for me, i'll be sooooooooooooooooooooo grateful!!!!!!!!

trying to make it work for some hours now, but I'm failing pretty hard. :crying:

Justin

2014-01-05 07:07:07

From: Sjoe
if someone wants to write this for me, i'll reward you roflol.

trying to make it work for some hours now, but I'm failing pretty hard.


I hope you're not paying/rewarding someone for a snippet here on Villavu ;)

Sjoe

2014-01-05 07:13:42

From: Justin
I hope you're not paying/rewarding someone for a snippet here on Villavu ;)


well i'll just edit my post :rolleyes:

The Killer

2014-01-05 07:34:21

From: Justin
I hope you're not paying/rewarding someone for a snippet here on Villavu ;)


If the snippet is posted pubilically then he is allowed to donate to them? Found a loophole gg Justin ;)

Hoodz

2014-01-05 08:03:35

@Sjoe

if you want it in srl5 i can make it for you but i dont have a member account

Sjoe

2014-01-05 08:12:19

From: hoodz
@Sjoe

if you want it in srl5 i can make it for you but i dont have a member account


got skype? :) u can lend my account

Hoodz

2014-01-05 08:30:23

From: Sjoe
got skype? :) u can lend my account


i keep my skype private if you dont mind :p

you can pm me if you want here on villavu

Sjoe

2014-01-05 08:33:32

From: hoodz
i keep my skype private if you dont mind :p

you can pm me if you want here on villavu


come on irc?
would be way easier to chat.