Magery Macro with Restock, Health Checking

Discussion in 'Guides' started by Errant, Feb 11, 2014.

  1. Errant

    Errant New Member

    Joined:
    Feb 11, 2014
    Messages:
    5
    Likes Received:
    3
    Someone asked me for the code so I adapted it to their requirements. Thought I'd just share it.

    Code:
    !Loop
    Assistant.Macros.IfAction|50|0|30|Mandrake Root
    Assistant.Macros.SpeechAction|0|52|3|ENU|2|16|2|bank
    Assistant.Macros.HotKeyAction|0|Restock Agent-2
    Assistant.Macros.AbsoluteTargetAction|0|0|1078300718|84|147|0|3702
    Assistant.Macros.PauseAction|00:00:06
    Assistant.Macros.EndIfAction
    
    Assistant.Macros.IfAction|0|0|40
    Assistant.Macros.HotKeyAction|1391|
    Assistant.Macros.HotKeyAction|1059|
    Assistant.Macros.PauseAction|00:00:03
    
    Assistant.Macros.ElseAction
    Assistant.Macros.HotKeyAction|3002040|
    Assistant.Macros.WaitForTargetAction|30
    Assistant.Macros.PauseAction|00:00:01.5000000
    Assistant.Macros.AbsoluteTargetAction|0|1|14669|2137|293|27|400
    Assistant.Macros.PauseAction|00:00:01
    Assistant.Macros.IfAction|1|0|20
    Assistant.Macros.HotKeyAction|1044106|
    Assistant.Macros.WaitForStatAction|1|1|40|3600
    Assistant.Macros.EndIfAction
    A line by line description for those who don't understand coding:

    Line 1: is a simple true false statement. If Mandrake < 30 it will execute line 2, 3, 4 and 5
    Line 2: Makes your character say "Bank"
    Line 3: is the restock agent found under the agents tab. Add the reagents you want there.
    Line 4: should be your character in game (if your reagents are in the main portion of your bank box)
    Line 5: modify to desire.
    Line 6: Goes with line 1. End If statements close out the If statement. For example, if this was not included EVERYTHING after this would be in the original if statement. So, to cast your spells your mandrake would have to be less than 30. Otherwise it would loop infinitely and do absolutely nothing.

    Lines: 7, 8, 9, 10
    Is hits < 40: true or false?
    is it is true? Cast heal self, target self.
    Lines: 11, 12, 13, 14, 15, 16
    Is it is false? Cast lightning, target absolute target.
    Note: Right click absolute target and click re target. Use this to target yourself or another player
    Lines: 17, 18, 19, 20
    Is mana < 20?
    Is it true? Meditate, wait for mana to be > 40.
    Is it false? Go back to Line 1



    Check on learning:

    a = 2;
    b = 3;

    If( a > b )
    This is NOT true, it will not execute.​
    Else
    This WILL execute because a is NOT greater than b​

    If( b > a )
    This IS true​
    Last edited: Feb 11, 2014
    Samorite and Brookstorm like this.
  2. Brookstorm

    Brookstorm New Member

    Joined:
    Feb 11, 2014
    Messages:
    1
    Likes Received:
    0
    Thank you Errant.
  3. Pirul

    Pirul Well-Known Member
    UO:R Subscriber

    Joined:
    May 16, 2013
    Messages:
    3,219
    Likes Received:
    2,469
    I think there's room for improvement, but the main thing would be to include a second health check.

    Casting, targetting and damage have a delay, so the appropriate person with enough patience can kill you. I'd suggest doing another health check between the actual casting and the targetting, like so:

    If HP > XX
    Cast XXX (lightning, e-bolt, FS)
    Wait for target
    IF HP > XX
    Target self

    Another important thing I almost missed is that you seem to be restocking from your bank. And you restock 30 ea reg, this will make lowly bank thieves VERY happy, as they will steal all your regs at their hearts content. When restocking from the bank, restock 1 ea. Sure, the delay is slightly longer, but you need to med up anyway, so no big deal. It will save you a ton of regs.
  4. Errant

    Errant New Member

    Joined:
    Feb 11, 2014
    Messages:
    5
    Likes Received:
    3
    Yes it isn't meant to be perfect. Just a means to an end with an explanation. Was trying to help him get set up with macros and understand how to code a macro.

    But thanks :)

Share This Page