SRL Archive - Research & Development Lounge

TreeWalk!


Naum

2008-02-29 13:52:32

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

2008-02-29 14:05:31

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

2008-02-29 14:05:56

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

2008-02-29 14:08:48

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

2008-02-29 14:13:26

Well I know HSL the most, but all the SRL ones seem to be made with RGB. Your choice.

Naum

2008-02-29 14:19:26

which would you think is the easiest?

MylesMadness

2008-02-29 14:41:26

He will think hsl because almost every function he makes has it… But I think rgb

malotthouse

2008-02-29 15:54:35

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

2008-02-29 21:35:00

From: malotthouse
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

2008-03-01 07:15:01

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

2008-03-01 21:44:15

Ooo, I could so use this for the walking script I'm working on. I was actually looking for something like this.

Naum

2008-03-02 05:25:04

No problem happy to help :)

Pure1993

2008-03-02 09:11:01

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

2008-03-02 10:59:39

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

2008-03-03 09:46:07

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

2008-03-03 11:50:29

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

2008-03-04 06:58:42

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

2008-03-10 08:03:25

Yes i could do that.

the scar noob

2008-03-26 18:15:41

From: stampede10343
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

2008-03-28 12:37:35

KK thanks TSN.
Thanks for sharing your ub3r knowledge :)