PDA

View Full Version : TreeWalk!



Naum
02-29-2008, 06:52 PM
I was playing around with walking function when i came up with an idea.
As we know more than 60% of runescape are full of trees and there is still no function that walks to the trees
Problem solved :)

I proudly present...


TreeWalk!!

{************************************************* *******************************
Function TreeWalk(WhatTree: String; x1, y1, x2, y2: Integer) : Boolean;
By: NaumanAkhlaQ
Description: Walks to a tree in a specified area, for use in the MiniMap
Direction: In the string 'WhatTree' the valid arguments are 'RareTree' and 'Tree'
************************************************** ******************************}

Function TreeWalk(WhatTree: String; x1, y1, x2, y2: Integer) : Boolean;
Var
Tree : array [0..2] of Integer;
i : Integer;
// x,y : Integer;
begin
Tree[0] := 2250789;
Tree[1] := 2315315;
Tree[2] := 2442328;
Begin
Case WhatTree of
'Tree': Begin
For i:= 0 to 2 do
If FindColorSpiralTolerance(x,y,Tree[i],x1,y1,x2,y2,48) then
Begin
Writeln('Tree Found!')
Result:= True;
Exit;
end else
Writeln('Tree Not Found, Exiting');
Exit;
end;
'RareTree' : Begin
If FindSymbolIn(x,y,'Tree',x1,y1,x2,y2) then
Begin
Writeln('Tree Found!')
Result:= True
Exit;
end else
Writeln('Tree Not Found, Exiting');
Exit;
end;
end;
end;
end;


Usage:
If TreeWalk('Tree',603, 38,609, 44) then

or

If TreeWalk('RareTree',605, 31,659, 4) then


A Quick example:

If TreeWalk('Tree',603, 38,609, 44) then
Begin
Location := Yews;
Mouse(x,y,1,1,true)
end;


Please post comments and suggestions.
Thanks
NaumanAkhlaQ!!!

n3ss3s
02-29-2008, 07:05 PM
Uhm... Umm... I don't want to insult you or your code but... you made a function that is the same as Result := FindSymbol(X, Y, 'tree')?

Also, are those colors brown or green ones?

Either case, the RuneScape colors are dynamic, and if I would now go to rs, use those colors, they most likely wouldn't find what I want to.

You need to make an autocolor procedure, I suggest a similar one to the SRL ones.

Cazax
02-29-2008, 07:05 PM
maybe you could add : function Function TreeWalk(WhatTree: String;var X,Y : Integer; x1, y1, x2, y2: Integer) : Boolean;
then you use :

if TreeWalk('Tree',x,y,343,134,43,23) then
begin
Wreiteln('We are at the tree');
Exit;
end;
blabla

Naum
02-29-2008, 07:08 PM
Whats so good about the vars?
True they look good and they give the position? but useage?
And n3ss3s im deeply insulted :( j/k
The colors work hence the high tol :p
What autocoloring BruteForce? RGB? XYZ? HSL?

n3ss3s
02-29-2008, 07:13 PM
Well I know HSL the most, but all the SRL ones seem to be made with RGB. Your choice.

Naum
02-29-2008, 07:19 PM
which would you think is the easiest?

MylesMadness
02-29-2008, 07:41 PM
He will think hsl because almost every function he makes has it... But I think rgb

malotthouse
02-29-2008, 08:54 PM
is this like radialwalking? or does it just find any tree in a certain area? if its like radialwalking ill try it. and maybe use it.

stampede10343
03-01-2008, 02:35 AM
is this like radialwalking? or does it just find any tree in a certain area? if its like radialwalking ill try it. and maybe use it.

I think it either searches by either using the Symbol on the minimap, or or little trees that you can see on the minimap ;)

Naum
03-01-2008, 12:15 PM
Yes guys it does use the small trees, It's very handy i'm using it im my script.
I figured never use a DTM as the tree's refresh every 1 second :)

Thx for the FeedBack

senrath
03-02-2008, 02:44 AM
Ooo, I could so use this for the walking script I'm working on. I was actually looking for something like this.

Naum
03-02-2008, 10:25 AM
No problem happy to help :)

Pure1993
03-02-2008, 02:11 PM
Btw, different trees often have different little "symbols", the willow one looks like a minimized willow, the dead trees are only brown (something which might need to be edited, cause it might not find these), oaks also have a slightly "rounder" shape to them, so maybe you can use something to differ tree from tree... just an idea.
Overall good idea, but needs some work. :)

Naum
03-02-2008, 03:59 PM
Yea the annoying problem is that the tree's keep changing the only thing i can think of is autocoloring and just plain coloring.
Or making arrays like iv'e done :)

Thx for the feedback anyways.

Pure1993
03-03-2008, 02:46 PM
Oh, btw, my comment was meant as a compliment, in case that sorta slipped under the carpet (like the saying goes). :)
But yeah, they vary greatly in shape... maybe someday it will be possible to create programs which work similar to the human mind, capturing the bitmap of the tree while running the program, running a category check to see into which category it applies, and then acts accordingly. *keeps dreaming* :D (of course, that would probably require huge ram to work fluently, lol)

Naum
03-03-2008, 04:50 PM
no really. It pretty easy if you use a java based pogram (Kyab). lol
But in delphi it would be hard but not impossible..

stampede10343
03-04-2008, 11:58 AM
you should make this like radial walk and search with angles, because what if you were walking right since it searches from left to right it might find a tree before that and start going left... just a thought

Naum
03-10-2008, 12:03 PM
Yes i could do that.

the scar noob
03-26-2008, 10:15 PM
you should make this like radial walk and search with angles, because what if you were walking right since it searches from left to right it might find a tree before that and start going left... just a thought

Ok. Nauman, use FindColorSpiralTolerance then xD.

Try some rgb/hsl autocoloring + radialwalk and that should work..

If you can find a static color (or colors that are found very often) fora MM tree, you could be able to make this function to work;)

-Tsn.

Naum
03-28-2008, 04:37 PM
KK thanks TSN.
Thanks for sharing your ub3r knowledge :)