ScriptUO

Official ScriptUO EasyUO Scripts => Scripting Chat => Topic started by: _C2_ on December 16, 2010, 07:53:32 AM

Title: anyone interested in doing a tile reader tutorial?
Post by: _C2_ on December 16, 2010, 07:53:32 AM
interested in learning in more depth...
 
how to do tile scanning

&

how to check a radius.

been looking at some but the deeper level arrays are messing with me just a hair.  once i understand them i am sure i will get it better.
Title: Re: anyone interested in doing a tile reader tutorial?
Post by: TrailMyx on December 16, 2010, 07:57:01 AM
Did you pick apart my Locate Tree sub?
http://www.scriptuo.com/index.php?topic=1227.0;highlight=locatetree
Title: Re: anyone interested in doing a tile reader tutorial?
Post by: _C2_ on December 16, 2010, 07:58:20 AM
Did you pick apart my Locate Tree sub?
http://www.scriptuo.com/index.php?topic=1227.0;highlight=locatetree

already sent u a pm on that with the specific question tripping me up.  it is beautiful and does what i want but i have particular questions about how it works the way it does.
Title: Re: anyone interested in doing a tile reader tutorial?
Post by: manwinc on December 22, 2010, 06:00:56 PM
At work right now so I'll try and explain the basic Commands.

Tile Init  ; Initiates tile info (thats all I really know)

Tile Cnt (X) (Y)  ; Returns the number of tiles on that X Y cordinate as #Tilecnt

Tile Get (X) (Y) (Index) ; Index is just the Number for the tile 1 to #Tilecnt

From there you have all your #Tile Variables that you can use to distinguish tiles from one another. When setting Up a radius there are multiple Methods you can use. Below is a simple Sub That I just pulled out my....... That will just locate a tile with a keyword within a radius you specify. Would look great for looking for something Like Dirt for filling plant bowls.

Gosub Locate_Tile 2 Tree
if #result
display YAY You found a TREE!!!!

Sub Locate_Tile
; Sub Locate_Tile (Radius) (Key Word)
set %Lower_X #charposx - %1
set %Upper_X #charposx + %1
set %Lower_Y #charposy - %1
set %Upper_Y #charposy + %1
Tile Init
For %X_Cord %Lower_X %Upper_X
{
For %Y_Cord %Lower_Y %Upper_Y
{
Tile cnt %X_Cord %Y_Cord
for %Index 1 #Tilecnt
{
Tile Get %X_Cord %Y_Cord %Index
if %2 in #tilename
Return #true
}
}
}
Return #false