SRL Archive - SRL Snippets

Box walk Tolerance


rj

2013-03-11 17:11:59

So I had a little time to kill and I came up with this Semi-reliable walking method:BoxWalk, It is pretty much just a failsafe version of using find color tolerance, but it's not bad!

Procedure BoxWalkTolerance(Col,xe,ye,w,h,tol,rm: Integer);
Var
X,Y,T:Integer;
Begin //643 83
If FindColorSpiralTolerance(X, Y, col, xe, ye, w, h, tol) then
Begin
MMouse(RandomRange(X - rm, X + rm), RandomRange(y - rm, y + rm), 0, 0);
ClickMouse2(Mouse_Left)
Wait(RandomRange(200, 400));
If P07_FindMMFlag Then
Begin
MarkTime(T)
Repeat
Wait(RandomRange(50, 150));
Until (P07_FindMMFlag=False) Or (TimeFromMark(T) > 6000)
Writeln('Can no longer find the flag')
End;
End;
End;


How to use:

BoxWalkTolerance(COLOR, X1, Y1, X2, Y2, TOL, RANDOMOFFSET)


Example script:

{$I SRL/SRL.Simba}
{$I P07Include.Simba}
Procedure BoxWalkTolerance(Col,xe,ye,w,h,tol,rm: Integer);
Var
X,Y,T:Integer;
Begin //643 83
If FindColorSpiralTolerance(X, Y, col, xe, ye, w, h, tol) then
Begin
MMouse(RandomRange(X - rm, X + rm), RandomRange(y - rm, y + rm), 0, 0);
ClickMouse2(Mouse_Left)
Wait(RandomRange(200, 400));
If P07_FindMMFlag Then
Begin
MarkTime(T)
Repeat
Wait(RandomRange(50, 150));
Until (P07_FindMMFlag=False) Or (TimeFromMark(T) > 6000)
Writeln('Can no longer find the flag')
End;
End;
End;
Begin
SetupP07Include;
MouseSpeed := 15;
BoxWalkTolerance(3297113, 632, 101, 655, 112, 15, 5)
End.

All I can say it, it works better then rotated DTM's for me, this just got me from flax feilds to bank 5 times in a row(didn't test anymore cba)

BoxWalkTolerance(2063699, 597, 73, 615, 96, 7, 3)
BoxWalkTolerance(1932142, 612, 28, 665, 56, 7, 3)
BoxWalkTolerance(1932142, 612, 28, 665, 56, 7, 3)
BoxWalkTolerance(1932135, 628, 17, 663, 44, 7, 3)
BoxWalkTolerance(1932149, 658, 32, 687, 64, 7, 3)
BoxWalkTolerance(4771055, 622, 35, 692, 121, 10, 4)

xtrapsp

2013-03-12 06:25:27

so essentially it just follows a colour inside a box which you define the width and height for ?

rj

2013-03-12 06:38:18

From: xtrapsp
so essentially it just follows a colour inside a box which you define the width and height for ?


Pretty much.

xtrapsp

2013-03-12 06:42:29

I'm pretty sure I've seen something like this before, correct me if I'm wrong haha.

rj

2013-03-12 06:48:12

From: xtrapsp
I'm pretty sure I've seen something like this before, correct me if I'm wrong haha.


Probably but it's more easy for nubs to use this then Findcolortolerance because it has a small fail-safe

SeanStar

2013-03-12 15:36:15

This won't help you when the compass decides to be off by -20 - 20 degrees :P

Walking needs to consistently work for it to be viable. (Even after you've reset the client/had it running for a while!)

rj

2013-03-12 15:37:02

From: SeanStar
This won't help you when the compass decides to be off by -20 - 20 degrees :P

Walking needs to consistently work for it to be viable. (Even after you've reset the client/had it running for a while!)


P07_MakeCompassNorth

SeanStar

2013-03-12 15:47:33

From: RJJ95
P07_MakeCompassNorth

Are you aware the the compass is actually inaccurate after a while? Compass can say perfect north, but the minimap can be like 15 degrees.

Olly

2013-03-13 00:37:50

From: SeanStar
Are you aware the the compass is actually inaccurate after a while? Compass can say perfect north, but the minimap can be like 15 degrees.


Best way to explain it (and what actually happens) is that the map in the minimap rotates, and the compass is unmoved.

Aside from that you should take a look at findColoredAreaTolerance rjj.