SRL Archive - Help

Pixel shift


rj

2012-12-17 16:04:39

I am looking to add pixel shift to my bot, but I am not really sure how it works. I made this basic script copying an example off the forums and added my own stuff in:

program test;
{$i srl/srl.simba}
const
TREEX=120;
TREEY=81;
TREEX2=382;
TREEY2=226;
Function Choppin: Boolean;
var
PBox: TBox;
begin
PBox := IntToBox(249, 134, 277, 180);
Result := (AveragePixelShift(PBox, 500, 650) > 1500);
Writeln(IntToStr(AveragePixelShift(PBox, 500, 650)));
end;
Procedure Woodchop;
var
X, Y: Integer;
begin
if (Choppin) then
begin
writeln('Waiting to stop Cutting');
wait(100);
end else
begin
writeln('Lets look for a Tree');
if FindColorTolerance(X,Y,12400,TREEX,TREEY,TREEX2,TREEY2,10)then
MouseSpeed:=15;
mmouse(x, y,1,1);
Wait(350 + Random(150));
ClickMouse(X, Y, mouse_Left);
Wait(500 + Random(700));
end;
end;
begin
repeat
Woodchop;
until (IsKeyDown (114));
end.

But the bot still sometimes clicks the tree even when the character is doing the cutting animation what numbers would I have to change to prevent this, for it to re-click a tree when the animation stops?

DannyRS

2012-12-17 16:07:45

run while cutting and while not, adjust numbers

Procedure DebugShiftCount;
var
PBox: TBox;
begin
PBox := IntToBox(245, 130, 285, 195);
Writeln(IntToStr(AveragePixelShift(PBox, 250, 500)));
end;

http://villavu.com/forum/showthread.php?t=74090

Rezozo

2012-12-17 16:13:57

Your problem is you put '>1500'. This is waaay too high. Put around 100 to 150. That should do the trick. Usually, you do not see more than 300. (Check my ChopNBurn)
~Rez

rj

2012-12-17 16:17:47

From: Rezozo
Your problem is you put '>1500'. This is waaay too high. Put around 100 to 150. That should do the trick. Usually, you do not see more than 300. (Check my ChopNBurn)
~Rez


Ok thanks!
I'm learning all this for my next membership application, my last one had colors and bitmaps and basic failsafes, my next one will have colors,DTM's,TPA's,pixelshift,bitmaps,added failsafes hopefuly that should get me in


EDIT, I put it down to 300 and then it constantly said "waiting to stop chopping" so.. I guess ill make it a lot higher then?

IsoMorphic

2012-12-17 22:39:46

no. idling never goes above 400. 400 is flawless

P1ng

2012-12-19 01:17:41

From: DannyRS
run while cutting and while not, adjust numbers

Procedure DebugShiftCount;
var
PBox: TBox;
begin
PBox := IntToBox(245, 130, 285, 195);
Writeln(IntToStr(AveragePixelShift(PBox, 250, 500)));
end;

http://villavu.com/forum/showthread.php?t=74090


Do exactly what Danny said. Debug the pixel shift and then you will be able to find what the max pixel shift for your idle character is and the min pixel shift for when your character is cutting. Make the number a reasonable sum between the two and it should work perfectly.

Peanuts

2013-06-16 04:50:28

This thread was so helpful.. !

Bumping it up to keep it alive for anyone searching pixels