Log in

View Full Version : Woodcutting Normal Trees



I Pick Axes
09-25-2006, 02:40 AM
I would like a way to find only normal trees and not oaks for woodcutting. Their colors are too similar. Should I be using some form of UpText or a bitmap or what? Also, how do I search for the message about getting logs? Bitmap? InChat? Also, if there's anything else you'd like to mention regarding a wcer/arrowshaft maker, please do tell. Thanks in advance.

Yakman
09-25-2006, 06:31 AM
if(isuptext('Chop Down Tree'))then

if(isuptext('Chop Down Oak'))then

Wizzup?
09-25-2006, 12:22 PM
He will need some deformed bitmap to find the tree.

Yakman
09-25-2006, 12:45 PM
i havent tried anything, it might be that the bitmap can tell the differance between trees leaves,
a good function to use for this is "FindDeformed" it works by gradually lowering the boundry so it should result in the bitmap thats most like the tree, with a bit of luck, a normal tree

if that doesnt work then try a bitmap of the tree trunk, if not, try evergreen trees,

for getting the last chat message use these functions

"function IsChat(s:string):boolean"
"function IsChatMulti(s1,s2,s3:string):boolean"

these find the black (not the name) text of the last chat message, so you will look for something like "ischat('Log')"

theres nothing urgent that comes to mind about wc/flechers, except i know that they can operate anywhere, so choose a good empty location.

WT-Fakawi
09-25-2006, 12:59 PM
I would like a way to find only normal trees and not oaks for woodcutting. Their colors are too similar. Should I be using some form of UpText or a bitmap or what? Also, how do I search for the message about getting logs? Bitmap? InChat? Also, if there's anything else you'd like to mention regarding a wcer/arrowshaft maker, please do tell. Thanks in advance.

Look at the Ratz! code.


//----------------------------------------------------------------------------//

function FindTreeDeformed(var ObjX, ObjY :integer; UpText1, UpText2: String; BMP, a, b, c, d: integer): Boolean;
var
acc, ref : Extended;
var
XT, YT,times,tol : Integer;
begin
ref:=0.9; tol:=0;
for times:=1 to 4 do
begin
FindDeformedBitmapToleranceIn(BMP, XT, YT, a, b, c, d, tol, 2, True, acc);
if (acc >= ref) then
begin
MMouse(XT+8,YT,0,0);
if (IsUpText(UpText1) or IsUpText(UpText2)) then
begin
ObjX:=XT;
ObjY:=YT;
Result := True;
Exit;
end;
end;
ref := ref - 0.1;
tol:=tol+10;
if FawkiDebug then Writeln('A '+FLoatToStr(acc)+'. R '+ FLoatToStr(ref)+ '. T '+IntToStr(tol));
FTWait(1);
end;
end;

//----------------------------------------------------------------------------//

function ChopTree : Boolean;
var CX, CY, RT, ChopTime, StopTime, ChP : Integer;
begin
RT := RTreeColor;
FindEnt ( RtreeColor );
if ( FindTreeDeformed(CX, CY, 'Tre' , 'ree', Tree, MSX1,MSY1,MSX2,MSY2 )) then
begin
Mouse ( CX+20, CY, 10, 0, True );
FindBirdsNest;
FlagFTWait;
FTWait(4);
if not InChatMulti('wing','axe','ree') then
begin
Result:=False;
Exit;
end;

MarkTime ( ChopTime );
repeat
MarkTime ( StopTime );
FTWait(5);
FindWCRandoms;
if ( ChopTime+15000 < StopTime ) then Break;
ChP:=ChP+1;
ClickToContinueFast;
if FawkiDebug then writeln('Chop pass:'+IntToStr(ChP));
if InChatMulti('adv','atu','ance') then Exit;
until ( InChatMulti('get','log','ogs') );
if InChatMulti('get','log','ogs') then
begin
Result := True;
TreeCount:=TreeCount+1;
end;
end;
end;


and this is the Bitmap:
Tree:= BitmapFromString(8, 1, '68783458583D383824' +
'707834485022687834384822586036');



It works extremely accurate even if I say so myself :f:

If you want I could write you a small out-of-the-box script that cuts trees using this code. :)

HISTORY
09-25-2006, 06:40 PM
looks liek fakawi doesnt want to be retired anymore:P

Dankness
09-25-2006, 10:02 PM
Look at the Ratz! code.

It works extremely accurate even if I say so myself :f:

If you want I could write you a small out-of-the-box script that cuts trees using this code. :)


we already wrote that script already :P I might release it one of these days....:(h)::spot:

I Pick Axes
09-26-2006, 01:32 AM
Thanks everyone. I'll be trying to put these into something workable.
Fakawi, I'm trying to write some part of the code myself, and quite honestly, I don't even understand the Ratz code completely, though I have some idea what it's doing.
I'll probably be trying to simplify tree finding. I don't need a 100% tree finding rate.
Thanks again all.

EDIT: Does the procedure for normal random finding include ents? If not, how do I use FindEnt?

EDIT: How do I click the 'Make X'?

WhiteShadow
09-26-2006, 02:45 AM
Thanks everyone. I'll be trying to put these into something workable.
Fakawi, I'm trying to write some part of the code myself, and quite honestly, I don't even understand the Ratz code completely, though I have some idea what it's doing.
I'll probably be trying to simplify tree finding. I don't need a 100% tree finding rate.
Thanks again all.

EDIT: Does the procedure for normal random finding include ents? If not, how do I use FindEnt?

EDIT: How do I click the 'Make X'?


{.include SRL/SRL/Skill/Woodcutting.Scar}

//include that! for FindEnt


procedure FindEnt(TreeColor : Integer);


function ChooseOption(i : String) : Boolean;

Or


function ClickOption(s: String; i: Integer): Boolean;
By: RSN
Description: Clicks Option in Specified Area (1 for Main Screen, 2 Inventory,
3 for Chat Window), returns True if text was found

I think that was what you were talking about. xP