The (almost) completely automated Remove Trap macro

darthdeus

Journeyman
Disclaimer: I'm very new to UOF. I have played UO on and off for the past 8 years, but mostly on shards with very different settings. All of this is very new to me, so I might be doing things in a very inefficient way. If so, please do tell me :)

I've been looking for a way to more easily level up Remove Trap, but there doesn't seem to be anything that would work on UOF (if I missed something, please do tell me).

So I decided to write the macro myself. It's still very early and probably broken in a lot of ways, especially since my experience with UOSteam has been less than a week, and their documentation is quite horrible (and the language itself lol). I'll be happy if you can point out ways in which the macro can be improved.

---

This macro is intended to run with two characters, one with tinkering, and another one with remove trap. If you're running both tinkering and remove trap on the same character, you can't use this macro (but you can write a different one, that will probably be much easier).

There's one macro that runs on the tinkerer, and one on the remove-trapper. Both of these assume there are exactly 13 trappable boxes. If you have a different amount, simply change 13 to something else (in both macros).


First the tinkerer

Code:
if not listexists 'boxes'
  clearlist 'boxes'
  createlist 'boxes'
  clearjournal
  for 13
    promptalias 'box'
    pushlist 'boxes' 'box'
  endfor
endif
for 0 to 'boxes'
  sysmsg 'starting on box'
  if usetype 0x1ebc 0x0 'backpack'
    replygump any 2
    waitfortarget 15000
    target boxes[]
    waitforgump any 15000
    sysmsg 'box trapped, next one'
  endif
endfor

and the remove-trapper

Code:
if not listexists 'boxes'
  clearlist 'boxes'
  createlist 'boxes'
  clearjournal
  for 13
    promptalias 'box'
    pushlist 'boxes' 'box'
  endfor
endif
for 0 to 'boxes'
  clearjournal
  while not @injournal 'carefully' 'system'
    useskill 'Remove trap'
    waitingfortarget 3000
    target boxes[]
    pause 11000
    if injournal "That doesn't appear to be trapped." "system"
      sysmsg "Skipping to the next one"
      break
    endif
  endwhile
endfor

The macro also assumes Tinker's tools. I'm not sure if there's a different way to do tinkering on this shard.

One thing the macro does not do is check if adding the dart trap to the container was successful. I skipped this part both because I don't know how to do it, and because my craft has almost 90% success rate on those traps, so it doesn't hurt him that much. If you know how to check if a craft result was successful, please do tell me. My current solution is to simply run the macro twice, since that results in just 1% chance to fail to trap a box.

If you can manage to share the container between both characters, you can simply run the macro and be happy. But since I don't have a house, I have to run the macro on one, wait until it completes, give it to the other character, and run the macro there ... but since removing the traps takes about 10-15 minutes, it's still better than doing it by hand.

If you have any thoughts on how to share the container, I'll be happy if you post them in the replies.

I've just finished writing the macro, and will probably improve it soon. I'll be updating this post when that happens.
 
Last edited by a moderator:
Top