Author Topic: TrailMyx's Locate Tree sub  (Read 22445 times)

0 Members and 1 Guest are viewing this topic.

Offline TrailMyxTopic starter

  • Officially retired from UO
  • Administrator
  • *
  • *
  • Posts: 13310
  • Activity:
    0%
  • Reputation Power: 154
  • TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!
  • Gender: Male
  • Viper!
  • Respect: +3089
  • Referrals: 34
    • View Profile
    • ScriptUO
TrailMyx's Locate Tree sub
« on: March 29, 2009, 10:01:22 AM »
+1
Just has one argument. 

%1 = Radius to search
returns #TRUE if a tree is found, otherwise #FALSE

Sub sets up the #LTARGET information so you can just event macro 22 (use last target)

Code: easyuo
  1. sub TM_LocateTree
  2.   namespace push
  3.   namespace local LT
  4.   if !init = N/A
  5.   {
  6.     tile init
  7.     set !init #TRUE
  8.   }
  9.   set !radius %1
  10.   set !xmin #CHARPOSX - !radius
  11.   set !xmax #CHARPOSX + !radius
  12.   set !ymin #CHARPOSY - !radius
  13.   set !ymax #CHARPOSY + !radius
  14.   for !x !xmin !xmax
  15.   {
  16.     for !y !ymin !ymax
  17.     {
  18.       tile cnt !x !y #CURSKIND
  19.       if #TILECNT > 0
  20.       {
  21.         for !i 1 #TILECNT
  22.         {
  23.           tile get !x !y !i #CURSKIND
  24.           if tree in #TILENAME
  25.           {
  26.             set #LTARGETX !x
  27.             set #LTARGETY !y
  28.             set #LTARGETZ #TILEZ
  29.             set #LTARGETTILE #TILETYPE
  30.             set #LTARGETKIND 3
  31.             namespace pop
  32.             return #TRUE
  33.           }
  34.         }
  35.       }
  36.     }
  37.   }
  38.   namespace pop
  39. return #FALSE
  40.  

If anything, hopefully this will de-mystify the TILE stuff.
« Last Edit: May 05, 2017, 04:58:42 PM by TrailMyx »
Please read the ScriptUO site RULES
Come play RIFT with me!

Offline camotbik

  • Sr. Member
  • *
  • Posts: 349
  • Activity:
    0%
  • Reputation Power: 3
  • camotbik has no influence.
  • Gender: Male
  • Hello! I'm a UO addict.
  • Respect: +90
  • Referrals: 0
    • View Profile
Re: TrailMyx's Locate Tree sub
« Reply #1 on: December 25, 2009, 08:04:03 PM »
-1
Good work. Thank you.
What you witness -- is whatver..
uogamers hybrid.

Offline Coragin

  • Wacko in Pajama's
  • Elite
  • *
  • *
  • Posts: 1641
  • Activity:
    0%
  • Reputation Power: 23
  • Coragin might someday be someone...Coragin might someday be someone...Coragin might someday be someone...Coragin might someday be someone...
  • Gender: Male
  • It Is What It Is.
  • Respect: +117
  • Referrals: 1
    • View Profile
Re: TrailMyx's Locate Tree sub
« Reply #2 on: December 25, 2009, 09:00:36 PM »
+1
*starts jumping up and down pointing* Mwinc, MWINC, LOOK LOOK!!
Coragin

My Facebook
And now I'm better at doing what ever it is Wolverine does!

Offline TrailMyxTopic starter

  • Officially retired from UO
  • Administrator
  • *
  • *
  • Posts: 13310
  • Activity:
    0%
  • Reputation Power: 154
  • TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!
  • Gender: Male
  • Viper!
  • Respect: +3089
  • Referrals: 34
    • View Profile
    • ScriptUO
Re: TrailMyx's Locate Tree sub
« Reply #3 on: December 26, 2009, 10:34:19 AM »
+1
*starts jumping up and down pointing* Mwinc, MWINC, LOOK LOOK!!

This probably won't work since this sub also relies on the tile stack.
Please read the ScriptUO site RULES
Come play RIFT with me!