Hail, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Welcome to the Achaea Forums! Please be sure to read the Forum Rules.

Mudlet Simple Question

IsmayIsmay Member Posts: 561 ✭✭✭✭ - Eminent
Hey, I want to write a simple trigger that will announce mindnet only if they are enemies, including the area location. This is what I have so far, which could very well be incorrect:

^(\w+) has left the area\.$


if target_calling == true and ndb.isenemy(matches[2]) then

send("pt " .. matches[2] .. " left " ..something goes here, I know it)

end


Any help would be appreciated.


Comments

  • EldEld Member Posts: 3,946 @@ - Legendary Achaean
    send("pt " .. matches[2] .. " left " .. gmcp.Room.Info.area)

    should work, I think.
    Ismay
  • IsmayIsmay Member Posts: 561 ✭✭✭✭ - Eminent
    I don't want to open a new thread for another question.

    I'm trying to write a script that would allow me to use a specific alias to check 'who here' and enemy all on that list IF I use that particular alias. I don't want to enemy everyone on who here if I'm not using that alias. Can anyone help, please?
  • KlendathuKlendathu Eye of the StormMember Posts: 2,983 @@ - Legendary Achaean
    You will need an alias which sets a flag to true (with an optioal tempTimer to set it to false again after a certain time has elapsed as failsafe), a trigger which runs off the standard output for who here and parses it into a list then passes a series of enemying commands if the flag is true, then sets the flag to false again. Probably need something to clear your existing enemy list too.

    Tharos, the Announcer of Delos shouts, "It's near the end of the egghunt and I still haven't figured out how to pronounce Clean-dat-hoo."
  • AustereAustere TennesseeMember Posts: 2,193 @@ - Legendary Achaean
    edited January 2016
    Ismay said:
    I don't want to open a new thread for another question.

    I'm trying to write a script that would allow me to use a specific alias to check 'who here' and enemy all on that list IF I use that particular alias. I don't want to enemy everyone on who here if I'm not using that alias. Can anyone help, please?
    A good alternative, Klendathu has a very nice gmcp tracker in his signature that tells you who is in the room.  You could write an alias that simply enemied off the table he populates.

    Edit: on mobile, so I can't guarantee its still there.  Guessing. .
  • IsmayIsmay Member Posts: 561 ✭✭✭✭ - Eminent
    I want to add another action to this alias, by means of setting a variable, but I am not sure how to do it.


    send("setalias tkc combo "..target.." "..kicks[matches[2]].." "..punch[matches[3]].." "..punch[matches[4]].."/"..mindcmd[matches[5]])

    send("queue add eqbal tkc")


    I'd like to add stancing to the end of this alias, but only if unstanced. I already have my variable created and all the relevant trigger lines to change the variable. I'm just not sure how to add the if statement to this.


    I thought about doing this:

    if unstanced == true then

    send("queue add eqbal scs")

    end


    But, monks can stance while off balance, I think. So, I'd be wasting more balance stancing when I don't need to. Any suggestions?





  • AustereAustere TennesseeMember Posts: 2,193 @@ - Legendary Achaean
    edited March 2016
    If unstanced then
      local stance = "/scs"
    else 
      local stance = ""
    end

    send("setalias tkc combo "..target.." "..kicks[matches[2]].." "..punch[matches[3]].." "..punch[matches[4]].."/"..mindcmd[matches[5]]..""..stance)
    send("queue add eqbal tkc")

    Edit: mobile so it's ugly, but that's one way to do it.  Another would be to simply call a function that returns the stance instead of a variable 
    Ismay
  • EldEld Member Posts: 3,946 @@ - Legendary Achaean
    edited March 2016
    Two options that do the same thing:
    1)
    if unstanced then
    send("setalias tkc combo "..target.." "..kicks[matches[2]].." "..punch[matches[3]].." "..punch[matches[4]].."/"..mindcmd[matches[5]].."/scs")
    else
    send("setalias tkc combo "..target.." "..kicks[matches[2]].." "..punch[matches[3]].." "..punch[matches[4]].."/"..mindcmd[matches[5]])
    end

    2)
    send("setalias tkc combo "..target.." "..kicks[matches[2]].." "..punch[matches[3]].." "..punch[matches[4]].."/"..mindcmd[matches[5]]..(unstanced and "/scs" or ""))

    The second is more concise, but the first might make the logic easier to understand.
    AustereIsmay
Sign In to Comment.