New here and I need help in my trigger

Hello everyone. I'm new and I'm trying to make a trigger for my monk. The triggers is for the Kata transition in Shikudo. It's for my bashing script. And I'm using Mudlet.

The trigger is like this:

    ^You are now maintaining a kata chain of (\d+) actions.$

    if tonumber(matches[2]) >= 5 then
        ChangeForm()
    end

The triggers has no problem. It executes the ChangeForm function when the Kata chain is over 4 actions.

Here is the ChangeForm function:

    function ChangeForm()
        if svo.defc.tykonos then
            send("transition to willow form")
        elseif svo.defc.willow then
            send("transition to rain form")
        elseif svo.defc.rain then
            send("transition to oak form")
        elseif svo.defc.oak then
            send("transition to willow form")
        end
    end

My problem is in my ChangeForm function. The first transition is fine, until to the second transition. It stays hitting the first transitions.
Example is.. My form is Tykonos. I fight and get 6 Kata actions, the triggers will do the first transition to Willow form and the Kata chain will reset to 0. The fight continues, until I get the 6 Kata actions again and triggers the transition, but instead of triggering the Rain form, it will stay triggering the Willow form transition.

Sorry for my bad English. It's not my natural language. I really need help in this. Thanks.

Comments

  • KlendathuKlendathu Eye of the Storm
    Have you checked that svo.defc.tykonos exists and, when you transition to that form, it changes?

    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."
  • Klendathu said:
    Have you checked that svo.defc.tykonos exists and, when you transition to that form, it changes?
    I actually didn't check it while fighting. I only checked it after fighting... and yes all the my defenses are there. When it's active, it will look like this:
    lua svo.defc
    {
      deaf = true,
      sileris = "unsure",
      boosting = true,
      hypersight = true,
      alertness = true,
      grip = true,
      frost = true,
      consciousness = true,
      regeneration = true,
      myrrh = true,
      toughness = true,
      resistance = true,
      curseward = true,
      mindseye = true,
      constitution = true,
      caloric = true,
      thirdeye = true,
      deathsight = true,
      mindnet = true,
      meditate = false,
      insomnia = true,
      willow = false,
      levitation = true,
      weathering = true,
      starburst = false,
      cloak = true,
      mindtelesense = true,
      tykonos = false,
      blind = true,
      trance = true,
      vitality = true,
      splitmind = true,
      nightsight = true,
      speed = true,
      selfishness = false,
      softfocus = true,
      kola = true,
      vigilance = true,
      bell = true,
      rain = true,
      mindcloak = true,
      venom = true
    }

  • Off the top of my head, my guess is that svo.defc.tykonos is still evaluating to not-false, despite you being in Willow.

    Try making the function display the values of svo.defc.tykonos and the other stance variables when it fires, so that you can see what the status is.
  • Nazihk said:
    Off the top of my head, my guess is that svo.defc.tykonos is still evaluating to not-false, despite you being in Willow.

    Try making the function display the values of svo.defc.tykonos and the other stance variables when it fires, so that you can see what the status is.
    Yeah. Your right. svo.defc.tykonos dont change.. it remains true..
    Hmmm.. how can I make it update when I change my form... while I'm in combat..
  • I'm on mobile so forgive any typos but a sketchy way to do it would be something like:

    trigger line: (willow form switch line)
    lua: svo.defc.tykantos = false

    note that this might mess something up in svof, hence why it's sketchy, but I don't know why svof would need to know what forms you've already done, either.
  • If you're going to do that don't even bother fucking around with setting svo variables, imo. 

    Just avoid messing with svo entirely and make an independent currentStance variable and track off of that.

  • It's working already.
    Here it is:

    function ChangeForm()
        if svo.defc.tykonos then
            send("transition to willow form")
            svo.defc.tykonos = false
            svo.defc.willow = true
        elseif svo.defc.willow then
            send("transition to rain form")
            svo.defc.willow = false
            svo.defc.rain = true
        elseif svo.defc.rain then
            send("transition to oak form")
            svo.defc.rain = false
            svo.defc.oak = true
        elseif svo.defc.oak then
            send("transition to gaital form")
            svo.defc.oak = false
            svo.defc.gaital = true
        elseif svo.defc.gaital then
            send("transition to maelstrom form")
            svo.defc.gaital = false
            svo.defc.maelstrom = true
        elseif svo.defc.maelstrom then
            send("transition to oak form")
            svo.defc.maelstrom = false
            svo.defc.oak = true
        end
    end

    Your right Nazihk, I'll make and independent variable soon. Thanks.
  • You should also be able to pull the current form you are in from svo.me.form.
  • I don't know if anything stops form transition (paralysis, stun, prone?) but if anything does, your function will stop working if it attempts to transition and can't because it'll still update the svo.defc.form true/false's. That's why I said to use the form switch line as a trigger, to avoid updating your svo.defc.form without actually changing form.
  • KlendathuKlendathu Eye of the Storm
    Solnir said:
    I don't know if anything stops form transition (paralysis, stun, prone?) but if anything does, your function will stop working if it attempts to transition and can't because it'll still update the svo.defc.form true/false's. That's why I said to use the form switch line as a trigger, to avoid updating your svo.defc.form without actually changing form.
    Is there not a gmcp event when you change form?

    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."
  • Keneanung said:
    You should also be able to pull the current form you are in from svo.me.form.
    Wow. This helps a lot. Thanks..
  • Klendathu said:
    Solnir said:
    I don't know if anything stops form transition (paralysis, stun, prone?) but if anything does, your function will stop working if it attempts to transition and can't because it'll still update the svo.defc.form true/false's. That's why I said to use the form switch line as a trigger, to avoid updating your svo.defc.form without actually changing form.
    Is there not a gmcp event when you change form?
    There is under gmcp.Char.Vitals i believe. Whereever the rage is for battlerage. You should get something like "Form: Willow" etc. Thats where I pulled mine from
Sign In or Register to comment.