SRL Archive - SRL Archives

ChopDone


timmyboy

2006-05-02 09:43:13

Same thing as the new MineDone, except this one if for tree's.


{*******************************************************************************
function ChopDone(Mtime: Integer): Boolean;
By: Timmyboy
Description: Returns true if you cut a tree, false if not.
Remember to set time-out(Mtime). Must be the max time you think it will take for your
character to cut the tree.
*******************************************************************************}
function ChopDone: Boolean;
var
Wmark: Integer;
begin
MarkTime(Wmark);
if(FindChatText('swing your axe'))then
begin
repeat
wait(500+random(400));
until(FindChatText('get some')) or (TimeFromMark(Wmark)>Mtime);
if(FindChatText('get some'))then
begin
Result:=true;
end else
if (TimeFromMark(Wmark)>Mtime)then
begin
Result:=false;
end;
end;
end;

phantombmx

2006-05-02 10:30:24

what if the player gets interrupted? this should have some sort of timeout of maybe 15-20 seconds that way if it does get sidetracked somehow, it will get back on track.. the cfix, i think, isnt nessecary(sp?) because the scripter should already have a chatsoff; in their script..

timmyboy

2006-05-02 10:41:01

Fixed it, this time with a user-set timeout.

HISTORY

2006-05-02 11:18:18

what if someone else gets all the logs
oh thats proc is like says if you got the logs or not. It doesnt tell you IF the tree has been cut down(example a willow tree can hold moe than one log)

timmyboy

2006-05-02 11:54:24

From: HISTORY
what if someone else gets all the logs
oh thats proc is like says if you got the logs or not. It doesnt tell you IF the tree has been cut down(example a willow tree can hold moe than one log)

Each time you get s log, it tells you that you got a log. And if somebody gets it before the character does, there is a time-out.;)

phantombmx

2006-05-02 13:33:13

what hes sayin is that it will look for the text.. if it finds the text sayin you got a log, it stops.. in a wc script.. it will click again.. and again for each new log..

its best, like history said, to have it check if the tree is gone

timmyboy

2006-05-02 15:32:10

From: phantombmx
what hes sayin is that it will look for the text.. if it finds the text sayin you got a log, it stops.. in a wc script.. it will click again.. and again for each new log..

its best, like history said, to have it check if the tree is gone

Well, I made it this so that the user has full control over the script. Like for example,

procedure chop;
begin
if(findcolor(x,y,038024)then
begin
mouse(x,y,3,3,true);
repeat
wait(500);
until(ChopDone(10000));
end;
if(ChopDone(10000)=false)then
begin
mouse(x,y,3,3,true);
repeat
wait(500);
until(ChopDone(10000));
end;
end;

Something like that =P I'll look into making the function the way you suggested though.