Autonomous Crafting Macro. Razor + House required!

Playguides written by Staff and Players.
Much more information on specific skills can be found in our T2A wiki.
Post Reply
Paradox Equation
Posts: 5
Joined: Fri Nov 13, 2009 3:22 pm

Autonomous Crafting Macro. Razor + House required!

Post by Paradox Equation »

Hey guys, this is my first post on the UOSA forums. I've only been on the shard for a few weeks but I've got my roommate addicted and by utilizing teamwork we've been able to do pretty well. He never played UO, so it's satisfying to see UO's unique gameplay dynamics appealing to a "newschool" style gamer.

I played back in 98-01' and T2A Era UO was the most fun I ever had playing any game, period. I wrote for, anyone remember me?

Anyways, I decided to officially say hello by sharing this tailoring macro I created last night and successfully tested. It's not the simplest of macros but I will try to provide easy instructions that anyone can follow as well as a brief rundown of pros versus cons of this macro against others.

If anyone has suggestions that could improve my macro's efficiency, please share them!

NOTE: This is NOT for resource gathering. This is for CRAFTING ONLY, as per shard rules.


Goal of this macro: To autonomously craft the same item repeatedly, using a large quantity of materials and tools. This macro can be used for hours without intervention, as it will fill up to 4 containers with the products of your crafting and restock on tools and materials without breaking the macro.

WHAT YOU'LL NEED: A house. A locked down container with a supply of sewing kits and your pile of hides. up to 4 locked down boxes for depositing finished goods. I used about 25 sewing kits and a pile of 6000 leather, and the macro took care of itself all night long.

STEP 1, INSTALLING MACRO: Make sure razor and UO are closed. Open your RAZOR Directory. Inside should be a folder titled "Macros". Open it. Use notepad to make a new text file in Macros, and cut and paste the following code into it:

Code: Select all

Assistant.Macros.HotKeyAction|0|Organizer Agent-2
Assistant.Macros.HotKeyAction|0|Organizer Agent-3
Assistant.Macros.HotKeyAction|0|Organizer Agent-4
Assistant.Macros.HotKeyAction|0|Organizer Agent-5
Assistant.Macros.HotKeyAction|0|Restock Agent-3
Assistant.Macros.HotKeyAction|0|Restock Agent-2

Save this file and name it to whatever.macro

Choose an appropriate name for your macro, I picked tailoring for mine. So the resulting filename looks like: tailoring.macro


Before this macro will function you will have to perform the following tasks:

Under the Agents tab in Razor

A. Set Organizing Agents 2, 3, 4, and 5. Click the "Add item" button and add the items you will be crafting to each agent. For me from 70 to 80, this was leather bustiers. Then have 4 locked down containers near your character. Set the hot bag for each organizing agent to each of the locked down containers. This will allow the macro to sort your finished products into the containers, allowing you to craft 500 items and then fill up your backpack before intervening in your macro.

B. Set Restock Agents 2, 3 The macro will use Restock 2 to restock sewing kits and Restock 3 to restock leather. Add these items to their respective agent. Set your sewing kit restock quantity to 1. THIS IS IMPORTANT. Razor doesn't handle more than one kit at a time very well using T2A style crafting.

Make sure that your Restock 3 quantity allows you to have materials left over in your stack after crafting at least two iterations, this will allow razor to keep your materials on an Absolute Target, which works more smoothly. If the materials are fully consumed in your pack before restocking, it will break the macro.

C. Set your targets. Go to the Macros tab in Razor. Select the macro from the list, it should be named after whatever you called the textfile from step 1. Scroll down the macro and highlight the "Absolute Target" after each of the restocks in Razor. Right click them and "retarget" them, and make sure to target the box containing your leather and your kits.

STEP 3: Record crafting your item

Look at these lines of the macro in Razor:

Double Click (sewing kit)
wait for target
absolute target
wait for menu (any)
menuresponse (3)
wait for menu (any)
menuresponse 1

These lines tells razor to craft Studded Gorgets specifically. If you want to craft something else, you will have to delete them and right click to "Record from here". Then record yourself crafting your item by selecting it in the gump menu. Make sure your double click for the tool is set to TYPE. Make sure your material is set to that second ABSOLUTE TARGET.

Voila, you're ready to go.


This macro makes razor select the item from a gump menu. While the item is crafting, each of the 4 organizing agents go off and deposits any items from the last iteration in one of the four locked boxes. If container #2 is full, then #3 will start filling up. If both #2 and #3 are full, #4 begins to fill, etc. As soon as the crafting sequence is finished and the item is either created or fails, the restock agent 3 first refills your leather supply, then 2 refills your sewing kit. Make sure the count on the sewing kit agent is set to 1, or the macro might get confused!

This agent is set to the end of the macro, because the server checks to see if a kit was destroyed on use only after the item is successfully crafted. Otherwise it would check for restock, see you don't need a kit, and then the kit would be destroyed, breaking the macro until timeout. I like to individual set timeout values on pertinent steps in the macro to 15, which is sufficient to account for worldsaves and lets your macro get going in about a minute after a step fails.

-Can craft thousands of materials into 500+ items without any intervention whatsoever.


-Hands off after setup.

-Can be used for almost any crafting skill with little editing.

-Not perfectly efficient. Crafting time (for me tailoring) seems to be about 9 1/2 seconds. This macro iterates in about 13 seconds, give or take some. This is because all of the restocking and organizing occurs every single iteration The macro uses the crafting time to run the agents, but it takes a few extra seconds to avoid hangups with all 6 agents.

-You need to have a house for maximum efficiency. Altering the macro to restock from a bank would work fine, but the bank is not sufficient to store the hundreds of items you can make over the course of a few hours. If you do this, cut out the organizing agents and manually sell/cut/whatever every time your pack fills up.

-Slightly tricky setup.


It seems to me I could make this macro perfect if I could figure out how If Conditionals work in Razor. My first attempt involved these but I could never get it to work right. Only restocking when necessary would cut a lot of the time out of each iteration.

Let me know your thoughts, guys. Happy mule-ing!


UOSA Subscriber!
UOSA Subscriber!
Posts: 380
Joined: Tue Jul 28, 2009 5:58 pm

Re: Autonomous Crafting Macro. Razor + House required!

Post by zzyzx »

Do you log in to IRC? I consider myself an expert in Razor. I have created some very complex macros and I enjoy helping people out with macroing related questions.
<Derrick> I guarantee world peace will not be seeded in a UO FreeShard IRC channel

Rick Scarf
Posts: 112
Joined: Mon Feb 07, 2011 9:08 pm

Re: Autonomous Crafting Macro. Razor + House required!

Post by Rick Scarf »

Just wanted to bump this thread because while it is a pain to set up the first time, this macro made me thousands upon thousands of fancy shirts in a fairly pain-free way.

Posts: 423
Joined: Tue Feb 16, 2010 6:52 pm
Location: United States

Re: Autonomous Crafting Macro. Razor + House required!

Post by Eastwood »

I'm running a crafting macro that looks like this,

Exec: Restock Agent -1 (restocks perfectly with my object delay set to 1 sec)
Absolute Target (chest full of boards/ingots/whatever)
Pause 2.00sec (This is for the restock, is this necessary? Razor just blows through it anyways)
Double Click (draw knife (10E4)) -carpentry tool I happen to be using, have 10 of these in bag
Wait for Menu (any) - This is where razor constantly hangs up and causes a Timeout of 5 minutes
MenuResponse 4 (shields in this case)
Wait for Menu (Any)
MenuResponse 1
Pause 9.50sec (To allow for item to be made)

I was finding it to hang up whenever the server goes through its saving process. I used to macro crafting a lot about a 10-12 months ago and do not recall having a problem with this while going through Smithing, Tinkering, or Tailoring.

Is there a way to avoid this hang up during the server saving process?


Catskills 97-99

User avatar
UOSA Donor!!
UOSA Donor!!
Posts: 1391
Joined: Sun Dec 06, 2009 6:30 pm
Location: Dennis, Strongbadia

Re: Autonomous Crafting Macro. Razor + House required!

Post by fox_phyre »

Hehe I find it funny this thread gets looked at from time to time because the person who brought me here wrote it (my old roommate, long since lost to stagnation).

The only way to deal with hangups afaik is to edit your timeouts for targetting (or Wait for menus) etc down to a few seconds from the stock 5 minute timeout period.
Visit my shop in Yew! First house west of Yew Moongate, always stocked!

UOSA Subscriber!
UOSA Subscriber!
Posts: 76
Joined: Fri Mar 13, 2009 9:43 pm

Re: Autonomous Crafting Macro. Razor + House required!

Post by jmerchant »

there is an easy way around getting hung up on world saves -

if sys message = "the world"
pause 30 sec
end if

put it in before you craft each item and you're set.

Post Reply

Return to “Guides”