SRL Archive - Delphi/FPC Help and Tutorials

Woodcutting Animation?


Leyser

2012-05-19 06:56:57

So, I have my own woodcutting script and it cuts Willows, when it selects the chop option it clicks it again when its still chopping is there a way to prevent this? like a certain wait?

~Leyser

litoris

2012-05-19 07:01:50

You can make the script check whether the character is doing the animation using pixelshift.
There's a tutorial right here:http://villavu.com/forum/showthread.php?t=74090

Leyser

2012-05-19 08:46:58

I still dont get this, where exactly do I put it and call it?

litoris

2012-05-19 09:03:39

From: Leyser
I still dont get this, where exactly do I put it and call it?



//Stolen from the tut:
function Woodcutting: Boolean;
PBox: TBox;
begin
PBox := IntToBox(245, 130, 285, 195);
Result := (AveragePixelShift(PBox, 250, 500) > 400);
end;
//Woodcutting procedure:
procedure Cut;
begin
FindTree; //Your procedure to find tree colors
Mouse(treex, treey, randomx, randomy, True);
repeat
Antiban;
Antirandoms;
WaitWhileCutting; //Count logs you got or whatever
Wait(600); //Wait one whole game tick just in case
until( not (Woodcutting)) //Stops the loop when cutting animation stops
end

Joe

2012-05-19 11:36:40

From: Leyser
I still dont get this, where exactly do I put it and call it?


Like litoris posted, just put it above your woodcutting procedure. Or under your declareplayers. (anywhere near the top of the script so its above the other procedures and can be called in any one of them)

Leyser

2012-05-20 02:50:10

From: JOEbot
Like litoris posted, just put it above your woodcutting procedure. Or under your declareplayers. (anywhere near the top of the script so its above the other procedures and can be called in any one of them)



Thanks a bunch! :D

Leyser

2012-05-20 02:51:36

From: litoris

//Stolen from the tut:
function Woodcutting: Boolean;
PBox: TBox;
begin
PBox := IntToBox(245, 130, 285, 195);
Result := (AveragePixelShift(PBox, 250, 500) > 400);
end;
//Woodcutting procedure:
procedure Cut;
begin
FindTree; //Your procedure to find tree colors
Mouse(treex, treey, randomx, randomy, True);
repeat
Antiban;
Antirandoms;
WaitWhileCutting; //Count logs you got or whatever
Wait(600); //Wait one whole game tick just in case
until( not (Woodcutting)) //Stops the loop when cutting animation stops
end




Thanks man! :D :D