Seeking a double line trigger.

ShaddusShaddus , the Leper MessiahOutside your window.
I'm trying to write a trigger, and I'm horrible at coding.

His health is at 3540 out of 3540.
His mana is at 3561 out of 3894.

I need the trigger to  match both of these, and if he's under a certain percent of health AND under a certain percent of mana, take an action. Has to be under both. Anyone mind throwing this together?
Everiine said: The reason population is low isn't because there are too many orgs. It's because so many facets of the game are outright broken and protected by those who benefit from it being that way. An overabundance of gimmicks (including game-breaking ones), artifacts that destroy any concept of balance, blatant pay-to-win features, and an obsession with convenience that makes few things actually worthwhile all contribute to the game's sad decline.

Comments

  • FalaeronFalaeron Jolteon
    edited March 2016
    Think you use Mudlet, which is what this is for. You want to set up the following as the perl regex patterns on separate lines.

    ^(His|Her) health is at (\d+) out of (\d+).$
    ^(His|Her) mana is at (\d+) out of (\d+).$

    Then check the box that says "multiline / AND Trigger" and in "line delta" put 1.
    <br>local maxhpercent = 75 -- % health below which you want it to trigger<br>local maxmpercent = 50 -- % mana below which you want it to trigger
    
    local hpercent = multimatches[1][3] / multimatches[1][4] * 100
    local mpercent = multimatches[2][3] / multimatches[2][4] * 100
    
    if hpercent < maxhpercent and mpercent < maxmpercent then
     --PUT WHAT YOU WANT TO DO HERE
     cecho("\n<green>Below <red>" .. maxhpercent .. "% <green>health and <red>" .. maxmpercent .. "% <green>mana.") --Just a sample echo you could do
    end</green></red></green></red></green>
Sign In or Register to comment.