Unknown2006-10-27 13:59:13
First of, let me start by saying I'm a complete novice with this. I've got down the basic gist of Triggers, but once I start adding a lot of variables or wander into lines that change too often I start having trouble.
I'm trying to make a set of gauges in zMUD but I have two troubles... The first one is the prompt from the server displaying all my information is only actualized like every three or four times it appears (which is kind of bogus), and the second is for some reason I could only manage to store my max health and max endurance from the SCORE command, and never was able to do so with willpower, ego and mana.
So anyway, I'm not on my comp right now (And even if I were, it wouldn't make much of a difference since the code is so bad) but can someone give me a quick example on how you setup your trigger for the prompt and SCORE command in zMUD? I should be able to get a better idea on how to do things after looking at someone else's.
I'm trying to make a set of gauges in zMUD but I have two troubles... The first one is the prompt from the server displaying all my information is only actualized like every three or four times it appears (which is kind of bogus), and the second is for some reason I could only manage to store my max health and max endurance from the SCORE command, and never was able to do so with willpower, ego and mana.
So anyway, I'm not on my comp right now (And even if I were, it wouldn't make much of a difference since the code is so bad) but can someone give me a quick example on how you setup your trigger for the prompt and SCORE command in zMUD? I should be able to get a better idea on how to do things after looking at someone else's.
Shorlen2006-10-27 22:38:31
CODE
#ALIAS score {
  #t+ scorecatch
  ~score
  }
#CLASS {Curingsystem|prompt|scorecatch}
#TRIGGER {^%sHealth%s:%s%d/(%d)} {
  #if (%1!=@maxhealth) {
    maxhealth=%1
    calcsips
    }
  }
#TRIGGER {^%sMana%s:%s%d/(%d)} {
  #if (%1!=@maxmana) {
    maxmana=%1
    calcsips
    }
  }
#TRIGGER {^%sEgo%s:%s%d/(%d)} {
  #if (%1!=@maxego) {
    maxego=%1
    calcsips
    }
  }
#TRIGGER {Endurance%s:%s%d/(%d)$} {maxendurance=%1}
#TRIGGER {Willpower%s:%s%d/(%d)$} {maxwillpower=%1}
#TRIGGER "scoreprompttrig" {You are %d years old} {#t- scorecatch} "" {prompt}
#CLASS 0
  #t+ scorecatch
  ~score
  }
#CLASS {Curingsystem|prompt|scorecatch}
#TRIGGER {^%sHealth%s:%s%d/(%d)} {
  #if (%1!=@maxhealth) {
    maxhealth=%1
    calcsips
    }
  }
#TRIGGER {^%sMana%s:%s%d/(%d)} {
  #if (%1!=@maxmana) {
    maxmana=%1
    calcsips
    }
  }
#TRIGGER {^%sEgo%s:%s%d/(%d)} {
  #if (%1!=@maxego) {
    maxego=%1
    calcsips
    }
  }
#TRIGGER {Endurance%s:%s%d/(%d)$} {maxendurance=%1}
#TRIGGER {Willpower%s:%s%d/(%d)$} {maxwillpower=%1}
#TRIGGER "scoreprompttrig" {You are %d years old} {#t- scorecatch} "" {prompt}
#CLASS 0
As for your prompt, make sure in the details of the trigger, there is an "options" tab. On the far right of the tab is a "Trigger on" box with three options: "prompt" "newline" and "line color."
For any trigger that fires on a prompt, make sure that the "prompt" box is checked, and that the "newline" box is NOT checked. All non-prompt triggers should be the other way around (which is the default), and triggers that fire both on the prompt and not on the prompt should have both boxes checked.
Drathys2006-10-28 00:27:38
I use something similar to Shorlen, though it is set up to handle optional gagging of the score output with the SILENTSCORE alias.
For that reason it also requires your title to be set (as this is the first line of the score output).
I also use a multistate trigger instead of single triggers
#CLASS {Score}
#ALIAS sc {#T+ capScore;#send score}
#ALIAS silentScore {#T+ capScore;#T+ gagScore;#send score}
#VAR title {High Druid Drathys, Servant of the Wilde}
#TRIGGER "capScore" {^@title$} {}
#COND {%sSex%s~: *%sRace%s~: *} {}
#COND {%sLevel%s~: (%d) ~((%d)~%~)%sRank%s~: *} {#var level %1;#var levelPercent %2}
#COND {%sHealth ~: (%d)~/(%d)%sEndurance ~: (%d)~/(%d)} {#var healthmax %2;#var endurancemax %4}
#COND {%sMana  ~: (%d)~/(%d)%sWillpower ~: (%d)~/(%d)} {#var manaMax %2;#var willpowerMax %4}
#COND {%sEgo    ~: (%d)~/(%d) %sReserves  ~: (%d)~%} {#var egoMax %2;#var reserves %3}
#COND {%sKarma  ~: (%d)~%%sEsteem    ~: (%d)~%} {}
#COND {^%dh, %dm, %de, %dp} {#T- gagScore;#T- capScore} {nocr|prompt}
#TRIGGER "gagScore" {(*)} {#gag} "" {disable}
#TRIGGER {You will now be known as (*)~, by order of} {#var title {%1}}
#CLASS 0
For that reason it also requires your title to be set (as this is the first line of the score output).
I also use a multistate trigger instead of single triggers
CODE
#CLASS {Score}
#ALIAS sc {#T+ capScore;#send score}
#ALIAS silentScore {#T+ capScore;#T+ gagScore;#send score}
#VAR title {High Druid Drathys, Servant of the Wilde}
#TRIGGER "capScore" {^@title$} {}
#COND {%sSex%s~: *%sRace%s~: *} {}
#COND {%sLevel%s~: (%d) ~((%d)~%~)%sRank%s~: *} {#var level %1;#var levelPercent %2}
#COND {%sHealth ~: (%d)~/(%d)%sEndurance ~: (%d)~/(%d)} {#var healthmax %2;#var endurancemax %4}
#COND {%sMana  ~: (%d)~/(%d)%sWillpower ~: (%d)~/(%d)} {#var manaMax %2;#var willpowerMax %4}
#COND {%sEgo    ~: (%d)~/(%d) %sReserves  ~: (%d)~%} {#var egoMax %2;#var reserves %3}
#COND {%sKarma  ~: (%d)~%%sEsteem    ~: (%d)~%} {}
#COND {^%dh, %dm, %de, %dp} {#T- gagScore;#T- capScore} {nocr|prompt}
#TRIGGER "gagScore" {(*)} {#gag} "" {disable}
#TRIGGER {You will now be known as (*)~, by order of} {#var title {%1}}
#CLASS 0
Unknown2006-10-28 04:14:43
Ah, now I see what I was doing wrong. Thanks, this has really helped me understand triggers and their variables a whole lot more.