Seeking a double line trigger.

ShaddusShaddus , the Leper MessiahOutside your window.Member Posts: 7,666 Transcendent
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?
If I'm not good enough for Lusternia, then it is no longer good enough for me.


  • FalaeronFalaeron Jolteon Member Posts: 1,660 Transcendent
    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.

    local maxhpercent = 75 -- % health below which you want it to trigger
    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("\nBelow " .. maxhpercent .. "% health and " .. maxmpercent .. "% mana.") --Just a sample echo you could do end
Sign In or Register to comment.