Would you like to react to this message? Create an account in a few clicks or log in to continue.

    Macros 201: Advanced scripting

    Danarius
    Danarius
    Noobie
    Noobie


    Number of posts : 16
    Points : 5569
    Registration date : 2009-02-24

    Macros 201: Advanced scripting Empty Macros 201: Advanced scripting

    Post  Danarius Tue Feb 24, 2009 5:19 pm

    Now then, assuming that you have brushed up on the basics >>HERE<< or have a pre-existing knowledge from past gaming endevors, lets take a little deeper look into what can be done with this wonderous macro thingy!

    All credit for these finding goes to TheGooch of the RoM-EN forums unless otherwise stated.


    Each Content links to the post with the explanations and details.

    Contents:(anything without a name on it is founded by TheGooch)

    Changing Width of Chat Frame and Relocating the Framerate text(Ctrl+X)
    If you always party with only one other person then here's some handy macros.
    Put the open backpack where you want.
    Cancel Buff by Index(Number)
    Using skills through hotbar slots
    Numbers for all hotbar slots
    Moving the Casting Bar
    Moving the "Equipment Damaged" Graphic
    Move/Disable the Scrolling Text
    Open Bank, House Chest, Character Window
    Creating an Echo(message only you can see)
    Checking the amount of HP a mob has(before attack)
    Assisting Person(requires targeting that person first)
    Get targets Primary/Secondary calsses in chat frame

    These only scratch the surface, there is far more you can do with the current macro system.

    The original thread can be found >>HERE<< and there is a wealth of user-created macros that can be found.

    Terms/Syntax/General Information to know:

    /script - Needs to be in the Macro of Most if not all of the Macros listed above. It Tells the Macro System to access the LUA Functions in the RoM API. Like the /cast function which tell the system to access the Cast Function.

    Syntax of an if/else statement -

    Code:
    /script if (*Condition*) then *Action*; else *Action*; end

    Example:

    Code:
    /script if (UnitHealth("player")/UnitMaxHealth("player")<=.85) then UseAction(9); elseif (UnitHealth("player")/UnitMaxHealth("player")<=.90) then UseAction(11); else UseAction(13); end

    The semicolon (; ) - is used to mark the end of a statement, its like the period (.) in english. It is better to learn from example, look at the above example and guess why the (; ) is there.

    Character Limit - Macros are limited by a certain number of characters(letters) allowed per Macro. There are ways to connect Macros, and you'll see a few in the list above.

    RoM/WoW Similarities - A lot of functions are similar to the WoW API (WoW Wiki) so some functions from WoW may work in RoM.

    Tips:



    Originally Posted by Stormbow
    Tip: Throw all your UI mods on one of your unused Quick Bars (I use Left Bar: 61-80, which is not visible on my screen) and use the /script UseAction(61); UseAction(62); UseAction(63); etc. script to activate all of them from one visible quick bar slot.




    You can stack multiple items under one /script command (but the macro's only allow a certain number of characters)(separate with a semi-colon( ; ))


    Originally Posted by TheGooch
    This tip isn't a macro, but it's related to macros. Often you write macros under one character but want your other characters to be able to use it as well. If you're familiar with windows and copying files, it's pretty easy to do, and faster than logging in as each character and re-creating the macro's over and over for each character.

    If you're using Windows Vista, your macro file is here:
    C:/Users/[your windows user name]/Documents/Radiant Arcana/[character name]/Macro.bsd

    If you're using Windows XP, your macro file is here:
    C:/Documents and Settings/[your windows user name]/My Documents/Radiant Arcana/[character name]/Macro.bsd

    Just copy the Macro.bsd file from the character name folder that has the most up-to-date macros into each of your other characters folders (overwriting them if they exist). The next time you log in as those characters you will have all your latest macros and just need to drag the ones you want onto your hotbar.

    So, there is a taste of what others have discovered and I will be sharing a few that I commonly use. Lets help each other learn the intricacies of what all can be done and make our gaming lives a little bit easier/more enjoyable!
    I'm also linking >>THIS<< for those that may have a more intimate knowledge of scripting or for the ones like me that just like to play with some commands every now and again to see what can be done.

    Enjoy all and feel free to post up your findings! cheers
    Danarius
    Danarius
    Noobie
    Noobie


    Number of posts : 16
    Points : 5569
    Registration date : 2009-02-24

    Macros 201: Advanced scripting Empty A few little tidbits I use....

    Post  Danarius Tue Feb 24, 2009 5:41 pm

    Auto-Rebuff Loop

    Code: Macro1
    /cast Holy Seal
    /wait 1.2
    /cast Enhanced Armor
    /wait 60
    /wait 60
    /wait 60
    /wait 60
    /wait 50
    /script UseAction(11)
    Code: Macro2
    /script UseAction(59)

    This two-part macro set allows me, with a single button press, to use both buffs (Knight), waits 4min 50secs of the 5min buff times, then automaticaly rebuffs. See how Macro1 casts both buffs, waits for the buff run time, then directs action to the hotbar number containing Macro2. Then Macro2 effectively looping action back to the hotbar number containing Macro1. Keeping in mind the global cool down(GCD), if I am spaming skills at the time the loop goes to rebuff, one or both may be missed due to the GCD being in effect. To cancel the looping effect, simply move one of the macros to a different hotbar location. With this setup, I move Macro2, resting in hotbar number 11 usualy, to another slot to cancel the loop since Macro1 is not visible on my screen.


    Quick Weapon Set Switch

    Code: 2H Weap
    /script UseAction(51)
    Code: Sword/Shield
    /script UseAction(52); UseAction(53);

    Same as can be done with potions, other items may be placed in hotbar slots. To do this, I place my CURRENT weapons/shield into the hotbar slots described above which are hidden on my screen. Then place the two macros in accessable hotbar slots.
    Note: Using this requires that if/when you change weapons that you will be using, you also replace them in their hotbar locations as well. The items must also be in your backpack for this to work.


    Auto-Pot Loop

    Disclaimer: This macro set is in no way perfect and depending on the status of GCD, may not actualy hit precisely uppon conditions met. It is not suggested that this setup be to heavily depended uppon as doing so can result in death of toon. Use at your own risk.

    Code: Macro1
    /script if (UnitHealth("player")/UnitMaxHealth("player")<=.75) then UseAction(71);end
    /wait 1.5
    /script UseAction(49)
    Code: Macro2
    /script if (UnitMana("player")/UnitMaxMana("player")<=.6) then UseAction(72);end
    /wait 1.5
    /script UseAction(60)

    This set, as before with the Auto-Rebuff, is made to loop on its self. The if/then scripts you see used here are monitoring HP/MP, using a mathmatical formula to determine percentage of each, and when HP/MP fall to or below the set percentage, using the appropriate action which contain potions. The "/wait" commands seen here represent the cool times on the potions so that the macro isnt constantly trying to use the prescribed potion while on cool time if the set conditions still exist. It's not perfect but has proven usefull when grinding dailies and has, on more than one occasion, kept me alive on instance runs when I was being neglected by the priest(s). Evil or Very Mad

      Current date/time is Sun May 19, 2024 8:06 pm