Mudlet M&M for Monks

by Janalon

Back to Mechanic's Corner.

Janalon2010-10-14 16:53:15
One of the "frustrating" things about being a monk, is that you need to develop separate katas for everything. One set for each step in momentum. Another set for each step in momentum with razing. Another set of raze/non-raze that target alternating limbs to avoid stance/parry. Now multiply that by the number of "progressions" you plan to use. The learning curve is a challenge, especially effectively tracking momentum, stance/parry, rebounding in combat. Not to mention all of the aliases/keybindings needed to orchestrate monk combat can be overwhelming.

Thanks to the comprehensive M&M system, extensive documentation, and willing support from Vadi, I've managed to eek together a simple monk momentum tracker. The main benefit is that I can compact my combat actions to a single alias/keybinding and allow the system to think through my moves on momentum building progressions. I know this might be a simple bit of code for some... but it represents a major step forward in terms of combat potential and coding ability for me.

CODE
if mm.stats.momentum == 0 then
   send("kata perform " .. janalon_pvptar .. " hold0")
   send("ka spronghai " .. janalon_pvptar .. " lleg left")
elseif mm.stats.momentum == 1 then
   send("kata perform " .. janalon_pvptar .. " hold0")
   send("ka spronghai " .. janalon_pvptar .. " rleg left")
elseif mm.stats.momentum == 2 then
   send("kata perform " .. janalon_pvptar .. " choke2")
   send("ka spronghai " .. janalon_pvptar .. " gut left")
elseif mm.stats.momentum == 3 then
   send("kata perform " .. janalon_pvptar .. " oothai3")
   send("ka spronghai " .. janalon_pvptar .. " gut left")
elseif mm.stats.momentum == 4 then
   send("kata perform " .. janalon_pvptar .. " oothai4")
end


Looking to tweak this in two ways. FIRST, I want to hardcode an ectoplasm warning that would disable a combat attack and echo a message. Does this seem correct?

CODE
if mm.affl.ectoplasm then
   send cecho("\\n> > > > > > - - - - Slimed with ECTOPLASM - - - - < < < < < <")
elseif mm.stats.momentum == 0 then
   send("kata perform " .. janalon_pvptar .. " hold0")
   send("ka spronghai " .. janalon_pvptar .. " lleg left")
elseif mm.stats.momentum == 1 then
   send("kata perform " .. janalon_pvptar .. " hold0")
   send("ka spronghai " .. janalon_pvptar .. " rleg left")
elseif mm.stats.momentum == 2 then
   send("kata perform " .. janalon_pvptar .. " choke2")
   send("ka spronghai " .. janalon_pvptar .. " gut left")
elseif mm.stats.momentum == 3 then
   send("kata perform " .. janalon_pvptar .. " oothai3")
   send("ka spronghai " .. janalon_pvptar .. " gut left")
elseif mm.stats.momentum == 4 then
   send("kata perform " .. janalon_pvptar .. " oothai4")
end


Also, I want to randomize limbs for the out-of-form spronghai kicks. Something where Mudlet will decide between the limbs I provide (i.e. rleg, lleg, rarm, llarm). Can anyone help with this bit of code?
Vadi2010-10-14 17:53:21
QUOTE
Looking to tweak this in two ways. FIRST, I want to hardcode an ectoplasm warning that would disable a combat attack and echo a message. Does this seem correct?


That's correct.

QUOTE
Also, I want to randomize limbs for the out-of-form spronghai kicks. Something where Mudlet will decide between the limbs I provide (i.e. rleg, lleg, rarm, llarm). Can anyone help with this bit of code?


Maybe this: http://forums.lusternia.com/index.php?show...st&p=778708 can help?
Janalon2010-10-14 18:06:19
QUOTE (Vadi @ Oct 14 2010, 01:53 PM) <{POST_SNAPBACK}>


Thanks! I had seen this before, but couldn't remember where to locate the post. To take a snippet of my code, would the following work:

CODE
elseif mm.stats.momentum == 0 then
   local commands = {"rleg", "lleg", "rarm", "larm"}
   send("kata perform " .. janalon_pvptar .. " hold0")
   send("ka spronghai " .. janalon_pvptar .. " ")

Vadi2010-10-14 18:13:53
Almost:

CODE
elseif mm.stats.momentum == 0 then
   local commands = {"rleg", "lleg", "rarm", "larm"}
   send("kata perform " .. janalon_pvptar .. " hold0")
   send("ka spronghai " .. janalon_pvptar .. " "..commands)
Unknown2010-10-14 18:33:19
And, you could replace 4 with #commands to avoid changing two things for any future changes made to the list of commands.
Janalon2010-10-14 20:31:36
QUOTE (Zarquan @ Oct 14 2010, 02:33 PM) <{POST_SNAPBACK}>
And, you could replace 4 with #commands to avoid changing two things for any future changes made to the list of commands.


Not sure that I understand the application of this. Meaning that lleg wouldn't be randomly picked back-to-back? Is this better syntax:


CODE
elseif mm.stats.momentum == 0 then
   local commands = {"rleg", "lleg", "rarm", "larm"}
   send("kata perform " .. janalon_pvptar .. " hold0")
   send("ka spronghai " .. janalon_pvptar .. " "..commands)
Lilia2010-10-14 20:34:37
Meaning you can add to the list of commands without having to change the number in the code.
Janalon2010-10-14 20:36:38
QUOTE (Vadi @ Oct 14 2010, 01:53 PM) <{POST_SNAPBACK}>
That's correct.


Getting an error message on the following code:

CODE
if mm.affl.ectoplasm then
   send cecho("\\n> > > > > > - - - - Slimed with ECTOPLASM - - - - < < < < < <")


This is what Mudlet tells me:

QUOTE
Lua syntax error::3: '=' expected near 'cecho'


Halp???
Vadi2010-10-14 20:42:32
Take away the send before cecho. It's a function of it's own.
Janalon2010-10-23 15:58:53
Alright... I used Vadi's awesome documentation with the M&M system to respond to personal afflictions sending out my offense:

CODE
if mm.affl.ectoplasm then
   cecho("\\n> > > > > > - - - - Slimed with ECTOPLASM - - - - < < < < < <")
elseif mm.affl.aeon then
   cecho("\\n> > > > > > - - - - Stuck in an AEON - - - - < < < < < <")
elseif mm.affl.choke and mm.stats.momentum == 0 then
   send("kata perform " .. janalon_pvptar .. " hold0")
elseif mm.stats.momentum == 0 then
   local commands = {"rleg", "lleg", "rarm", "larm"}
   send("kata perform " .. janalon_pvptar .. " hold0")
   send("ka spronghai " .. janalon_pvptar .. " "..commands)
elseif mm.affl.choke and mm.stats.momentum == 1 then
   send("kata perform " .. janalon_pvptar .. " hold0")
elseif mm.stats.momentum == 1 then
   local commands = {"rleg", "lleg", "rarm", "larm"}
   send("kata perform " .. janalon_pvptar .. " hold0")
   send("ka spronghai " .. janalon_pvptar .. " "..commands)
elseif mm.affl.choke and mm.stats.momentum == 2 then
   send("kata perform " .. janalon_pvptar .. " choke2")
elseif mm.stats.momentum == 2 then
   local commands = {"rleg", "lleg", "rarm", "larm"}
   send("kata perform " .. janalon_pvptar .. " choke2")
   send("ka spronghai " .. janalon_pvptar .. " "..commands)
elseif mm.affl.choke and mm.stats.momentum == 3 then
   send("kata perform " .. janalon_pvptar .. " oothai3")
elseif mm.stats.momentum == 3 then
   local commands = {"rleg", "lleg", "rarm", "larm"}
   send("kata perform " .. janalon_pvptar .. " oothai3")
   send("ka spronghai " .. janalon_pvptar .. " "..commands)
elseif mm.stats.momentum == 4 then
   send("kata perform " .. janalon_pvptar .. " oothai4")
elseif mm.stats.momentum == 5 then
   send("kata perform " .. janalon_pvptar .. " oothai5")
end


Now I want to start tracking my opponent's status. Namely shielding/rebounding/prone (more so for my nekai/angknek momentum building progression). I already have echoes set to follow my combat target only. For example:

CODE
NAME: Enemy Rebounding
TRIGGER (perl regex): ^You suddenly perceive the vague outline of an aura of rebounding around (\\w+).$
SCRIPT:
if string.lower(matches) == string.lower(janalon_pvptar) then cecho("\\n.oO( ( ( " .. janalon_pvptar .. " SHIELDS " .. janalon_pvptar .. " REBOUNDS  ) ) )Oo.") end


Now I want to use that information to set values AND then place into my offensive listed above. This is a huge leap, and will greatly help me condense a ton of katas into a few keybindings. Suggestions?
Vadi2010-10-23 17:43:17
The first script could be condensed a bit by declaring the commands (since it seems to be the same thing) table once before you get into the ifs:


CODE
local commands = {"rleg", "lleg", "rarm", "larm"}

if mm.affl.ectoplasm then
   cecho("\\n> > > > > > - - - - Slimed with ECTOPLASM - - - - < < < < < <")
elseif mm.affl.aeon then
   cecho("\\n> > > > > > - - - - Stuck in an AEON - - - - < < < < < <")
elseif mm.affl.choke and mm.stats.momentum == 0 then
   send("kata perform " .. janalon_pvptar .. " hold0")
elseif mm.stats.momentum == 0 then
   send("kata perform " .. janalon_pvptar .. " hold0")
   send("ka spronghai " .. janalon_pvptar .. " "..commands)
elseif mm.affl.choke and mm.stats.momentum == 1 then
   send("kata perform " .. janalon_pvptar .. " hold0")
elseif mm.stats.momentum == 1 then
   send("kata perform " .. janalon_pvptar .. " hold0")
   send("ka spronghai " .. janalon_pvptar .. " "..commands)
elseif mm.affl.choke and mm.stats.momentum == 2 then
   send("kata perform " .. janalon_pvptar .. " choke2")
elseif mm.stats.momentum == 2 then
   send("kata perform " .. janalon_pvptar .. " choke2")
   send("ka spronghai " .. janalon_pvptar .. " "..commands)
elseif mm.affl.choke and mm.stats.momentum == 3 then
   send("kata perform " .. janalon_pvptar .. " oothai3")
elseif mm.stats.momentum == 3 then
   send("kata perform " .. janalon_pvptar .. " oothai3")
   send("ka spronghai " .. janalon_pvptar .. " "..commands)
elseif mm.stats.momentum == 4 then
   send("kata perform " .. janalon_pvptar .. " oothai4")
elseif mm.stats.momentum == 5 then
   send("kata perform " .. janalon_pvptar .. " oothai5")
end


As for tracking - to begin with simply, you could use a boolean variable to track whenever they have rebounding - true if they do, false if they don't.

CODE
if string.lower(matches) == string.lower(janalon_pvptar) then cecho("\\n.oO( ( ( " .. janalon_pvptar .. " SHIELDS " .. janalon_pvptar .. " REBOUNDS  ) ) )Oo.") end
janalon_pvptar_hasrebounding = true


... and set to false when you see them lose it. Just like mm.affl variables, 'if janalon_pvptar_hasrebounding' would check if they have it, and 'if not janalon_pvptar_hasrebounding' would check if they don't have it.

Do remember that you'll want to account for cases when they get rebounding up, leave the room and lose it, or leave the room without it, get it, and come back in... you won't see the lines for that.
Janalon2010-10-23 23:24:08
Hrm... so this looks easy on the code side of things, though the logic of changing variables due to someone (either them or me) boggles my mind. Is there a quick and easy way to detect rebounding & shielding (such as a general room "look" description)?
Neos2010-10-23 23:36:00
QUOTE (Janalon @ Oct 23 2010, 07:24 PM) <{POST_SNAPBACK}>
Hrm... so this looks easy on the code side of things, though the logic of changing variables due to someone (either them or me) boggles my mind. Is there a quick and easy way to detect rebounding & shielding (such as a general room "look" description)?

Do you have psymet? If so, you could use read aura in psionics to check. It's not perfect but it helps.
Janalon2010-10-24 01:24:29
Come to think about it... the idea might be better suited for mudlet side bar rather than automation.
Janalon2010-11-01 14:01:27
OK... new avenue of thought. I want to create a set of forms that will shift offense to one arm when the opposing arm is incapacitated due to any number of afflictions: brokenleftwrist, mangledleftarm, fracturedleftarm, hemiphlegyleft, crippledleftarm, missingleftarm.

These forms will be integrated into my IF, ELSEIF keybinding progression.

CODE
elseif mm.affl.choke and mm.stats.momentum == 3 then
   send("kata perform " .. janalon_pvptar .. " bleed3")
elseif mm.stats.momentum == 3 then
   sendAll("envenom nekai2541 with dulak", "envenom nekai3364 with mantakaya")
   send("kata perform " .. janalon_pvptar .. " bleed3")
   sendAll("wipe nekai2541", "wipe nekai3364")


First, can I use OR statements? For example:

CODE
elseif mm.stats.momentum == 3 and mm.affs.brokenleftwrist or mm.affs.mangledleftarm or mm.affs.fracturedleftarm or mm.affs.hemiphlegyleft or mm.affs.crippledleftarm or mm.affs.missingleftarm then
      send("kata perform " .. janalon_pvptar .. " nolarm3")


What's the syntax on this one?
Vadi2010-11-01 16:32:55
Yes, though you don't want it to be ambiguous, better to do:

QUOTE
elseif mm.stats.momentum == 3 and (mm.affl.brokenleftwrist or mm.affl.mangledleftarm or mm.affl.fracturedleftarm or mm.affl.hemiphlegyleft or mm.affl.crippledleftarm or mm.affl.missingleftarm) then
Janalon2010-11-04 15:08:44
Here's my beast of a keybinding so far:


CODE
if mm.affl.ectoplasm then
   cecho("\\n> > > > > > - - - - Slimed with ECTOPLASM - - - - < < < < < <")
elseif mm.affl.aeon then
   cecho("\\n> > > > > > - - - - Stuck in an AEON - - - - < < < < < <")
elseif mm.affl.sap then
   cecho("\\n> > > > > > - - - - Icky sticky with SAP - - - - < < < < < <")
elseif mm.affl. hemiphlegyleft and mm.affl. hemiphlegyright then
   cecho("\\n> > > > > > - - - - Paralysed with DOUBLE HEMIPHLEGY - - - - < < < < < <")


elseif mm.stats.momentum == 0 and (mm.affl.brokenleftwrist or mm.affl.mangledleftarm or mm.affl.fracturedleftarm or mm.affl.hemiphlegyleft or mm.affl.crippledleftarm or mm.affl.missingleftarm) and (mm.affl.brokenrightwrist or mm.affl.mangledrightarm or mm.affl.fracturedrightarm or mm.affl.hemiphlegyright or mm.affl.crippledrightarm or mm.affl.missingrightarm) then
  send("kata perform " .. janalon_pvptar .. " noarm0")
elseif mm.stats.momentum == 0 and (mm.affl.brokenleftwrist or mm.affl.mangledleftarm or mm.affl.fracturedleftarm or mm.affl.hemiphlegyleft or mm.affl.crippledleftarm or mm.affl.missingleftarm) then
  send("kata perform " .. janalon_pvptar .. " noleftarm0")
elseif mm.stats.momentum == 0 and (mm.affl.brokenrightwrist or mm.affl.mangledrightarm or mm.affl.fracturedrightarm or mm.affl.hemiphlegyright or mm.affl.crippledrightarm or mm.affl.missingrightarm) then
  send("kata perform " .. janalon_pvptar .. " norightarm0")
elseif mm.affl.choke and mm.stats.momentum == 0 then
   send("kata perform " .. janalon_pvptar .. " bleed0")
elseif mm.stats.momentum == 0 then
   local commands = {"rleg", "lleg", "rarm", "larm"}
   sendAll("envenom nekai2541 with dulak", "envenom nekai3364 with mantakaya")
   send("kata perform " .. janalon_pvptar .. " bleed0")
   send("ka spronghai " .. janalon_pvptar .. " ".. commands .. " right")
   sendAll("wipe nekai2541", "wipe nekai3364")


elseif mm.stats.momentum == 1 and (mm.affl.brokenleftwrist or mm.affl.mangledleftarm or mm.affl.fracturedleftarm or mm.affl.hemiphlegyleft or mm.affl.crippledleftarm or mm.affl.missingleftarm) and (mm.affl.brokenrightwrist or mm.affl.mangledrightarm or mm.affl.fracturedrightarm or mm.affl.hemiphlegyright or mm.affl.crippledrightarm or mm.affl.missingrightarm) then
  send("kata perform " .. janalon_pvptar .. " noarm1")
elseif mm.stats.momentum == 1 and (mm.affl.brokenleftwrist or mm.affl.mangledleftarm or mm.affl.fracturedleftarm or mm.affl.hemiphlegyleft or mm.affl.crippledleftarm or mm.affl.missingleftarm) then
  send("kata perform " .. janalon_pvptar .. " noleftarm1")
elseif mm.stats.momentum == 1 and (mm.affl.brokenrightwrist or mm.affl.mangledrightarm or mm.affl.fracturedrightarm or mm.affl.hemiphlegyright or mm.affl.crippledrightarm or mm.affl.missingrightarm) then
  send("kata perform " .. janalon_pvptar .. " norightarm1")
elseif mm.affl.choke and mm.stats.momentum == 1 then
   send("kata perform " .. janalon_pvptar .. " bleed1")
elseif mm.stats.momentum == 1 then
   local commands = {"rleg", "lleg", "rarm", "larm"}
   sendAll("envenom nekai2541 with dulak", "envenom nekai3364 with mantakaya")
   send("kata perform " .. janalon_pvptar .. " bleed1")
   send("ka spronghai " .. janalon_pvptar .. " "..commands .." right")
   sendAll("wipe nekai2541", "wipe nekai3364")


elseif mm.stats.momentum == 2 and (mm.affl.brokenleftwrist or mm.affl.mangledleftarm or mm.affl.fracturedleftarm or mm.affl.hemiphlegyleft or mm.affl.crippledleftarm or mm.affl.missingleftarm) and (mm.affl.brokenrightwrist or mm.affl.mangledrightarm or mm.affl.fracturedrightarm or mm.affl.hemiphlegyright or mm.affl.crippledrightarm or mm.affl.missingrightarm) then
  send("kata perform " .. janalon_pvptar .. " noarm2")
elseif mm.stats.momentum == 2 and (mm.affl.brokenleftwrist or mm.affl.mangledleftarm or mm.affl.fracturedleftarm or mm.affl.hemiphlegyleft or mm.affl.crippledleftarm or mm.affl.missingleftarm) then
  send("kata perform " .. janalon_pvptar .. " noleftarm2")
elseif mm.stats.momentum == 2 and (mm.affl.brokenrightwrist or mm.affl.mangledrightarm or mm.affl.fracturedrightarm or mm.affl.hemiphlegyright or mm.affl.crippledrightarm or mm.affl.missingrightarm) then
  send("kata perform " .. janalon_pvptar .. " norightarm2")
elseif mm.affl.choke and mm.stats.momentum == 2 then
   send("kata perform " .. janalon_pvptar .. " bleed2")
elseif mm.stats.momentum == 2 then
   local commands = {"rleg", "lleg", "rarm", "larm"}
   sendAll("envenom nekai2541 with dulak", "envenom nekai3364 with mantakaya")
   send("kata perform " .. janalon_pvptar .. " bleed2")
   send("ka spronghai " .. janalon_pvptar .. " "..commands .." right")
   sendAll("wipe nekai2541", "wipe nekai3364")


elseif mm.stats.momentum == 3 and (mm.affl.brokenleftwrist or mm.affl.mangledleftarm or mm.affl.fracturedleftarm or mm.affl.hemiphlegyleft or mm.affl.crippledleftarm or mm.affl.missingleftarm) and (mm.affl.brokenrightwrist or mm.affl.mangledrightarm or mm.affl.fracturedrightarm or mm.affl.hemiphlegyright or mm.affl.crippledrightarm or mm.affl.missingrightarm) then
  send("kata perform " .. janalon_pvptar .. " noarm3")
elseif mm.stats.momentum == 3 and (mm.affl.brokenleftwrist or mm.affl.mangledleftarm or mm.affl.fracturedleftarm or mm.affl.hemiphlegyleft or mm.affl.crippledleftarm or mm.affl.missingleftarm) then
  send("kata perform " .. janalon_pvptar .. " noleftarm3")
elseif mm.stats.momentum == 3 and (mm.affl.brokenrightwrist or mm.affl.mangledrightarm or mm.affl.fracturedrightarm or mm.affl.hemiphlegyright or mm.affl.crippledrightarm or mm.affl.missingrightarm) then
  send("kata perform " .. janalon_pvptar .. " norightarm3")
elseif mm.affl.choke and mm.stats.momentum == 3 then
   send("kata perform " .. janalon_pvptar .. " bleed3")
elseif mm.stats.momentum == 3 then
   sendAll("envenom nekai2541 with dulak", "envenom nekai3364 with mantakaya")
   send("kata perform " .. janalon_pvptar .. " bleed3")
   sendAll("wipe nekai2541", "wipe nekai3364")


elseif mm.stats.momentum == 4 and (mm.affl.brokenleftwrist or mm.affl.mangledleftarm or mm.affl.fracturedleftarm or mm.affl.hemiphlegyleft or mm.affl.crippledleftarm or mm.affl.missingleftarm) and (mm.affl.brokenrightwrist or mm.affl.mangledrightarm or mm.affl.fracturedrightarm or mm.affl.hemiphlegyright or mm.affl.crippledrightarm or mm.affl.missingrightarm) then
   local commands = {"noarm4larm", "noarm4rarm"}
   send("kata perform " .. janalon_pvptar .. " "..commands)
elseif mm.stats.momentum == 4 and (mm.affl.brokenleftwrist or mm.affl.mangledleftarm or mm.affl.fracturedleftarm or mm.affl.hemiphlegyleft or mm.affl.crippledleftarm or mm.affl.missingleftarm) then
   local commands = {"noleftarm4larm", "noleftarm4rarm"}
   send("kata perform " .. janalon_pvptar .. " "..commands)
elseif mm.stats.momentum == 4 and (mm.affl.brokenrightwrist or mm.affl.mangledrightarm or mm.affl.fracturedrightarm or mm.affl.hemiphlegyright or mm.affl.crippledrightarm or mm.affl.missingrightarm) then
   local commands = {"norightarm4larm", "norightarm4rarm"}
elseif mm.affl.choke and mm.stats.momentum == 4 then
   local commands = {"bleed4rarm", "bleed4larm"}
   send("kata perform " .. janalon_pvptar .. " "..commands)
elseif mm.stats.momentum == 4 then
   local commands = {"bleed4rarm", "bleed4larm"}
   sendAll("envenom nekai2541 with dulak", "envenom nekai3364 with mantakaya")
   send("kata perform " .. janalon_pvptar .. " "..commands)
   sendAll("wipe nekai2541", "wipe nekai3364")


elseif mm.stats.momentum == 5 and (mm.affl.brokenleftwrist or mm.affl.mangledleftarm or mm.affl.fracturedleftarm or mm.affl.hemiphlegyleft or mm.affl.crippledleftarm or mm.affl.missingleftarm) and (mm.affl.brokenrightwrist or mm.affl.mangledrightarm or mm.affl.fracturedrightarm or mm.affl.hemiphlegyright or mm.affl.crippledrightarm or mm.affl.missingrightarm) then
   local commands = {"noarm4head", "noarm4larm", "noarm4rarm", "noarm4lleg", "noarm4rleg"}
   send("kata perform " .. janalon_pvptar .. " "..commands)
elseif mm.stats.momentum == 5 and (mm.affl.brokenleftwrist or mm.affl.mangledleftarm or mm.affl.fracturedleftarm or mm.affl.hemiphlegyleft or mm.affl.crippledleftarm or mm.affl.missingleftarm) then
   local commands = {"noleftarm5larm", "noleftarm5rarm", "noleftarm5lleg", "noleftarm5rleg"}
   send("kata perform " .. janalon_pvptar .. " "..commands)
elseif mm.stats.momentum == 5 and (mm.affl.brokenrightwrist or mm.affl.mangledrightarm or mm.affl.fracturedrightarm or mm.affl.hemiphlegyright or mm.affl.crippledrightarm or mm.affl.missingrightarm) then
   local commands = {"norightarm5larm", "norightarm5rarm", "norightarm5lleg", "norightarm5rleg"}
   send("kata perform " .. janalon_pvptar .. " "..commands)
elseif mm.affl.choke and mm.stats.momentum == 4 then
   local commands = {"bleed5lleg", "bleed5rleg", "bleed5rarm", "bleed5larm"}
   send("kata perform " .. janalon_pvptar .. " "..commands)
elseif mm.stats.momentum == 5 then
   local commands = {"bleed5lleg", "bleed5rleg", "bleed5rarm", "bleed5larm"}
   sendAll("envenom nekai2541 with dulak", "envenom nekai3364 with mantakaya")
   send("kata perform " .. janalon_pvptar .. " "..commands)
   sendAll("wipe nekai2541", "wipe nekai3364")

end



I won't attack if sapped/aeon/ecto so I can prioritize curing. Attacking in a choke is paired down to eliminate envenom/wipe and out of form kicks. Also handling for one-armed and no-armed combat so I can make the most of a form and still gain momentum even under afflicted circumstances. I also have some degree of randomization on my 4mo and 5mo forms to chase stancing.

Now I am looking to set definitions for envenom based on my opponents archetype. For example, I want to first alias xpoison (i.e. xpoison wiccan) and have upwards of 4 poisons set (janalon_archetype_poison1 etc...) defined. This way I can swing dulak/mantakaya on newbs, and then switch on the fly to hadrudin for a more class-specific offense.

I understand how I can capture a variable for the archetype. Not sure how the archetype would then define four poison combination. Something like:

if janalon_pvptar_archetype == wiccan then
janalon_pvptar_poison1 == hadrudin
janalon_pvptar_poison2 == ezcozul

And then place " .. janalon_pvptar_poison1 .. " into the above bit where my poisons should be named.

Does any of that make sense? Am I overthinking this?
Vadi2010-11-04 16:55:16
Since all you want to do is change what venoms are used depending on the archetype... what you could do is instead of evaluating what you venoms you should be using on each attack, evaluate once when you set it and then simply use the available venoms.

So, you could have two tables - one defines what poisons should be used for a particular archetype, and one that knows which venoms should you be using right now.

Because tables in Lua can point to other tables, all you'd need to do is change to which set of venoms the 'current' table is pointing to and that's it. Here's an example to start with...

CODE
-- this table defines what poisons should we randomly select for a given archetype. Put it in a script somewhere so it's defined when the profile is started.
data_definitions = {
  wiccan = {"poisona", "poisonb", "poisonc"},
  warriors = {"poisona", "poisond"},
}


And this could go into your archetype switching alias... current_venoms is a table that points to, and thus contains, what poisons should we be using atm
CODE
-- safety check: if we haven't defined this archetype yet, give a warning and don't do anything
if not data_definitions] then
  cecho("\\n> > > > > > - - - - Don't know about the "..matches.." archetype- - - - < < < < < <")
  return
end

-- set the current_venoms to point to the archetype
current_venoms = data_definitions]


To use a random venom from the current archetype that's selected, you'd get it with:

CODE
current_venoms


That'd be all. I hope you'll see the cleanliness in this data / logic separation smile.gif. You might want to set a default archetype as well in the data definition script so your combos won't break with current_venoms not defined yet.
Janalon2011-07-18 02:52:43
For those who were asking, my most recent application of my monk grapple keybinding for M&M. This includes a momentum tracker, and also will prohibit actions if you under certain afflictions.

CODE
if mm.affl.ectoplasm then
   cecho("\\n> > > > > > - - - - Slimed with ECTOPLASM - - - - < < < < < <")
elseif mm.affl.aeon then
   cecho("\\n> > > > > > - - - - Stuck in an AEON - - - - < < < < < <")
elseif mm.affl.sap then
   cecho("\\n> > > > > > - - - - Icky sticky with SAP - - - - < < < < < <")
elseif mm.affl. hemiphlegyleft and mm.affl. hemiphlegyright then
   cecho("\\n> > > > > > - - - - Paralysed with DOUBLE HEMIPHLEGY - - - - < < < < < <")


elseif mm.stats.momentum == 0 and (mm.affl.brokenleftwrist or mm.affl.mangledleftarm or mm.affl.fracturedleftarm or mm.affl.hemiphlegyleft or mm.affl.crippledleftarm or mm.affl.missingleftarm) and (mm.affl.brokenrightwrist or mm.affl.mangledrightarm or mm.affl.fracturedrightarm or mm.affl.hemiphlegyright or mm.affl.crippledrightarm or mm.affl.missingrightarm) then
  send("kata perform " .. janalon_pvptar .. " noarm0")
elseif mm.stats.momentum == 0 and (mm.affl.brokenleftwrist or mm.affl.mangledleftarm or mm.affl.fracturedleftarm or mm.affl.hemiphlegyleft or mm.affl.crippledleftarm or mm.affl.missingleftarm) then
  send("kata perform " .. janalon_pvptar .. " noleftarm0")
elseif mm.stats.momentum == 0 and (mm.affl.brokenrightwrist or mm.affl.mangledrightarm or mm.affl.fracturedrightarm or mm.affl.hemiphlegyright or mm.affl.crippledrightarm or mm.affl.missingrightarm) then
  send("kata perform " .. janalon_pvptar .. " norightarm0")
elseif mm.affl.choke and mm.stats.momentum == 0 then
   send("kata perform " .. janalon_pvptar .. " hold0")
elseif mm.stats.momentum == 0 then
   send("kata perform " .. janalon_pvptar .. " hold0")


elseif mm.stats.momentum == 1 and (mm.affl.brokenleftwrist or mm.affl.mangledleftarm or mm.affl.fracturedleftarm or mm.affl.hemiphlegyleft or mm.affl.crippledleftarm or mm.affl.missingleftarm) and (mm.affl.brokenrightwrist or mm.affl.mangledrightarm or mm.affl.fracturedrightarm or mm.affl.hemiphlegyright or mm.affl.crippledrightarm or mm.affl.missingrightarm) then
  send("kata perform " .. janalon_pvptar .. " noarm1")
elseif mm.stats.momentum == 1 and (mm.affl.brokenleftwrist or mm.affl.mangledleftarm or mm.affl.fracturedleftarm or mm.affl.hemiphlegyleft or mm.affl.crippledleftarm or mm.affl.missingleftarm) then
  send("kata perform " .. janalon_pvptar .. " noleftarm1")
elseif mm.stats.momentum == 1 and (mm.affl.brokenrightwrist or mm.affl.mangledrightarm or mm.affl.fracturedrightarm or mm.affl.hemiphlegyright or mm.affl.crippledrightarm or mm.affl.missingrightarm) then
  send("kata perform " .. janalon_pvptar .. " norightarm1")
elseif mm.affl.choke and mm.stats.momentum == 1 then
   send("kata perform " .. janalon_pvptar .. " hold0")
elseif mm.stats.momentum == 1 then
   send("kata perform " .. janalon_pvptar .. " hold0")


elseif mm.stats.momentum == 2 and (mm.affl.brokenleftwrist or mm.affl.mangledleftarm or mm.affl.fracturedleftarm or mm.affl.hemiphlegyleft or mm.affl.crippledleftarm or mm.affl.missingleftarm) and (mm.affl.brokenrightwrist or mm.affl.mangledrightarm or mm.affl.fracturedrightarm or mm.affl.hemiphlegyright or mm.affl.crippledrightarm or mm.affl.missingrightarm) then
  send("kata perform " .. janalon_pvptar .. " noarm2")
elseif mm.stats.momentum == 2 and (mm.affl.brokenleftwrist or mm.affl.mangledleftarm or mm.affl.fracturedleftarm or mm.affl.hemiphlegyleft or mm.affl.crippledleftarm or mm.affl.missingleftarm) then
  send("kata perform " .. janalon_pvptar .. " noleftarm2")
elseif mm.stats.momentum == 2 and (mm.affl.brokenrightwrist or mm.affl.mangledrightarm or mm.affl.fracturedrightarm or mm.affl.hemiphlegyright or mm.affl.crippledrightarm or mm.affl.missingrightarm) then
  send("kata perform " .. janalon_pvptar .. " norightarm2")
elseif mm.affl.choke and mm.stats.momentum == 2 then
   send("kata perform " .. janalon_pvptar .. " choke2")
elseif mm.stats.momentum == 2 then
   send("kata perform " .. janalon_pvptar .. " choke2")


elseif mm.stats.momentum == 3 and (mm.affl.brokenleftwrist or mm.affl.mangledleftarm or mm.affl.fracturedleftarm or mm.affl.hemiphlegyleft or mm.affl.crippledleftarm or mm.affl.missingleftarm) and (mm.affl.brokenrightwrist or mm.affl.mangledrightarm or mm.affl.fracturedrightarm or mm.affl.hemiphlegyright or mm.affl.crippledrightarm or mm.affl.missingrightarm) then
  send("kata perform " .. janalon_pvptar .. " noarm3")
elseif mm.stats.momentum == 3 and (mm.affl.brokenleftwrist or mm.affl.mangledleftarm or mm.affl.fracturedleftarm or mm.affl.hemiphlegyleft or mm.affl.crippledleftarm or mm.affl.missingleftarm) then
  send("kata perform " .. janalon_pvptar .. " noleftarm3")
elseif mm.stats.momentum == 3 and (mm.affl.brokenrightwrist or mm.affl.mangledrightarm or mm.affl.fracturedrightarm or mm.affl.hemiphlegyright or mm.affl.crippledrightarm or mm.affl.missingrightarm) then
  send("kata perform " .. janalon_pvptar .. " norightarm3")
elseif mm.affl.choke and mm.stats.momentum == 3 then
   send("kata perform " .. janalon_pvptar .. " oothai3")
elseif mm.stats.momentum == 3 then
   send("kata perform " .. janalon_pvptar .. " oothai3")


elseif mm.stats.momentum == 4 and (mm.affl.brokenleftwrist or mm.affl.mangledleftarm or mm.affl.fracturedleftarm or mm.affl.hemiphlegyleft or mm.affl.crippledleftarm or mm.affl.missingleftarm) and (mm.affl.brokenrightwrist or mm.affl.mangledrightarm or mm.affl.fracturedrightarm or mm.affl.hemiphlegyright or mm.affl.crippledrightarm or mm.affl.missingrightarm) then
   local commands = {"noarm4larm", "noarm4rarm"}
   send("kata perform " .. janalon_pvptar .. " "..commands)
elseif mm.stats.momentum == 4 and (mm.affl.brokenleftwrist or mm.affl.mangledleftarm or mm.affl.fracturedleftarm or mm.affl.hemiphlegyleft or mm.affl.crippledleftarm or mm.affl.missingleftarm) then
   local commands = {"noleftarm4larm", "noleftarm4rarm"}
   send("kata perform " .. janalon_pvptar .. " "..commands)
elseif mm.stats.momentum == 4 and (mm.affl.brokenrightwrist or mm.affl.mangledrightarm or mm.affl.fracturedrightarm or mm.affl.hemiphlegyright or mm.affl.crippledrightarm or mm.affl.missingrightarm) then
   local commands = {"norightarm4larm", "norightarm4rarm"}
   send("kata perform " .. janalon_pvptar .. " "..commands)
elseif mm.stats.momentum == 4 then
   local commands = {"oothai4larm", "oothai4rarm"}
   send("kata perform " .. janalon_pvptar .. " "..commands)


elseif mm.stats.momentum == 5 and (mm.affl.brokenleftwrist or mm.affl.mangledleftarm or mm.affl.fracturedleftarm or mm.affl.hemiphlegyleft or mm.affl.crippledleftarm or mm.affl.missingleftarm) and (mm.affl.brokenrightwrist or mm.affl.mangledrightarm or mm.affl.fracturedrightarm or mm.affl.hemiphlegyright or mm.affl.crippledrightarm or mm.affl.missingrightarm) then
   local commands = {"noarm4head", "noarm4larm", "noarm4rarm", "noarm4lleg", "noarm4rleg"}
   send("kata perform " .. janalon_pvptar .. " "..commands)
elseif mm.stats.momentum == 5 and (mm.affl.brokenleftwrist or mm.affl.mangledleftarm or mm.affl.fracturedleftarm or mm.affl.hemiphlegyleft or mm.affl.crippledleftarm or mm.affl.missingleftarm) then
   local commands = {"noleftarm5larm", "noleftarm5rarm", "noleftarm5lleg", "noleftarm5rleg"}
   send("kata perform " .. janalon_pvptar .. " "..commands)
elseif mm.stats.momentum == 5 and (mm.affl.brokenrightwrist or mm.affl.mangledrightarm or mm.affl.fracturedrightarm or mm.affl.hemiphlegyright or mm.affl.crippledrightarm or mm.affl.missingrightarm) then
   local commands = {"norightarm5lleg", "norightarm5rleg"}
   send("kata perform " .. janalon_pvptar .. " "..commands)
elseif mm.stats.momentum == 5 then
   local commands = {"oothai5larm", "oothai5rarm"}
   send("kata perform " .. janalon_pvptar .. " "..commands)

end