Welcome to the Rise of Agon Community

Create an account today to engage in discussions and community events on the Rise of Agon forums.

Enchanting Macro

Discussion in 'New Player Tips & Tricks' started by RabbleRabble, Aug 18, 2018.

  1. RabbleRabble

    RabbleRabble Deadeye
    Legend

    Joined:
    Oct 17, 2015
    Messages:
    160
    Likes Received:
    135
    Here is an enchanting macro for AHK:
    ctr+alt+ a starts it
    Hold F11 to stop

    to set each position Hold control then the appropriate F1-F12 key

    F1: middle of the enchanting box where you drag the item to enchant(set the position right in the middle)
    F2/F3/F4 are the posiitons you drag your enchant mats to in the UI
    F5 is the catalyst on the UI
    F6 is where you want the item to be drug back to after enchant
    F7 enchant button
    F8/F9/F10 are the enchanting mats in your bag
    F11 catalyst in your bag
    f12 item to enchant


    Code:
    Class Position {
        X := 0
        Y := 0
        __New(x, y) {
            this.X := x
            this.Y := y
        }
    }
     
    
    
    ;Ctr F1 sets position of Item Target
    ^F1::
    {
    
    MouseGetPos, xt, yt
    ItemTarget := new Position(xt,yt)
    }
    return
    
    ;Ctr F2 sets position of MatTaget1
    ^F2::
    {
    MouseGetPos, xt, yt
    MatTarget1 := new Position(xt,yt)
    }
    return
    
    ;Ctr F3 sets position of MatTaget2
    ^F3::
    {
    MouseGetPos, xt, yt
    MatTarget2 := new Position(xt,yt)
    }
    return
    
    ;Ctr F4 sets position of MatTarget3
    ^F4::
    {
    MouseGetPos, xt, yt
    MatTarget3 := new Position(xt,yt)
    }
    return
    
    
    ;Ctr F5 sets position of Catalyst
    ^F5::
    {
    MouseGetPos, xt, yt
    CatalystTarget := new Position(xt,yt)
    }
    return
    
    ;Ctr F6 sets position of ItemBackTarget
    ^F6::
    {
    MouseGetPos, xt, yt
    ItemBackTarget := new Position(xt,yt)
    }
    return
    
    ;Ctr F7 sets position of EnchantClick
    ^F7::
    {
    MouseGetPos, xt, yt
    EnchantClick := new Position(xt,yt)
    }
    return
    
    ;Ctr F8 sets position of Mat1
    ^F8::
    {
    MouseGetPos, xt, yt
    Mat1 := new Position(xt,yt)
    }
    return
    
    ;Ctr F9 sets position of Mat2
    ^F9::
    {
    MouseGetPos, xt, yt
    Mat2 := new Position(xt,yt)
    }
    return
    
    ;Ctr F10 sets position of Mat3
    ^F10::
    {
    MouseGetPos, xt, yt
    Mat3 := new Position(xt,yt)
    }
    return
    
    ;Ctr F11 sets position of Catalyst
    ^F11::
    {
    MouseGetPos, xt, yt
    Catalyst := new Position(xt,yt)
    }
    return
    
    ;Ctr F12 sets position of Item to enchant
    ^F12::
    {
    MouseGetPos, xt, yt
    Item1 := new Position(xt,yt)
    }
    return
    
    
    
    
    
     
    ;Show positions
    ^!q::
    {
        showPosition(ItemTarget)
        if GetKeyState("F11", "P") {
            return
        }
        showPosition(MatTarget1)
        if GetKeyState("F11", "P")
            return
        showPosition(MatTarget2)
        if GetKeyState("F11", "P")
            return
        showPosition(MatTarget3)
        if GetKeyState("F11", "P")
            return
        showPosition(CatalystTarget)
        if GetKeyState("F11", "P")
            return
        showPosition(EnchantClick)
        if GetKeyState("F11", "P")
            return
        showPosition(Mat1)
        if GetKeyState("F11", "P")
            return
        showPosition(Mat2)
        if GetKeyState("F11", "P")
            return
        showPosition(Mat3)
        if GetKeyState("F11", "P")
            return
        showPosition(Catalyst)
        if GetKeyState("F11", "P")
            return
        showPosition(Item1)
        if GetKeyState("F11", "P")
            return
        showPosition(ItemBackTarget)
    }
    return
     
    ^!w::
    {
        MouseGetPos, mouseX, mouseY
        MsgBox First co-ordinate is  %mouseX%, %mouseY%
    }
    return
     
     
    showPosition(obj1) {
        MouseMove, obj1.X, obj1.Y, 10
        Sleep, 500
    }
     
    ;Enchant 1st row
    ^!a::
    Loop 180
    {
        if GetKeyState("F11", "P") {
            Break
        }
     
        grabObject(Item1, ItemTarget)
        shiftGrabObject(Catalyst, CatalystTarget, 1)
        shiftGrabObject(Mat1, MatTarget1, 5)
        shiftGrabObject(Mat2, MatTarget2, 5)
        shiftGrabobject(Mat3, MatTarget3, 5)
     
        Sleep, 100
        enchant(EnchantClick)
        Loop 152 {
            if GetKeyState("F11", "P") {
                Break
            }
           
        }
       
        grabObject(ItemTarget, ItemBackTarget)
     
    }
    return
     
    grabObject(obj1, obj2) {
        MouseClickDrag, L, obj1.X, obj1.Y, obj2.X, obj2.Y, 5  
        Sleep, 20
    }
     
    shiftGrabObject(obj1, obj2, key)
    {
        Send, {shift down}
        Sleep, 20
        MouseClickDrag, L, obj1.X, obj1.Y, obj2.X, obj2.Y, 5  
        Sleep, 20
        Send, {shift up}
        Sleep, 20
        Send, {%key%}
        Sleep, 20
        Send, {ENTER}
        Sleep, 10
    }
     
    enchant(obj) {
        x := obj.X
        y := obj.Y
        Click %x%, %y%
        Sleep, 2000
    }
     
    #1 RabbleRabble, Aug 18, 2018
    Last edited: Aug 18, 2018
    onslaught, Kantor and Blaze like this.
  2. Sero

    Sero Fire Giant
    Legend

    Joined:
    Apr 8, 2016
    Messages:
    4,448
    Likes Received:
    5,362
    Back in my day, you used to have to do this for DAYS. x.x
     
    Collapse Signature Expand Signature
    Cudelr and AbyssWalker like this.
  3. Leafcrawl

    Leafcrawl Goblin Warlord

    Joined:
    May 2, 2017
    Messages:
    77
    Likes Received:
    296
    The entire Enchantment UI needs to be improved imo.
     
    HeganHatsumo and onslaught like this.
  4. Flux D

    Flux D Deadeye
    Legend

    Joined:
    Feb 24, 2016
    Messages:
    162
    Likes Received:
    113
    A super easy and significant improvement to make would be the ability to drag stacks of gems and stacks of mats without having to change anything UI...
     
    Collapse Signature Expand Signature
  5. Void

    Void Infernal
    Legend

    Joined:
    Apr 11, 2016
    Messages:
    513
    Likes Received:
    321
    this would be 100 times better then the current
     
    Collapse Signature Expand Signature
  6. Flux D

    Flux D Deadeye
    Legend

    Joined:
    Feb 24, 2016
    Messages:
    162
    Likes Received:
    113
    technically, you can already drag stacks of mats...but only enough for 1 enchant lol.

    enabling a stack of mats and gems to be applied all to the same enchant shouldn't be that much more of a difficult endeavor and also remove fail loss...
     
    Collapse Signature Expand Signature
  7. Dixie Normus

    Dixie Normus Black Knight
    Legend

    Joined:
    Sep 14, 2015
    Messages:
    1,176
    Likes Received:
    1,171
    Should be a drop down menu of enchants that you can pick that automatically grabs the requisite mats out of your bag.

    Can be greyed our if you are missing some mats.
     
    Collapse Signature Expand Signature
    Andrew likes this.
  8. streaml1ne

    streaml1ne Akathar
    Legend

    Joined:
    Nov 9, 2015
    Messages:
    271
    Likes Received:
    200
    Keep the last selected entry in the drop down and accept a bag with the items you want to enchant and that'd work. This way if you want to enchant a few swords, select what you want, drag the weapon in, click go, drag a new weapon in click go. Otherwise if you want to bulk enchant drop a bag of swords and click go once. Convenience no matter which way you slice it.
     
    Dixie Normus likes this.