[Razor] Auto-adding Resources to Crafter's Keys

If you make a Client-side script you can publish it here for other players to use
Locked
Unbeliever
Legendary Scribe
Reactions:
Posts: 287
Joined: Tue Jul 16, 2013 9:08 pm
Location: East Tennessee

[Razor] Auto-adding Resources to Crafter's Keys

Post by Unbeliever »

This should be useful for anyone who really can't stand manually adding reagents and such over and over, or trying to find what the Black Pearl is buried under in your backpack. It's pretty simple to set up - a little slow going perhapns, but once it's done this will save you a TON of time and effort for the rest of your playing days.

Let's just start with adding regs/resources to Spellcaster's Keys. Plan out what you would like to have the macro automatically add to the keys for you. I don't normally have sand in my backpack so I don't have Sand in my macro, but use whatever works for you. Make sure you have at least 1 of each resource you want to add in your backpack. Start recording your macro. Double click your Spellcaster's Keys to open the gump. Click on the "Add resource or item" button and target every one of the items to add. Stop recording the macro. Now you'll have to go in and manually edit.

Your macro will look like this at first:

Double Click (0x41BB7ED7)
Wait For Gump (Any)
GumpResponse (Button 25)
Wait for Target
Wait For Gump (Any)
Absolute Target
Wait for Target
Wait For Gump (Any)
Absolute Target
Wait for Target
Wait For Gump (Any)
Absolute Target
.....and so on.

You want to do the following:
1. Remove the "Wait For Gump (Any)" line in the beginning right after double-clicking the keys and add in a 1.2 or so second pause. [right-click Wait for Target/Special Constructs/Inset Pause/Wait/ 1200 milliseconds]
2. Manually remove all the Wait For Gump (Any) lines in the rest of the macro.
3. Add a Pause .70sec after every Wait for Target line.
4. Right-click on all Absolute Target lines and choose Convert to Target by Type.

Your macro should now look like this:

Double Click (0x41BB7ED7)
Pause 1.20sec
GumpResponse (Button 25)
Wait for Target
Pause .70sec
Target by Type Nightshade (0F88)
Wait for Target
Pause .70sec
Target by Type Sulfurous Ash (0F8C)
Wait for Target
....and so on.


How you close out this macro and deal with the other keys is up to you - and there are two different paths to take here. If you would like to create a separate macro for loading each different crafting key, then what you would do here is this:

Go to your Hot Keys tab in Razor. Expand the Targets menu. Assign a hotkey for Cancel Current Target. Go back to your macro and replace the lines after your last targeted resource with another 1 second Pause, then Begin Recording, use your Cancel Current Target Macro, stop recording. The end of your macro should look like this:

Wait for Target
Pause .70sec
Target by Type Sulfurous Ash (0F8C)
Pause 1.00sec
Exec: Cancel Current Target

At this point you would have a complete Spellcaster Key adding macro from start to finish. Feel free to tweak the pauses to suit your connection and patience. :)

However, it is also possible to chain macros for all the keys together. Instead of adding a Cancel Current Target in, you would tack on another key set the same way you did above: record yourself double-clicking another set of keys, add resources, edit. When you finally have your macro where you want it, then close it out with a Cancel Current Target at the very end.

Important point: Razor does not readily distinguish between different types of ingots, leather, wood, or granite. It naturally sees iron, valorite, and platinum as exactly the same, for example. So creating macros for those resource keys is MUCH simpler than Spellcasters. Instead of targeting each type separately, you create a For/End For loop for however many different types of that resource there are. Using Tailor's keys for an example, there are 11 different types of leather. Since Razor sees them all as "cut up leather (1081)", you'd want to record yourself adding one type of leather to the Tailor's keys and then edit the macro like so:

Double Click (0x442A48D3)
Pause 1.20sec
GumpResponse (Button 999)
Wait for Target
Pause .70sec
For (1 to 11)
Target by Type cut up leather (1081)
Wait for Target
Pause .70sec
End For

The macro will start at the top of the gump list and work its way down in order. It doesn't matter if you don't have all 11 different types in your backpack. Once everything you have has been added, you'll just get a message saying "xxxxxx not found". The macro will still run its course.

Important info:

If there are resources in your immediate area similar to the ones you are trying to add to your keys, the macro may try to grab that instead of what is in your pack, tell you "that is out of range", and get stuck. This would include resources laying on the ground, in containers nearby, or even on corpses. Live monsters and players will not affect the function of the macro.

Though it would be possible to also do this with a Tool House, I don't recommend it because of the potential for making an expensive mistake. If you accidentally added a 4x46 pickaxe in with normal pickaxes, you'd be kicking yourself for days. There is also potential for accidentally mixing in other expensive tools with common ones and it's just not worth the risk.

I hope everyone enjoys this and gets lots of use out of it! If anything I said was unclear or needs further explanation, or if I left anything out, feel free to post questions and I'll help ya out. :D
in-game Thomas Covenant
Unbeliever
Legendary Scribe
Reactions:
Posts: 287
Joined: Tue Jul 16, 2013 9:08 pm
Location: East Tennessee

Re: [Razor] Auto-adding Resources to Crafter's Keys

Post by Unbeliever »

Today a friend of mine suggested that I simply post some handy ready-to-go macros for this purpose. I argued that everyone desperately wanted to read my lengthy guide and create their own macros but, in the end, he won. Listed below are ready-to-go macros. To use them, log out of Excelsior and open your Razor Macros folder (probably under C:\Program Files\Razor\Macros). Copy the macro(s) you want to use, create a notepad document in the Macros folder, paste the text into it, and save it. Then manually replace the .txt file extension with .macro. Next time you start up Excelsior, it'll be in your macro list. IMPORTANT: Right-click on the first line in the macro (which is the double-click keyring action) and choose "Retarget", then target your own crafting keys. This will make sure that Razor has the proper item identifier to use your keys located in your backpack. You might want to edit the length of the pauses in the macro to suit your connection speed and/or patience. You also might want to add in items that the macros below do not include. Each macro only adds in the basic resources those keys hold - my Wood Worker's keys macro adds wood to the keys but not arrows, bolts, etc. If you wish to tweak the macros and add in new resources, please read the instructions in the first post in this thread. Enjoy!

Stone Worker's Keys macro (auto-adds all types of granite):

Assistant.Macros.DoubleClickAction|1130393467|5995
Assistant.Macros.PauseAction|00:00:01.2000000
Assistant.Macros.GumpResponseAction|15|0|0
Assistant.Macros.WaitForTargetAction|30
Assistant.Macros.PauseAction|00:00:00.7000000
Assistant.Macros.ForAction|14
Assistant.Macros.TargetTypeAction|False|6009
Assistant.Macros.WaitForTargetAction|30
Assistant.Macros.PauseAction|00:00:00.7000000
Assistant.Macros.EndForAction
Assistant.Macros.PauseAction|00:00:01
Assistant.Macros.HotKeyAction|1332|

-----------------------------------------------------------------

Spell Caster's Keys macro (auto-adds all normal and necro reagents):

Assistant.Macros.DoubleClickAction|1102806743|5995
Assistant.Macros.PauseAction|00:00:01.2000000
Assistant.Macros.GumpResponseAction|25|0|0
Assistant.Macros.WaitForGumpAction|1750433090|False|300
Assistant.Macros.WaitForTargetAction|30
Assistant.Macros.PauseAction|00:00:00.7000000
Assistant.Macros.TargetTypeAction|False|3976
Assistant.Macros.WaitForTargetAction|30
Assistant.Macros.PauseAction|00:00:00.7000000
Assistant.Macros.TargetTypeAction|False|3980
Assistant.Macros.WaitForTargetAction|30
Assistant.Macros.PauseAction|00:00:00.7000000
Assistant.Macros.TargetTypeAction|False|3973
Assistant.Macros.WaitForTargetAction|30
Assistant.Macros.PauseAction|00:00:00.7000000
Assistant.Macros.TargetTypeAction|False|3972
Assistant.Macros.WaitForTargetAction|30
Assistant.Macros.PauseAction|00:00:00.7000000
Assistant.Macros.TargetTypeAction|False|3963
Assistant.Macros.WaitForTargetAction|30
Assistant.Macros.PauseAction|00:00:00.7000000
Assistant.Macros.TargetTypeAction|False|3974
Assistant.Macros.WaitForTargetAction|30
Assistant.Macros.PauseAction|00:00:00.7000000
Assistant.Macros.TargetTypeAction|False|3981
Assistant.Macros.WaitForTargetAction|30
Assistant.Macros.PauseAction|00:00:00.7000000
Assistant.Macros.TargetTypeAction|False|3962
Assistant.Macros.WaitForTargetAction|30
Assistant.Macros.PauseAction|00:00:00.7000000
Assistant.Macros.TargetTypeAction|False|3983
Assistant.Macros.WaitForTargetAction|30
Assistant.Macros.PauseAction|00:00:00.7000000
Assistant.Macros.TargetTypeAction|False|3615
Assistant.Macros.WaitForTargetAction|30
Assistant.Macros.PauseAction|00:00:00.7000000
Assistant.Macros.TargetTypeAction|False|3966
Assistant.Macros.WaitForTargetAction|30
Assistant.Macros.PauseAction|00:00:00.7000000
Assistant.Macros.TargetTypeAction|False|2426
Assistant.Macros.WaitForTargetAction|30
Assistant.Macros.PauseAction|00:00:00.7000000
Assistant.Macros.TargetTypeAction|False|3620
Assistant.Macros.WaitForTargetAction|30
Assistant.Macros.PauseAction|00:00:00.7000000
Assistant.Macros.TargetTypeAction|False|9911
Assistant.Macros.WaitForTargetAction|30
Assistant.Macros.PauseAction|00:00:00.7000000
Assistant.Macros.TargetTypeAction|False|3965
Assistant.Macros.WaitForTargetAction|30
Assistant.Macros.PauseAction|00:00:00.7000000
Assistant.Macros.TargetTypeAction|False|3969
Assistant.Macros.WaitForTargetAction|30
Assistant.Macros.PauseAction|00:00:00.7000000
Assistant.Macros.TargetTypeAction|False|3978
Assistant.Macros.WaitForTargetAction|30
Assistant.Macros.PauseAction|00:00:00.7000000
Assistant.Macros.TargetTypeAction|False|3983
Assistant.Macros.WaitForTargetAction|30
Assistant.Macros.PauseAction|00:00:00.7000000
Assistant.Macros.TargetTypeAction|False|3982
Assistant.Macros.WaitForTargetAction|30
Assistant.Macros.PauseAction|00:00:00.7000000
Assistant.Macros.TargetTypeAction|False|3960
Assistant.Macros.PauseAction|00:00:01
Assistant.Macros.HotKeyAction|1332|

----------------------------------------------------------

Wood Worker's Keys macro (auto-adds all types of boards):

Assistant.Macros.DoubleClickAction|1143601336|5995
Assistant.Macros.PauseAction|00:00:01.2000000
Assistant.Macros.GumpResponseAction|17|0|0
Assistant.Macros.WaitForTargetAction|30
Assistant.Macros.PauseAction|00:00:00.7000000
Assistant.Macros.ForAction|12
Assistant.Macros.TargetTypeAction|False|7127
Assistant.Macros.WaitForTargetAction|30
Assistant.Macros.PauseAction|00:00:00.7000000
Assistant.Macros.EndForAction
Assistant.Macros.PauseAction|00:00:01
Assistant.Macros.HotKeyAction|1332|

-----------------------------------------------------------------

Metal Worker's Keys macro (auto-adds all types of ingots):

Assistant.Macros.DoubleClickAction|1143587962|5995
Assistant.Macros.PauseAction|00:00:01.2000000
Assistant.Macros.GumpResponseAction|15|0|0
Assistant.Macros.WaitForTargetAction|30
Assistant.Macros.PauseAction|00:00:00.7000000
Assistant.Macros.ForAction|14
Assistant.Macros.TargetTypeAction|False|7154
Assistant.Macros.WaitForTargetAction|30
Assistant.Macros.PauseAction|00:00:00.7000000
Assistant.Macros.EndForAction
Assistant.Macros.PauseAction|00:00:01
Assistant.Macros.HotKeyAction|1332|

---------------------------------------------------------------------

Tailor's Keys macro (auto-adds all types of leather):

Assistant.Macros.DoubleClickAction|1143621843|5995
Assistant.Macros.PauseAction|00:00:01.2000000
Assistant.Macros.GumpResponseAction|999|0|0
Assistant.Macros.WaitForTargetAction|30
Assistant.Macros.PauseAction|00:00:00.7000000
Assistant.Macros.ForAction|11
Assistant.Macros.TargetTypeAction|False|4225
Assistant.Macros.WaitForTargetAction|30
Assistant.Macros.PauseAction|00:00:00.7000000
Assistant.Macros.EndForAction
Assistant.Macros.PauseAction|00:00:01
Assistant.Macros.HotKeyAction|1332|
in-game Thomas Covenant
Cassie
Expert Scribe
Reactions:
Posts: 30
Joined: Sat Dec 14, 2013 5:05 pm

Re: [Razor] Auto-adding Resources to Crafter's Keys

Post by Cassie »

I really appreciate all the work you have done. I must be the only person having trouble with this Macro. I have tried creating it from scratch and I have tried copying your macro and re-targeting the keys. I have also tried re-targeting the regents. It just won't work for me. It runs and keeps saying target can not be found. I am at a loss. Any suggestions?
Unbeliever
Legendary Scribe
Reactions:
Posts: 287
Joined: Tue Jul 16, 2013 9:08 pm
Location: East Tennessee

Re: [Razor] Auto-adding Resources to Crafter's Keys

Post by Unbeliever »

Hi Cassie :) I re-read my first post several times to see if I had left anything out but it looks complete. If you built the macro manually and it still isn't working then you must have skipped a step. Since you got it to run at all and it's giving you the "not found" message, I'd say the most likely thing is that you didn't change the Absolute Target lines to Target by Type.

However, if that's not it, I'd be happy to help you out further. If you want, feel free to Log out of the game, open your macro file in Notepad, copy the entire thing and paste it in a message to me here on the forum. I'll be able to figure out the problem then for sure and message you back a working copy.
in-game Thomas Covenant
Locked