Steam Lumberjacking

Discussion about the technical aspects of scripting. Ask about all issues involving your freelance projects here.
Post Reply
Blarog
Passer by
Posts: 3
Joined: Wed Dec 27, 2017 3:49 am

Steam Lumberjacking

Post by Blarog »

EDIT : Managed an ugly workaround (eww) but if anyone got a better idea im down for it lol. (Ugly workaround in the code section below)

I am trying to make a lumberjacking macro for steam (so far it looks like this)

Code: Select all

if not findalias 'chopper'
  headmsg 'Select your chopping axe (must be equipped)'
  promptalias 'chopper'
endif
if not findalias 'shovelin'
  headmsg 'Select a shovel... yes, a shovel... ugly workaround'
  promptalias 'shovelin'
endif
if not listexists 'trees'
  createlist 'trees'
  pushlist 'trees' 0xce0 //walnut
  pushlist 'trees' 0xcd0 // pine
  pushlist 'trees' 0xcd3 //ash
  pushlist 'trees' 0xcd9 //cedar needle
  pushlist 'trees' 0xce6 //willow
  pushlist 'trees' 0xccd //tree
  pushlist 'trees' 0xcd0 //tree
  pushlist 'trees' 0xcd6 //cedar
  pushlist 'trees' 0xcd8 //cedar 2
  pushlist 'trees' 0xcdd //oak
  pushlist 'trees' 0xce3 //tree
endif
@clearjournal
for 0 to 'trees'
  useobject 'shovelin'
  waitfortarget 15000
  if direction == 0
    targettileoffset 0 -1 0 trees[]
  elseif direction == 1
    targettileoffset 1 -1 0 trees[]
  elseif direction == 2
    targettileoffset 1 0 0 trees[]
  elseif direction == 3
    targettileoffset 1 1 0 trees[]
  elseif direction == 4
    targettileoffset 0 1 0 trees[]
  elseif direction == 5
    targettileoffset -1 1 0 trees[]
  elseif direction == 6
    targettileoffset -1 0 0 trees[]
  elseif direction == 7
    targettileoffset -1 -1 0 trees[]
  endif
  pause 100
  while @injournal "can't mine that"
    pause 2000
    useobject 'chopper'
    waitfortarget 15000
    if direction == 0
      targettileoffset 0 -1 0 trees[]
    elseif direction == 1
      targettileoffset 1 -1 0 trees[]
    elseif direction == 2
      targettileoffset 1 0 0 trees[]
    elseif direction == 3
      targettileoffset 1 1 0 trees[]
    elseif direction == 4
      targettileoffset 0 1 0 trees[]
    elseif direction == 5
      targettileoffset -1 1 0 trees[]
    elseif direction == 6
      targettileoffset -1 0 0 trees[]
    elseif direction == 7
      targettileoffset -1 -1 0 trees[]
    endif
    if @injournal 'not enough wood'
      break
    endif
  endwhile
endfor
.. which KIND OF works, but every macro loop, it tries to target all the tree types. (which is why I put a pause at 75 instead of like 3000) My question is, would there be a way to make it so once it finds that its the "right" kind of tree in front of me, it stops cycling through the lists? I tried findtype but it doesn't find the trees since they are static objects. Tried about everything I thought of, but maybe someone will have a sudden insight when seeing this (its been a long week at work so maybe I am overlooking a tiny detail).

Would it be possible to "detect" when I start swinging my axe, so that would mean its targetting the right tree? My issue is that when it targets a tree from the list that isn't the tree in front of me, I get no journal error or anything, so I can't do a simple if @injournal 'whatever'...

I want to do it with steam because its kind of easy to tweak afterward (once I add the checks for weight then chopping all logs into boards > sending them into the wood keys), and welp, because I am a total newbie with EasyUO and I am not sure I want to spend dozens of hours delving into documentation to write something simple (but complex for a newb at that language).

If someone has an idea, I am all ears.
User avatar
Alamiester
Legendary Scribe
Posts: 279
Joined: Wed Jan 04, 2017 8:49 pm

Re: Steam Lumberjacking

Post by Alamiester »

ive been playing around with a lumberjacking macro the last few days. i like your thinking on how to target the trees. but when i messed around with it i couldnt get uosteam to recognize the trees in a list because they arent an item or a mobile. the easiest way i could figure was to target each tree, and reset the macro when its out of wood. and to make matters worrse logs havto be chopped now before they go into keys, so you havto select each wood color before its chopped. really slows down the process of adding wood to keys. i will post my tree chopper as soon as i play around a little more with the delays. i think i can get it a little faster. :displeased:
Ghurdo
Apprentice Scribe
Posts: 10
Joined: Fri Aug 03, 2018 10:36 pm

Re: Steam Lumberjacking

Post by Ghurdo »

I just posted the UOSteam macros I use for lumberjacking before reading this thread. Trees are targeted as tiles, not objects. I basically just use an equipped hatchet object and allow the user to target a tree. Wait for journal entries and then use " targettile 'last' " to re-target that tree. You can also use relative tile targeting to target a tree you are facing using: " targettilerelative 'self' 1 'false' "

If you would like to look at how my lumberjacking macro works, take a look at the macros I posted for harvesting wood here.

[UOSteam] Lumber Harvesting System

-Ghurdo
Post Reply