New Player Magery Training | Intro to Razor Scripts

Discussion in 'Guides' started by shinra tensei, Jun 25, 2022.

  1. shinra tensei

    shinra tensei New Member

    Joined:
    Jun 9, 2022
    Messages:
    2
    Likes Received:
    4
    Hello,

    I have made a script for training Magery from 50-100 using the Razor Scripting options. With this script you will not need to worry about wasting regs or having to setup multiple macros based on the spell you need to cast for gains. As a new player it can be kind of odd having a third party assistant such as Razor while playing a game. This script will also introduce you to some capabilities of Razor. Much of the setup of this script can be applied to other areas of the game to improve quality of life while playing the game.

    First you will want to start off by setting up a few restock agents:
    (navigate to agents in razor then click add and use the in game target to target the regs)

    Restock Agent 2
    Restock2.png

    Restock Agent 3
    Restock 3.png

    Restock Agent 4

    Restock 4.png

    Restock Agent 5

    Restock 5.png

    Next you will need to create some variables for the script:
    (navigate to scripts in razor, click options then click add and use the in game target to target each variable)

    myspellbook
    some spells allow you to cast on your spellbook, doing this will not require you to heal yourself with another character.

    mycharacter
    this variable will be used to target any character besides the caster, this will let you train resist on a character that needs it if the one casting it will not be using that skill.

    regs
    this script will require you to have all your regs inside of a container in your house or bank, it will use the restock agents to take one of each reg for the spell you are casting. add the container your regs are in as this variable.

    varaibles.png

    Alternative Targets
    This script is customizable, depending on your needs you can adjust the targets within the script, simply adjust the lines that say: target 'variable' to your needs.
    Just be sure not to adjust ANY lines with the 'regs' variable or you will break the script.

    The End!
    gm magery.png

    Code:
    if skill 'magery' = 100
        overhead 'It is about goddamn time'
    endif
    if mana < 35
        overhead 'Out of mana'
        skill 'meditation'
        pause 15000
    endif
    if skill 'magery' < 60
        restock 02    // Razor > Agents > Restock-02 > Add Black Pearl, Bloodmoss, Spider Slik
        target 'regs'
        overhead 'Getting regs'
        wait 3500
        cast 'mana drain'
        waitfortarget 2500
        target 'myplayer' // Razor > Scripts > Options > Add any character other than yourself
                           
            elseif skill 'magery' < 80
            restock 03  // Razor > Agents > Restock-03 > Add Bloodmoss, Nightshade
            wait 3500
            target 'regs'
            overhead 'Getting regs'
            cast 'invisibility'
            waitfortarget 3500
            target 'self'
    endif
    if skill 'magery' < 90
        restock 04 // Razor > Agents > Restock-04 > Add Sulfurous Ash, Spider Silk
        wait 3500
        target 'regs'
        overhead 'Getting regs'
        cast 'flamestrike'
        waitfortarget 3500
        target 'myspellbook' // Razor > Scripts > Options > Add any character other than yourself
                  
           elseif skill 'magery' < 100
            restock 05 // Razor > Agents > Restock-05 > Add Bloodmoss, Ginseng, Garlic
            wait 3500
            target 'regs'
            overhead 'Getting regs'
            cast 'resurrection'
            waitfortarget 4000
            target 'myspellbook' // Razor > Scripts > Options > Add Spellbook within your bag
    endif
    replay
    
    Last edited: Jun 25, 2022
    Banyon, Sayer, Codus and 1 other person like this.
  2. fefe

    fefe Active Member

    Joined:
    Sep 30, 2015
    Messages:
    116
    Likes Received:
    48
    I used this for 3 of my characters after the recent resist event. GM magery has never been easier, thanks for making this.
    shinra tensei likes this.
  3. Unternoober

    Unternoober Member

    Joined:
    Jan 11, 2022
    Messages:
    67
    Likes Received:
    48
    I love seeing skill-gain automations shared, thank you for getting this out there! And thank you for doing it in script format-- our forums have an overwhelming number of macros that are difficult to understand without cut/pasting them in, so it stands to reason that most readers won't take the time to consider the contents thoughtfully.

    In that vein, please consider the following a code review.... that is, I have some suggestions that might improve what you have here, but I support the thrust of what you're doing and how you've done it and would like to see it adopted :)



    Suggestion for simpler script-setup generally: have your restock agent restock all materials needed for the entire script. E.g. in the case of magery, have a single one which restocks 10x of all 8 reagents.

    Restocking only takes ~600ms per item moved into your inventory(500ms + your ping time). If you're restocking 3 items, the 3500ms wait you have baked in here could be shortened to 1800ms or so.... Seems trivial, but over the course of several thousand casts it'll save you several hours.

    The timeouts in `wait` could be tuned-- 3500-4000ms is neither low enough to save time, nor high enough to account for server saves without doing something weird. Generally speaking, you want to either wait forever (Razor times out at 60 seconds anyway), for 16 seconds (to allow for a server save), or the exact amount of time you expect if you need really tight timing for some reason. For skill macroing, I'd recommend just going with the 16000ms delay to allow for server saves.

    This script will attempt to cast resurrection even if you don't have enough mana: it meditates if mana is <35, but it may not recover to >50 in the 15 seconds of meditation.
    I suggest changing that block to:
    Code:
    if mana < 50
      skill 'meditation'
      pause 10000
      loop // <--- this will cause it to check again if there's enough mana, and re-meditate if still not enough
    
    This script will keep eating up reagents even if you've GM'd magery... it prints an overhead message if you're at GM, but keeps on casting. I suggest changing the last line to:
    Code:
    if skill 'magery' < 100.0
    
        loop
    endif
    Finally, if you're optimizing for *time* rather than efficient use of reagents, you're better off casting spells as soon as you're capable of succeeding even a small fraction of the time. For my characters (which I usually get to GM resist in an event before I've decided what template they'll be) I do:
    Code:
    vendor trained -> 50 (shown skill): lightning
    50 -> 60: paralyze
    60 -> 70: energy bolt
    70 -> 80: flamestrike
    80 -> 100: resurrection
    All spells targeted at my spellbook because again, I'm getting resist elsewhere. This does cost more than if you cast flamestrike all the way to GM, but it's noticeably faster.
    shinra tensei likes this.
  4. fefe

    fefe Active Member

    Joined:
    Sep 30, 2015
    Messages:
    116
    Likes Received:
    48
    I can confirm the script stops at GM magery.
    shinra tensei likes this.
  5. Unternoober

    Unternoober Member

    Joined:
    Jan 11, 2022
    Messages:
    67
    Likes Received:
    48
    Ahh I see, it does have a check for magery < 100 before casting res. It'll loop indefinitely, but it won't eat regs.
  6. shinra tensei

    shinra tensei New Member

    Joined:
    Jun 9, 2022
    Messages:
    2
    Likes Received:
    4

    Appreciate the response,

    This script is purposely imperfect. I once had a friend who wouldn't try UO because he "didn't have a computer science degree". This is to show someone without any experience they can fumble through a lot of this to accomplish what they are trying to do. You could condense this script a lot and make it much more efficient but it will GM your magery in about 2 days or so. Perfect for a casual new player and it also introduces them to creating agents in razor and calling variables they've added in themselves. Many things could change such as setting the variables within the script instead of doing them manually.

    You do seem to have a good understanding of programming and I appreciate the well thought out response. :)
  7. Hydaelyn

    Hydaelyn New Member

    Joined:
    Jul 22, 2022
    Messages:
    12
    Likes Received:
    3
    @shinra tensei question for you. I copied everything exactly as shown with the exception all targeting is my spell book. However, when I am running it (current shown skill imagery is 56) it'll go to cast Mana Drain and follow up with a Flame strike. Now, I believe that shouldn't be the case right? It should continue to spam Mana Drain until I cross 60 then move to invisibility. Any thoughts as to why its casting Flamestrike?

Share This Page