ScriptUO

Official ScriptUO EasyUO Scripts => Script Debug => Topic started by: Neo on August 15, 2011, 12:20:46 PM

Title: lumber issue
Post by: Neo on August 15, 2011, 12:20:46 PM
I just started playing with some lumber scripts...

The thing is, I used this stuff I wrote this morning, and it was working, and now it doesn't work anymore.

I'm setting #ltargetx #ltargety #ltargetz #ltargetkind #ltargettile to the tree, and using the axe, and then event macro 22...

A message appears: You can't do that.

Anyone know what's causing this?

Cheers!

neo
Title: Re: lumber issue
Post by: Goliath on August 15, 2011, 12:26:56 PM
I haven't yet given it a shot to write a script, but at first glance people are going to need more information.

1) Where are you when it happens (ie.. at home, bank, near a tree)?
2) Does it happen after you recall to a location (ie no axe in hand)?
3) Does it loop and continue you give this message?
4) Any chance I can see it in action?

Or... Maybe I am wrong and someone here can answer this on the fly ;D

Like I said... I haven't made my first script yet... But I would like to consider myself an avid scripter.

On second thought... you would probably be best to ignore me.. LOL
Title: Re: lumber issue
Post by: Neo on August 15, 2011, 12:30:32 PM
Well, I'm just testing some stuff... So, I stand near a tree, double-click my axe, and target the tree. It starts chopping...

Then I set the ltargetx, y, z, etc to the tree's.

Then I try something like this, standing in the same position:

set #ltargetx %1
set #ltargetz %2
set #ltargety %3
set #ltargetkind %4
set #ltargettile %5
finditem %axe C_ , #charid
set #lobjectid #findid
event macro 17
repeat
wait
until #targcurs = 1
event macro 22

Am I doing something wrong?
Weird thing is that this worked for me this morning (unless I'm going crazy or sth), and now I get a message:
You can't do that...
:(

neo
Title: Re: lumber issue
Post by: gimlet on August 15, 2011, 12:39:16 PM
Where did you test?
Title: Re: lumber issue
Post by: Neo on August 15, 2011, 12:43:48 PM
Where did you test?

Malas and Ter Mur so far....
Title: Re: lumber issue
Post by: Neo on August 15, 2011, 12:46:00 PM
Just tested trammel, no luck either!
Title: Re: lumber issue
Post by: camotbik on August 15, 2011, 12:55:12 PM
for example
Code: [Select]
tile Init
  for %x -2 2
  {
    for %y -2 2
    {
      set %xx #CHARPOSX + %x
      set %yy #CHARPOSY + %y
      set #LTARGETX %xx
      set #LTARGETY %yy
      tile Cnt #LTARGETX #LTARGETY 1
      tile Get #LTARGETX #LTARGETY #TILECNT 1
      if tree in #TILENAME
      {
        set #LTARGETTILE #TILETYPE
        set #LTARGETKIND 3
        set #LTARGETZ #TILEZ
        set #LOBJECTID %AXE
        event Macro 17 0
        target 2s
        event Macro 22
        gosub scan_journal
      }
    }
 }

Oh and yes, tile scaning does not work in ter-mur
Title: Re: lumber issue
Post by: Neo on August 15, 2011, 12:57:54 PM
for example
Code: [Select]
tile Init
  for %x -2 2
  {
    for %y -2 2
    {
      set %xx #CHARPOSX + %x
      set %yy #CHARPOSY + %y
      set #LTARGETX %xx
      set #LTARGETY %yy
      tile Cnt #LTARGETX #LTARGETY 1
      tile Get #LTARGETX #LTARGETY #TILECNT 1
      if tree in #TILENAME
      {
        set #LTARGETTILE #TILETYPE
        set #LTARGETKIND 3
        set #LTARGETZ #TILEZ
        set #LOBJECTID %AXE
        event Macro 17 0
        target 2s
        event Macro 22
        gosub scan_journal
      }
    }
 }

Oh and yes, tile scaning does not work in ter-mur
Yeah, I know it doesn't work... But I was manually setting the tile, just to test something, and it's not working... :(
Title: Re: lumber issue
Post by: Neo on August 15, 2011, 01:11:13 PM
Weird...
I just changed the order of this



to this:

set #ltargetx %x
set #ltargety %y
set #ltargetz %z
set #ltargettile %tile
set #ltargetkind %kind

And now it's working! :O

Maybe I had a typo before? Or I dunno... I think I'm spending too much time in front of the computer these days! :)

Thanks for the quick replies guys!

neo
Title: Re: lumber issue
Post by: Hoby on August 15, 2011, 02:52:51 PM
Kudos for you for trying to write a script and being able to trouble shoot it.  Thata more than I've ever done.
Title: Re: lumber issue
Post by: gimlet on August 15, 2011, 03:00:41 PM
Is there a default z value?

Title: Re: lumber issue
Post by: Neo on August 15, 2011, 03:46:15 PM
Is there a default z value?


No, the z value varies too.

neo
Title: Re: lumber issue
Post by: Endless Night on August 16, 2011, 05:09:32 PM
set targetz to 0
Title: Re: lumber issue
Post by: Neo on August 16, 2011, 05:54:17 PM
set targetz to 0
If you set it generically to 0, it'll work for every tree?
Title: Re: lumber issue
Post by: Endless Night on August 16, 2011, 06:30:55 PM
set targetz to 0
If you set it generically to 0, it'll work for every tree?

I believe so yes.
Title: Re: lumber issue
Post by: Neo on August 16, 2011, 06:49:03 PM
set targetz to 0
If you set it generically to 0, it'll work for every tree?

I believe so yes.
Nice, didn't know about that... Thanks for the info...

neo