Limb targetting - Achaea

Post Reply
Verthar
Posts: 10
Joined: Tue Apr 27, 2010 3:12 pm

Limb targetting - Achaea

Post by Verthar »

Alrighty here we go, I'm attempting to set up aliases for breaking limbs as a monk in Achaea, I'll use my left leg one for the purpose of this question. I just honestly don't know what I'm doing wrong. I attempt to put in the alias and it just simply doesn't work.

Pattern: ^ll$

send ("snk " .. target .. left)
send ("hfp " .. target .. left)
send ("hfp " .. target .. left)

User avatar
Vadi
Posts: 5042
Joined: Sat Mar 14, 2009 3:13 pm

Re: Limb targetting - Achaea

Post by Vadi »

Code: Select all

send ("snk " .. target .. " left")
send ("hfp " .. target .. " left")
send ("hfp " .. target .. " left")
text goes into quotes, variables don't go into quotes, glue text with variables with two dots

Knute
Posts: 87
Joined: Fri Mar 05, 2010 12:08 am

Re: Limb targetting - Achaea

Post by Knute »

Also, if you want a space between 2 variables, you have to chain that with the two dots as well.

I say that, because it's good to take note of the space after the snk and hfb and before left in the example provided.

User avatar
tsuujin
Posts: 695
Joined: Fri Feb 26, 2010 12:59 am
Location: California
Contact:

Re: Limb targetting - Achaea

Post by tsuujin »

Or, to make it easier to read (and debug) you can use string.format rather than the concatenation operator ("..")
Code: [show] | [select all] lua
send(string.format("snk %s left",target))
send(string.format("hfp %s left",target))
send(string.format("hfp %s left",target))
you can also use a function to alternate left and right
Code: [show] | [select all] lua
function atk(lr)
    send(string.format("snk %s %s",target,lr))
    send(string.format("hfp %s %s",target,lr))
    send(string.format("hfp %s %s",target,lr))
end

atk("left")
and finally, if you wanted to be able to pass any combo into the function...
Code: [show] | [select all] lua
function atk(atkList,lr)
    -- To make sure you have a target, and exit if you don't
    if not target then return false end

    for _,i in pairs(atkList) do
        send(string.format("%s %s %s",i,target,lr))
    end
end

atk({"snk","hfp","hfp"},"left")

Post Reply